wip
This commit is contained in:
@@ -12,20 +12,22 @@ from PyQt5.QtCore import QSettings
|
||||
import os, json, yaml
|
||||
|
||||
class AppCfg(QSettings):
|
||||
WINDOW_GEOMETRY="window/geometry"
|
||||
WINDOW_STATE= "window/state"
|
||||
WINDOW_SPLITTER="window/splitter"
|
||||
|
||||
# ---------- OBSOLETE ??? ----------
|
||||
ZOOM_BUTTONS="sample_viewing/zoom_buttons"
|
||||
|
||||
SKIP_ESCAPE_TRANSITIONS_IF_SAFE="escape/skip_transitions_if_safe"
|
||||
|
||||
GEO_OPT_CTR='geometry/opt_ctr'
|
||||
GEO_PIX2POS='geometry/pix2pos'
|
||||
|
||||
BEAM_MARKER_POSITIONS="beam/marker_positions"
|
||||
BEAM_SIZE="beam/size"
|
||||
GEO_BEAM_SZ="geometry/beam_size"
|
||||
GEO_BEAM_POS="geometry/beam_pos"
|
||||
|
||||
|
||||
WINDOW_GEOMETRY="window/geometry"
|
||||
WINDOW_SPLITTER="window/splitter"
|
||||
WINDOW_STATE= "window/state"
|
||||
|
||||
# ---------- OBSOLETE ??? ----------
|
||||
#ZOOM_BUTTONS="sample_viewing/zoom_buttons"
|
||||
|
||||
SKIP_ESCAPE_TRANSITIONS_IF_SAFE="escape/skip_transitions_if_safe"
|
||||
|
||||
CRYOJET_MOTION_ENABLED="cryojet/motion_enabled"
|
||||
CRYOJET_NOZZLE_OUT="cryojet/nozzle_out"
|
||||
@@ -47,9 +49,78 @@ class AppCfg(QSettings):
|
||||
def __init__(self):
|
||||
super(AppCfg, self).__init__("PSI", "SwissMX")
|
||||
keys = self.allKeys()
|
||||
# Dump config to debug
|
||||
#for k in keys:
|
||||
# print(k, self.value(k))
|
||||
|
||||
#set default keys if not existing
|
||||
if AppCfg.BEAM_SIZE not in keys:
|
||||
self.setValue(AppCfg.BEAM_SIZE, [40, 20]) #([40, 20) -> tuples are not supported natively
|
||||
if AppCfg.GEO_BEAM_SZ not in keys:
|
||||
_log.warning(f'{AppCfg.GEO_BEAM_SZ} not defined. set default')
|
||||
self.setValue(AppCfg.GEO_BEAM_SZ, [40, 20]) #([40, 20) -> tuples are not supported natively
|
||||
|
||||
if AppCfg.GEO_PIX2POS not in keys:
|
||||
_log.warning(f'{AppCfg.GEO_OPT_CTR} not defined. calc default')
|
||||
import geometry
|
||||
geo=geometry.geometry()
|
||||
pix2pos_measure={
|
||||
1:[(-3.0, -7.6, 116.99110193046, 632.5463827525),
|
||||
(-2.0, -7.6, 934.07501517856, 600.7926167715),
|
||||
(-2.0, -7.1, 916.54131238102, 191.0366615002),
|
||||
(-3.0, -7.1, 103.74668003329, 226.2150231456)],
|
||||
200:[(-3.1, -7.3, 113.66321353086, 824.9041423107),
|
||||
(-2.3, -7.3, 1065.97386092697, 792.2851118419),
|
||||
(-2.3, -6.7, 1033.68452410347, 74.0336610693),
|
||||
(-3.1, -6.7, 84.62681572700, 116.6832971512)],
|
||||
400:[(-3.4, -6.7, 155.00053674203, 601.3838942136),
|
||||
(-3.0, -6.7, 957.95919656052, 573.0827012272),
|
||||
(-3.2, -6.5, 541.08684037200, 187.9171307943),
|
||||
(-3.2, -6.8, 564.32152887203, 789.1146957326)],
|
||||
600:[(-3.3, -6.8, 328.27244399903, 509.5061192017),
|
||||
(-3.1, -6.8, 992.78996735279, 488.0323963092),
|
||||
(-3.2, -6.9, 672.03111567934, 832.4122409755),
|
||||
(-3.2, -6.7, 645.70960116180, 164.2534779331)],
|
||||
800:[(-3.2, -6.7, 639.52253576449, 53.4455632943),
|
||||
(-3.2, -6.85, 671.47023245203, 882.6335091391),
|
||||
(-3.3, -6.75, 105.12470026379, 361.3051859197),
|
||||
(-3.1, -6.75, 1195.96864609255, 313.1068618673)],
|
||||
1000:[(-3.25, -6.75, 195.05641095116, 353.3492286375),
|
||||
(-3.15, -6.75, 1117.27204644084, 314.9636405871),
|
||||
(-3.2, -6.8, 675.10991143017, 790.3040145281),
|
||||
(-3.2, -6.72, 638.98580653116, 59.3803912957)]}
|
||||
geo.update_pix2pos(pix2pos_measure)
|
||||
self.setValue(AppCfg.GEO_PIX2POS, geo._lut_pix2pos)
|
||||
|
||||
if AppCfg.GEO_OPT_CTR not in keys:
|
||||
_log.warning(f'{AppCfg.GEO_OPT_CTR} not defined. calc default')
|
||||
import geometry
|
||||
geo=geometry.geometry()
|
||||
opt_ctr_meas={ # x,y = 0.02, -4.89
|
||||
1000:[(1057.4251530483375, 116.10122290395591),
|
||||
(117.84916300310408, 190.27827474963223),
|
||||
(184.2181041281829, 963.2812360887852),
|
||||
(1092.5616512910262, 899.514998537239)],
|
||||
800:[(888.2494207687248, 203.2917926172947),
|
||||
(329.96950424600305, 248.83910515411347),
|
||||
(372.9141132092893, 708.2162858826),
|
||||
(906.4683457834523, 675.6824912134438)],
|
||||
600:[(781.5385742538922, 251.44180872764602),
|
||||
(447.09116505496564, 264.4553265953085),
|
||||
(471.81684900352445, 554.6567750441825),
|
||||
(798.4561474818535, 535.1364982426887)],
|
||||
400:[(722.9777438494109, 286.5783069703348),
|
||||
(525.1722722609408, 295.68776947769857),
|
||||
(535.5830865550707, 462.26079818377866),
|
||||
(729.4845027832422, 450.5486321028824)],
|
||||
200:[(689.1425973934884, 308.70128734536104),
|
||||
(565.5141776506945, 307.39993555859473),
|
||||
(574.6236401580583, 406.30267135282986),
|
||||
(693.0466527537872, 399.79591241899857)],
|
||||
1:[(673.5263759522934, 307.39993555859473),
|
||||
(591.5412133860195, 308.70128734536104),
|
||||
(595.4452687463182, 376.3715802572061),
|
||||
(672.2250241655271, 373.7688766836736)]}
|
||||
geo.update_optical_center(opt_ctr_meas)
|
||||
self.setValue(AppCfg.GEO_OPT_CTR, geo._opt_ctr)
|
||||
|
||||
#if AppCfg.ACTIVATE_PULSE_PICKER not in keys:
|
||||
# self.setValue(AppCfg.ACTIVATE_PULSE_PICKER, False)
|
||||
|
||||
Reference in New Issue
Block a user