Skip to content

Commit

Permalink
Cannot create Application instance in instances tab
Browse files Browse the repository at this point in the history
  • Loading branch information
thienan2050 committed Jul 2, 2021
1 parent e374cc4 commit 82da58b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ide/instanceEditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1891,7 +1891,8 @@ def CreateNewInstance(self,entity,position,size=None, name=None):
# TODO ent = self.entityType.createEntity(position, size)
if size is None: size = (COL_WIDTH, ROW_WIDTH) # The layout will automatically update the long size to be the width of the screen
# Add index for entities when creating them, index will be the current maximum index plus 1
inst = entity.createInstance(position, size, name=name, parent=self, id = 0 if not len(self.model.instances) else sorted(filter(lambda n: n.et.name in ['ServiceGroup', 'Node'] , self.model.instances.values()), reverse=True, key = lambda n: n.data['id'])[0].data['id']+1)
inst = entity.createInstance(position, size, name=name, parent=self, id = 0 if not len(self.model.instances) else sorted(filter(lambda n: n.et.name in ['ServiceGroup', 'Node', 'Application'] , self.model.instances.values()), reverse=True, key = lambda n: n.data['id'])[0].data['id']+1)

inst.instanceLocked = copy.deepcopy(entity.instanceLocked)

self.model.instances[inst.data["name"]] = inst
Expand Down

0 comments on commit 82da58b

Please sign in to comment.