|
@@ -52,20 +52,20 @@ class Detector_TiRayDR
|
|
DetStatus_XrayCalibration,
|
|
DetStatus_XrayCalibration,
|
|
};
|
|
};
|
|
|
|
|
|
- //探测器信息
|
|
|
|
|
|
+ //鎺㈡祴鍣ㄤ俊鎭�
|
|
struct CPanelStatus
|
|
struct CPanelStatus
|
|
{
|
|
{
|
|
- bool bInitOver; //是否初始化完成
|
|
|
|
- bool bConnectState; //是否连接
|
|
|
|
- SYNC_MODE eSyncMode; //同步模式
|
|
|
|
|
|
+ bool bInitOver; //鏄�惁鍒濆�鍖栧畬鎴�
|
|
|
|
+ bool bConnectState; //鏄�惁杩炴帴
|
|
|
|
+ SYNC_MODE eSyncMode; //鍚屾�妯″紡
|
|
int nSoftAcqState;
|
|
int nSoftAcqState;
|
|
- eDetStatus eFPDStatus; //探测器状态
|
|
|
|
|
|
+ eDetStatus eFPDStatus; //鎺㈡祴鍣ㄧ姸鎬�
|
|
|
|
|
|
CPanelStatus()
|
|
CPanelStatus()
|
|
{
|
|
{
|
|
bInitOver = false;
|
|
bInitOver = false;
|
|
bConnectState = false;
|
|
bConnectState = false;
|
|
- eSyncMode = SYNC_SOFTWARE; //暂时使用软同步作为缺省值
|
|
|
|
|
|
+ eSyncMode = SYNC_SOFTWARE; //鏆傛椂浣跨敤杞�悓姝ヤ綔涓虹己鐪佸€�
|
|
nSoftAcqState = 0;
|
|
nSoftAcqState = 0;
|
|
eFPDStatus = eDetStatus::DetStatus_NotIni;
|
|
eFPDStatus = eDetStatus::DetStatus_NotIni;
|
|
}
|
|
}
|
|
@@ -111,7 +111,7 @@ public:
|
|
|
|
|
|
void register_event_listener(const EventListener& fn);
|
|
void register_event_listener(const EventListener& fn);
|
|
void unregister_event_listener(const EventListener& fn);
|
|
void unregister_event_listener(const EventListener& fn);
|
|
- static bool cropImage(unsigned short* srcData,
|
|
|
|
|
|
+ bool cropImage(unsigned short* srcData,
|
|
int srcWidth, int srcHeight,
|
|
int srcWidth, int srcHeight,
|
|
unsigned short* destData,
|
|
unsigned short* destData,
|
|
int destWidth, int destHeight);
|
|
int destWidth, int destHeight);
|
|
@@ -168,17 +168,17 @@ public:
|
|
// param[0].Type = TiRayVariant::TiRayInt;
|
|
// param[0].Type = TiRayVariant::TiRayInt;
|
|
// param[0].IntValue = attribute;
|
|
// param[0].IntValue = attribute;
|
|
|
|
|
|
- // // 执行命令
|
|
|
|
|
|
+ // // 鎵ц�鍛戒护
|
|
// auto err = Execute(m_nDetectorID, Cmd_ReadAttribute, param, 1);
|
|
// auto err = Execute(m_nDetectorID, Cmd_ReadAttribute, param, 1);
|
|
// if (err != Err_Success) {
|
|
// if (err != Err_Success) {
|
|
// return { err, {} };
|
|
// return { err, {} };
|
|
// }
|
|
// }
|
|
|
|
|
|
- // // 处理event_params类型(实际是std::vector<event_param>)
|
|
|
|
|
|
+ // // 澶勭悊event_params绫诲瀷锛堝疄闄呮槸std::vector<event_param>锛�
|
|
// if constexpr (std::is_same_v<T, event_params>) {
|
|
// if constexpr (std::is_same_v<T, event_params>) {
|
|
// event_params result;
|
|
// event_params result;
|
|
|
|
|
|
- // // 根据参数类型构造对应的event_param并添加到vector中
|
|
|
|
|
|
+ // // 鏍规嵁鍙傛暟绫诲瀷鏋勯€犲�搴旂殑event_param骞舵坊鍔犲埌vector涓�
|
|
// switch (param[0].Type) {
|
|
// switch (param[0].Type) {
|
|
// case TiRayVariant::TiRayInt:
|
|
// case TiRayVariant::TiRayInt:
|
|
// result.emplace_back(param[0].IntValue);
|
|
// result.emplace_back(param[0].IntValue);
|
|
@@ -200,7 +200,7 @@ public:
|
|
// T result;
|
|
// T result;
|
|
// bool typeMismatch = false;
|
|
// bool typeMismatch = false;
|
|
|
|
|
|
- // // 根据参数类型和目标类型进行转换
|
|
|
|
|
|
+ // // 鏍规嵁鍙傛暟绫诲瀷鍜岀洰鏍囩被鍨嬭繘琛岃浆鎹�
|
|
// if constexpr (std::is_integral_v<T> && sizeof(T) <= 4 || std::is_enum_v<T>) {
|
|
// if constexpr (std::is_integral_v<T> && sizeof(T) <= 4 || std::is_enum_v<T>) {
|
|
// if (param[0].Type == TiRayVariant::TiRayInt) {
|
|
// if (param[0].Type == TiRayVariant::TiRayInt) {
|
|
// result = static_cast<T>(param[0].IntValue);
|
|
// result = static_cast<T>(param[0].IntValue);
|
|
@@ -226,12 +226,12 @@ public:
|
|
// }
|
|
// }
|
|
// }
|
|
// }
|
|
// else {
|
|
// else {
|
|
- // // 处理其他类型(如自定义类型)
|
|
|
|
|
|
+ // // 澶勭悊鍏朵粬绫诲瀷锛堝�鑷�畾涔夌被鍨嬶級
|
|
// typeMismatch = true;
|
|
// typeMismatch = true;
|
|
// }
|
|
// }
|
|
|
|
|
|
// if (typeMismatch) {
|
|
// if (typeMismatch) {
|
|
- // return { err, {} }; // 假设存在类型不匹配的错误码
|
|
|
|
|
|
+ // return { err, {} }; // 鍋囪�瀛樺湪绫诲瀷涓嶅尮閰嶇殑閿欒�鐮�
|
|
// }
|
|
// }
|
|
|
|
|
|
// return { Err_Success, result };
|
|
// return { Err_Success, result };
|
|
@@ -291,40 +291,40 @@ public:
|
|
return Err_Success;
|
|
return Err_Success;
|
|
}
|
|
}
|
|
|
|
|
|
- std::vector<image_info> m_gainCalibImages; // 存储Gain模式下的所有30张图像
|
|
|
|
- std::vector<image_info> m_currentDoseImages; // 存储当前剂量组的6张图像
|
|
|
|
- std::vector<image_info> m_gainV2MeanImages; // 存储每个剂量组生成的均值图
|
|
|
|
- int m_currentDoseIndex = 0; // 当前处理的剂量组索引(0-4,共5组)
|
|
|
|
|
|
+ std::vector<image_info> m_gainCalibImages; // 瀛樺偍Gain妯″紡涓嬬殑鎵€鏈�30寮犲浘鍍�
|
|
|
|
+ std::vector<image_info> m_currentDoseImages; // 瀛樺偍褰撳墠鍓傞噺缁勭殑6寮犲浘鍍�
|
|
|
|
+ std::vector<image_info> m_gainV2MeanImages; // 瀛樺偍姣忎釜鍓傞噺缁勭敓鎴愮殑鍧囧€煎浘
|
|
|
|
+ int m_currentDoseIndex = 0; // 褰撳墠澶勭悊鐨勫墏閲忕粍绱㈠紩锛�0-4锛屽叡5缁勶級
|
|
private:
|
|
private:
|
|
map<FPDDeviceTiRay*, int>* m_pDPC2PanelID;
|
|
map<FPDDeviceTiRay*, int>* m_pDPC2PanelID;
|
|
map<int, FPDDeviceTiRay*>* m_pPanelID2DPC;
|
|
map<int, FPDDeviceTiRay*>* m_pPanelID2DPC;
|
|
std::list<EventListener> m_listeners;
|
|
std::list<EventListener> m_listeners;
|
|
|
|
|
|
- ResDataObject m_ModeConfig; //保存DPC模块下发的配置
|
|
|
|
|
|
+ ResDataObject m_ModeConfig; //淇濆瓨DPC妯″潡涓嬪彂鐨勯厤缃�
|
|
CPanelStatus* m_pStPanelStatus[2]; //
|
|
CPanelStatus* m_pStPanelStatus[2]; //
|
|
void* m_hTiRayDRModule;
|
|
void* m_hTiRayDRModule;
|
|
- APP_STATUS m_nAppStatus; //记录软件状态
|
|
|
|
- CCOS_CALIBRATION_TYPE m_eCaliType; // 记录当前校正类型
|
|
|
|
- CCOS_CALIBRATION_MODE m_nCalibrationMode;//校正模式 ecom校正/厂商校正
|
|
|
|
|
|
+ APP_STATUS m_nAppStatus; //璁板綍杞�欢鐘舵€�
|
|
|
|
+ CCOS_CALIBRATION_TYPE m_eCaliType; // 璁板綍褰撳墠鏍℃�绫诲瀷
|
|
|
|
+ CCOS_CALIBRATION_MODE m_nCalibrationMode;//鏍℃�妯″紡 ecom鏍℃�/鍘傚晢鏍℃�
|
|
CZSKKCalibrationCtrl* m_pZSKKCalib;
|
|
CZSKKCalibrationCtrl* m_pZSKKCalib;
|
|
|
|
|
|
std::map<int32_t, std::promise<event_params>> notifiers_;
|
|
std::map<int32_t, std::promise<event_params>> notifiers_;
|
|
std::mutex notifiers_mutex_;
|
|
std::mutex notifiers_mutex_;
|
|
|
|
|
|
- int m_nPanelCount; //探测器数量
|
|
|
|
|
|
+ int m_nPanelCount; //鎺㈡祴鍣ㄦ暟閲�
|
|
int m_nDetectorID;
|
|
int m_nDetectorID;
|
|
int m_nCurrentPanelID;
|
|
int m_nCurrentPanelID;
|
|
- int m_nSyncMode; //记录选择模式时使用的同步模式
|
|
|
|
|
|
+ int m_nSyncMode; //璁板綍閫夋嫨妯″紡鏃朵娇鐢ㄧ殑鍚屾�妯″紡
|
|
int m_nImageWidth;
|
|
int m_nImageWidth;
|
|
int m_nImageHeight;
|
|
int m_nImageHeight;
|
|
int m_nWidthOffset;
|
|
int m_nWidthOffset;
|
|
int m_nHeightOffset;
|
|
int m_nHeightOffset;
|
|
- int m_nRawImgWidth; //SDK反馈的图像宽
|
|
|
|
- int m_nRawImgHeight; //SDK反馈的图像高
|
|
|
|
- int m_nCalibrationRounds;//校正轮数
|
|
|
|
- int m_nCalibCurrentCalibrationRound;//当前校正轮数
|
|
|
|
- int m_nCalibCurrentExposureIndex;//当前轮次曝光第几次
|
|
|
|
- int m_nExposureNumCurrentRound;//当前轮次需要曝光的总次数
|
|
|
|
|
|
+ int m_nRawImgWidth; //SDK鍙嶉�鐨勫浘鍍忓�
|
|
|
|
+ int m_nRawImgHeight; //SDK鍙嶉�鐨勫浘鍍忛珮
|
|
|
|
+ int m_nCalibrationRounds;//鏍℃�杞�暟
|
|
|
|
+ int m_nCalibCurrentCalibrationRound;//褰撳墠鏍℃�杞�暟
|
|
|
|
+ int m_nCalibCurrentExposureIndex;//褰撳墠杞��鏇濆厜绗�嚑娆�
|
|
|
|
+ int m_nExposureNumCurrentRound;//褰撳墠杞��闇€瑕佹洕鍏夌殑鎬绘�鏁�
|
|
int m_nImageNum;
|
|
int m_nImageNum;
|
|
int m_nReconnectTimePeriod;
|
|
int m_nReconnectTimePeriod;
|
|
int m_nNotifyStatusTimePeriod;
|
|
int m_nNotifyStatusTimePeriod;
|
|
@@ -338,27 +338,27 @@ private:
|
|
|
|
|
|
bool m_bUseGainV2 = false;
|
|
bool m_bUseGainV2 = false;
|
|
|
|
|
|
- std::string m_strWorkPath; //保存工作路径,用于加载SDK和配置
|
|
|
|
- std::string m_strDetectorType; //探测器类型
|
|
|
|
|
|
+ std::string m_strWorkPath; //淇濆瓨宸ヤ綔璺�緞锛岀敤浜庡姞杞絊DK鍜岄厤缃�
|
|
|
|
+ std::string m_strDetectorType; //鎺㈡祴鍣ㄧ被鍨�
|
|
std::string m_strWiredIP;
|
|
std::string m_strWiredIP;
|
|
std::string m_strWirelessIP;
|
|
std::string m_strWirelessIP;
|
|
std::string m_strLocalIP;
|
|
std::string m_strLocalIP;
|
|
std::string m_strSerialNum;
|
|
std::string m_strSerialNum;
|
|
|
|
|
|
- WORD* m_pRawImgBuffer; //原始图
|
|
|
|
- WORD* m_pImgBuffer; //裁剪后图像
|
|
|
|
|
|
+ WORD* m_pRawImgBuffer; //鍘熷�鍥�
|
|
|
|
+ WORD* m_pImgBuffer; //瑁佸壀鍚庡浘鍍�
|
|
|
|
|
|
- //辅助线程事件
|
|
|
|
|
|
+ //杈呭姪绾跨▼浜嬩欢
|
|
std::shared_ptr<LinuxEvent> m_hInitEvent;
|
|
std::shared_ptr<LinuxEvent> m_hInitEvent;
|
|
- std::shared_ptr<LinuxEvent> m_hExitEvent; //退出辅助线程事件
|
|
|
|
|
|
+ std::shared_ptr<LinuxEvent> m_hExitEvent; //閫€鍑鸿緟鍔╃嚎绋嬩簨浠�
|
|
std::shared_ptr<LinuxEvent> m_hReConnectEvent;
|
|
std::shared_ptr<LinuxEvent> m_hReConnectEvent;
|
|
std::shared_ptr<LinuxEvent> m_hRadEvent;
|
|
std::shared_ptr<LinuxEvent> m_hRadEvent;
|
|
std::vector<std::shared_ptr<LinuxEvent>> m_hArrayEvent;
|
|
std::vector<std::shared_ptr<LinuxEvent>> m_hArrayEvent;
|
|
|
|
|
|
pthread_t m_hReconnectThread = 0;
|
|
pthread_t m_hReconnectThread = 0;
|
|
bool m_bReconnectThreadRunning = false;
|
|
bool m_bReconnectThreadRunning = false;
|
|
- std::shared_ptr<LinuxEvent> m_hToggleEvent; //辅助线程退出通知事件
|
|
|
|
- pthread_t m_hFPDScanThread = 0; //辅助线程
|
|
|
|
|
|
+ std::shared_ptr<LinuxEvent> m_hToggleEvent; //杈呭姪绾跨▼閫€鍑洪€氱煡浜嬩欢
|
|
|
|
+ pthread_t m_hFPDScanThread = 0; //杈呭姪绾跨▼
|
|
|
|
|
|
pthread_t m_hRadAcquisitionThread = 0;
|
|
pthread_t m_hRadAcquisitionThread = 0;
|
|
|
|
|
|
@@ -379,7 +379,7 @@ private:
|
|
bool CloseDetectorScan();
|
|
bool CloseDetectorScan();
|
|
bool LoadCalibrationFiles(int nCalibrationMode);
|
|
bool LoadCalibrationFiles(int nCalibrationMode);
|
|
bool TestError(TiRayError nErrorCode);
|
|
bool TestError(TiRayError nErrorCode);
|
|
- //辅助线程
|
|
|
|
|
|
+ //杈呭姪绾跨▼
|
|
static void* onFPDScanThread(PVOID pvoid);
|
|
static void* onFPDScanThread(PVOID pvoid);
|
|
void OnReconnectFPD();
|
|
void OnReconnectFPD();
|
|
void OnProcessInitFPD();
|
|
void OnProcessInitFPD();
|