|
@@ -1,4 +1,3 @@
|
|
|
-
|
|
|
// YAServerDlg.cpp : 实现文件
|
|
|
//
|
|
|
#include "stdafx.h"
|
|
@@ -97,14 +96,6 @@ CYAServerDlg::CYAServerDlg(CWnd* pParent /*=NULL*/)
|
|
|
{
|
|
|
ws_init();
|
|
|
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
|
|
|
-
|
|
|
- m_bUseFilter = theApp.use_filter;
|
|
|
- if(m_bUseFilter){
|
|
|
- m_nFilterType = FILTER_KALMAN;
|
|
|
- }else{
|
|
|
- m_nFilterType = NO_FILTER;
|
|
|
- }
|
|
|
-
|
|
|
}
|
|
|
|
|
|
void CYAServerDlg::DoDataExchange(CDataExchange* pDX)
|
|
@@ -464,6 +455,20 @@ BOOL CYAServerDlg::OnInitDialog()
|
|
|
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ //加载系统配置
|
|
|
+ m_bUseFilter = theApp.use_filter;
|
|
|
+ if(m_bUseFilter){
|
|
|
+ m_nFilterType = FILTER_KALMAN;
|
|
|
+ }else{
|
|
|
+ m_nFilterType = NO_FILTER;
|
|
|
+ }
|
|
|
+
|
|
|
+ m_log_sys_status = theApp.log_sys_status;
|
|
|
+ m_log_raw_data = theApp.log_raw_data;
|
|
|
+ m_log_parse_data = theApp.log_parse_data;
|
|
|
+ m_log_send_package = theApp.log_send_package;
|
|
|
+ m_log_recv_package = theApp.log_recv_package;
|
|
|
// 设置此对话框的图标。当应用程序主窗口不是对话框时,框架将自动
|
|
|
// 执行此操作
|
|
|
SetIcon(m_hIcon, TRUE); // 设置大图标
|
|
@@ -509,6 +514,7 @@ BOOL CYAServerDlg::OnInitDialog()
|
|
|
time_sync_reader_time=time_clear_call_time=time_send_call=::GetTickCount();
|
|
|
m_thread_timer = ::AfxBeginThread(_thread_timer, this, THREAD_PRIORITY_HIGHEST);
|
|
|
|
|
|
+
|
|
|
UpdateData(FALSE);
|
|
|
return TRUE; // 除非将焦点设置到控件,否则返回 TRUE
|
|
|
}
|
|
@@ -827,7 +833,9 @@ int CYAServerDlg::init_staffer(string staff_id /* = "" */, bool is_card /*= fals
|
|
|
mysql_free_result(pRes);
|
|
|
CString strlog;
|
|
|
strlog.Format(_T("%s%d%s"), _T(LOG_INIT_STAFF), nRow, _T(LOG_RECORD_COUNT));
|
|
|
+
|
|
|
show_log(strlog);
|
|
|
+
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
@@ -902,7 +910,9 @@ int CYAServerDlg::init_vehicle(string vehicle_id /* = "" */, bool is_card /*= fa
|
|
|
mysql_free_result(pRes);
|
|
|
CString strlog;
|
|
|
strlog.Format(_T("%s%d%s"), _T(LOG_INIT_VEHICLE), nRow, _T(LOG_RECORD_COUNT));
|
|
|
+
|
|
|
show_log(strlog);
|
|
|
+
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
@@ -1618,9 +1628,14 @@ void CYAServerDlg::parse_data(BYTE *pData, int nLen, DWORD dwConnID)
|
|
|
|
|
|
void CYAServerDlg::parse_data_receive(BYTE *pData, int nLen, DWORD dwConnID )
|
|
|
{
|
|
|
- CString strBuf;
|
|
|
- formatByteArray(strBuf, (BYTE*)pData, nLen);
|
|
|
- writeErrorLog(_T("RAW_SS"), strBuf, false);
|
|
|
+ //CString strBuf;
|
|
|
+ //formatByteArray(strBuf, (BYTE*)pData, nLen);
|
|
|
+ //writeErrorLog(_T("RAW_SS"), strBuf, false);
|
|
|
+ if(m_log_raw_data){
|
|
|
+ //CString strBuf;
|
|
|
+ //formatByteArray(strBuf, (BYTE*)pData, nLen);
|
|
|
+ //writeErrorLog(_T("RAW_SS"), strBuf, false);
|
|
|
+ }
|
|
|
|
|
|
int total_pos = 0;
|
|
|
WORD pkg_len = 0;
|
|
@@ -1659,9 +1674,13 @@ void CYAServerDlg::parse_package_data( BYTE* DataBuffer, int nLen, DWORD dwConnI
|
|
|
|
|
|
DWORD dw = ::GetTickCount();
|
|
|
|
|
|
- CString strBuf;
|
|
|
- formatByteArray(strBuf, DataBuffer, nLen);
|
|
|
- writeErrorLog(_T("RAW_S"), strBuf, false);
|
|
|
+ CString strBuf = _T("");
|
|
|
+ //formatByteArray(strBuf, DataBuffer, nLen);
|
|
|
+ //writeErrorLog(_T("RAW_S"), strBuf, false);
|
|
|
+ if(m_log_raw_data){
|
|
|
+ formatByteArray(strBuf, DataBuffer, nLen);
|
|
|
+ writeErrorLog(_T("RAW_S"), strBuf, false);
|
|
|
+ }
|
|
|
|
|
|
int nCurPos = 0;
|
|
|
//nCurPos += sizeof(WORD);
|
|
@@ -1672,7 +1691,8 @@ void CYAServerDlg::parse_package_data( BYTE* DataBuffer, int nLen, DWORD dwConnI
|
|
|
|
|
|
CFunctions::getWord(&DataBuffer[nCurPos], &w, nLen - sizeof(WORD));
|
|
|
if( w != wCrc ){ // 校验不对
|
|
|
- if(theApp.log_raw_data){
|
|
|
+ //if(theApp.log_raw_data){
|
|
|
+ if(m_log_raw_data){
|
|
|
strBuf = _T("CRC校验不通过");
|
|
|
writeErrorLog(_T("RAW_S"), strBuf);
|
|
|
}
|
|
@@ -1816,7 +1836,8 @@ void CYAServerDlg::parse_data_locate_reader(BYTE * DataBuffer, int& nCurPos, int
|
|
|
CFunctions::getWord(DataBuffer, &wState, sizeof(WORD));
|
|
|
nCurPos += sizeof(WORD);
|
|
|
// pReader->state = wState;
|
|
|
- if(theApp.log_parse_data){
|
|
|
+ //if(theApp.log_parse_data){
|
|
|
+ if(m_log_parse_data){
|
|
|
CString strLog;
|
|
|
strLog.Format(_T("id:%d, n:%d, %.2d-%.2d-%.2d %.2d:%.2d:%.2d, tep:%d, sta:%d"),
|
|
|
dwReaderID, wTickCount, btYear, btMonth, btDay, btHour, btMin, btSec, btTemperature, wState);
|
|
@@ -1955,7 +1976,8 @@ void CYAServerDlg::parse_data_locate_card_vehicle(BYTE* DataBuffer, int& nCurPos
|
|
|
card->antenna_id = ((btAntenna & 0xFF) == 1) ? 0 : 1;
|
|
|
card->distance = dldist;
|
|
|
|
|
|
- if(theApp.log_parse_data){
|
|
|
+ //if(theApp.log_parse_data){
|
|
|
+ if(m_log_parse_data){
|
|
|
CString strLog;
|
|
|
strLog.Format(_T("id:%s, n:%d, type:%d, power:%d, acc:%d, flytime:%I64u, d:%f, ant:%d, syncnum:%d, strength:%d"),
|
|
|
CFunctions::c2wc(card->card_id.c_str()), wCardTickCount, btType, btPower, btAcceleration, lTime1, dldist, btAntenna, wSyncNum, wStrength);
|
|
@@ -2694,8 +2716,9 @@ void CYAServerDlg::send_json_data(string cmd, string data, bool is_login /* = fa
|
|
|
strlog.Format(_T("%s: %s"), _T(LOG_SEND_JSON_DATA), _T("常规数据"));
|
|
|
show_log(strlog);
|
|
|
_io->socket()->emit(cmd, utf8_data);
|
|
|
- if(theApp.log_send_event){
|
|
|
- writeErrorLog(L"JSON_S", CFunctions::c2wc(data.c_str()));
|
|
|
+ //if(theApp.log_send_package){
|
|
|
+ if(m_log_send_package){
|
|
|
+ writeErrorLog(L"JSON_S", CFunctions::c2wc(data.c_str()),false);
|
|
|
}
|
|
|
}
|
|
|
strlog.Format(_T("%s: %s"), _T(LOG_SEND_JSON_DATA), CFunctions::c2wc(cmd.c_str()));
|
|
@@ -3642,12 +3665,24 @@ void CYAServerDlg::OnTimer( UINT nIDEvent )
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+/*
|
|
|
+ * 从配置文件中载入数据库配置
|
|
|
+ *
|
|
|
+ * param
|
|
|
+ * 无
|
|
|
+ *
|
|
|
+ * return
|
|
|
+ * 无
|
|
|
+*/
|
|
|
void CYAServerDlg::load_param_from_ini()
|
|
|
{
|
|
|
IniFile ini;
|
|
|
string strvalue;
|
|
|
int nTemp = 0;
|
|
|
- show_log(_T(LOG_LOAD_CONFIG), FALSE);
|
|
|
+ //show_log(_T(LOG_LOAD_CONFIG), FALSE);
|
|
|
+ //输出操作日志到日志文件
|
|
|
+ show_log(_T(LOG_LOAD_CONFIG));
|
|
|
+
|
|
|
if(ini.open(FILEPATH_SERVER_CONFIG)){
|
|
|
strvalue = ini.read(CONF_SECT_SERVER_SETTING, CONF_SERVER_WS_URL);
|
|
|
m_ws_url = strvalue;
|
|
@@ -3678,8 +3713,11 @@ void CYAServerDlg::load_param_from_ini()
|
|
|
m_db_setting.encoding = ini.read(CONF_SECT_DB, CONF_DB_KEY_ENCODING);
|
|
|
m_db_setting.port = atoi(ini.read(CONF_SECT_DB, CONF_DB_KEY_PORT).c_str());*/
|
|
|
|
|
|
- show_log(_T(LOG_LOAD_CONFIG_SUCCESS), FALSE);
|
|
|
+ //show_log(_T(LOG_LOAD_CONFIG_SUCCESS), FALSE);
|
|
|
+ show_log(_T(LOG_LOAD_CONFIG_SUCCESS));
|
|
|
+
|
|
|
}else{
|
|
|
+ //show_log(_T(LOG_LOAD_CONFIG_FAIL));
|
|
|
show_log(_T(LOG_LOAD_CONFIG_FAIL));
|
|
|
}
|
|
|
}
|
|
@@ -3716,6 +3754,16 @@ int CYAServerDlg::init_dept()
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+/*
|
|
|
+ * 从数据库的dat_setting表初始化系统阈值,
|
|
|
+ * 包括:井下人员阈值,井下车辆阈值,人员超时阈值,车辆超时阈值,车辆超速阈值
|
|
|
+ *
|
|
|
+ * param
|
|
|
+ * 无
|
|
|
+ *
|
|
|
+ * return
|
|
|
+ * 无
|
|
|
+*/
|
|
|
int CYAServerDlg::init_setting()
|
|
|
{
|
|
|
CMysqlConn* pConn = NULL;
|
|
@@ -3745,7 +3793,9 @@ int CYAServerDlg::init_setting()
|
|
|
}
|
|
|
}
|
|
|
mysql_free_result(pRes);
|
|
|
+
|
|
|
show_log(_T(LOG_INIT_SETTING));
|
|
|
+
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
@@ -3807,16 +3857,26 @@ void CYAServerDlg::deal_alarm_area( Area* area, AreaMap* dest_area_list, bool is
|
|
|
dest_area_list->insert(make_pair(area->area_id, area));
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- switch(tag){
|
|
|
-
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
+/*
|
|
|
+ * 从数据库的dat_alarm_type表初始化告警类型和名称
|
|
|
+ *
|
|
|
+ * param
|
|
|
+ * 无
|
|
|
+ *
|
|
|
+ * return
|
|
|
+ * 无
|
|
|
+*/
|
|
|
int CYAServerDlg::init_alarm_type()
|
|
|
{
|
|
|
CMysqlConn* pConn = NULL;
|
|
|
CDBConnGuard pDbGuard(pConn);
|
|
|
+
|
|
|
+ if(pConn == NULL){
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+
|
|
|
MYSQL_ROW pRow;
|
|
|
MYSQL_RES *pRes = NULL;
|
|
|
int err = 0;
|
|
@@ -3830,7 +3890,9 @@ int CYAServerDlg::init_alarm_type()
|
|
|
}
|
|
|
}
|
|
|
mysql_free_result(pRes);
|
|
|
+
|
|
|
show_log(_T(LOG_INIT_ALARM_TYPE));
|
|
|
+
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
@@ -3857,7 +3919,6 @@ void CYAServerDlg::AddItem( CString strvalue, int readerid, BOOL is_closed /*= f
|
|
|
|
|
|
void CYAServerDlg::show_log( LPCTSTR szlog, BOOL bSave )
|
|
|
{
|
|
|
- return ;
|
|
|
CString sMsg, sLog;
|
|
|
CString sTime=COleDateTime::GetCurrentTime().Format(_T(LOG_TIME_FORMAT));
|
|
|
sMsg.Format(_T("%s %s\n"), sTime, szlog);
|
|
@@ -3866,14 +3927,29 @@ void CYAServerDlg::show_log( LPCTSTR szlog, BOOL bSave )
|
|
|
}
|
|
|
catch(...){
|
|
|
}
|
|
|
- if(bSave && theApp.log_sys_status){
|
|
|
+ /*if(bSave && theApp.log_sys_status){
|
|
|
writeErrorLog(_T("LOG_S"), sMsg);
|
|
|
+ }*/
|
|
|
+ if(m_log_sys_status){
|
|
|
+ writeErrorLog(_T("LOG_S"), sMsg,false);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+/*
|
|
|
+ * 初始化数据库连接
|
|
|
+ *
|
|
|
+ * param
|
|
|
+ * 无
|
|
|
+ *
|
|
|
+ * return
|
|
|
+ * 无
|
|
|
+ *
|
|
|
+*/
|
|
|
void CYAServerDlg::database_connect()
|
|
|
{
|
|
|
- show_log(_T(LOG_CONNECT_DB), FALSE);
|
|
|
+ //show_log(_T(LOG_CONNECT_DB), FALSE);
|
|
|
+ show_log(_T(LOG_CONNECT_DB));
|
|
|
+
|
|
|
GetConnPool().Init(m_db_setting.encoding.c_str(), m_db_setting.host.c_str(), m_db_setting.user.c_str(),
|
|
|
m_db_setting.password.c_str(), m_db_setting.dbname.c_str(), m_db_setting.port, NULL, 0);
|
|
|
int nConn = GetConnPool().InitAllConn();
|
|
@@ -3981,6 +4057,12 @@ void CYAServerDlg::parse_json_data_set_limit_value( const char* sz )
|
|
|
|
|
|
strlog.Format(_T("%s%s"), _T(LOG_SET_LIMIT_VALUE), _T(LOG_SUCCESS));
|
|
|
show_log(strlog);
|
|
|
+
|
|
|
+ if(m_log_recv_package){
|
|
|
+ strlog = _T("");
|
|
|
+ strlog.Format(_T("%s"),sz);
|
|
|
+ writeErrorLog(_T("JSON_R"),strlog,false);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
void CYAServerDlg::parse_json_data_call_card( const char* sz )
|
|
@@ -4105,6 +4187,12 @@ void CYAServerDlg::parse_json_data_call_card( const char* sz )
|
|
|
}
|
|
|
strlog.Format(_T("%s%s"), _T(LOG_CALL_CARD), _T(LOG_SUCCESS));
|
|
|
show_log(strlog);
|
|
|
+
|
|
|
+ if(m_log_recv_package){
|
|
|
+ strlog = _T("");
|
|
|
+ strlog.Format(_T("%s"),sz);
|
|
|
+ writeErrorLog(_T("JSON_R"),strlog,false);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
void CYAServerDlg::parse_json_data_clear_card( const char* sz )
|
|
@@ -4138,6 +4226,12 @@ void CYAServerDlg::parse_json_data_clear_card( const char* sz )
|
|
|
}
|
|
|
strlog.Format(_T("%s%s"), _T(LOG_CLEAR_CARD), _T(LOG_SUCCESS));
|
|
|
show_log(strlog);
|
|
|
+
|
|
|
+ if(m_log_recv_package){
|
|
|
+ strlog = _T("");
|
|
|
+ strlog.Format(_T("%s"),sz);
|
|
|
+ writeErrorLog(_T("JSON_R"),strlog,false);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
void CYAServerDlg::parse_json_data_deal_help( const char* sz )
|
|
@@ -4161,6 +4255,12 @@ void CYAServerDlg::parse_json_data_deal_help( const char* sz )
|
|
|
}
|
|
|
strlog.Format(_T("%s%s"), _T(LOG_DEAL_HELP), _T(LOG_SUCCESS));
|
|
|
show_log(strlog);
|
|
|
+
|
|
|
+ if(m_log_recv_package){
|
|
|
+ strlog = _T("");
|
|
|
+ strlog.Format(_T("%s"),sz);
|
|
|
+ writeErrorLog(_T("JSON_R"),strlog,false);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
void CYAServerDlg::deal_call_edit_map(int id, EDIT_TYPE_ID edit_type_id)
|
|
@@ -4606,10 +4706,26 @@ void CYAServerDlg::execute_sql( const char* sql )
|
|
|
mysql_free_result(pRes);
|
|
|
}
|
|
|
|
|
|
+/*
|
|
|
+ * 日志菜单设置
|
|
|
+ * 将日志菜单设置内容同步更新到主对话框中的相应变量
|
|
|
+ *
|
|
|
+ * param
|
|
|
+ * 无
|
|
|
+ *
|
|
|
+ * return
|
|
|
+ * 无
|
|
|
+*/
|
|
|
void CYAServerDlg::OnMenuLog()
|
|
|
{
|
|
|
CLogSetting dlg;
|
|
|
dlg.DoModal();
|
|
|
+
|
|
|
+ m_log_sys_status = dlg.m_log_sys_status;
|
|
|
+ m_log_raw_data = dlg.m_log_raw_data;
|
|
|
+ m_log_parse_data = dlg.m_log_parse_data;
|
|
|
+ m_log_recv_package = dlg.m_log_recv_package;
|
|
|
+ m_log_send_package = dlg.m_log_send_package;
|
|
|
}
|
|
|
|
|
|
void CYAServerDlg::OnMenuParam()
|
|
@@ -5881,6 +5997,32 @@ void CYAServerDlg::release_memory()
|
|
|
delete[] theApp.m_path_monitor;
|
|
|
theApp.m_path_monitor = NULL;
|
|
|
}
|
|
|
+
|
|
|
+ release_dept_memory();
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+/*
|
|
|
+ * 释放mp_dept_list中的new的内存
|
|
|
+ *
|
|
|
+ * param
|
|
|
+ * 无
|
|
|
+ *
|
|
|
+ * return
|
|
|
+ * 无
|
|
|
+ *
|
|
|
+*/
|
|
|
+void CYAServerDlg::release_dept_memory()
|
|
|
+{
|
|
|
+ if(mp_dept_list.size() > 0){
|
|
|
+ DeptMap::iterator it = mp_dept_list.begin();
|
|
|
+ for(it ;it != mp_dept_list.end();++it){
|
|
|
+ Dept* tmp = (Dept*)(it->second);
|
|
|
+ mp_dept_list.erase(it);
|
|
|
+ delete tmp;
|
|
|
+ tmp = NULL;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
afx_msg LRESULT CYAServerDlg::OnWriteErrorLog(WPARAM wParam, LPARAM lParam)
|
|
@@ -5923,9 +6065,14 @@ afx_msg LRESULT CYAServerDlg::OnWriteErrorLog(WPARAM wParam, LPARAM lParam)
|
|
|
|
|
|
void CYAServerDlg::parse_data_server( const BYTE * pData, int nLen, DWORD dwConnId )
|
|
|
{
|
|
|
- CString strBuf;
|
|
|
- formatByteArray(strBuf, (BYTE*)pData, nLen);
|
|
|
- writeErrorLog(_T("RAW_SSSS"), strBuf, false);
|
|
|
+ //CString strBuf;
|
|
|
+ //formatByteArray(strBuf, (BYTE*)pData, nLen);
|
|
|
+ //writeErrorLog(_T("RAW_SSSS"), strBuf, false);
|
|
|
+ if(m_log_raw_data){
|
|
|
+ //CString strBuf;
|
|
|
+ //formatByteArray(strBuf, (BYTE*)pData, nLen);
|
|
|
+ //writeErrorLog(_T("RAW_SSSS"), strBuf, false);
|
|
|
+ }
|
|
|
|
|
|
int read_length = 0;
|
|
|
int pkg_len = 0;
|
|
@@ -6080,7 +6227,19 @@ void CYAServerDlg::deal_card_msg( Card* card, bool is_hist /*= false*/ )
|
|
|
}
|
|
|
card->add_dist(dist);
|
|
|
|
|
|
- CString strLog;
|
|
|
+ if(m_log_locate_data){
|
|
|
+ CString strLog = _T("");
|
|
|
+
|
|
|
+ if(card->x != card->last_x || card->y != card->last_y){
|
|
|
+ strLog.Format(_T("cardid:%s, cx: %f, cy: %f, cz: %f, clx: %f, cly: %f"), CFunctions::c2wc(card->card_id.c_str()), card->x, card->y, card->z, card->last_x, card->last_y);
|
|
|
+ writeErrorLog(_T("DIST_S"), strLog, false);
|
|
|
+ }
|
|
|
+
|
|
|
+ strLog.Format(_T("r: %d-%d, t: %d, l:%d, tt: %I64u, ft: %I64u, x1: %f, y1: %f, z1: %f, ct: %d, cardid:%s"),
|
|
|
+ dist->reader_id, dist->antenna_id + 1, card->sync_num, card->p_reader->sync_level, dist->tt, card->flying_time, dist->x, dist->y, dist->z,card->time_stamp, CFunctions::c2wc(card->card_id.c_str()));
|
|
|
+ writeErrorLog(_T("DIST_S"), strLog, true);
|
|
|
+ }
|
|
|
+ /*CString strLog;
|
|
|
|
|
|
if(card->x != card->last_x || card->y != card->last_y){
|
|
|
strLog.Format(_T("cardid:%s, cx: %f, cy: %f, cz: %f, clx: %f, cly: %f"), CFunctions::c2wc(card->card_id.c_str()), card->x, card->y, card->z, card->last_x, card->last_y);
|
|
@@ -6089,7 +6248,7 @@ void CYAServerDlg::deal_card_msg( Card* card, bool is_hist /*= false*/ )
|
|
|
|
|
|
strLog.Format(_T("r: %d-%d, t: %d, l:%d, tt: %I64u, ft: %I64u, x1: %f, y1: %f, z1: %f, ct: %d, cardid:%s"),
|
|
|
dist->reader_id, dist->antenna_id + 1, card->sync_num, card->p_reader->sync_level, dist->tt, card->flying_time, dist->x, dist->y, dist->z,card->time_stamp, CFunctions::c2wc(card->card_id.c_str()));
|
|
|
- writeErrorLog(_T("DIST_S"), strLog, true);
|
|
|
+ writeErrorLog(_T("DIST_S"), strLog, true);*/
|
|
|
|
|
|
//CString strLog2 = _T("");
|
|
|
//strLog2.Format(_T("cx: %f, cy: %f, cz: %f, v: %f, dt: %f, vx: %f, vy: %f"), card->output_loc_data.x, card->output_loc_data.y, card->output_loc_data.z, card->output_loc_data.v,card->output_dt,card->output_vx,card->output_vy);
|
|
@@ -6145,7 +6304,19 @@ afx_msg LRESULT CYAServerDlg::OnCardAddDist(WPARAM wParam, LPARAM lParam)
|
|
|
}
|
|
|
card->add_dist(dist);
|
|
|
|
|
|
- CString strLog;
|
|
|
+ if(m_log_locate_data){
|
|
|
+ CString strLog = _T("");
|
|
|
+
|
|
|
+ if(card->x != card->last_x || card->y != card->last_y){
|
|
|
+ strLog.Format(_T("cardid:%s, cx: %f, cy: %f, cz: %f, clx: %f, cly: %f"), CFunctions::c2wc(card->card_id.c_str()), card->x, card->y, card->z, card->last_x, card->last_y);
|
|
|
+ writeErrorLog(_T("DIST_S"), strLog, false);
|
|
|
+ }
|
|
|
+
|
|
|
+ strLog.Format(_T("r: %d-%d, t: %d, l:%d, tt: %I64u, ft: %I64u, x1: %f, y1: %f, z1: %f, ct: %d, cardid:%s"),
|
|
|
+ dist->reader_id, dist->antenna_id + 1, card->sync_num, card->p_reader->sync_level, dist->tt, card->flying_time, dist->x, dist->y, dist->z,card->time_stamp, CFunctions::c2wc(card->card_id.c_str()));
|
|
|
+ writeErrorLog(_T("DIST_S"), strLog, true);
|
|
|
+ }
|
|
|
+ /*CString strLog;
|
|
|
|
|
|
if(card->x != card->last_x || card->y != card->last_y){
|
|
|
strLog.Format(_T("cardid:%s, cx: %f, cy: %f, cz: %f, clx: %f, cly: %f"), CFunctions::c2wc(card->card_id.c_str()), card->x, card->y, card->z, card->last_x, card->last_y);
|
|
@@ -6154,7 +6325,7 @@ afx_msg LRESULT CYAServerDlg::OnCardAddDist(WPARAM wParam, LPARAM lParam)
|
|
|
|
|
|
strLog.Format(_T("r: %d-%d, t: %d, l:%d, tt: %I64u, ft: %I64u, x1: %f, y1: %f, z1: %f, ct: %d, cardid:%s"),
|
|
|
dist->reader_id, dist->antenna_id + 1, card->sync_num, card->p_reader->sync_level, dist->tt, card->flying_time, dist->x, dist->y, dist->z,card->time_stamp, CFunctions::c2wc(card->card_id.c_str()));
|
|
|
- writeErrorLog(_T("DIST_S"), strLog, true);
|
|
|
+ writeErrorLog(_T("DIST_S"), strLog, true);*/
|
|
|
return 0;
|
|
|
}
|
|
|
|