Open MattBlack85 opened 2 years ago
One of the correct process for managing the camera shot process could be something like this:
An idea of this could be as the following diagram:
@AndreaMarini74 good inputs!
two questions:
@AndreaMarini74 the blob is already available in memory when you ask for it to the camera, if you look at the code here, code you need to pass a pointer to a buffer to the SDK, so effectively it is already a 2-step action for the camera itself, you ask the camera to expose and it puts it in memory, you ask the camera to download the exposure and it flushes the memory copying bytes from the camera memory to the buffer owned by the camera driver.
Not sure I understand correctly the item list actions, I cannot see actions like dithering there as it will live into the mount driver 🤔 unless I am missing something
@MattBlack85 good! i miss the point the driver already works using memory instead of saving locally the image, what i was trying to depict was the fact that the item i call driver is the implementation and the camera is the driver camera. It is ok the camera takes in memory the image, my idea is the software when is aware the camera ends, save it to the disk in the raw format. The client can that the row format and do what every it wants. It is should be a sort of API layer between the camera and the client. About the dithering, yes i know it is a mount action, i just tried to figure a situation when you have multiple action and you have to manage it. For example, suppose you have a sequence of 16 photos of about 10 minutes. Every two photos you have to perform a dither. If you manage with a multiple thread way, one for camera, one for mount, the mount thread should start when the second photo is finished. You have two solution: the first is that you that the sequence and decouple each action on it thread and it is the thread that check if he can run or not. In this first solution idea, for this example, the mount thread runs for 20' before having the camera response the photo is finished. In the second solution idea, you put the sequence in a list and base on the sequence step type a correct thread is started. In this way, you have a centralized component that manage the sequence, and the mount starts when it is his turn. Pay attention: this is not the case the action is performed when the client action is finished BUT when the device, finished; so, if the camera finished to take the image but the client has not yet, took it, the dither can start, because the camera is free.
An exposure cycle is usually following this flow:
1) a client request the camera to expose for X seconds 2) the driver call into the library function to do the exposure 3) when done, the client gets the BLOB with the exposure data
right now, to have a semi-functional driver that can be tested the driver converts binary data into FITS and dumps the picture to the disk.
The exposure cycle should be refactored such that:
1) clients request an exposure 2) the driver prepare the properties to signal an exposure is ongoing 3) when the exposure is done the driver should dump the exposure data into a buffer 4) the client gets the raw data and does whatever it wants with it
open questions about this API remain: