Selaa lähdekoodia

1.1.9.2调整稳态值为差值,显示位置为稳态时间.

git-svn-id: https://202.107.226.68:8443/svn/Services/ResistanceMonitor@88 a05970a1-87b9-9d4f-9ee5-fa77e2ec115b
shenchunzhong 1 vuosi sitten
vanhempi
commit
1e6b50167d
4 muutettua tiedostoa jossa 14 lisäystä ja 11 poistoa
  1. 7 6
      4.Data/HttpPrcess.cpp
  2. 1 0
      4.Data/MGWSServer.h
  3. 6 5
      4.Data/ResistAlarm.cpp
  4. BIN
      4.Data/TimeSyncServer.rc

+ 7 - 6
4.Data/HttpPrcess.cpp

@@ -4729,10 +4729,10 @@ int DealResistMove(const httplib::Request& req, const string token, char** json,
 				ii = mapSecondStatInfo2.find(it->tmEnd - 1);
             ASSERT(ii != mapSecondStatInfo2.end());
 			last_value = ii->second.end_val;
-			auto dif = abs(last_value - first_value);
+			auto dif = last_value - first_value;
 			auto strLog = fmt::format("{}  first:{}  last:{} dif:{}",
 				CTime(it->time / 1000).Format("%Y-%m-%d %H:%M:%S"), first_value, last_value, dif);
-			if (dif > 1000)
+			if (dif > 1000 || dif < -1000)
 			{
 				if (it->tmEnd - it->tmStart >= 4)
 				{
@@ -4740,8 +4740,9 @@ int DealResistMove(const httplib::Request& req, const string token, char** json,
 					FRICTION_RESIST info;
 					info.peak_time = it->time;
 					info.peak_val = it->val;
-					info.show_time = it->time; //暂时赋值峰值
-					info.show_val = last_value;
+					info.show_time = ii->first * 1000;
+					info.show_val = dif;//稳态值显示差值
+					info.curr_val = last_value; //显示的位置
 					info.tmStart = it->tmStart;
 					info.tmEnd = it->tmEnd;
 					info.t = strLog;
@@ -4874,8 +4875,8 @@ int DealResistMove(const httplib::Request& req, const string token, char** json,
 
 		for (auto& it : lstFriction)
 		{
-			time_t show_time = it.peak_time;
-			int curr_val = it.peak_val;
+			time_t show_time = it.show_time;
+			int curr_val = it.curr_val;
 			int show_val = it.show_val;
 			auto obj = yyjson_mut_obj(doc);
 			yyjson_mut_arr_add_val(convert_points, obj);

+ 1 - 0
4.Data/MGWSServer.h

@@ -50,6 +50,7 @@ typedef struct tagFrictionResist
 {
 	int show_val = 0; //稳态值
 	time_t show_time = 0; //稳态时间
+	int curr_val = 0; //当前值
 	int peak_val = 0; //峰值
 	time_t peak_time = 0; //峰值时间
 	eUpOrDownInfo bUpOrDown = eUpOrDownInfo::UOD_UNKNOWN;  //1. up 缩进  2. down  伸出

+ 6 - 5
4.Data/ResistAlarm.cpp

@@ -3077,10 +3077,10 @@ void CResistAlarmMng::ThreadProcMove(DWORD_PTR param)
 						ii = map2.find(it->tmEnd - 1);
 					ASSERT(ii != map2.end());
 					last_value = ii->second.end_val;
-					auto dif = abs(last_value - first_value);
+					auto dif = last_value - first_value;
 					auto strLog = fmt::format("[摩擦力判断]{}  first:{}  last:{} dif:{}",
 						CTime(it->time / 1000).Format("%Y-%m-%d %H:%M:%S"), first_value, last_value, dif);
-					if (dif > 1000)
+					if (dif > 1000 || dif < -1000)
 					{
 						SPDLOG_INFO(strLog);
 						if (it->tmEnd - it->tmStart >= 4)
@@ -3088,8 +3088,9 @@ void CResistAlarmMng::ThreadProcMove(DWORD_PTR param)
 							FRICTION_RESIST info;
 							info.peak_time = it->time;
 							info.peak_val = it->val;
-							info.show_time = it->time; //暂时赋值峰值
-							info.show_val = last_value;
+							info.show_time = ii->first * 1000;
+							info.show_val = dif;  //稳态值显示差值
+							info.curr_val = last_value;  //显示的位置
 							info.tmStart = it->tmStart;
 							info.tmEnd = it->tmEnd;
 							info.t = strLog;
@@ -3309,7 +3310,7 @@ void CResistAlarmMng::ThreadProcMove(DWORD_PTR param)
 
 					for (auto& it : lstFriction)
 					{
-						CResistAlarmMng::InsertToDBByMove(mo, mp, it.peak_time, it.tmStart, it.tmEnd, it.peak_val, it.bUpOrDown == eUpOrDownInfo::UOD_DOWN ? -it.show_val :it.show_val, 2,
+						CResistAlarmMng::InsertToDBByMove(mo, mp, it.show_time, it.tmStart, it.tmEnd, it.curr_val, it.show_val, 2,
 							(uint8_t)eDaoChaPosi::DCP_UNKNOWN, (uint8_t)ePowerName::PN_FRICTION, fmt::format("稳态值:{}", it.show_val));
 
 						//CMonitorObjectMng::Instance()->UpdateZZJEPOS(mo + "." + mp, DAOCHA_POSITION::MP_QUARTO); //四开

BIN
4.Data/TimeSyncServer.rc