Skip to content

Commit

Permalink
2-way trigger confirmation that works in the luna container.
Browse files Browse the repository at this point in the history
  • Loading branch information
pslocum committed Feb 9, 2024
1 parent b515072 commit 680adbf
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Source/Kassiopeia/LMCCyclotronRadiationExtractor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,22 @@ namespace locust
fInterface->fDigitizerCondition.notify_one(); // notify Locust after writing.

int tTriggerConfirm = 0;

while ( !(fSampleIndex < fInterface->fSampleIndex) && (tTriggerConfirm < fInterface->fTriggerConfirm) )
{
// If the Locust sample index has not advanced yet, keep checking it.
// If the Locust sample index has not advanced yet, keep checking it.
tTriggerConfirm += 1;
std::this_thread::sleep_for(std::chrono::milliseconds(1));
if ( tTriggerConfirm % 1000 == 0 )
{
LPROG(lmclog,"Checking the digitizer synchronization, tTriggerConfirm index = " << tTriggerConfirm );
}

if ( ( tTriggerConfirm > fInterface->fTriggerConfirm - 3) && ( fSampleIndex < fInterface->fFastRecordLength ) )
{
LPROG(lmclog,"Checking the digitizer synchronization, tTriggerConfirm index = " << tTriggerConfirm);
LPROG(lmclog,"Checking the digitizer synchronization, at fast sample = " << fSampleIndex);
LPROG(lmclog,"Checking the digitizer synchronization, at Locust fast sample = " << fInterface->fSampleIndex);
LPROG(lmclog,"Fast record length = " << fInterface->fFastRecordLength);
std::this_thread::sleep_for(std::chrono::milliseconds(10000));
if ( !(fSampleIndex < fInterface->fSampleIndex) )
Expand Down

0 comments on commit 680adbf

Please sign in to comment.