Configfiles to support different operational modes#4
Configfiles to support different operational modes#4zoltuz wants to merge 9 commits intoHarrisonSteel:masterfrom
Conversation
- creating a placeholder for DeviceName for later use
- check config file for config key, raise ValueError if critical config data is missing - number of OD measurements set by the config file
…s to run two chi.bio units per pump board
|
Hi Zoltan, I think it looks like a sensible and useful feature to add, certainly will be helpful if people are frequently setting up the same experiment etc. Let me know how the testing goes! |
- moving the config value to the initialization phase
|
I've tested the code as much as I can. It handles well the case when a config value was not found. Here're the two cases: Let me know you think! Zoltan |
|
Hi Harry, |
| if application.config['TWO_PUMPS_PER_DEVICE']: | ||
| chibios_to_shut_down = [0, 1, 2, 3] | ||
| else: | ||
| chibios_to_shut_down = [0, 1, 2, 4, 5, 6, 7] |
There was a problem hiding this comment.
number 3 is missing!
| chibios_to_shut_down = [0, 1, 2, 3] | ||
| else: | ||
| chibios_to_shut_down = [0, 1, 2, 4, 5, 6, 7] | ||
| if int(M[1]) in chibios_to_shut_down: |
There was a problem hiding this comment.
let's use f-string instead! printf(f'M{number}') in number
| setPWM(M,'Pumps',sysItems['All'],0,0) | ||
|
|
||
| if application.config['TWO_PUMPS_PER_DEVICE']: | ||
| chibios_to_shut_down = [0, 1, 2, 3] |
There was a problem hiding this comment.
let's call the variable chibios_w_pumps
| sysData[M]['present']=0 | ||
| tries=-1 | ||
| if tries>10: #In this case something else has gone wrong, so we panic. | ||
| if tries >= application.config['DEVICE_COMM_FAILURE_THRESHOLD']: #In this case something else has gone wrong, so we panic. |
| if(sysData[M]['present']==1): | ||
| turnEverythingOff(M) | ||
| print(str(datetime.now()) + " Initialised " + str(M) +', Device ID: ' + sysData[M]['DeviceID']) | ||
| print(str(datetime.now()) + " Initialised " + str(M) + ', (' + sysData[M]['DeviceName'] + ') Device ID: ' |
There was a problem hiding this comment.
remove device name feature
|
add CONTINUOUS_STIRRING = False to this PR |
Hi Harrison,
First of all, DO NOT MERGE THIS PR with the master for now. I just wanted to show you a path I'd like to take with the code, namely allowing for config files for certain variables (two vs four pump, number of OD measurements, etc).I've not tested this code below. I'll do it later this week, once I get access to the chi.bios, until then I'm happy to get some feedback from you.
Cheers,
Zoltan