@@ -29,19 +29,6 @@ import collections
29
29
import qdarkstyle
30
30
import ctypes
31
31
32
- # TO DO:
33
- # turn scopes on off
34
- # thread melshare
35
- # save window size
36
- # curve scaling (eg deg2rad)
37
- # scope modules to generic modules, add interactive gain modules with sliders
38
- # open from .scope
39
- # changing colros when paused deletes data
40
- # add MelNet
41
- # write only shouldn't plot
42
- # write curves do weird things on plot -- should be hidden or fixed
43
- # settigns tab on each scope
44
-
45
32
#==============================================================================
46
33
# DEFAULT SETTINGS
47
34
#==============================================================================
@@ -96,7 +83,7 @@ time_mode = DEFAULT_TIME_MODE
96
83
# GLOBAL CONSTANTS
97
84
#==============================================================================
98
85
99
- VER = '0.2.2 '
86
+ VER = '0.3.0 '
100
87
101
88
SCREEN_RESOLUTION = application .desktop ().screenGeometry ()
102
89
RESOLUTION_SCALE = SCREEN_RESOLUTION .width () / 1920.0
@@ -112,10 +99,10 @@ SCROLL_OPTIONS = ['Fixed', 'Rolling']
112
99
NUM_SAMPLES = SAMPLE_DURATION * SAMPLE_TARGET
113
100
114
101
THEME_OPTIONS = ['Classic' , 'Dark' ]
115
- THEME_STYLESHEETS = {'Classic' : '' , 'Dark' : qdarkstyle .load_stylesheet ( pyside = False )}
116
- THEME_SCOPE_BG_COLORS = {"Classic" : [240 , 240 , 240 ], "Dark" : [49 , 54 , 59 ]}
102
+ THEME_STYLESHEETS = {'Classic' : '' , 'Dark' : qdarkstyle .load_stylesheet_pyqt5 ( )}
103
+ THEME_SCOPE_BG_COLORS = {"Classic" : [240 , 240 , 240 ], "Dark" : [25 , 35 , 45 ]}
117
104
THEME_SCOPE_FB_COLORS = {"Classic" : [0 , 0 , 0 ], "Dark" : [240 , 240 , 240 ]}
118
- THEME_SCOPE_VB_COLORS = {"Classic" : [240 , 240 , 240 ], "Dark" : [35 , 38 , 41 ]}
105
+ THEME_SCOPE_VB_COLORS = {"Classic" : [240 , 240 , 240 ], "Dark" : [19 , 27 , 35 ]}
119
106
THEME_SCOPE_IO_CONFIRMED_COLORS = {"Classic" : [204 , 232 , 255 ], "Dark" : [24 , 70 , 93 ]}
120
107
THEME_SCOPE_IO_CHANGING_COLORS = {'Classic' : [144 , 200 , 246 ], 'Dark' : [191 , 54 , 12 ]}
121
108
@@ -650,12 +637,11 @@ def open_new_instance():
650
637
subprocess .Popen ([sys .executable , 'MelScope.pyw' ],
651
638
creationflags = CREATE_NO_WINDOW )
652
639
653
- def open ():
640
+ def open_scope ():
654
641
global filepath
655
- filepath = QtGui .QFileDialog .getOpenFileName (
656
- main_widget , 'Open MELScope' , "" , 'Scope Files (*.scope *.yaml)' )
642
+ filepath , _ = QtGui .QFileDialog .getOpenFileName (main_widget , 'Open MELScope' , "" , 'Scope Files (*.scope *.yaml)' )
657
643
if filepath :
658
- stream = file (filepath , 'r' )
644
+ stream = open (filepath , 'r' )
659
645
config = yaml .load (stream )
660
646
remove_all_data_sources ()
661
647
remove_all_scope_modulels ()
@@ -670,26 +656,26 @@ def open():
670
656
main_window .setWindowTitle ('MELScope (' + filename + ')' )
671
657
672
658
673
- def save ():
659
+ def save_scope ():
674
660
global filepath
675
661
if filepath :
676
662
config = generate_config ()
677
- stream = file (filepath , 'w' )
663
+ stream = open (filepath , 'w' )
678
664
yaml .dump (config , stream )
679
665
filename = str (filepath [str (filepath ).rfind ('/' ) + 1 :])
680
666
filename = filename [0 : filename .rfind ('.' )]
681
667
status_bar .showMessage ('Saved <' + filename + '>' )
682
668
main_window .setWindowTitle ('MELScope (' + filename + ')' )
683
669
else :
684
- save_as ()
670
+ save_scope_as ()
685
671
686
672
687
- def save_as ():
673
+ def save_scope_as ():
688
674
global filepath
689
- new_filepath = QtGui .QFileDialog .getSaveFileName (main_widget , 'Save MELScope' , "" , 'Scope Files (*.scope *.yaml)' )
675
+ new_filepath , _ = QtGui .QFileDialog .getSaveFileName (main_widget , 'Save MELScope' , "" , 'Scope Files (*.scope *.yaml)' )
690
676
if new_filepath :
691
677
filepath = new_filepath
692
- save ()
678
+ save_scope ()
693
679
694
680
695
681
def deploy_config (config ):
@@ -943,7 +929,7 @@ class ConfigureDataDialog(QtGui.QDialog):
943
929
new_line_combo_box = QtGui .QComboBox (self )
944
930
new_line_combo_box .addItems (CURVE_STYLE_OPTIONS .keys ())
945
931
new_line_combo_box .setCurrentIndex (
946
- CURVE_STYLE_OPTIONS .keys ().index (data_sources [name ].curve_styles [i ]))
932
+ list ( CURVE_STYLE_OPTIONS .keys () ).index (data_sources [name ].curve_styles [i ]))
947
933
self .line_combo_boxes [name ].append (new_line_combo_box )
948
934
layout .addWidget (new_line_combo_box , row , 5 )
949
935
@@ -1271,7 +1257,7 @@ def about():
1271
1257
AboutDialog .open_dialog ()
1272
1258
1273
1259
def open_github ():
1274
- webbrowser .open ('https://github.com/epezent /MEL' )
1260
+ webbrowser .open ('https://github.com/mahilab /MEL' )
1275
1261
1276
1262
def prompt_scroll_mode ():
1277
1263
global time_mode
@@ -1324,15 +1310,15 @@ new_action = QtGui.QAction('&New', main_window,
1324
1310
file_menu .addAction (new_action )
1325
1311
1326
1312
open_action = QtGui .QAction ('&Open...' , main_window ,
1327
- shortcut = 'Ctrl+O' , statusTip = 'Open an existing MELScope' , triggered = open )
1313
+ shortcut = 'Ctrl+O' , statusTip = 'Open an existing MELScope' , triggered = open_scope )
1328
1314
file_menu .addAction (open_action )
1329
1315
1330
1316
save_action = QtGui .QAction ('&Save' , main_window ,
1331
- shortcut = 'Ctrl+S' , statusTip = 'Save this MELScope' , triggered = save )
1317
+ shortcut = 'Ctrl+S' , statusTip = 'Save this MELScope' , triggered = save_scope )
1332
1318
file_menu .addAction (save_action )
1333
1319
1334
1320
save_as_action = QtGui .QAction ('Save &As...' , main_window ,
1335
- shortcut = 'Ctrl+Shift+S' , statusTip = 'Save this MELScope under a new name' , triggered = save_as )
1321
+ shortcut = 'Ctrl+Shift+S' , statusTip = 'Save this MELScope under a new name' , triggered = save_scope_as )
1336
1322
file_menu .addAction (save_as_action )
1337
1323
1338
1324
reload_action = QtGui .QAction ('&Reload' , main_window ,
@@ -1347,9 +1333,9 @@ add_melshare_action = QtGui.QAction('&Add MELShare...', main_window,
1347
1333
shortcut = 'Ctrl+A' , statusTip = 'Add a MELShare data source' , triggered = prompt_add_melshare )
1348
1334
edit_menu .addAction (add_melshare_action )
1349
1335
1350
- add_melnet_action = QtGui .QAction ('Add &MELNet...' , main_window ,
1351
- shortcut = 'Ctrl+Shift+A' , statusTip = 'Add a MELNet data source' , triggered = prompt_add_melnet )
1352
- edit_menu .addAction (add_melnet_action )
1336
+ # add_melnet_action = QtGui.QAction('Add &MELNet...', main_window,
1337
+ # shortcut='Ctrl+Shift+A', statusTip='Add a MELNet data source', triggered=prompt_add_melnet)
1338
+ # edit_menu.addAction(add_melnet_action)
1353
1339
1354
1340
remove_action = QtGui .QAction ('&Remove Data Source...' , main_window ,
1355
1341
shortcut = 'Ctrl+X' , statusTip = 'Remove an existing data source' , triggered = prompt_remove_melshare )
@@ -1422,7 +1408,7 @@ status_bar.addPermanentWidget(rate_label)
1422
1408
for i in range (QtGui .QColorDialog .customCount ()):
1423
1409
rgb = CURVE_COLOR_OPTIONS [i ]
1424
1410
color = QtGui .QColor (rgb [0 ], rgb [1 ], rgb [2 ])
1425
- QtGui .QColorDialog .setCustomColor (i , color . rgb () )
1411
+ QtGui .QColorDialog .setCustomColor (i , color )
1426
1412
1427
1413
set_theme ()
1428
1414
reload_grid ()
@@ -1461,7 +1447,7 @@ render_loop_timer.start(1000 / FPS_TARGET)
1461
1447
1462
1448
# connect main window closeEvent to custom close to prevent crash
1463
1449
def close (event ):
1464
- print "Closing MELScope"
1450
+ # print( "Closing MELScope")
1465
1451
sys .exit ()
1466
1452
main_window .closeEvent = close
1467
1453
0 commit comments