|
|
@ -110,7 +110,7 @@ LRF_HardwareManager::LRF_HardwareManager( config_setting_t *SNode ){ |
|
|
#endif
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
memset( &m_sPARAMETERS, 0 ,sizeof( LGS_PARAMETERS )); |
|
|
|
|
|
|
|
|
memset( &m_sPARAMETERS, 0 ,sizeof( LGS_3D_PARAMETERS )); |
|
|
|
|
|
|
|
|
m_sPARAMETERS.flags.BaseScanCount = BASE_SCAN_COUNT; |
|
|
m_sPARAMETERS.flags.BaseScanCount = BASE_SCAN_COUNT; |
|
|
m_sPARAMETERS.flags.DetectorsCount = KERNEL_COUNT; |
|
|
m_sPARAMETERS.flags.DetectorsCount = KERNEL_COUNT; |
|
|
@ -592,8 +592,8 @@ bool LRF_HardwareManager::setHardwareParams( PHW_PARAMS Params ){ |
|
|
return true; |
|
|
return true; |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
bool LRF_HardwareManager::getParams( LGS_PARAMETERS &Params ){ |
|
|
|
|
|
memcpy( &Params, &m_sPARAMETERS, sizeof(LGS_PARAMETERS) ); |
|
|
|
|
|
|
|
|
bool LRF_HardwareManager::getParams( LGS_3D_PARAMETERS &Params ){ |
|
|
|
|
|
memcpy( &Params, &m_sPARAMETERS, sizeof(LGS_3D_PARAMETERS) ); |
|
|
return true; |
|
|
return true; |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
@ -1629,43 +1629,66 @@ bool LRF_HardwareManager::getDetectionParams( TH_PARAMS &Params ){ |
|
|
#endif
|
|
|
#endif
|
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
bool LRF_HardwareManager::setParams( LGS_3D_PARAMETERS *Params ){ |
|
|
|
|
|
if(Params == NULL) return false; |
|
|
|
|
|
if(m_pSOC == NULL ) return false; |
|
|
|
|
|
memcpy( &m_sPARAMETERS, Params, sizeof(LGS_3D_PARAMETERS) ); |
|
|
|
|
|
// Save into settings
|
|
|
|
|
|
m_sCP_Detector.delta = m_sPARAMETERS.nDelta; |
|
|
|
|
|
m_sCP_Detector.flip_size = m_sPARAMETERS.nFlip; |
|
|
|
|
|
m_sCP_Detector.good_points = m_sPARAMETERS.nGPointSamples; |
|
|
|
|
|
m_sCP_Detector.offset = m_sPARAMETERS.nOffset; |
|
|
|
|
|
m_sCP_Detector.order = m_sPARAMETERS.nOrder; |
|
|
|
|
|
m_sCP_Detector.self_build_ena = m_sPARAMETERS.flags.BuildThByCore; |
|
|
|
|
|
m_sCP_Detector.master = m_sPARAMETERS.flags.isMaster; |
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
|
|
char Buffer[256]; |
|
|
|
|
|
sprintf( Buffer, "Detector[%s] NEW Parameters: Delta[%d] Flip_Size[%d] Good_Points[%d] Order[%d] Offset[%d] TH_Automatic_Build[%d]", |
|
|
|
|
|
((m_sCP_Detector.master)?"M":"S"), |
|
|
|
|
|
m_sCP_Detector.delta, |
|
|
|
|
|
m_sCP_Detector.flip_size, |
|
|
|
|
|
m_sCP_Detector.good_points, |
|
|
|
|
|
m_sCP_Detector.order, |
|
|
|
|
|
m_sCP_Detector.offset, |
|
|
|
|
|
m_sCP_Detector.self_build_ena |
|
|
|
|
|
); |
|
|
|
|
|
LOG( Buffer ); |
|
|
|
|
|
#endif
|
|
|
|
|
|
// Apply new Parameters
|
|
|
|
|
|
if(!m_pSOC->setThCoreParams( &m_sCP_Detector )){ |
|
|
|
|
|
LOG_ERROR("Detection Core Set NEW Params Failure"); |
|
|
|
|
|
return false; |
|
|
|
|
|
}; |
|
|
|
|
|
*((uint32_t*)&m_sCP_Detector) = m_pSOC->getThCoreParams(); |
|
|
|
|
|
saveCurrentParameters(); |
|
|
|
|
|
return true; |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
bool LRF_HardwareManager::setDetectionParams( TH_PARAMS *Params ){ |
|
|
bool LRF_HardwareManager::setDetectionParams( TH_PARAMS *Params ){ |
|
|
if(Params == NULL) return false; |
|
|
|
|
|
memcpy( &m_sPARAMETERS, Params, sizeof(LGS_PARAMETERS) ); |
|
|
|
|
|
|
|
|
if( Params == NULL) return false; |
|
|
|
|
|
if( m_pSOC == NULL ) return false; |
|
|
|
|
|
memcpy( &m_sCP_Detector, Params, sizeof(TH_PARAMS) ); |
|
|
#ifndef ONPC_TOTTAL_SIMULATOR
|
|
|
#ifndef ONPC_TOTTAL_SIMULATOR
|
|
|
if( m_pSOC!=NULL ){ |
|
|
|
|
|
// Save into settings
|
|
|
|
|
|
m_sCP_Detector.delta = m_sPARAMETERS.nDelta; |
|
|
|
|
|
m_sCP_Detector.flip_size = m_sPARAMETERS.nFlip; |
|
|
|
|
|
m_sCP_Detector.good_points = m_sPARAMETERS.nGPointSamples; |
|
|
|
|
|
m_sCP_Detector.offset = m_sPARAMETERS.nOffset; |
|
|
|
|
|
m_sCP_Detector.order = m_sPARAMETERS.nOrder; |
|
|
|
|
|
m_sCP_Detector.self_build_ena = m_sPARAMETERS.flags.BuildThByCore; |
|
|
|
|
|
m_sCP_Detector.master = m_sPARAMETERS.flags.isMaster; |
|
|
|
|
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
|
|
char Buffer[256]; |
|
|
|
|
|
sprintf( Buffer, "Detector[%s] NEW Parameters: Delta[%d] Flip_Size[%d] Good_Points[%d] Order[%d] Offset[%d] TH_Automatic_Build[%d]", |
|
|
|
|
|
((m_sCP_Detector.master)?"M":"S"), |
|
|
|
|
|
m_sCP_Detector.delta, |
|
|
|
|
|
m_sCP_Detector.flip_size, |
|
|
|
|
|
m_sCP_Detector.good_points, |
|
|
|
|
|
m_sCP_Detector.order, |
|
|
|
|
|
m_sCP_Detector.offset, |
|
|
|
|
|
m_sCP_Detector.self_build_ena |
|
|
|
|
|
); |
|
|
|
|
|
LOG( Buffer ); |
|
|
|
|
|
#endif
|
|
|
|
|
|
// Apply new Parameters
|
|
|
|
|
|
if(!m_pSOC->setThCoreParams(Params)){ |
|
|
|
|
|
LOG_ERROR("Detection Core Set NEW Params Failure"); |
|
|
|
|
|
return false; |
|
|
|
|
|
}; |
|
|
|
|
|
*((uint32_t*)&m_sCP_Detector) = m_pSOC->getThCoreParams(); |
|
|
|
|
|
saveCurrentParameters(); |
|
|
|
|
|
return true; |
|
|
|
|
|
}; |
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
|
|
char Buffer[256]; |
|
|
|
|
|
sprintf( Buffer, "Detector[%s] NEW Parameters: Delta[%d] Flip_Size[%d] Good_Points[%d] Order[%d] Offset[%d] TH_Automatic_Build[%d]", |
|
|
|
|
|
((m_sCP_Detector.master)?"M":"S"), |
|
|
|
|
|
m_sCP_Detector.delta, |
|
|
|
|
|
m_sCP_Detector.flip_size, |
|
|
|
|
|
m_sCP_Detector.good_points, |
|
|
|
|
|
m_sCP_Detector.order, |
|
|
|
|
|
m_sCP_Detector.offset, |
|
|
|
|
|
m_sCP_Detector.self_build_ena |
|
|
|
|
|
); |
|
|
|
|
|
LOG( Buffer ); |
|
|
|
|
|
#endif
|
|
|
|
|
|
// Apply new Parameters
|
|
|
|
|
|
if(!m_pSOC->setThCoreParams( &m_sCP_Detector )){ |
|
|
|
|
|
LOG_ERROR("Detection Core Set NEW Params Failure"); |
|
|
|
|
|
return false; |
|
|
|
|
|
}; |
|
|
|
|
|
*((uint32_t*)&m_sCP_Detector) = m_pSOC->getThCoreParams(); |
|
|
|
|
|
saveCurrentParameters(); |
|
|
#else
|
|
|
#else
|
|
|
return true; |
|
|
return true; |
|
|
#endif
|
|
|
#endif
|
|
|
|