|
|
|
@ -1027,6 +1027,11 @@ void deviceNodeCamera::m_fThreadProc( void ){ |
|
|
|
m_pCurrentROI->cam_orientation.pan, |
|
|
|
m_pCurrentROI->cam_orientation.tilt, |
|
|
|
m_pCurrentROI->cam_orientation.zoom, COL, ROW ); |
|
|
|
char tB[64]; |
|
|
|
sprintf( tB, "Get ABS Preset Col %d Row %d!", COL, ROW ); |
|
|
|
LOG( tB ); |
|
|
|
sprintf( tB, "Old Preset Col %d Row %d!", m_bCurrentPresetCol, m_bCurrentPresetRow ); |
|
|
|
LOG( tB ); |
|
|
|
if ( ( m_bCurrentPresetCol == COL ) && ( m_bCurrentPresetRow == ROW ) ) { |
|
|
|
m_fCP_Pan = m_pCurrentROI->cam_orientation.pan; |
|
|
|
m_fCP_Tilt = m_pCurrentROI->cam_orientation.tilt; |
|
|
|
@ -1056,7 +1061,8 @@ void deviceNodeCamera::m_fThreadProc( void ){ |
|
|
|
}; |
|
|
|
}; |
|
|
|
} else { |
|
|
|
LOG("Get ABS Preset!"); |
|
|
|
|
|
|
|
|
|
|
|
CSTR token = getPresetToken( COL, ROW ); |
|
|
|
if ( token ) { |
|
|
|
LOG("Have One!"); |
|
|
|
@ -1101,6 +1107,7 @@ void deviceNodeCamera::m_fThreadProc( void ){ |
|
|
|
}; |
|
|
|
}; |
|
|
|
} else { |
|
|
|
LOG("Not Found!"); |
|
|
|
utilizeROI( m_pCurrentROI ); |
|
|
|
setWM( CAM_WS_READY ); |
|
|
|
}; |
|
|
|
@ -1872,10 +1879,15 @@ bool deviceNodeCamera::load_presets( void ){ |
|
|
|
bool bHaveIRON = false; |
|
|
|
bool bHaveIRAUTO = false; |
|
|
|
if ( m_pDBC == NULL ) return false; |
|
|
|
LOG("Loading Presets!"); |
|
|
|
DBC_PRESETS_INFO *tData = m_pDBC->getCamPresetInfo(m_sCamData.id); |
|
|
|
if ( tData ) { |
|
|
|
memcpy( &m_sCamPresets, tData, sizeof(DBC_PRESETS_INFO)); |
|
|
|
memcpy( &m_sCamPresets, tData, sizeof(DBC_PRESETS_INFO)); |
|
|
|
#ifdef DEBUG
|
|
|
|
char tB[128]; |
|
|
|
LOG("Loading Presets!"); |
|
|
|
sprintf( tB, "Cam Presets Info: CNT: %d Cols: %d Rows: %d ", m_sCamPresets.maxCount, m_sCamPresets.gCols, m_sCamPresets.gRows ); |
|
|
|
LOG( tB ); |
|
|
|
#endif
|
|
|
|
DBC_INT_LIST *tList = m_pDBC->listCamPresets( m_sCamData.id ); |
|
|
|
if ( tList ) { |
|
|
|
for( DBC_INT_LIST::iterator idx= tList->begin(); idx < tList->end(); idx++ ) { |
|
|
|
@ -1893,18 +1905,39 @@ bool deviceNodeCamera::load_presets( void ){ |
|
|
|
m_bShineOnTarget = (bHaveIROFF && bHaveIRAUTO); |
|
|
|
} else m_bShineOnTarget = false; |
|
|
|
return true; |
|
|
|
#ifdef DEBUG
|
|
|
|
} else { |
|
|
|
LOG("No Camera Presets!"); |
|
|
|
}; |
|
|
|
#endif
|
|
|
|
|
|
|
|
return false; |
|
|
|
}; |
|
|
|
|
|
|
|
void deviceNodeCamera::translateROI2PRESET( float P, float T, float Z, uint8_t &col, uint8_t &row ){ |
|
|
|
char tB[128]; |
|
|
|
sprintf( tB,"Translate Cord to PRESET %0.3f %0.3f %0.3f", P, T, Z ); |
|
|
|
LOG( tB ); |
|
|
|
sprintf( tB,"Cord Parameters Col %d Row %d ", m_sCamPresets.gCols, m_sCamPresets.gRows ); |
|
|
|
LOG( tB ); |
|
|
|
float kRange = 1.0f / ((float)m_sCamPresets.gRows); |
|
|
|
sprintf( tB,"Range: %0.3f", kRange ); |
|
|
|
LOG( tB ); |
|
|
|
row = (uint8_t) ( Z / kRange ); |
|
|
|
float kAz = 2.0f / ( (float) (m_sCamPresets.gCols * ( 1 << row )) ); |
|
|
|
|
|
|
|
float kAz = 2.0f / ((float)(m_sCamPresets.gCols * (1 << row))); |
|
|
|
row++; |
|
|
|
P = 0.5f + ( -1.0f * P ); |
|
|
|
if ( P > 1.0f ) P = P - 2.0f; |
|
|
|
P = P + 1.0f; |
|
|
|
sprintf( tB,"kAZ: %0.3f", kAz ); |
|
|
|
LOG( tB ); |
|
|
|
//P = 0.5f + ( -1.0f * P );
|
|
|
|
//if ( P > 1.0f ) P = P - 2.0f;
|
|
|
|
//P = P + 1.0f;
|
|
|
|
if ( P < 0.5 ){ |
|
|
|
P = P + 1.5f; |
|
|
|
} else { |
|
|
|
P = P - 0.5f; |
|
|
|
}; |
|
|
|
|
|
|
|
col = (uint8_t) ( P / kAz ); |
|
|
|
}; |
|
|
|
|
|
|
|
|