Refactor DeviceManager

This commit is contained in:
Krad
2022-05-17 16:15:20 +08:00
parent 121d1753d4
commit b691cfb1e3
2 changed files with 170 additions and 109 deletions

View File

@@ -15,13 +15,33 @@ public:
static DeviceManager manager;
return &manager;
}
/**
* init device, include Shimlib and it's error call back,
* deviceInfTimer to get temperature of water, and the
* preview data caller thread.
*/
void initDevice();
/**
* close and release the device reference resource.
*/
void close();
/**
* Get Firm ware version
* @return Firm ware version
*/
QString getSoftwareVersion();
/**
* Get Scan data output path
* @return Scan data output path
*/
QString getScanOutputPath();
void setErrorOccurred(bool v){
errorOccurred = v;
}
QString getSoftwareVersion();
QString getScanOutputPath();
bool getErrorOccurred(){
return errorOccurred;
}
@@ -33,9 +53,40 @@ protected:
void timerEvent(QTimerEvent* event) override;
private:
void processScan(const char* json, bool empty = false);
/**
* To start a new scan operation
* @param json The patient information json string
* @param empty Empty scan flag
*/
void startScan(const char* json, bool empty = false);
/**
* Post Scan start command to Shimlib
*/
void postScanCommand();
/**
* Post Continue Scan command to Shimlib
* @param useTimer start a new timer flag
*/
void postContinueCommand(bool useTimer = false);
/**
* Prepare for finishing the Scan
*/
void prepareFinishScan();
/**
* exit the current Scan process timer
*/
void exitScanTimer();
/**
* Process scan progress change
* @param Scan progress
*/
void scanProcess(int progress);
int scanPhase = 1;
int timerID = -1;
int deviceInfTimerID = -1;