File tree Expand file tree Collapse file tree 3 files changed +24
-3
lines changed Expand file tree Collapse file tree 3 files changed +24
-3
lines changed Original file line number Diff line number Diff line change 8
8
9
9
# Board_config_dialog -------------------------------------------------
10
10
11
+ flashdrive_message = (
12
+ 'It is recommended to disable the pyboard filesystem from acting as a '
13
+ 'USB flash drive before loading the framework, as this helps prevent the '
14
+ 'filesystem getting corrupted. Do you want to disable the flashdrive?' )
15
+
11
16
class Board_config_dialog (QtGui .QDialog ):
12
17
13
18
def __init__ (self , parent = None ):
@@ -41,6 +46,13 @@ def exec_(self, board):
41
46
42
47
def load_framework (self ):
43
48
self .accept ()
49
+ if self .flashdrive_enabled :
50
+ reply = QtGui .QMessageBox .question (self , 'Disable flashdrive' ,
51
+ flashdrive_message , QtGui .QMessageBox .Yes | QtGui .QMessageBox .No )
52
+ if reply == QtGui .QMessageBox .Yes :
53
+ self .board .disable_mass_storage ()
54
+ self .disconnect = True
55
+ return
44
56
self .board .load_framework ()
45
57
46
58
def load_hardware_definition (self ):
Original file line number Diff line number Diff line change @@ -119,6 +119,10 @@ def setup_experiment(self, experiment):
119
119
print_func ('Connection failed.' )
120
120
self .abort_experiment ()
121
121
return
122
+ if not self .boards [i ].status ['framework' ]:
123
+ print_func ('\n Install pyControl framework on board before running experiment.' )
124
+ self .abort_experiment ()
125
+ return
122
126
self .boards [i ].subject = experiment ['subjects' ][setup ]
123
127
# Hardware test.
124
128
if experiment ['hardware_test' ] != 'no hardware test' :
Original file line number Diff line number Diff line change @@ -228,6 +228,8 @@ def open_config_dialog(self):
228
228
self .task_changed ()
229
229
if self .GUI_main .config_dialog .disconnect :
230
230
self .disconnect ()
231
+ if self .connected and self .board .status ['framework' ]:
232
+ self .task_groupbox .setEnabled (True )
231
233
232
234
# Widget methods.
233
235
@@ -243,17 +245,20 @@ def connect(self):
243
245
self .board = Pycboard (port , print_func = self .print_to_log , data_logger = self .data_logger )
244
246
self .connected = True
245
247
self .config_button .setEnabled (True )
246
- self .task_groupbox .setEnabled (True )
247
248
self .connect_button .setEnabled (True )
248
249
self .connect_button .setText ('Disconnect' )
249
250
self .status_text .setText ('Connected' )
251
+ if self .board .status ['framework' ]:
252
+ self .task_groupbox .setEnabled (True )
253
+ else :
254
+ self .print_to_log (
255
+ "\n Load pyControl framework using 'Config' button." )
250
256
except SerialException :
251
257
self .status_text .setText ('Connection failed' )
252
258
self .print_to_log ('Connection failed.' )
253
259
self .connect_button .setEnabled (True )
254
260
self .board_select .setEnabled (True )
255
- if self .connected and not self .board .status ['framework' ]:
256
- self .board .load_framework ()
261
+
257
262
258
263
def disconnect (self ):
259
264
# Disconnect from pyboard.
You can’t perform that action at this time.
0 commit comments