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)
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
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())
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()
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))
def add_setting(self, setting: Setting): if setting.name() not in self.settings: self.settings[setting.name()] = setting
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()))
def _add_setting(self, name, value, constant=False): self.settings[name] = Setting(name, value, constant, self)