|
|
@ -165,6 +165,9 @@ bool mekorotKernel::init(void){ |
|
|
config_setting_set_string(pSetting, m_pStorageBase); |
|
|
config_setting_set_string(pSetting, m_pStorageBase); |
|
|
basicSettingsProvider::getInstance()->compromise(); |
|
|
basicSettingsProvider::getInstance()->compromise(); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
sprintf(m_sFSReportName, "%s/report.csv", m_pStorageBase); |
|
|
|
|
|
|
|
|
int tFrameCnt = MAX_RECORD_FRAMES; |
|
|
int tFrameCnt = MAX_RECORD_FRAMES; |
|
|
pSetting = config_setting_get_member(m_pSettings, MEKOROT_KRNL_LAPSE_FRAMES); |
|
|
pSetting = config_setting_get_member(m_pSettings, MEKOROT_KRNL_LAPSE_FRAMES); |
|
|
if (pSetting != NULL) { |
|
|
if (pSetting != NULL) { |
|
|
@ -178,7 +181,7 @@ bool mekorotKernel::init(void){ |
|
|
}; |
|
|
}; |
|
|
config_setting_set_int(pSetting, tFrameCnt); |
|
|
config_setting_set_int(pSetting, tFrameCnt); |
|
|
}; |
|
|
}; |
|
|
m_nInitialFSID = (uint32_t)time(NULL); |
|
|
|
|
|
|
|
|
m_nInitialFSID = 0;// (uint32_t)time(NULL);
|
|
|
/* Storage Init */ |
|
|
/* Storage Init */ |
|
|
m_pStorageProvider = storageProvider::getInstance( m_pStorageBase ); |
|
|
m_pStorageProvider = storageProvider::getInstance( m_pStorageBase ); |
|
|
|
|
|
|
|
|
@ -695,59 +698,24 @@ void mekorotKernel::m_fThreadProc(void){ |
|
|
}; |
|
|
}; |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Kernel::putEvent2FS(uint8_t code, int x1, int y1, int x2, int y2, float speed, bool has_image, CSTR path) { |
|
|
|
|
|
|
|
|
void mekorotKernel::reg_event( uint8_t devID, float az, float el, float ra, CSTR path ) { |
|
|
FILE* fd; |
|
|
FILE* fd; |
|
|
fd = fopen(m_sFSReportName, "a+"); |
|
|
fd = fopen(m_sFSReportName, "a+"); |
|
|
if (fd) { |
|
|
if (fd) { |
|
|
m_nInitialFSID++; |
|
|
m_nInitialFSID++; |
|
|
uint32_t ts = (uint32_t)time(NULL); |
|
|
uint32_t ts = (uint32_t)time(NULL); |
|
|
switch (code) { |
|
|
|
|
|
case FSL_OPERATOR_ALARM: |
|
|
|
|
|
case FSL_ALARM: { |
|
|
|
|
|
float r1, r2; |
|
|
|
|
|
r1 = y1;//( m_fDetectorMaxDistance / 8.0f ) * (float) y1;
|
|
|
|
|
|
r2 = y2;//( m_fDetectorMaxDistance / 8.0f ) * (float) y2;
|
|
|
|
|
|
fprintf(fd, "%d,%d,%d,%d,%0.2f,%d,%0.2f,%0.3f,%d,%s\n", |
|
|
|
|
|
m_nInitialFSID, |
|
|
|
|
|
ts, |
|
|
|
|
|
code, |
|
|
|
|
|
x1, r1, x2, r2, speed, has_image, path |
|
|
|
|
|
); |
|
|
|
|
|
break; |
|
|
|
|
|
}; |
|
|
|
|
|
default: fprintf(fd, "%d,%d,%d\n", m_nInitialFSID, ts, code); break; |
|
|
|
|
|
}; |
|
|
|
|
|
fclose(fd); |
|
|
|
|
|
chmod(m_sFSReportName, STORAGE_FILE_MODE); |
|
|
|
|
|
}; |
|
|
|
|
|
}; |
|
|
|
|
|
//https://www.ebay.com/itm/Nvidia-Tesla-M2090-6GB-GDDR5-PCIe-Accelerator-Video-Graphics-Card-775NK/123590917738
|
|
|
|
|
|
|
|
|
|
|
|
//http://www.zoomify.com/free.htm
|
|
|
|
|
|
|
|
|
|
|
|
void Kernel::postStatus2FS(bool isActive) { |
|
|
|
|
|
FILE* fd; |
|
|
|
|
|
fd = fopen(m_sWEBStatus, "w+"); |
|
|
|
|
|
if (fd) { |
|
|
|
|
|
uint32_t ts = (uint32_t)time(NULL); |
|
|
|
|
|
fprintf(fd, "%d,%d,%d,%d,%d,%d,%d,%0.3f,%0.3f,%0.3f \n", |
|
|
|
|
|
|
|
|
fprintf(fd, "%d,%d,%d,%0.2f,%0.2f,%0.2f,%s\n", |
|
|
|
|
|
m_nInitialFSID, |
|
|
ts, |
|
|
ts, |
|
|
isActive, |
|
|
|
|
|
m_bDetectorArmed, |
|
|
|
|
|
m_nCOnlineMask, |
|
|
|
|
|
m_nCOKMask, |
|
|
|
|
|
m_nDetectorOffset, |
|
|
|
|
|
m_nDetectorSST, |
|
|
|
|
|
m_fDetectorMaxDistance, |
|
|
|
|
|
m_fDetectorLayerDistance, |
|
|
|
|
|
m_fDetectorMinSpeed |
|
|
|
|
|
|
|
|
devID, |
|
|
|
|
|
az, el, ra, path |
|
|
); |
|
|
); |
|
|
for (uint8_t index = 0; index < MAX_LRF_SENSORS; index++) fprintf(fd, "%d\n", m_nLRF_Background[index]); |
|
|
|
|
|
fclose(fd); |
|
|
fclose(fd); |
|
|
chmod(m_sWEBStatus, STORAGE_FILE_MODE); |
|
|
|
|
|
|
|
|
chmod(m_sFSReportName, STORAGE_FILE_MODE ); |
|
|
}; |
|
|
}; |
|
|
}; |
|
|
}; |
|
|
|
|
|
//https://www.ebay.com/itm/Nvidia-Tesla-M2090-6GB-GDDR5-PCIe-Accelerator-Video-Graphics-Card-775NK/123590917738
|
|
|
|
|
|
//http://www.zoomify.com/free.htm
|
|
|
|
|
|
|
|
|
bool mekorotKernel::packetHandler(protocolPackage* Package) { |
|
|
bool mekorotKernel::packetHandler(protocolPackage* Package) { |
|
|
uint8_t cDeviceID; |
|
|
uint8_t cDeviceID; |
|
|
@ -841,7 +809,7 @@ void mekorotKernel::treat_alarm(uint8_t devID, uint16_t az, uint16_t ra, uint32_ |
|
|
rZoom = m_pZoomTable[0]; |
|
|
rZoom = m_pZoomTable[0]; |
|
|
}; |
|
|
}; |
|
|
alarm(); |
|
|
alarm(); |
|
|
m_pVideoOutput->getOutputName(); |
|
|
|
|
|
|
|
|
reg_event(devID, rAz, rEl, rZoom, m_pVideoOutput->getOutputName()); |
|
|
move_cam( rAz, rEl, rZoom ); |
|
|
move_cam( rAz, rEl, rZoom ); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|