Commit f3b35a0b authored by Jason Milhone's avatar Jason Milhone
Browse files

Pretty sure this has the pcx fixes

parent 3b52886c
...@@ -120,24 +120,25 @@ ...@@ -120,24 +120,25 @@
y = disch_curr.anode5 y = disch_curr.anode5
color = "#9467bd" color = "#9467bd"
[03] [03]
ylabel = A ylabel = mA
legend = True legend = True
[[MP1A]] [[MP1A]]
x = dim_of(mach_curr.mp1) x = dim_of(mach_curr.mp1)
y = DATA(mach_curr.mp1[*, 0]) y = "1e3*DATA(mach_curr.mp1[*,0])"
color = "#1f77b4" color = "#1f77b4"
[[MP1B]] [[MP1B]]
x = dim_of(mach_curr.mp1) x = dim_of(mach_curr.mp1)
y = data(mach_curr.mp1[*, 1]) y = "1e3*data(mach_curr.mp1[*,1])"
color = "#ff7f0e" color = "#ff7f0e"
[13] [13]
ylabel = kW ylabel = kW
legend = True legend = True
xlabel = ""
[[BAPS1]] [[BAPS1]]
x = dim_of(disch_curr.cathode0) x = dim_of(disch_curr.cathode0)
y = -disch_volt.cathode0 * disch_curr.cathode0 * 0.001 y = -disch_volt.cathode0 * disch_curr.cathode0 * 0.001
color = "#1f77b4" color = "#1f77b4"
[[BAPS2]] [[BAPS2]]
x = dim_of(aux_lem.aux_lem_2) x = dim_of(aux_lem.aux_lem_2)
y = aux_lem.aux_lem_2*(data(disch_curr.cathode1)+data(disch_curr.cathode2)+data(disch_curr.cathode3)+data(disch_curr.cathode4)+data(aux_lem.aux_lem_4))*0.001 y = aux_lem.aux_lem_2*(data(disch_curr.cathode1)+data(disch_curr.cathode2)+data(disch_curr.cathode3)+data(disch_curr.cathode4)+data(aux_lem.aux_lem_4))*0.001*-1
color = "#ff7f0e" color = "#ff7f0e"
...@@ -8,9 +8,11 @@ default_colors = ['#1f77b4', '#ff7f0e', '#2ca02c', '#d62728', ...@@ -8,9 +8,11 @@ default_colors = ['#1f77b4', '#ff7f0e', '#2ca02c', '#d62728',
def config_parser(filename): def config_parser(filename):
config = ConfigObj(filename) print(filename)
config = ConfigObj(filename,raise_errors=True)
config = config.dict() config = config.dict()
col_setup = config['setup']['col'] col_setup = config['setup']['col']
col_setup = [int(x) for x in col_setup] col_setup = [int(x) for x in col_setup]
...@@ -42,6 +44,7 @@ def get_data_locs(config): ...@@ -42,6 +44,7 @@ def get_data_locs(config):
for key in config.keys(): for key in config.keys():
if key.lower() != 'setup': if key.lower() != 'setup':
data_locs[key] = config[key] data_locs[key] = config[key]
#print(config[key])
parse_data_colors(config, key) parse_data_colors(config, key)
return data_locs return data_locs
...@@ -60,6 +63,7 @@ def parse_data_colors(config, key): ...@@ -60,6 +63,7 @@ def parse_data_colors(config, key):
keys.sort() keys.sort()
top_ignore = ['xlabel', 'ylabel', 'xlim', 'ylim', 'legend', 'noresample', 'xshare'] top_ignore = ['xlabel', 'ylabel', 'xlim', 'ylim', 'legend', 'noresample', 'xshare']
j = 0 j = 0
#print(keys)
for k in keys: for k in keys:
if k not in top_ignore: if k not in top_ignore:
# this is a signal # this is a signal
...@@ -67,4 +71,7 @@ def parse_data_colors(config, key): ...@@ -67,4 +71,7 @@ def parse_data_colors(config, key):
if 'color' not in local_config[k].keys(): if 'color' not in local_config[k].keys():
config[key][k]['color'] = default_colors[j % 10] config[key][k]['color'] = default_colors[j % 10]
j += 1 j += 1
if isinstance(config[key][k].get('y', None), list):
print("I found you!")
config[key][k]['y'] = ','.join(config[key][k]['y'])
print(config[key][k]['y'])
...@@ -120,6 +120,7 @@ class PiScope(QtWidgets.QMainWindow): ...@@ -120,6 +120,7 @@ class PiScope(QtWidgets.QMainWindow):
self.acquiring_data = False self.acquiring_data = False
if config_file is not None: if config_file is not None:
print(config_file)
self.load_configuration(config_file) self.load_configuration(config_file)
if shot_number is None: if shot_number is None:
......
...@@ -5,7 +5,7 @@ import argparse ...@@ -5,7 +5,7 @@ import argparse
import source.gui.piscope as MyApp import source.gui.piscope as MyApp
#import logging #import logging
from source.logging.piscope_logging import create_logger, log from source.logging.piscope_logging import create_logger, log
import os.path as path
if __name__ == "__main__": if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Run a PiScope for the Big Red Ball.") parser = argparse.ArgumentParser(description="Run a PiScope for the Big Red Ball.")
...@@ -39,5 +39,8 @@ if __name__ == "__main__": ...@@ -39,5 +39,8 @@ if __name__ == "__main__":
myapp = QApplication([]) myapp = QApplication([])
myapp.setWindowIcon(QIcon("Icons/application-wave.png")) myapp.setWindowIcon(QIcon("Icons/application-wave.png"))
print(args.config, type(args.config))
import os
print(os.path.dirname(os.path.realpath(__file__)))
window = MyApp.PiScope(args.config, args.shot_number) window = MyApp.PiScope(args.config, args.shot_number)
myapp.exec_() myapp.exec_()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment