Переглянути джерело

增加护理门灯的控制

vothin 2 роки тому
батько
коміт
61b8607b1f

+ 15 - 0
jni/logic/mainLogic.cc

@@ -763,6 +763,17 @@ static bool onButtonClick_CallCencelButton(ZKButton *pButton) {
 static bool onButtonClick_NursingButton(ZKButton *pButton) {
     LOGD(" ButtonClick NursingButton !!!\n");
 	LOGD("onButtonClick_Nursing 触发护理按钮!!!");
+
+	std::string color = partSetting.nursingColorRgb;
+	std::string heartStr;
+	if (color != "" && color.size() == 3) {
+		heartStr = "DOORLED," + color + "F";
+	} else {
+		heartStr = "DOORLED,010F";
+	}
+	const char* sendMsg = heartStr.c_str();
+	sendProtocolTo(UART_TTYS2, (byte*)(sendMsg), strlen(sendMsg));
+
 	mFunctionWinPtr->showWnd();
 	mFunctionTextViewPtr->setText(LANGUAGEMANAGER->getValue("InNursing"));
 	mFunctionButtonPtr->setText(LANGUAGEMANAGER->getValue("NursingEnd"));
@@ -804,6 +815,10 @@ static bool onButtonClick_FunctionButton(ZKButton *pButton) {
     LOGD(" ButtonClick FunctionButton !!!\n");
 	mFunctionWinPtr->hideWnd();
 
+	std::string heartStr = "DOORLED,000F";
+	const char* sendMsg = heartStr.c_str();
+	sendProtocolTo(UART_TTYS2, (byte*)(sendMsg), strlen(sendMsg));
+
 	if (nursingTcpModel.json.size() != 0) {	// 对比一下,json里面不为空的时候
 		// 发送tcp, tcp_type = SIDE, tcp_action = NURSING_END
 		TcpModel tcpModel;

+ 14 - 3
jni/logic/startLogic.cc

@@ -298,11 +298,18 @@ void handleMsg(byte* inBytes){
 				GetTelephone()->Hangup(info.id, voip::SIP_STATUS_CODE_DECLINE);
 				GetTelephone()->Hangup();
 				EASYUICONTEXT->goBack();
+			}
 
-				std::string heartStr = "DOORLED,000F";
-				const char* sendMsg = heartStr.c_str();
-				sendProtocolTo(UART_TTYS2, (byte*)(sendMsg), strlen(sendMsg));
+
+			std::string color = StoragePreferences::getString(STORE_NURSING_COLOR_RGB, "010");
+			std::string heartStr;
+			if (color != "" && color.size() == 3) {
+				heartStr = "DOORLED," + color + "F";
+			} else {
+				heartStr = "DOORLED,010F";
 			}
+			const char* sendMsg = heartStr.c_str();
+			sendProtocolTo(UART_TTYS2, (byte*)(sendMsg), strlen(sendMsg));
 
 
 			// 删除这个定时器
@@ -312,6 +319,10 @@ void handleMsg(byte* inBytes){
 		}
 		else if (tcpModel.action == SideAction::NURSING_END) {
 			// 收到nursing_end
+
+			std::string heartStr = "DOORLED,000F";
+			const char* sendMsg = heartStr.c_str();
+			sendProtocolTo(UART_TTYS2, (byte*)(sendMsg), strlen(sendMsg));
 		}
 		else if (tcpModel.action == SideAction::CALL) {
 			// 收到CALL,需要亮红灯

+ 5 - 2
jni/service/BusinessConfig.h

@@ -45,11 +45,13 @@
 #define STORE_NURSE_TITLE "nurse_title"
 #define STORE_NURSE_VISIBLE "nurse_visible"
 
+#define STORE_NURSING_COLOR_RGB "nursingColorRgb"
+
 #define STORE_AUDO_ANSWER "auto_answer"
 #define SIGNAL_TYPE "TCP" //TCP,SIP
 
-static std::string version = "v1.0.12";
-static int versionNo = 12;
+static std::string version = "v1.0.15";
+static int versionNo = 15;
 static std::string serverIP = "172.28.100.100";
 static std::string tcpIP = "172.28.100.100";
 static int serverHttpPort = 8006;
@@ -144,6 +146,7 @@ void acceptSIP();
 
 void sendVoiceTcp(std::string action, TcpModel model, int toId);
 
+
 class PartSetting{
 public:
 	inline static int id;

BIN
libs/armeabi/libzkgui.so


BIN
obj/activity/DeviceUpdateActivity.o


BIN
obj/activity/callActivity.o


BIN
obj/activity/mainActivity.o


BIN
obj/activity/startActivity.o


BIN
obj/activity/statusbar.o


BIN
obj/activity/ui3Activity.o


BIN
obj/activity/warnActivity.o


BIN
obj/core/update_assistant.o


BIN
obj/net/tcp_client.o


BIN
obj/service/BusinessConfig.o


BIN
obj/service/time.o


BIN
ui/statusbar.ftu