diff --git a/src/EEHGMaster.py b/src/EEHGMaster.py index eb03d6fe3c0f88cafe58616190a2500af8bb9556..7ed6c6297a98d82a57debc18c4c28534932e1f39 100755 --- a/src/EEHGMaster.py +++ b/src/EEHGMaster.py @@ -950,6 +950,8 @@ class EEHGMaster(Device): # PROTECTED REGION ID(EEHGMaster.prior_wl_seed_write) ENABLED START # """Set the prior_wl_seed attribute.""" self._prior_wl_seed = value + self._prior_bunch = not value + # PROTECTED REGION END # // EEHGMaster.prior_wl_seed_write def read_prior_bunch(self): @@ -962,6 +964,7 @@ class EEHGMaster(Device): # PROTECTED REGION ID(EEHGMaster.prior_bunch_write) ENABLED START # """Set the prior_bunch attribute.""" self._prior_bunch = value + self._prior_wl_seed = not value # PROTECTED REGION END # // EEHGMaster.prior_bunch_write def read_pref_rx(self): @@ -1079,6 +1082,7 @@ class EEHGMaster(Device): """Set the a1_fix attribute.""" self._a1_fix = value self.a1_fix.set_write_value = value + self._a2_fix = not value pass # PROTECTED REGION END # // EEHGMaster.a1_fix_write @@ -1093,8 +1097,6 @@ class EEHGMaster(Device): """Set the a2 attribute.""" self._a2 = value self.a2.set_write_value = value - pass - self._a2 = value # PROTECTED REGION END # // EEHGMaster.a2_write def read_emod2(self): @@ -1142,7 +1144,9 @@ class EEHGMaster(Device): def write_a2_fix(self, value): # PROTECTED REGION ID(EEHGMaster.a2_fix_write) ENABLED START # """Set the a2_fix attribute.""" - pass + self._a2_fix = value + self.a2_fix.set_write_value = value + self._a1_fix = not value # PROTECTED REGION END # // EEHGMaster.a2_fix_write def read_e_nrg_fel(self): @@ -1239,7 +1243,9 @@ class EEHGMaster(Device): def write_r561_fix(self, value): # PROTECTED REGION ID(EEHGMaster.r561_fix_write) ENABLED START # """Set the r561_fix attribute.""" - pass + self._r561_fix = value + self._r561_fix.set_write_value = value + self._r562_fix = not value # PROTECTED REGION END # // EEHGMaster.r561_fix_write def read_r561_off_abs(self): @@ -1307,7 +1313,9 @@ class EEHGMaster(Device): def write_r562_fix(self, value): # PROTECTED REGION ID(EEHGMaster.r562_fix_write) ENABLED START # """Set the r562_fix attribute.""" - pass + self._r562_fix = value + self._r562_fix.set_write_value = value + self._r561_fix = not value # PROTECTED REGION END # // EEHGMaster.r562_fix_write def read_r562_off_abs(self): @@ -1375,7 +1383,7 @@ class EEHGMaster(Device): def write_lambda_s1or2_fix(self, value): # PROTECTED REGION ID(EEHGMaster.lambda_s1or2_fix_write) ENABLED START # """Set the lambda_s1or2_fix attribute.""" - pass + self._lambda_s1or2_fix = value # PROTECTED REGION END # // EEHGMaster.lambda_s1or2_fix_write def read_fl_s1(self): @@ -1637,31 +1645,17 @@ class EEHGMaster(Device): self.set_state(tango.DevState.RUNNING) self.set_status('Started calculation') - -#dt_s1 = 200e-15 #seed1 pulse duration in s altrimenti letto dal device sl/master/seed_master_sl.01/pulselength se correttamente impostato -#s1_nrg_max = 30e-6 #seed1 max pulse energy in J -#dt_s2 = 100e-15 #seed2 pulse duration in s -#s2_nrg_max = 25e-6 #seed2 max pulse energy in J - -# ora letti dal seed master: -# s1_nrg_max = 30e-6 #seed1 max pulse energy in J self.nrg_s1_range -# s2_nrg_max = 25e-6 #seed2 max pulse energy in J self.nrg_s2_range -# -#n_curr = -1 #andrebbe letto dal server EEHG come valore di n -#m_curr = 21 #andrebbe letto dal server EEHG come valore di m + #n_curr = -1 #andrebbe letto dal server EEHG come valore di n + #m_curr = 21 #andrebbe letto dal server EEHG come valore di m n_rng = [-1,0] # puo' essere anche [-n, 0], n = 1, 2, 3 ... ma all' aumentare di n il tempo di calcolo aumenta m_rng = [1,50] -#picco = 'left' # can be also 'right' or ' both' + #picco = 'left' # can be also 'right' or ' both' picco = 'left' # can be also 'right' or ' both' -#i_solution = 0 # indice della soluzione da applicare. per difetto e' la prima trovata -#wl_fel = 13e-9 #lambda FEL in m -# -# -# -#""" -#calcola configurazioni -#""" + #i_solution = 0 # indice della soluzione da applicare. per difetto e' la prima trovata + """ + calcola configurazioni usando utili + """ printout = False ebeam = utl.ElectronBeam(energy = self._e_nrg_fel * 1e9, energyspread = 100e3, @@ -1676,10 +1670,9 @@ class EEHGMaster(Device): # wl_range matenuto fisso attorno al seed attuale # wl_range = [self.lambda_s1.get_properties().min_value * 1e-9, # self.lambda_s1.get_properties().max_value * 1e-9]) -# wl_range = [lambda_s1_range[0]*1e-9, lambda_s1_range[1]*1e-9]) seed1.set_duration(self._dt_s1) - seed1.nrg_range = [0.0, self.nrg_s1_range * 1e-6] # da verificare se il seed da in uJ o in J + seed1.nrg_range = [0.0, self.nrg_s1_range * 1e-6] mod1.calc_aw(seed1.wl, ebeam.energy) @@ -1726,17 +1719,6 @@ class EEHGMaster(Device): fix1 = 'A1', fix2 = 'R561', peak = picco, par_err = par_err, printout = printout) -# A1_sol = solu[0] -# A2_sol = solu[1] -# R561_sol = solu[2] -# R562_sol = solu[3] -# Wls1_sol = solu[4] -# Wls2_sol = solu[5] -# N_sol = solu[6] -# M_sol = solu[7] -# Bmax_sol = solu[8] -# B_var = solu[9] - ''' soluzione da applicare i_solution ''' @@ -1756,15 +1738,13 @@ class EEHGMaster(Device): # M_sol_ap = solu[7][self._i_solution] # da scivere nel server sul valore di m self.write_m(solu[7][self._i_solution]) # Bmax_sol_ap = solu[8][self._i_solution] # da scivere nel server su bunch_fel - bunching_array = solu[8][self._i_solution] + bunching_array = solu[8] print(bunching_array) self._bunc_sol = solu[8][self._i_solution] # B_var_ap = solu[9][self._i_solution] - self.set_state(tango.DevState.ON) self.set_status('Calculation performed') - # PROTECTED REGION END # // EEHGMaster.Calculate def is_Calculate_allowed(self):