def updateForObject( self, keys ): """ called from MainWindow to update the content to the choosen object key Default params will be shown if there is more than 1 key""" _infoer.function = str(self.updateForObject) _infoer.write("") if isinstance( keys, int ) : self.__keys = [keys] elif isinstance( keys, list ) and len(keys)>0 : self.__keys = keys else : return if len(self.__keys) == 1 : params = ObjectMgr().getParamsOfObject(self.__keys[0]) if isinstance(params, int) or isinstance(params, coDNAItemParams): self.__setParams( params ) elif len(self.__keys) > 1 : # multi selection: show default params self.oldPanelParams = coDNAItemParams() params = CopyParams(self.oldPanelParams) params.name = "Multiselection" self.__setParams( params )
def updateForObject(self, keys): """ called from MainWindow to update the content to the choosen object key Default params will be shown if there is more than 1 key""" _infoer.function = str(self.updateForObject) _infoer.write("") if isinstance(keys, int): self.__keys = [keys] elif isinstance(keys, list) and len(keys) > 0: self.__keys = keys else: return if len(self.__keys) == 1: params = ObjectMgr().getParamsOfObject(self.__keys[0]) if isinstance(params, int) or isinstance(params, coDNAItemParams): self.__setParams(params) elif len(self.__keys) > 1: # multi selection: show default params self.oldPanelParams = coDNAItemParams() params = CopyParams(self.oldPanelParams) params.name = "Multiselection" self.__setParams(params)
def __getParams(self): _infoer.function = str(self.__getParams) _infoer.write("") data = coDNAItemParams() data.name = str(self.nameWidget.text()) #transform card self.TransformManagerGetParams(data) #connections data.connectionPoints = {} data.connectionPointsDisable = {} for i in range(5): conn = self.connections[i] connEnabled = self.connectionsEnabled[i] if not conn.isHidden() : data.connectionPoints[str(conn.text())] = conn.isChecked() data.connectionPointsDisable[str(conn.text())] = connEnabled.isChecked() data.needConn = self.vrpCheckBoxNeedToBeConn.isChecked() return data
def __getParams(self): _infoer.function = str(self.__getParams) _infoer.write("") data = coDNAItemParams() data.name = str(self.nameWidget.text()) #transform card self.TransformManagerGetParams(data) #connections data.connectionPoints = {} data.connectionPointsDisable = {} for i in range(5): conn = self.connections[i] connEnabled = self.connectionsEnabled[i] if not conn.isHidden(): data.connectionPoints[str(conn.text())] = conn.isChecked() data.connectionPointsDisable[str( conn.text())] = connEnabled.isChecked() data.needConn = self.vrpCheckBoxNeedToBeConn.isChecked() return data