| 
						
						
							
								
							
						
						
					 | 
					@ -138,9 +138,6 @@ void HonaLowLevelAPI::hiruStart() | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					/*************************************************************************************************/ | 
					 | 
					 | 
					/*************************************************************************************************/ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					void HonaLowLevelAPI::hsruStop() | 
					 | 
					 | 
					void HonaLowLevelAPI::hsruStop() | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					{ | 
					 | 
					 | 
					{ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    if(_hsruIsStarted) | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        _hsruIsStarted = false; | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    _hsruStopEvent.wakeAll(); | 
					 | 
					 | 
					    _hsruStopEvent.wakeAll(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					} | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -158,6 +155,11 @@ void HonaLowLevelAPI::init() | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    } | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					} | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					bool HonaLowLevelAPI::isHsruStarted() | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					{ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    return _hsruIsStarted; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					/*************************************************************************************************/ | 
					 | 
					 | 
					/*************************************************************************************************/ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					void HonaLowLevelAPI::writeSettingToRegisters(HonaSettings& settings) | 
					 | 
					 | 
					void HonaLowLevelAPI::writeSettingToRegisters(HonaSettings& settings) | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					{ | 
					 | 
					 | 
					{ | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -204,6 +206,7 @@ void HonaLowLevelAPI::hsruMainThread() | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    deviceReset(); | 
					 | 
					 | 
					    deviceReset(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    setConfig(); | 
					 | 
					 | 
					    setConfig(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    deviceReset(); | 
					 | 
					 | 
					    deviceReset(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    if(!plxWrapper.deviceEnableInterrupt()) | 
					 | 
					 | 
					    if(!plxWrapper.deviceEnableInterrupt()) | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    { | 
					 | 
					 | 
					    { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        throw HonaException(); | 
					 | 
					 | 
					        throw HonaException(); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -215,13 +218,18 @@ void HonaLowLevelAPI::hsruMainThread() | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    QtConcurrent::run(this, &HonaLowLevelAPI::hsruReadThread); | 
					 | 
					 | 
					    QtConcurrent::run(this, &HonaLowLevelAPI::hsruReadThread); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    QtConcurrent::run(this, &HonaLowLevelAPI::hsruUpdateThread); | 
					 | 
					 | 
					    QtConcurrent::run(this, &HonaLowLevelAPI::hsruUpdateThread); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					    _mutex.lock(); | 
					 | 
					 | 
					    _mainMutex.lock(); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					    _hsruStopEvent.wait(&_mutex); | 
					 | 
					 | 
					    _hsruStopEvent.wait(&_mainMutex); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					    _mutex.unlock(); | 
					 | 
					 | 
					    _mainMutex.unlock(); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    _isHsruReaderThreadFree = true; | 
					 | 
					 | 
					    _isHsruReaderThreadFree = true; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    _isHsruUpdateThreadFree = true; | 
					 | 
					 | 
					    _isHsruUpdateThreadFree = true; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    _hsruReadDone.wakeAll(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    _hsruUpdateAck.wakeAll(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    _hsruIsStarted = false; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    if(!plxWrapper.deviceDisableInterrupt()) | 
					 | 
					 | 
					    if(!plxWrapper.deviceDisableInterrupt()) | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    { | 
					 | 
					 | 
					    { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        throw HonaException(); | 
					 | 
					 | 
					        throw HonaException(); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -241,8 +249,8 @@ void HonaLowLevelAPI::hsruReadThread() | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        { | 
					 | 
					 | 
					        { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            throw HonaException(); | 
					 | 
					 | 
					            throw HonaException(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        honaPacketList.clear(); | 
					 | 
					 | 
					
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        _hsruLoss = 0; | 
					 | 
					 | 
					        | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					        if(!plxWrapper.deviceOpenPCIChannel()) | 
					 | 
					 | 
					        if(!plxWrapper.deviceOpenPCIChannel()) | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        { | 
					 | 
					 | 
					        { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            throw HonaException(); | 
					 | 
					 | 
					            throw HonaException(); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -250,11 +258,11 @@ void HonaLowLevelAPI::hsruReadThread() | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        _hsruLoss += hsruParserInt123C(hsruReadHonaBuffer(honaReceivers::int123C), honaPacketList); | 
					 | 
					 | 
					        _hsruLoss += hsruParserInt123C(hsruReadHonaBuffer(honaReceivers::int123C), honaPacketList); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        _hsruLoss += hsruParserRes123C(hsruReadHonaBuffer(honaReceivers::res123C), honaPacketList); | 
					 | 
					 | 
					        _hsruLoss += hsruParserRes123C(hsruReadHonaBuffer(honaReceivers::res123C), honaPacketList); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        _hsruLoss += hsruParserIntS(hsruReadHonaBuffer(honaReceivers::intS), honaPacketList); | 
					 | 
					 | 
					//        _hsruLoss += hsruParserIntS(hsruReadHonaBuffer(honaReceivers::intS), honaPacketList);
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					        _hsruLoss += hsruParserResS(hsruReadHonaBuffer(honaReceivers::resS), honaPacketList); | 
					 | 
					 | 
					        _hsruLoss += hsruParserResS(hsruReadHonaBuffer(honaReceivers::resS), honaPacketList); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        _hsruLoss += hsruParserInt4(hsruReadHonaBuffer(honaReceivers::int4), honaPacketList); | 
					 | 
					 | 
					//        _hsruLoss += hsruParserInt4(hsruReadHonaBuffer(honaReceivers::int4), honaPacketList);
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        _hsruLoss += hsruParserRes4(hsruReadHonaBuffer(honaReceivers::res4), honaPacketList); | 
					 | 
					 | 
					//        _hsruLoss += hsruParserRes4(hsruReadHonaBuffer(honaReceivers::res4), honaPacketList);
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        _hsruLoss += hsruParserSinglePulse(hsruReadHonaBuffer(honaReceivers::singlePulse),honaPacketList); | 
					 | 
					 | 
					//        _hsruLoss += hsruParserSinglePulse(hsruReadHonaBuffer(honaReceivers::singlePulse),honaPacketList);
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        if(!plxWrapper.deviceClosePCIChannel()) | 
					 | 
					 | 
					        if(!plxWrapper.deviceClosePCIChannel()) | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        { | 
					 | 
					 | 
					        { | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -264,11 +272,11 @@ void HonaLowLevelAPI::hsruReadThread() | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        { | 
					 | 
					 | 
					        { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            throw HonaException(); | 
					 | 
					 | 
					            throw HonaException(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        QThread::usleep(200000); | 
					 | 
					 | 
					
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        _mutex.lock(); | 
					 | 
					 | 
					        _readMutex.lock(); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					        _hsruReadDone.wakeAll(); | 
					 | 
					 | 
					        _hsruReadDone.wakeAll(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        _hsruUpdateAck.wait(&_mutex); | 
					 | 
					 | 
					        _hsruUpdateAck.wait(&_readMutex); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        _mutex.unlock(); | 
					 | 
					 | 
					        _readMutex.unlock(); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					    } | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					} | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -277,14 +285,19 @@ void HonaLowLevelAPI::hsruUpdateThread() | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					{ | 
					 | 
					 | 
					{ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    while(true) | 
					 | 
					 | 
					    while(true) | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    { | 
					 | 
					 | 
					    { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        _mutex.lock(); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        _hsruReadDone.wait(&_mutex); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        _mutex.unlock(); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        if(_isHsruUpdateThreadFree) | 
					 | 
					 | 
					        if(_isHsruUpdateThreadFree) | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            break; | 
					 | 
					 | 
					            break; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        _updateMutex.lock(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        _hsruReadDone.wait(&_updateMutex); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        _updateMutex.unlock(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        quint32 Doa = 0; | 
					 | 
					 | 
					        quint32 Doa = 0; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        Doa = hiruGetDOA(); | 
					 | 
					 | 
					        Doa = hiruGetDOA(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        emit lowLevelHonaData(honaPacketList, _hsruLoss, Doa); | 
					 | 
					 | 
					        emit lowLevelHonaData(honaPacketList, _hsruLoss, Doa); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					 		_hsruLoss = 0; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        honaPacketList.clear(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        QThread::usleep(200000); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        _hsruUpdateAck.wakeAll(); | 
					 | 
					 | 
					        _hsruUpdateAck.wakeAll(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    } | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					} | 
					 | 
					 | 
					} | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -292,14 +305,7 @@ void HonaLowLevelAPI::hsruUpdateThread() | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					/*************************************************************************************************/ | 
					 | 
					 | 
					/*************************************************************************************************/ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					void HonaLowLevelAPI::hiruMainThread() | 
					 | 
					 | 
					void HonaLowLevelAPI::hiruMainThread() | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					{ | 
					 | 
					 | 
					{ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					    QtConcurrent::run(this, &HonaLowLevelAPI::hiruReadThread); | 
					 | 
					 | 
					
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					 | 
					 | 
					    QtConcurrent::run(this, &HonaLowLevelAPI::hiruUpdateThread); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    while(true) | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    { | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        _mutex.lock(); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        _hsruStopEvent.wait(&_mutex); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        _mutex.unlock(); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    } | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					} | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					/*************************************************************************************************/ | 
					 | 
					 | 
					/*************************************************************************************************/ | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  |