コード例 #1
0
 def init_settings(self):
     s = Setting('X', FloatValue(.0))
     self._add_setting(s)
     s = Setting('Y', FloatValue(.0))
     self._add_setting(s)
     s = Setting('Width', FloatValue(0.9, v_min=0.8))
     self._add_setting(s)
     s = Setting('Height', FloatValue(1.2, v_min=0.6))
     self._add_setting(s)
コード例 #2
0
 def __init__(self, type_name: str, name: str, parent=None):
     QObject.__init__(self, parent)
     self._type = type_name
     self.settings = {'Name': Setting('Name', StringValue(name))}
     self._complex = False
     self._parent = parent
     self._selected = False
コード例 #3
0
 def __init__(self, name: str="Var", parent=None):
     Block.__init__(self, "Variable", name, parent)
     self._resizable = False
     self._bg_color = QColor(233, 221, 175)
     self._fg_color = QColor(0, 0, 0)
     self.settings["Value"] = Setting('Value', BaseValue(NoneType()))
     self._add_input('Value', NoneType())
     self._add_output('Value', NoneType())
コード例 #4
0
 def __init__(self, type_name: str, name: str, parent: QWidget=None):
     QWidget.__init__(self, parent)
     self.settings = {"Name": Setting("Name", StringValue(name), parent=self)}
     self.outputs = {}
     self.inputs = {}
     self.__type_name = type_name
     self._bg_color = QColor(159, 160, 144, 255)
     self._fg_color = QColor(255, 255, 255)
     self._resizable = True
     self.setMinimumSize(90, 120)
     self.__origin = QPoint(0, 0)
     self.__action = Action.NONE
     self.__status = Mode.EDIT_LOGIC
     self.__selected = False
     self.__line = None
     self.__label = None
     self.setMouseTracking(True)
     if self._resizable:
         self.__init_corner()
コード例 #5
0
 def __init__(self, name: str, parent: Container, value: BaseValue = None):
     BlockDefinition.__init__(self, 'Variable', name, parent)
     self.add_setting(Setting('Value', value))
     self.add_input(Input('Value', PolyType(), self))
     self.add_output(Output('Value', PolyType(), self))
コード例 #6
0
 def add_setting(self, setting: Setting):
     if setting.name() not in self.settings:
         self.settings[setting.name()] = setting
コード例 #7
0
 def init_gui_settings(self):
     self.settings['X'] = Setting('X', IntegerValue(5))
     self.settings['Y'] = Setting('Y', IntegerValue(5))
     self.settings['Width'] = Setting('Width', IntegerValue(90, self.minimumWidth()))
     self.settings['Height'] = Setting('Height', IntegerValue(120, self.minimumHeight()))
コード例 #8
0
 def _add_setting(self, name, value, constant=False):
     self.settings[name] = Setting(name, value, constant, self)
コード例 #9
0
ファイル: Definitions.py プロジェクト: Mandarancio/OpenIris
 def add_setting(self, setting: Setting):
     if setting.name() not in self.settings:
         self.settings[setting.name()] = setting