def __init__(self): # build UI from glade file builder = Gtk.Builder() #builder.add_from_file(to_abs_path(PoResources.UI_TRAY)) builder.add_from_file(to_abs_path(PoResources.UI_TRAY)) builder.connect_signals(self) style.setStyle() # get some common used object self.builder = builder self.menu = builder.get_object('tray_menu') self.lb_clock = builder.get_object('mni_clock') self.lb_counter = builder.get_object('mni_archive_count') APPIND_SUPPORT = 1 try: from gi.repository import AppIndicator3 except: APPIND_SUPPORT = 0 if APPIND_SUPPORT == 1: self.ind = AppIndicator3.Indicator.new_with_path("domor-indicator", 'app_icon_64', AppIndicator3.IndicatorCategory.APPLICATION_STATUS, to_abs_path('img')) self.ind.set_status(AppIndicator3.IndicatorStatus.ACTIVE) self.ind.set_menu(self.menu) else: self.myStatusIcon = Gtk.StatusIcon() self.myStatusIcon.set_from_file( to_abs_path(PoResources.ICON_APP_64)) self.myStatusIcon.connect( 'popup-menu', self.right_click_event_statusicon) # 6 load config self.settings = settings = Settings() settings.load_config() # 7 init class state self.btn_state = State.STOP self.state = State.IDLE self.time = settings.short_work_time self.work_time = 0 self.count = 0 # create main screen self.main_window = MainWindow(self.on_mni_start_activate) self.main_window.update(self.state, self.btn_state) # create rest screen self.break_screen = BreakScreen(self.on_skip_break) self.reset() # register timer callback GObject.timeout_add_seconds(1, self.count_down)
def __init__(self): # build UI from glade file builder = Gtk.Builder() builder.add_from_file(to_abs_path(PoResources.UI_SETTING)) builder.connect_signals(self) style.setStyle() # get some common used object self.builder = builder # 6 load config self.settings = settings = Settings() settings.load_config() self.dialog = builder.get_object('setting_dialog') self.cb_block_mode = builder.get_object('cb_block_input') self.cb_popup_mode = builder.get_object('cb_popup') self.sw_allow_skip = builder.get_object('swt_allow_skip') self.sw_sound_noti = builder.get_object('swt_enable_sound') self.txb_sound_file = builder.get_object('txb_sound_file')
from style import setStyle from common import * import os, sys, re import ROOT setStyle() #thresholds = [100] #thresholds = [50,60,70,80,90,100,110,120] #config_211_4_13_12_photek #config_212_4_3_14_photek #config_213_4_13_14_photek #config_214_6_5_11_photek # channel name, scope ch, adjacent channel, scope ch, config infos = [] infos.append([4, 0, 14, 2, "config_212_4_3_14_photek"]) infos.append([4, 0, 3, 1, "config_212_4_3_14_photek"]) infos.append([4, 0, 13, 1, "config_211_4_13_12_photek"]) infos.append([4, 0, 4, 0, "config_211_4_13_12_photek"]) def label(i, opt): label = "Track in " if "hit" in opt: label = "Track & hit in " if i == 3: label += "strip" elif i == 2: label += "1st adjacent strip" elif i == 1: label += "2nd adjacent strip" elif i == 0: label += "3rd adjacent strip" else: return ""
def buildHistogramDictionary(root_file_path): root_file = TFile(root_file_path) histogram_dict = {} for entry in root_file.GetListOfKeys(): name = entry.GetName() hist = root_file.Get(name) hist.SetDirectory(0) if isinstance(hist, TH1): histogram_dict[name] = hist return histogram_dict if __name__ == '__main__': #set plotting style style = setStyle() if len(sys.argv) > 1: base_card_path = sys.argv[1] if len(sys.argv) > 2: base_card_path2 = sys.argv[2] if len(sys.argv) > 3: base_card_path3 = sys.argv[3] if len(sys.argv) > 4: base_card_path4 = sys.argv[4] if len(sys.argv) > 5: flav = [sys.argv[5]]
from array import array from style import setStyle from tot_cleaning import tot_cleaning import os, sys, re import ROOT colors = setStyle() # default parameters ch_photek = 3 # photek channel minPh = 50 #mV maxPh = 100 #mV def int_conf(cfg): global_conf = int(cfg.split("_")[1]) return global_conf def get_min_amp(ch=None, cfg=None): global_conf = int_conf(cfg) if ch == 3: return photek_min(cfg) elif is_discrim(ch, cfg): return 400 elif ch == 0: if global_conf <= 146: # UCSD if global_conf == 130: return 50 elif global_conf == 131: return 70 elif global_conf == 132: return 50 elif global_conf == 133: return 50 elif global_conf == 135: return 40 elif global_conf == 136: return 30