Refactor DeviceManager
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user