Flatten routine
This commit is contained in:
1 parent
1bcda98d26
commit
4bffa906fe
3 files changed
+11
-10
No files matched your search
@@ -224,14 +224,13 @@ class BeamlineScene(QGraphicsScene):
|
||||
act_copy.triggered.connect(lambda: self._ctx_copy(node))
|
||||
menu.addAction(act_copy)
|
||||
|
||||
# Flatten — only shown for Start markers
|
||||
if node.element_type == "Start":
|
||||
menu.addSeparator()
|
||||
act_flatten = QAction("Flatten from here", menu)
|
||||
act_flatten.triggered.connect(
|
||||
lambda: self._ctx_flatten(node)
|
||||
)
|
||||
menu.addAction(act_flatten)
|
||||
# Flatten — calls on_flatten with this node's ID
|
||||
menu.addSeparator()
|
||||
act_flatten = QAction("Flatten from here", menu)
|
||||
act_flatten.triggered.connect(
|
||||
lambda: self._ctx_flatten(node)
|
||||
)
|
||||
menu.addAction(act_flatten)
|
||||
|
||||
menu.addSeparator()
|
||||
|
||||
|
||||
@@ -150,6 +150,7 @@ class BeamlineEditor(QtWidgets.QMainWindow, Ui_BeamlineGUI):
|
||||
def updateProperties(self,node_id: str, data: dict):
|
||||
# make sure that the ID is not changed
|
||||
data['Name']['ID']=node_id
|
||||
type = self.editor.getElementType(node_id)
|
||||
# check for name consitency
|
||||
if 'Index' in data['Name'].keys() and 'Tag' in data['Name'].keys():
|
||||
tag=data['Name']['Tag'].upper()+'XXXX'
|
||||
@@ -165,8 +166,7 @@ class BeamlineEditor(QtWidgets.QMainWindow, Ui_BeamlineGUI):
|
||||
name = data['Name']['Name']
|
||||
# update GUI
|
||||
type = self.editor.getElementType(node_id)
|
||||
if not (type == 'Start' or type == 'End'):
|
||||
self.editor.setElementName(node_id,name)
|
||||
self.editor.setElementName(node_id,name)
|
||||
updated = self.editor.updatePropertyPane(node_id, data)
|
||||
|
||||
proplist=getPropertyList(type)
|
||||
|
||||
@@ -16,6 +16,8 @@ def getPropertyList(element_type: str | None) -> dict:
|
||||
return {}
|
||||
if element_type == 'Line':
|
||||
return {'Name':'Name/Name','LengthEnding':'Position/Reserved Length','firstElementID':'Anchor/Reference'}
|
||||
elif element_type == 'Start':
|
||||
return {'Name': 'Name/Name'}
|
||||
fields={}
|
||||
for i , fld in enumerate(eName):
|
||||
fields[fld]='Name/'+Name[i]
|
||||
|
||||
Reference in new issue
Block a user