def GetCurrTarget(self, type='obj', what='both'): """ Dummy method to return the Project ID """ # ignore any input as this just imitates the cdml function id = self.idPrj if id == '': return None # Just create a dummy structure with enough information to allow # processing it by the general menu handler function DummyStructToReturn = cdml.Struct() DummyStructToReturn.Id = 1 DummyStructToReturn.Key = id return DummyStructToReturn
def GetCurrTarget(self, type='obj', what='both'): """ Dummy method to return the selected ID """ # ignore any input as this just imitates the cdml function id = self.cc_id_sim.GetValue() # Retrieve simulation ID from combo box if id == '': return None id_sim = int(id) target_id = [ result.ID for result in DB.SimulationResults.values() if result.ID == id_sim and result.ProjectID == self.idPrj ] if len(target_id) != 1: return None # Just create a dummy structure with enough information to allow # processing it by the general menu handler function DummyStructToReturn = cdml.Struct() DummyStructToReturn.Id = 1 DummyStructToReturn.Key = target_id[0] return DummyStructToReturn