Skip to content

Commit 5b5ebd9

Browse files
Added custom delay namespace to Scanlab driver
1 parent dace1d8 commit 5b5ebd9

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

Drivers/ScanLab/Implementation/libmcdriver_scanlab_rtccontext.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2834,11 +2834,16 @@ void CRTCContext::addLayerToListEx(LibMCEnv::PToolpathLayer pLayer, eOIERecordin
28342834
if (nIndividiualPreSegmentDelayInMicroseconds >= 0)
28352835
nPreSegmentDelayInTicks = (uint32_t)(nIndividiualPreSegmentDelayInMicroseconds / 10);
28362836

2837+
// Check for a Presegment delay override for each segment in the Scanlab Namespace
2838+
int64_t nScanlabPreSegmentDelayInMicroseconds = pLayer->GetSegmentProfileIntegerValueDef(nSegmentIndex, "http://schemas.scanlab.com/delay/2023/01", "predelay", -1);
2839+
if (nScanlabPreSegmentDelayInMicroseconds >= 0)
2840+
nPreSegmentDelayInTicks = (uint32_t)(nScanlabPreSegmentDelayInMicroseconds / 10);
2841+
28372842
if (nPreSegmentDelayInTicks > 0) {
28382843
if (nPreSegmentDelayInTicks > RTCCONTEXT_MAXSEGMENTDELAY_ONEHOURIN100KHZ)
28392844
throw ELibMCDriver_ScanLabInterfaceException(LIBMCDRIVER_SCANLAB_ERROR_SEGMENTDELAYEXCEEDSONEHOUR);
28402845

2841-
// Set delay in 10 Microsecond steps, dPreSegmentDelay is in Milliseconds
2846+
// Set delay in 10 Microsecond steps, dPreSegmentDelay is in Microseconds
28422847
m_pScanLabSDK->n_long_delay(m_CardNo, nPreSegmentDelayInTicks);
28432848
}
28442849
}
@@ -2907,11 +2912,16 @@ void CRTCContext::addLayerToListEx(LibMCEnv::PToolpathLayer pLayer, eOIERecordin
29072912
if (nIndividiualPostSegmentDelayInMicroseconds >= 0)
29082913
nPostSegmentDelayInTicks = (uint32_t)(nIndividiualPostSegmentDelayInMicroseconds / 10);
29092914

2915+
// Check for a Postsegment delay override for each segment in the Scanlab Namespace
2916+
int64_t nScanlabPostSegmentDelayInMicroseconds = pLayer->GetSegmentProfileIntegerValueDef(nSegmentIndex, "http://schemas.scanlab.com/delay/2023/01", "postdelay", -1);
2917+
if (nScanlabPostSegmentDelayInMicroseconds >= 0)
2918+
nPostSegmentDelayInTicks = (uint32_t)(nScanlabPostSegmentDelayInMicroseconds / 10);
2919+
29102920
if (nPostSegmentDelayInTicks > 0) {
29112921
if (nPostSegmentDelayInTicks > RTCCONTEXT_MAXSEGMENTDELAY_ONEHOURIN100KHZ)
29122922
throw ELibMCDriver_ScanLabInterfaceException(LIBMCDRIVER_SCANLAB_ERROR_SEGMENTDELAYEXCEEDSONEHOUR);
29132923

2914-
// Set delay in 10 Microsecond steps, dPostSegmentDelay is in Milliseconds
2924+
// Set delay in 10 Microsecond steps, dPostSegmentDelay is in Microseconds
29152925
m_pScanLabSDK->n_long_delay(m_CardNo, nPostSegmentDelayInTicks);
29162926
}
29172927
}

0 commit comments

Comments
 (0)