dev: описание содержимого PlotWidget перенесено в отдельный файл

This commit is contained in:
Andrew 2025-02-05 20:10:13 +03:00
parent 945ce45621
commit c4bc353032
3 changed files with 109 additions and 103 deletions

View File

@ -0,0 +1,102 @@
{
"Electrode Force, N & Welding Current, kA": {
"Settings": {
"zoom": false,
"stages": true,
"performance": true,
"ideals": true,
"mirror ME": false,
"workpiece": false,
"force compensation FE": false,
"force accuracy":true
},
"Real_signals": [
{
"name": "Electrode Force, N ME",
"pen": "r"
},
{
"name": "Electrode Force, N FE",
"pen": "w"
}
],
"Ideal_signals": [
{
"name": "Force",
"pen": {"color": "g", "width":3}
}
]
},
"Electrode Position, mm": {
"Settings": {
"zoom": false,
"stages": true,
"performance": false,
"ideals": true,
"mirror ME": true,
"workpiece": true,
"force compensation FE": true,
"force accuracy":false
},
"Real_signals": [
{
"name": "Rotor Position, mm ME",
"pen": {"color": "r", "width":2}
},
{
"name": "Rotor Position, mm FE",
"pen": {"color": "w", "width":2}
}
],
"Ideal_signals": [
{
"name": "Position ME",
"pen": {"color": "g", "width":4}
},
{
"name": "Position FE",
"pen": {"color": "b", "width":4}
}
]
},
"Electrode Speed, mm/s": {
"Settings": {
"zoom": false,
"stages": true,
"performance": false,
"ideals": true,
"mirror ME": false,
"workpiece": false,
"force compensation FE": false,
"force accuracy":false
},
"Real_signals": [
{
"name": "Rotor Speed, mm/s ME",
"pen": "r",
"zoom": false
},
{
"name": "Rotor Speed, mm/s FE",
"pen": "w",
"zoom": false
}
],
"Ideal_signals": [
{
"name": "Rotor Speed ME",
"pen": {"color": "g", "width":3},
"zoom": false
},
{
"name": "Rotor Speed FE",
"pen": {"color": "b", "width":3},
"zoom": false
}
]
}
}

View File

@ -189,108 +189,7 @@ class BasePlotWidget:
"Relief": [34, 139, 34, 100], # Forest Green
"Oncomming": [255, 165, 0, 100] # Orange
}
self._plt_channels = {
"Electrode Force, N & Welding Current, kA": {
"Settings": {
"zoom": False,
"stages": True,
"performance": True,
"ideals": True,
"mirror ME": False,
"workpiece": False,
"force compensation FE": False,
"force accuracy":True
},
"Real_signals": [
{
"name": "Electrode Force, N ME",
"pen": 'r',
},
{
"name": "Electrode Force, N FE",
"pen": 'w',
},
#{
# "name": "Welding Current ME",
# "pen": "y",
#}
],
"Ideal_signals": [
{
"name": "Force",
"pen": {'color': 'g', 'width':3},
}
]
},
"Electrode Position, mm": {
"Settings": {
"zoom": False,
"stages": True,
"performance": False,
"ideals": True,
"mirror ME": True,
"workpiece": True,
"force compensation FE": True,
"force accuracy":False
},
"Real_signals": [
{
"name": "Rotor Position, mm ME",
"pen": {'color': 'r', 'width':2},
},
{
"name": "Rotor Position, mm FE",
"pen": {'color': 'w', 'width':2},
}
],
"Ideal_signals": [
{
"name": "Position ME",
"pen": {'color': 'g', 'width':4},
},
{
"name": "Position FE",
"pen": {'color': 'b', 'width':4},
}
]
},
"Electrode Speed, mm/s": {
"Settings": {
"zoom": False,
"stages": True,
"performance": False,
"ideals": True,
"mirror ME": False,
"workpiece": False,
"force compensation FE": False,
"force accuracy":False
},
"Real_signals": [
{
"name": "Rotor Speed, mm/s ME",
"pen": 'r',
"zoom": False
},
{
"name": "Rotor Speed, mm/s FE",
"pen": 'w',
"zoom": False
}
],
"Ideal_signals": [
{
"name": "Rotor Speed ME",
"pen": {'color': 'g', 'width':3},
"zoom": False
},
{
"name": "Rotor Speed FE",
"pen": {'color': 'b', 'width':3},
"zoom": False
}
]
},
}
self._plt_channels = None
@staticmethod
def set_style(object_: Union[QTabWidget, QWidget]) -> None:

View File

@ -18,7 +18,8 @@ from loguru import logger
import pyqtgraph as pg
import pandas as pd
from base.base import BasePlotWidget, GraphicPassport, PlotItems, PointPassport, UsefulGraphData
from base.base import BasePlotWidget, GraphicPassport, PlotItems, PointPassport, UsefulGraphData, BaseController
from utils.json_tools import read_json
from utils import qt_settings as qts
@ -35,6 +36,10 @@ class ChannelTimings():
class PlotWidget(BasePlotWidget):
def __init__(self, controller:BaseController):
super().__init__(controller=controller)
self._plt_channels = read_json("params/plot_structure_params.json")
def build(self, data: list[GraphicPassport]) -> None:
"""