def save_simulation(self, path): model_list = [] canvas_shapes = [] for shape, modelid in self.models.iteritems(): model_list.append(engine.getModelById(modelid)) canvas_shapes.append(shape) links = engine.getAllLinks() model_utils.write_simulation_json(model_list, canvas_shapes, links, path) return
def populate_variable_list(self): if len(engineAccessors.getAllLinks()) < 1: elog.info("No links have been added") return else: models = {} # compile a list of model ids and names that exist in the configuration links = engineAccessors.getAllLinks() for link in links: s_id = link['source_component_id'] t_id = link['target_component_id'] if s_id not in models.keys(): models[s_id] = link['source_component_name'] if t_id not in models.keys(): models[t_id] = link['target_component_name'] # sort models self._data = self.sort_output_model(models) self.insert_data(self._data) self.table.auto_size_table() self.table.alternate_row_color()