|
|
|
@ -206,15 +206,33 @@ void IM_DataBaseAdapter::insertItemROI( uint32_t itemID, uint32_t classID, float |
|
|
|
}; |
|
|
|
|
|
|
|
uint32_t IM_DataBaseAdapter::insertItemFace( uint32_t itemID, CSTR md5, uint32_t x, uint32_t y, uint32_t w, uint32_t h ){ |
|
|
|
uint32_t RetVal = 0; |
|
|
|
if( m_pConnectorClass ) { |
|
|
|
char tQBuf[CTEXT]; |
|
|
|
sprintf(tQBuf, "INSERT INTO `faces_chips` SET `item_id`=%d, `md5`='%s', `x`=%d, `y`=%d, `w`=%d, `h`=%d", itemID, md5, x, y, w, h ); |
|
|
|
sprintf(tQBuf, "INSERT INTO `faces_chips` SET `item_id`=%d, `md5`='%s', `x`=%d, `y`=%d, `w`=%d, `h`=%d ON DUPLICATE KEY UPDATE `item_id`=%d, `x`=%d, `y`=%d, `w`=%d", itemID, md5, x, y, w, h, itemID, x, y, w, h ); |
|
|
|
#ifdef DEBUG
|
|
|
|
LOG(tQBuf); |
|
|
|
#endif
|
|
|
|
return (uint32_t) m_pConnectorClass->QueryID( tQBuf ); |
|
|
|
RetVal = m_pConnectorClass->QueryID( tQBuf ); |
|
|
|
if( RetVal == 0 ) { |
|
|
|
AAssoc *result; |
|
|
|
sprintf(tQBuf, "SELECT `id` FROM `faces_chips` WHERE `md5`='%s' ", md5 ); |
|
|
|
result = m_pConnectorClass->Query( tQBuf ); |
|
|
|
if( result!= NULL ) { |
|
|
|
if( result->size() > 0 ) { |
|
|
|
Assoc *cArr; |
|
|
|
Assoc::iterator it; |
|
|
|
cArr = result->at(0); |
|
|
|
it = cArr->find("id"); |
|
|
|
if( it != cArr->end() ){ |
|
|
|
RetVal = atoi( it->second.c_str() ); |
|
|
|
}; |
|
|
|
}; |
|
|
|
}; |
|
|
|
deleteResult( result ); |
|
|
|
}; |
|
|
|
}; |
|
|
|
return 0; |
|
|
|
return RetVal; |
|
|
|
}; |
|
|
|
|
|
|
|
void IM_DataBaseAdapter::updateItemFace( uint32_t itemID, uint8_t dID, float P ){ |
|
|
|
@ -228,17 +246,6 @@ void IM_DataBaseAdapter::updateItemFace( uint32_t itemID, uint8_t dID, float P ) |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
void IM_DataBaseAdapter::updateItemFaceDNA( uint32_t itemID, CSTR S ){ |
|
|
|
if( m_pConnectorClass ) { |
|
|
|
char tQBuf[CTEXT]; |
|
|
|
sprintf(tQBuf, "UPDATE `faces_chips` SET `dna`='%s' WHERE `id`=%d", S, itemID ); |
|
|
|
#ifdef DEBUG
|
|
|
|
LOG(tQBuf); |
|
|
|
#endif
|
|
|
|
m_pConnectorClass->SilentQuery( tQBuf ); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
#undef LOG
|
|
|
|
#undef LOG_ERROR
|
|
|
|
|