Elegant export
This commit is contained in:
29
reference.py
29
reference.py
@@ -3,7 +3,7 @@ import copy
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
from numpy.ma.core import floor_divide
|
||||
|
||||
#from fontTools.misc.cython import returns
|
||||
from generateMatchSettings import configMatching
|
||||
|
||||
CBeige = QtGui.QColor(250, 240, 200)
|
||||
CGreen = QtGui.QColor(100, 255, 100)
|
||||
@@ -33,6 +33,14 @@ class ReferenceManager:
|
||||
self.loadReference('MatchingConfig/Reference.json')
|
||||
self.parent.UITrackReference.currentIndexChanged.connect(self.updateReferenceWidgets)
|
||||
self.parent.UIMatchOrder.itemClicked.connect(self.displayMatchingPoint)
|
||||
self.parent.UIConfigMatching.clicked.connect(self.configMatching)
|
||||
|
||||
def configMatching(self):
|
||||
label=str(self.parent.UIMatchingConfigLabel.text())
|
||||
var = {}
|
||||
var['SYR56'] = float(str(self.parent.UIMatchConfigSYComp.text())) * 0.01
|
||||
fname = configMatching(label,var)
|
||||
self.loadReference(fname)
|
||||
|
||||
|
||||
def clearMatching(self):
|
||||
@@ -81,22 +89,6 @@ class ReferenceManager:
|
||||
self.save[ID]={'betax':twiss.betx[0],'betay':twiss.bety[0],'alphax':twiss.alfx[0],'alphay':twiss.alfy[0]}
|
||||
print('saving twissvalue for',ID,':',self.save[ID])
|
||||
|
||||
def updateUserVariables(self):
|
||||
ID = str(self.parent.UIMatchLabel.text())
|
||||
print(self.settings['Parameter'][ID])
|
||||
|
||||
return
|
||||
# ncol = table.columnCount()
|
||||
# nrow = table.rowCount()
|
||||
# content={}
|
||||
# for irow in range(nrow):
|
||||
# tag = str(table.item(irow,0).text())
|
||||
# content[tag]={}
|
||||
# for icol in range(1,ncol):
|
||||
# fld = str(table.item(irow,icol).text())
|
||||
# content[tag][icol]=fld
|
||||
# return content
|
||||
|
||||
|
||||
|
||||
def getMatchingPoint(self):
|
||||
@@ -285,7 +277,8 @@ class ReferenceManager:
|
||||
key = str(self.parent.UITrackReference.currentText())
|
||||
if key == 'User Defined':
|
||||
return
|
||||
|
||||
if key=='': # some quick solution in the case that the referenc epoints are regenerated, generating a signal for empty table
|
||||
return
|
||||
twiss = self.reference[key]['Twiss']
|
||||
name = self.reference[key]['Location']
|
||||
self.parent.UITrackLocation.setText(name)
|
||||
|
||||
Reference in New Issue
Block a user