microscope-cockpit / cockpit

Cockpit is a microscope graphical user interface. It is a flexible and easy to extend platform aimed at life scientists using bespoke microscopes.
https://microscope-cockpit.org
GNU General Public License v3.0
35 stars 26 forks source link

change primitives while cockpit is running #608

Open carandraug opened 4 years ago

carandraug commented 4 years ago

While fixing #605 I found that there is code that, each time it draws the macro stage and mosaic, checks if the primitives have changed. However, there is no way for a user to actually change them during a session.

I thought of just removing it but maybe this could be a nice new feature. The use case I imagine is a user swapping plate during one session. What do you guys think? Remove or improve?

mickp commented 4 years ago

I think that was exactly the use case it was put in for: changing the sample holder type. I can't remember the code, but I expect originally it evaluated the primitives on every call, then I put in a check that uses a shortcut if they hadn't changed.

On Wed, 20 May 2020 at 15:53, Carnë Draug notifications@github.com wrote:

While fixing #605 https://github.com/MicronOxford/cockpit/issues/605 I found that there is code that, each time it draws the macro stage and mosaic, checks if the primitives have changed. However, there is no way for a user to actually change them during a session.

I thought of just removing it but maybe this could be a nice new feature. The use case I imagine is a user swapping plate during one session. What do you guys think? Remove or improve?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/MicronOxford/cockpit/issues/608, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABHGTL5TXX2RHCWGJZ4HUATRSRNM3ANCNFSM4NGL2RWQ .

--


Mick Phillips


iandobbie commented 4 years ago

I would head for improving if at all possible, or leave as a check for later improvement. Fixing something like this to require a restart it silly.

carandraug commented 4 years ago

Fixing something like this to require a restart it silly.

I'm not fixing this to require a restart. Requiring a restart and change of configuration file is the current state of affairs, even before my changes on #605. I think we should have a way to do this without requiring that.

But it seems that no one is doing this any time soon anyway so I have removed those checks with 1ee2ad710122. Now that we have an issue about this, when someone wants to implement it, they can easily revert those changes. However, when this does get implemented, I think that instead of a check for new primitives on each paint, the canvas needs to be notified when the primitives are changed. The canvas them updates the list that is available during paint.