3dct / open_iA

A tool for the visual analysis and processing of volumetric datasets, with a focus on industrial computed tomography.
GNU General Public License v3.0
40 stars 16 forks source link

Different Handling of Desync while loading Dataset #67

Closed mdalpiaz closed 6 months ago

mdalpiaz commented 6 months ago

Following the previous pull request, these are the proposed changes to handle desynchronization while loading datasets. My last comment from the previous pull request is copied here:

I think you're right, we should keep the current implementation. If we change datasets successfully, the state of objects is already reset, so they are always in sync.

However, one case in which it would make sense to NAK the clients would be the following: The server wants to change to a dataset, that a client doesn't have. The client simultaneously sends a object manipulation command (which reaches the server after dataset load was sent --> message is discarded). The client answers with NAK (it doesn't have the dataset).

Now we have two states: The server in the state before the object manipulation command (because discarded). The client after manipulating the object (the command doesn't require acknowledgement).

One way to resolve this, could be to "mark" clients which have sent commands while in the dataset loading process, and in case they NAK, send the state of the server to these clients (objects positions, snapshots, etc.). What do you think about it?

codeling commented 6 months ago

Sounds like a good idea!

In case of aborted loading, the server will just send out the state of objects (matrix for each object) and snapshots ("clear snapshot" followed by "add snapshot" for each existing on server);

One thing i just realized - new clients should probably also get such a "synchronization" package about objects and snapshots, if a dataset is already loaded when they connect.

mdalpiaz commented 6 months ago

I will add the synchronization procedure to the document at the client connected command, so new clients get synchronized properly.

mdalpiaz commented 6 months ago

Can we really just set the object state first and then add all the snapshots? When we take a snapshot, rotate the object, then take another snapshot, the first one still has the coordinates of the old slice plane? Doing a sync would then take these old coordinates and slice the NEW object at these. --> The first snapshot is wrong.

If we do snapshot slices only in accordance to local space (with the object as reference), the object could be manipulated in any way and it would work again.

codeling commented 6 months ago

If we do snapshot slices only in accordance to local space (with the object as reference), the object could be manipulated in any way and it would work again.

Yes I think this is the only reliable way.