snu-quiqcl / iquip

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

Modification based dataset realtime update #208

Closed kangz12345 closed 1 year ago

kangz12345 commented 1 year ago

I apologize for the large diffs... It was an urgent patch so I didn't break it to several PRs.

To summarize this PR:

  1. Change polling strategy: periodic polling -> long polling
  2. Change dataset update strategy: fetch whole dataset every time -> only modifications since the last fetch
  3. Change threading strategy: Spawn a new thread for every fetch -> Spawn a thread for each sync (spawn once start sync, destroy after stop sync) and run a long polling loop
  4. Synchronize fetching thread and GUI thread with a QMutex and a QWaitCondition
  5. NOT changed the data structure or plot strategy: it still updates the plot for the whole dataset when the dataset is updated (even by modifications)

More description for the thread synchronization:

As I tested, the most of the latency was because of the large data transfer. Therefore, I didn't change the dataset organizing and plotting policy.

This branch is already tested and used in the experiment PC. It works well without any glitch up to 200,000 data points (tested so far, will work for even more!) (the previous version crashed for 20,000 data points).

This branch works after snu-quiqcl/artiq-proxy#93 is done (already done in a not-merged branch).

This closes #207.

kangz12345 commented 1 year ago

There comes a little bit of change soon, because of a bug found last week. It is resolved in the lab PC, so I will apply it to this branch soon.

kangz12345 commented 1 year ago

There comes a little bit of change soon, because of a bug found last week. It is resolved in the lab PC, so I will apply it to this branch soon.

I will create another PR for the updates.