|
@@ -1144,55 +1144,8 @@ static bool onButtonClick_CallCencelButton(ZKButton *pButton) {
|
|
|
|
|
|
static bool onButtonClick_NursingButton(ZKButton *pButton) {
|
|
|
LOGD(" ButtonClick NursingButton !!!\n");
|
|
|
-
|
|
|
-// 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));
|
|
|
- std::string color = StoragePreferences::getString(STORE_NURSING_COLOR_RGB, "010");
|
|
|
- if (color != "" && color.size() == 3) {
|
|
|
- color = color + "F";
|
|
|
- } else {
|
|
|
- color = "010F";
|
|
|
- }
|
|
|
- lightControl("DOORLED", color);
|
|
|
-
|
|
|
- mFunctionWinPtr->showWnd();
|
|
|
- mFunctionTextViewPtr->setText(LANGUAGEMANAGER->getValue("InNursing"));
|
|
|
- mFunctionButtonPtr->setText(LANGUAGEMANAGER->getValue("NursingEnd"));
|
|
|
- mFunctionBackPtr->setVisible(false);
|
|
|
-
|
|
|
- // 发送tcp, tcp_type = SIDE, tcp_action = NURSING
|
|
|
- TcpModel tcpModel;
|
|
|
- tcpModel.tid = base::format("t%d",TimeHelper::getCurrentTime());
|
|
|
- tcpModel.type = TcpType::SIDE;
|
|
|
- tcpModel.action = SideAction::NURSING;
|
|
|
- tcpModel.from_id = StoragePreferences::getInt(STORE_DEVICE_ID,0);
|
|
|
- tcpModel.to_id = NULL;
|
|
|
- std::string req = getTcpModelString(tcpModel);
|
|
|
- LOGD("TCP SIDE : %s",req.c_str());
|
|
|
-
|
|
|
- //回调注册
|
|
|
- TcpCallback callback;
|
|
|
- callback.tid = tcpModel.tid;
|
|
|
- callback.jsonStr = req;
|
|
|
- callback.onSuccess = [](Json::Value json){
|
|
|
- LOGD("side callback success");
|
|
|
- return 0;
|
|
|
- };
|
|
|
- callback.onFalied = [](Json::Value json){
|
|
|
- LOGD("side callback failed");
|
|
|
- return 0;
|
|
|
- };
|
|
|
- TcpClient::instance()->sendMsgWithCb(req.c_str(), callback);
|
|
|
-
|
|
|
- // 把护理状态缓存起来
|
|
|
- StoragePreferences::putBool(STORE_NURSING_TYPE, true);
|
|
|
+ mPasswordEditTextPtr->setText("");
|
|
|
+ mPasswordWindowPtr->showWnd();
|
|
|
return false;
|
|
|
}
|
|
|
|
|
@@ -1255,3 +1208,60 @@ static bool onButtonClick_CallBedCancel(ZKButton *pButton) {
|
|
|
mCallBebWinPtr->hideWnd();
|
|
|
return false;
|
|
|
}
|
|
|
+static void onEditTextChanged_PasswordEditText(const std::string &text) {
|
|
|
+ //LOGD(" onEditTextChanged_ PasswordEditText %s !!!\n", text.c_str());
|
|
|
+}
|
|
|
+
|
|
|
+static bool onButtonClick_ConfirmButton(ZKButton *pButton) {
|
|
|
+ LOGD(" ButtonClick ConfirmButton !!!\n");
|
|
|
+ string pwd = mPasswordEditTextPtr->getText();
|
|
|
+ string cpwd = "1020";
|
|
|
+
|
|
|
+ if (pwd == cpwd){
|
|
|
+ mPasswordWindowPtr->hideWnd();
|
|
|
+
|
|
|
+ std::string color = StoragePreferences::getString(STORE_NURSING_COLOR_RGB, "010");
|
|
|
+ if (color != "" && color.size() == 3) {
|
|
|
+ color = color + "F";
|
|
|
+ } else {
|
|
|
+ color = "010F";
|
|
|
+ }
|
|
|
+ lightControl("DOORLED", color);
|
|
|
+
|
|
|
+ mFunctionWinPtr->showWnd();
|
|
|
+ mFunctionTextViewPtr->setText(LANGUAGEMANAGER->getValue("InNursing"));
|
|
|
+ mFunctionButtonPtr->setText(LANGUAGEMANAGER->getValue("NursingEnd"));
|
|
|
+ mFunctionBackPtr->setVisible(false);
|
|
|
+
|
|
|
+ // 发送tcp, tcp_type = SIDE, tcp_action = NURSING
|
|
|
+ TcpModel tcpModel;
|
|
|
+ tcpModel.tid = base::format("t%d",TimeHelper::getCurrentTime());
|
|
|
+ tcpModel.type = TcpType::SIDE;
|
|
|
+ tcpModel.action = SideAction::NURSING;
|
|
|
+ tcpModel.from_id = StoragePreferences::getInt(STORE_DEVICE_ID,0);
|
|
|
+ tcpModel.to_id = NULL;
|
|
|
+ std::string req = getTcpModelString(tcpModel);
|
|
|
+ LOGD("TCP SIDE : %s",req.c_str());
|
|
|
+
|
|
|
+ //回调注册
|
|
|
+ TcpCallback callback;
|
|
|
+ callback.tid = tcpModel.tid;
|
|
|
+ callback.jsonStr = req;
|
|
|
+ callback.onSuccess = [](Json::Value json){
|
|
|
+ LOGD("side callback success");
|
|
|
+ return 0;
|
|
|
+ };
|
|
|
+ callback.onFalied = [](Json::Value json){
|
|
|
+ LOGD("side callback failed");
|
|
|
+ return 0;
|
|
|
+ };
|
|
|
+ TcpClient::instance()->sendMsgWithCb(req.c_str(), callback);
|
|
|
+
|
|
|
+ // 把护理状态缓存起来
|
|
|
+ StoragePreferences::putBool(STORE_NURSING_TYPE, true);
|
|
|
+ return false;
|
|
|
+ } else {
|
|
|
+ mErrorTextViewPtr->setTextTr("PasswordWrong");
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+}
|