|
@@ -155,6 +155,7 @@ namespace MIVA
|
|
|
data.AddrNum = GetAddrNum(data.Pid);
|
|
|
this->m_InferInfo->DataSources.push_back(data);
|
|
|
sourceId++;
|
|
|
+ InfoL << "Load source with id:"<<data.Id<<" url:"<<data.uri;
|
|
|
}
|
|
|
if(m_Infer->Init() != OK){
|
|
|
ErrorL << "Inference module initialization failed";
|
|
@@ -262,7 +263,7 @@ namespace MIVA
|
|
|
#endif
|
|
|
|
|
|
// 定时上报数据
|
|
|
- this->m_timer1 = std::make_shared<Timer>(1.0f,[&](){
|
|
|
+ this->m_timer1 = std::make_shared<Timer>(2.0f,[&](){
|
|
|
this->ReportData(); // 上报数据
|
|
|
return true;
|
|
|
}, nullptr);
|
|
@@ -293,6 +294,12 @@ namespace MIVA
|
|
|
return true;
|
|
|
},nullptr);
|
|
|
|
|
|
+ /*if(this->m_manager->getStartPower() != OK) WarnL << "推理未结束或内存所剩不足或资源未释放完全" << endl;
|
|
|
+ this ->m_timer0 = std::make_shared<Timer>(5.0f, [&](){
|
|
|
+ this->ListenClosed();
|
|
|
+ return false;
|
|
|
+ }, nullptr);*/
|
|
|
+
|
|
|
// 记录时间
|
|
|
clock_gettime(CLOCK_BOOTTIME, &time1);
|
|
|
InfoL << "Task started successfully!" << endl;
|
|
@@ -375,7 +382,8 @@ namespace MIVA
|
|
|
if(this->m_httpClient == NULL) this->m_httpClient = HttpClient::CreateNew();
|
|
|
|
|
|
DebugL << "登录Netty" << endl;
|
|
|
- if(this->m_httpClient->Init(this->account,this->Netty_ip,8760) != OK){
|
|
|
+ //if(this->m_httpClient->Init(this->account,this->Netty_ip,8760) != OK){
|
|
|
+ if(this->m_httpClient->Init(this->account,this->Netty_ip,80) != OK){
|
|
|
ErrorL << "HttpClient登录Netty失败" << endl;
|
|
|
}else{
|
|
|
DebugL << "登录Netty成功!!!!" << endl;
|
|
@@ -549,6 +557,7 @@ namespace MIVA
|
|
|
// 获取到关好门的信号
|
|
|
if((serverResultMag.DoorFlag))
|
|
|
{
|
|
|
+ InfoL<<"Door closed.";
|
|
|
if(this->m_manager->getStartPower() != OK) WarnL << "推理未结束或内存所剩不足或资源未释放完全" << endl;
|
|
|
if(CloseTimer != nullptr) CloseTimer.reset();
|
|
|
// 定时5s后启动
|
|
@@ -851,9 +860,10 @@ namespace MIVA
|
|
|
*/
|
|
|
uint32_t UserApp::DataCalculation(uint32_t noLoad, uint32_t dynamicLoad, int num)
|
|
|
{
|
|
|
+ //TODO: Add acture calculation logic
|
|
|
uint32_t result = 0;
|
|
|
-
|
|
|
- return num;
|
|
|
+ result = num;
|
|
|
+ return result;
|
|
|
}
|
|
|
|
|
|
int UserApp::GetAddrNum(std::string Pid){
|