def ForceValue(self, item): """ Force value of item given @param item: Item to force value """ # Check variable data type iec_path = item.GetVariable() iec_type = self.ParentWindow.GetDataType(iec_path) # Return immediately if not found if iec_type is None: return # Open a dialog to enter varaible forced value dialog = ForceVariableDialog(self, iec_type, str(item.GetValue())) if dialog.ShowModal() == wx.ID_OK: self.ParentWindow.ForceDataValue(iec_path.upper(), dialog.GetValue())
def ForceVariableFunction(event): if iec_type is not None: dialog = ForceVariableDialog(self, iec_type, str(item.GetValue())) if dialog.ShowModal() == wx.ID_OK: self.ForceDataValue(iec_path, dialog.GetValue())