snu-quiqcl / iquip

Ion trap Quantum computing User Interface Project
GNU General Public License v3.0
7 stars 0 forks source link

Safe control of dataset synchronization thread #209

Closed kangz12345 closed 1 year ago

kangz12345 commented 1 year ago

Feature you want to implement

The current implementation of #208 does not protect the dataset synchronization thread (_DatasetFetcherThread) spawning. In other words, since the user can click the Sync ON/OFF button rapidly, it can spawn multiple fetcher threads or induce some illegal situations. Therefore, I want to protect the UI to ensure that the thread can be exist at most 1 at once.

How the feature is implemented

When the button is toggled, it immediately disables the button. If the button is now "ON", spawn a thread and enable the button back. If the button is now "OFF", stop the thread and DO NOT enable the button. After the thread actually finishes, the finished signal will trigger to enable the button back.

Also, more logging will be added.