diff --git a/params/plot_structure_params.json b/params/plot_structure_params.json new file mode 100644 index 0000000..2bba5e5 --- /dev/null +++ b/params/plot_structure_params.json @@ -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 + } + ] + } +} diff --git a/src/base/base.py b/src/base/base.py index 1676103..1bce78e 100644 --- a/src/base/base.py +++ b/src/base/base.py @@ -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: diff --git a/src/gui/plotter.py b/src/gui/plotter.py index c3c144e..2d271c8 100644 --- a/src/gui/plotter.py +++ b/src/gui/plotter.py @@ -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: """