|
|
@@ -104,7 +104,8 @@ Detector_TiRayDR::Detector_TiRayDR()
|
|
|
m_bAEDReady(false),
|
|
|
m_bAEDWorkFlag(false),
|
|
|
m_bExitRadAcqStatus(false),
|
|
|
- m_bMonitorFlag(false)
|
|
|
+ m_bMonitorFlag(false),
|
|
|
+ m_bIsMultiFrame(false)
|
|
|
{
|
|
|
m_pDPC2PanelID = new map<FPDDeviceTiRay*, int>();
|
|
|
m_pPanelID2DPC = new map<int, FPDDeviceTiRay*>();
|
|
|
@@ -388,17 +389,20 @@ bool Detector_TiRayDR::SetAcqMode(int nMode)
|
|
|
if (nMode == AcqMode::RAD)
|
|
|
{
|
|
|
workMode = WorkMode_FreeSync;
|
|
|
+ m_bIsMultiFrame = false; // 单帧点片
|
|
|
modeName = "RAD";
|
|
|
}
|
|
|
else if (nMode == AcqMode::DDR)
|
|
|
{
|
|
|
workMode = WorkMode_DDR;
|
|
|
+ m_bIsMultiFrame = true; // 多帧图
|
|
|
modeName = "DDR";
|
|
|
nXWindow = 800;
|
|
|
}
|
|
|
else if (nMode == AcqMode::PF)
|
|
|
{
|
|
|
workMode = WorkMode_SyncIn;
|
|
|
+ m_bIsMultiFrame = true; // 多帧图
|
|
|
modeName = "PF";
|
|
|
nXWindow = 800;
|
|
|
}
|
|
|
@@ -528,17 +532,19 @@ bool Detector_TiRayDR::PrepareAcquisition(FPDDeviceTiRay* pDrvDPC)
|
|
|
|
|
|
// 生成新的会话时间戳,这次拍摄的所有图片都将使用这个时间戳
|
|
|
m_strCurrentSessionTimestamp = generateReadableTimestamp();
|
|
|
+ FINFO("New session started with timestamp: {$}", m_strCurrentSessionTimestamp);
|
|
|
m_nSessionFrameCounter = 0; // 重置帧计数器
|
|
|
|
|
|
- // 初始化采集状态
|
|
|
- m_bIsAcquiring = true;
|
|
|
- m_bAcquisitionCompleted = false;
|
|
|
- m_bWaitingForNextExposure = false;
|
|
|
-
|
|
|
- FINFO("New session started with timestamp: {$}", m_strCurrentSessionTimestamp);
|
|
|
+ if (m_bIsMultiFrame)
|
|
|
+ {
|
|
|
+ // 初始化采集状态
|
|
|
+ m_bIsAcquiring = true;
|
|
|
+ m_bAcquisitionCompleted = false;
|
|
|
+ m_bWaitingForNextExposure = false;
|
|
|
|
|
|
- // 启动采集完成检测线程
|
|
|
- StartAcquisitionCheckThread();
|
|
|
+ // 启动采集完成检测线程
|
|
|
+ StartAcquisitionCheckThread();
|
|
|
+ }
|
|
|
|
|
|
//m_hRadEvent->SetEvent();
|
|
|
|
|
|
@@ -2129,16 +2135,16 @@ std::string Detector_TiRayDR::saveProcessedImage(Detector_TiRayDR& detector, uns
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // 策略2: 尝试原始目录
|
|
|
- if (hasEnoughSpace(ORIGINAL_DIR))
|
|
|
- {
|
|
|
- if (tryToSaveInDir(ORIGINAL_DIR, false))
|
|
|
- return filePath;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- FINFO("Original directory space insufficient, trying backup");
|
|
|
- }
|
|
|
+ //// 策略2: 尝试原始目录
|
|
|
+ //if (hasEnoughSpace(ORIGINAL_DIR))
|
|
|
+ //{
|
|
|
+ // if (tryToSaveInDir(ORIGINAL_DIR, false))
|
|
|
+ // return filePath;
|
|
|
+ //}
|
|
|
+ //else
|
|
|
+ //{
|
|
|
+ // FINFO("Original directory space insufficient, trying backup");
|
|
|
+ //}
|
|
|
|
|
|
// 策略3: 使用备用目录 /userdata/
|
|
|
FINFO("Using backup directory: {$}", BACKUP_DIR);
|
|
|
@@ -2432,7 +2438,11 @@ void Detector_TiRayDR::handleHardwareSyncImage(Detector_TiRayDR& detector, TiRay
|
|
|
// applyCalibration(detector);
|
|
|
detector.InfoFeedback(EVT_DATA_RAW_IMAGE, -1, 0, 0, processedImagePath.c_str());
|
|
|
|
|
|
- //detector.StatusFeedback(EVT_STATUS_PANEL, PANEL_XWINDOW_OFF);
|
|
|
+ if (!detector.m_bIsMultiFrame)
|
|
|
+ {
|
|
|
+ FINFO("=== Single frame acquisition completed === Frame count: {$}", detector.m_nSessionFrameCounter);
|
|
|
+ detector.StatusFeedback(EVT_STATUS_PANEL, PANEL_XRAY_OFF);
|
|
|
+ }
|
|
|
detector.m_bExitRadAcqStatus = false;
|
|
|
}
|
|
|
|
|
|
@@ -2483,7 +2493,12 @@ void Detector_TiRayDR::handleSoftwareSyncImage(Detector_TiRayDR& detector, TiRay
|
|
|
detector.InfoFeedback(EVT_DATA_RAW_IMAGE, -1, 0, 0, processedImagePath.c_str());
|
|
|
// 应用校准
|
|
|
// applyCalibration(detector);
|
|
|
- //detector.StatusFeedback(EVT_STATUS_PANEL, PANEL_XWINDOW_OFF);
|
|
|
+
|
|
|
+ if (!detector.m_bIsMultiFrame)
|
|
|
+ {
|
|
|
+ FINFO("=== Single frame acquisition completed === Frame count: {$}", detector.m_nSessionFrameCounter);
|
|
|
+ detector.StatusFeedback(EVT_STATUS_PANEL, PANEL_XRAY_OFF);
|
|
|
+ }
|
|
|
detector.m_bExitRadAcqStatus = false;
|
|
|
}
|
|
|
|
|
|
@@ -2535,7 +2550,11 @@ void Detector_TiRayDR::handleAedSyncImage(Detector_TiRayDR& detector, TiRayVaria
|
|
|
detector.InfoFeedback(EVT_DATA_RAW_IMAGE, -1, 0, 0, processedImagePath.c_str());
|
|
|
detector.m_bAEDWorkFlag = false;
|
|
|
//usleep(500000);
|
|
|
- //detector.StatusFeedback(EVT_STATUS_PANEL, PANEL_XWINDOW_OFF);
|
|
|
+ if (!detector.m_bIsMultiFrame)
|
|
|
+ {
|
|
|
+ FINFO("=== Single frame acquisition completed === Frame count: {$}", detector.m_nSessionFrameCounter);
|
|
|
+ detector.StatusFeedback(EVT_STATUS_PANEL, PANEL_XRAY_OFF);
|
|
|
+ }
|
|
|
detector.m_bExitRadAcqStatus = false;
|
|
|
}
|
|
|
|
|
|
@@ -2857,7 +2876,6 @@ void Detector_TiRayDR::on_event_callback(int detectorId, TiRayEvent eventType, T
|
|
|
}
|
|
|
case TiRayEvent::Evt_ImageReceived:
|
|
|
{
|
|
|
- cout << funcTag << "Evt_ImageReceived!!!" << endl;
|
|
|
FINFO("Evt_ImageReceived!!");
|
|
|
handleImageReceived(detector, argv);
|
|
|
break;
|