HolyLab / Imagine

A graphical interface for recording with OCPI microscopes.
1 stars 1 forks source link

Should Imagine write a command file every time settings are applied? #53

Closed Cody-G closed 6 years ago

Cody-G commented 6 years ago

I'm thinking it's better to write a command file only when the Record button is pressed. Here's an example of when our current approach causes problems.

  1. User does a recording with their own command file.
  2. Afterwards the user wants to take a look at the sample in live mode. They also want to temporarily adjust camera exposure and/or piezo settings while looking around.
  3. They disable custom waveform mode so that they have access to the settings.
  4. Immediately when they click "Apply All" Imagine writes a new command file, possibly overwriting the command file from step 1. The user may not realize their original file was overwritten until they open it for analysis later.

It seems to me the simplest fix is to adopt the stance that no files get written to disk unless the user clicks "Record".

kdw503 commented 6 years ago

We already had a exposure setting spinbox in waveform tab. But, we decided not to allow change this exposure setting because this should be compatible with camera pulse especially in the 'exposure control' mode but still this could be a problem in 'exposure start' mode also. So, that time I blocked this spinbox. And the one in camera tab is for GUI control mode.

Internally imagine keeps two control wavefoms. One is generated from GUI control setting. The other is custom control loaded when we open the .json file in the waveform tab. We can toggle these waveforms by checking and unchecking the 'enable' checkbox in waveform tab. So, if we unchecked this 'enable', imagine does not overwrite the custom waveform data even when we press apply button. It only change the control waveform from GUI control setting. And, we can just bring the custom control up again by checking 'enable' button.

Then, do we need to make the exposure setting spinbox in the waveform tab be enable again?

Cody-G commented 6 years ago

So, if we unchecked this 'enable', imagine does not overwrite the custom waveform data even when we press apply button. It only change the control waveform from GUI control setting.

I just checked again and Imagine's waveform file does get written to disk when I uncheck the enable box and then click apply. (and if the custom file has the same name then it gets overwritten). So maybe this is a bug?

Cody-G commented 6 years ago

Per our discussion offline, the plan is to append "_gui" to all command files written by Imagine to keep from accidentally overwriting the user's command file.

Cody-G commented 6 years ago

This was solved as described above, by appending _gui to Imagine-generated commands