Closed ThomasAkam closed 1 year ago
where running any task or experiment without naming the setups gave an error message, I encountered a bug in the hardware variables dialog. The bug happens when I open the hardware variables dialog in the setups tab
I'm not sure I follow. would it be possible to share a screen recording of you encountering the error? You shouldn't be able to open the hardware variables dialog in the setups tab without first naming the setup (the Variables
button should not be enabled)
@alustig3 I get this error even when all the setups have names, see the configuration in the image below. The error occurs when I open the hardware variables dialog, and only happens if there are saved values for hardware variables. The setups.json
file read:
{
"COM4": {
"name": "b2",
"variables": {
"hw_solenoid": 10
}
},
"COM6": {
"name": "b1",
"variables": {
"hw_solenoid": 8
}
}
}
While fixing a bug in 50bd9c11b4d62a2dbf22c14bb9248fb190494929 where running any task or experiment without naming the setups gave an error message, I encountered a bug in the hardware variables dialog. The bug happens when I open the hardware variables dialog in the setups tab, and causes the error message below to appear in the log:
I could not work out what is causing this, @alustig3 could you take a look.
Also, I have a couple of questions/comments about the code for the
VariablesTable
widget inhardware_variables_dialog.py
:if setup_variables is not False
, and could we refactor it to avoid this somewhat weird syntax?setup_variables["hw_var"] = self.setup_var_editor.variable_cbox.currentText()
given that all the other entries in thesetup_variables
dictionary are{setup_name: variable_value}
. Mixing these different bits of information in the same dictionary then makes the logic of the code in the save method hard to follow. Would it be possible to refactor this, e.g. by just reading thevariable_cbox.currentText()
when the save button is pressed?