|
@@ -3,6 +3,7 @@
|
|
|
#include "service/BusinessConfig.h"
|
|
|
#include "voip/media_player.h"
|
|
|
#include "manager/ConfigManager.h"
|
|
|
+#include "manager/LanguageManager.h"
|
|
|
|
|
|
#include <sys/reboot.h>
|
|
|
/*
|
|
@@ -37,6 +38,9 @@
|
|
|
|
|
|
Json::Value bedList;
|
|
|
Json::Value chooseBed;
|
|
|
+Json::Value _partFrameTree;
|
|
|
+Json::Value _roomFrameTree;
|
|
|
+Json::Value _bedFrameTree;
|
|
|
int chooseId = 0;
|
|
|
static string _functionWindows;
|
|
|
static string _functionText;
|
|
@@ -45,6 +49,7 @@ static string _warnText;
|
|
|
static string _goActivity;
|
|
|
static int functionThemeInt = defaultThemeInt;
|
|
|
static uint32_t functionColor = buleDeepColour;
|
|
|
+static string _functionTransmitDeviceId;
|
|
|
|
|
|
static base::MediaPlayer mediaPlayer;
|
|
|
|
|
@@ -130,7 +135,11 @@ static void callBed() {
|
|
|
else {
|
|
|
bedList.clear();
|
|
|
}
|
|
|
+
|
|
|
+ mCallBedTextViewPtr->setText(LANGUAGEMANAGER->getValue("CallableBeds"));
|
|
|
mCallBedListViewPtr->refreshListView();
|
|
|
+ mConfirmCallButtonPtr->setText(LANGUAGEMANAGER->getValue("ConfirmCall"));
|
|
|
+ mCancelCallButtonPtr->setText(LANGUAGEMANAGER->getValue("CancelCall"));
|
|
|
mCallBedWindowPtr->showWnd();
|
|
|
}
|
|
|
|
|
@@ -163,12 +172,87 @@ static void helpResopnse() {
|
|
|
mActivityPtr->registerUserTimer(FUNCTION_TIMER_HANDLE, 30 * 1000); // 30秒
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+void eventCall(string functionText) {
|
|
|
+ mIconPainterPtr->setBackgroundPic("icon/chenggong.png");
|
|
|
+ mFunctionTextViewPtr->setText(functionText + LANGUAGEMANAGER->getValue("EventCalled"));
|
|
|
+ mStateTextViewPtr->setVisible(false);
|
|
|
+ mFunctionButtonPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "button/elliptic_bule2.png");
|
|
|
+ mFunctionButtonPtr->setText(LANGUAGEMANAGER->getValue("Confirm"));
|
|
|
+ mFunctionWindowPtr->showWnd();
|
|
|
+
|
|
|
+ mActivityPtr->registerUserTimer(FUNCTION_TIMER_HANDLE, 30 * 1000); // 30秒
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+void eventResponse(string functionText) {
|
|
|
+ mIconPainterPtr->setBackgroundPic("icon/xiangy.png");
|
|
|
+ mFunctionTextViewPtr->setText(functionText);
|
|
|
+ mStateTextViewPtr->setVisible(false);
|
|
|
+ mFunctionButtonPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "button/elliptic_bule2.png");
|
|
|
+ mFunctionButtonPtr->setText(LANGUAGEMANAGER->getValue("Confirm"));
|
|
|
+ mFunctionWindowPtr->showWnd();
|
|
|
+
|
|
|
+ mActivityPtr->registerUserTimer(FUNCTION_TIMER_HANDLE, 30 * 1000); // 30秒
|
|
|
+}
|
|
|
+
|
|
|
+Json::Reader reader(Json::Features::strictMode());
|
|
|
+Json::Value interaction;
|
|
|
+void eventHandle(string functionText) {
|
|
|
+ if (reader.parse(functionText.c_str(), interaction, false)){
|
|
|
+ string eventStr = interaction["data"].asString();
|
|
|
+ mEventHandleTextViewPtr->setText(LANGUAGEMANAGER->getValue("EventCompleteOrCancel") + eventStr);
|
|
|
+ mEventHandleWindowPtr->showWnd();
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ mEventHandleTextViewPtr->setText(LANGUAGEMANAGER->getValue("EventCompleteOrCancel"));
|
|
|
+ mEventHandleWindowPtr->showWnd();
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+void executeAffair(string _functionText) {
|
|
|
+ mHandleIconPainterPtr->setBackgroundPic("icon/chenggong.png");
|
|
|
+ mHandleTextViewPtr->setText(_functionText);
|
|
|
+ mHandleStatusTextViewPtr->setVisible(true);
|
|
|
+ mHandleStatusTextViewPtr->setText(LANGUAGEMANAGER->getValue("IsExecuteAffair"));
|
|
|
+ mHandleConfirmButtonPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "button/elliptic_bule2.png");
|
|
|
+ mHandleConfirmButtonPtr->setText(LANGUAGEMANAGER->getValue("Confirm"));
|
|
|
+ mHandleWindowPtr->showWnd();
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
void toFunctionActivity(std::string data) {
|
|
|
if (_functionWindows == "help") {
|
|
|
helpResopnse();
|
|
|
mediaPlayer.Play(CONFIGMANAGER->getResFilePath("response.wav"), "", 1000,
|
|
|
base::MediaPlayer::PlayMode::Default);
|
|
|
}
|
|
|
+ else if (_functionWindows == "eventCall") {
|
|
|
+ eventResponse(data);
|
|
|
+ mediaPlayer.Play(CONFIGMANAGER->getResFilePath("response.wav"), "", 1000,
|
|
|
+ base::MediaPlayer::PlayMode::Default);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+void success(string _functionText) {
|
|
|
+ if (functionThemeInt == 1) {
|
|
|
+ mIconPainterPtr->setBackgroundPic("icon/zengyuan2.png");
|
|
|
+ mFunctionButtonPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "button/elliptic_bule2.png");
|
|
|
+ }
|
|
|
+ else if (functionThemeInt == 2) {
|
|
|
+ mIconPainterPtr->setBackgroundPic("icon/zengyuan2-pink.png");
|
|
|
+ mFunctionButtonPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "button/elliptic_pink2.png");
|
|
|
+ }
|
|
|
+ mFunctionTextViewPtr->setText(_functionText);
|
|
|
+ mStateTextViewPtr->setVisible(false);
|
|
|
+ mFunctionButtonPtr->setText(LANGUAGEMANAGER->getValue("Confirm"));
|
|
|
+ mFunctionWindowPtr->showWnd();
|
|
|
+
|
|
|
+ mActivityPtr->registerUserTimer(FUNCTION_TIMER_HANDLE, 30 * 1000); // 30秒
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
void warn(string warnText) {
|
|
@@ -209,17 +293,40 @@ void nursing(string functionText, string nursingText) {
|
|
|
mFunctionWindowPtr->showWnd();
|
|
|
}
|
|
|
|
|
|
+void nursing2() {
|
|
|
+ mIconPainterPtr->setBackgroundPic("icon/huli2.png");
|
|
|
+ mFunctionTextViewPtr->setText(LANGUAGEMANAGER->getValue("SetNursingMsg2"));
|
|
|
+ mStateTextViewPtr->setVisible(false);
|
|
|
+ mFunctionButtonPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "button/elliptic_pink2.png");
|
|
|
+ mFunctionButtonPtr->setText(LANGUAGEMANAGER->getValue("Nursing"));
|
|
|
+ mFunctionWindowPtr->showWnd();
|
|
|
+
|
|
|
+ mediaPlayer.Play(CONFIGMANAGER->getResFilePath("response.wav"), "", 1000,
|
|
|
+ base::MediaPlayer::PlayMode::Default);
|
|
|
+
|
|
|
+ mActivityPtr->registerUserTimer(FUNCTION_TIMER_HANDLE, 30 * 1000); // 30秒
|
|
|
+}
|
|
|
+
|
|
|
|
|
|
void nursingEnd(string functionText) {
|
|
|
mIconPainterPtr->setBackgroundPic("icon/huli2.png");
|
|
|
mFunctionTextViewPtr->setText(functionText);
|
|
|
mStateTextViewPtr->setVisible(true);
|
|
|
mStateTextViewPtr->setText(LANGUAGEMANAGER->getValue("SetNursingEndMsg"));
|
|
|
- mFunctionButtonPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "button/elliptic_pink.png");
|
|
|
+ mFunctionButtonPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "button/elliptic_pink2.png");
|
|
|
mFunctionButtonPtr->setText(LANGUAGEMANAGER->getValue("NursingEnd"));
|
|
|
mFunctionWindowPtr->showWnd();
|
|
|
}
|
|
|
|
|
|
+void nursingEnd2() {
|
|
|
+ mHandleIconPainterPtr->setBackgroundPic("icon/huli2.png");
|
|
|
+ mHandleTextViewPtr->setText(LANGUAGEMANAGER->getValue("SetNursingEndMsg2"));
|
|
|
+ mHandleStatusTextViewPtr->setVisible(false);
|
|
|
+ mHandleConfirmButtonPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "button/elliptic_pink2.png");
|
|
|
+ mHandleConfirmButtonPtr->setText(LANGUAGEMANAGER->getValue("Confirm"));
|
|
|
+ mHandleWindowPtr->showWnd();
|
|
|
+}
|
|
|
+
|
|
|
|
|
|
|
|
|
void pwdWindowInfo() {
|
|
@@ -280,6 +387,71 @@ void mode(string functionText) {
|
|
|
mFunctionWindowPtr->showWnd();
|
|
|
}
|
|
|
|
|
|
+void blueCode() {
|
|
|
+ mIconPainterPtr->setBackgroundPic("icon/chenggong.png");
|
|
|
+ mFunctionTextViewPtr->setText(LANGUAGEMANAGER->getValue("BlueCodeMsg"));
|
|
|
+ mStateTextViewPtr->setVisible(false);
|
|
|
+ mFunctionButtonPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "button/elliptic_bule2.png");
|
|
|
+ mFunctionButtonPtr->setText(LANGUAGEMANAGER->getValue("Confirm"));
|
|
|
+ mFunctionWindowPtr->showWnd();
|
|
|
+
|
|
|
+ mActivityPtr->registerUserTimer(FUNCTION_TIMER_HANDLE, 30 * 1000); // 30秒
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+void getPartFrameTree() {
|
|
|
+ _partFrameTree = getFrameTree(_functionWindows);
|
|
|
+
|
|
|
+ if (_partFrameTree.size() == 0) {
|
|
|
+ mWarnTextViewPtr->setText(LANGUAGEMANAGER->getValue("PartFrameTreeMsg"));
|
|
|
+ mWarnWindowPtr->showWnd();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ chooseId = 0;
|
|
|
+
|
|
|
+ mCallBedTextViewPtr->setText(LANGUAGEMANAGER->getValue("ChoicePartMsg"));
|
|
|
+ mConfirmCallButtonPtr->setText(LANGUAGEMANAGER->getValue("Confirm"));
|
|
|
+ mCancelCallButtonPtr->setText(LANGUAGEMANAGER->getValue("Cancel"));
|
|
|
+ mCallBedListViewPtr->refreshListView();
|
|
|
+ mCallBedWindowPtr->showWnd();
|
|
|
+}
|
|
|
+
|
|
|
+void getRoomFrameTree() {
|
|
|
+ _roomFrameTree = getFrameTree(_functionWindows);
|
|
|
+
|
|
|
+ if (_roomFrameTree.size() == 0) {
|
|
|
+ mWarnTextViewPtr->setText(LANGUAGEMANAGER->getValue("RoomFrameTreeMsg"));
|
|
|
+ mWarnWindowPtr->showWnd();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ chooseId = 0;
|
|
|
+
|
|
|
+ mCallBedTextViewPtr->setText(LANGUAGEMANAGER->getValue("ChoiceRoomMsg"));
|
|
|
+ mConfirmCallButtonPtr->setText(LANGUAGEMANAGER->getValue("Confirm"));
|
|
|
+ mCancelCallButtonPtr->setText(LANGUAGEMANAGER->getValue("Cancel"));
|
|
|
+ mCallBedListViewPtr->refreshListView();
|
|
|
+ mCallBedWindowPtr->showWnd();
|
|
|
+}
|
|
|
+
|
|
|
+void getBedFrameTree() {
|
|
|
+ _bedFrameTree = getFrameTree(_functionWindows);
|
|
|
+
|
|
|
+ if (_bedFrameTree.size() == 0) {
|
|
|
+ mWarnTextViewPtr->setText(LANGUAGEMANAGER->getValue("BedFrameTreeMsg"));
|
|
|
+ mWarnWindowPtr->showWnd();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ chooseId = 0;
|
|
|
+
|
|
|
+ mCallBedTextViewPtr->setText(LANGUAGEMANAGER->getValue("ChoiceBedMsg"));
|
|
|
+ mConfirmCallButtonPtr->setText(LANGUAGEMANAGER->getValue("Confirm"));
|
|
|
+ mCancelCallButtonPtr->setText(LANGUAGEMANAGER->getValue("Cancel"));
|
|
|
+ mCallBedListViewPtr->refreshListView();
|
|
|
+ mCallBedWindowPtr->showWnd();
|
|
|
+}
|
|
|
|
|
|
|
|
|
|
|
@@ -298,7 +470,7 @@ static S_ACTIVITY_TIMEER REGISTER_ACTIVITY_TIMER_TAB[] = {
|
|
|
*/
|
|
|
static void onUI_init(){
|
|
|
//Tips :添加 UI初始化的显示代码到这里,如:mText1Ptr->setText("123");
|
|
|
- mFunctionPainterPtr->setAlpha(102);
|
|
|
+ mFunctionPainterPtr->setAlpha(200);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -314,15 +486,18 @@ static void onUI_intent(const Intent *intentPtr) {
|
|
|
if (_functionWindows == "callBed") {
|
|
|
callBed();
|
|
|
}
|
|
|
- else if (_functionWindows == "help") {
|
|
|
+ else if (_functionWindows == "help" ||
|
|
|
+ _functionWindows == "helpResonse") {
|
|
|
help();
|
|
|
mediaPlayer.Play(CONFIGMANAGER->getResFilePath("response.wav"), "", 1000,
|
|
|
base::MediaPlayer::PlayMode::Default);
|
|
|
}
|
|
|
- else if (_functionWindows == "helpResonse") {
|
|
|
- helpResopnse();
|
|
|
+ else if (_functionWindows == "success") {
|
|
|
+ _functionText = intentPtr->getExtra(functionText);
|
|
|
+ success(_functionText);
|
|
|
mediaPlayer.Play(CONFIGMANAGER->getResFilePath("response.wav"), "", 1000,
|
|
|
base::MediaPlayer::PlayMode::Default);
|
|
|
+
|
|
|
}
|
|
|
else if (_functionWindows == "warn") {
|
|
|
_warnText = intentPtr->getExtra(warnText);
|
|
@@ -356,9 +531,15 @@ static void onUI_intent(const Intent *intentPtr) {
|
|
|
else if (_functionWindows == "serverChange" ||
|
|
|
_functionWindows == "setting" ||
|
|
|
_functionWindows == "init" ||
|
|
|
- _functionWindows == "reboot") {
|
|
|
+ _functionWindows == "reboot" ||
|
|
|
+ _functionWindows == "nursing2" ||
|
|
|
+ _functionWindows == "deviceAdd"
|
|
|
+ ) {
|
|
|
pwdWindowInfo();
|
|
|
}
|
|
|
+ else if (_functionWindows == "nursingEnd2") {
|
|
|
+ nursingEnd2();
|
|
|
+ }
|
|
|
else if (_functionWindows == "theme") {
|
|
|
_functionText = intentPtr->getExtra(functionText);
|
|
|
theme(_functionText);
|
|
@@ -367,6 +548,43 @@ static void onUI_intent(const Intent *intentPtr) {
|
|
|
_functionText = intentPtr->getExtra(functionText);
|
|
|
mode(_functionText);
|
|
|
}
|
|
|
+
|
|
|
+ else if (_functionWindows == "eventCall") {
|
|
|
+ _functionText = intentPtr->getExtra(functionText);
|
|
|
+ eventCall(_functionText);
|
|
|
+ mediaPlayer.Play(CONFIGMANAGER->getResFilePath("response.wav"), "", 1000,
|
|
|
+ base::MediaPlayer::PlayMode::Default);
|
|
|
+ }
|
|
|
+ else if (_functionWindows == "eventResponse") {
|
|
|
+ _functionText = intentPtr->getExtra(functionText);
|
|
|
+ eventResponse(_functionText);
|
|
|
+ mediaPlayer.Play(CONFIGMANAGER->getResFilePath("response.wav"), "", 1000,
|
|
|
+ base::MediaPlayer::PlayMode::Default);
|
|
|
+ }
|
|
|
+ else if (_functionWindows == "eventHandle") {
|
|
|
+ _functionText = intentPtr->getExtra(functionText);
|
|
|
+ _functionTransmitDeviceId = intentPtr->getExtra(transmitDeviceId);
|
|
|
+ eventHandle(_functionText);
|
|
|
+ }
|
|
|
+ else if (_functionWindows == "customerAffair") {
|
|
|
+ _functionText = intentPtr->getExtra(functionText);
|
|
|
+ executeAffair(_functionText);
|
|
|
+ }
|
|
|
+ else if (_functionWindows == "blueCode") {
|
|
|
+ blueCode();
|
|
|
+ mediaPlayer.Play(CONFIGMANAGER->getResFilePath("response.wav"), "", 1000,
|
|
|
+ base::MediaPlayer::PlayMode::Default);
|
|
|
+ }
|
|
|
+ else if (_functionWindows == "getPartFrame") {
|
|
|
+ getPartFrameTree();
|
|
|
+ }
|
|
|
+ else if (_functionWindows == "getRoomFrame") {
|
|
|
+ getRoomFrameTree();
|
|
|
+
|
|
|
+ }
|
|
|
+ else if (_functionWindows == "getBedFrame") {
|
|
|
+ getBedFrameTree();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -459,7 +677,19 @@ static bool onButtonClick_sys_back(ZKButton *pButton) {
|
|
|
}
|
|
|
static int getListItemCount_CallBedListView(const ZKListView *pListView) {
|
|
|
//LOGD("getListItemCount_CallBedListView !\n");
|
|
|
- return bedList.size();
|
|
|
+ if (_functionWindows == "callBed") {
|
|
|
+ return bedList.size();
|
|
|
+ }
|
|
|
+ else if (_functionWindows == "getPartFrame") {
|
|
|
+ return _partFrameTree.size();
|
|
|
+ }
|
|
|
+ else if (_functionWindows == "getRoomFrame") {
|
|
|
+ return _roomFrameTree.size();
|
|
|
+ }
|
|
|
+ else if (_functionWindows == "getBedFrame") {
|
|
|
+ return _bedFrameTree.size();
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
}
|
|
|
|
|
|
static void obtainListItemData_CallBedListView(ZKListView *pListView,ZKListView::ZKListItem *pListItem, int index) {
|
|
@@ -472,19 +702,32 @@ static void obtainListItemData_CallBedListView(ZKListView *pListView,ZKListView:
|
|
|
}
|
|
|
pListItem->setTextStatusColor(ZK_CONTROL_STATUS_SELECTED, functionColor);
|
|
|
|
|
|
- if (bedList.size() > 0) {
|
|
|
- string frameBedName = bedList[index]["frame_bed"]["full_name"].asString();
|
|
|
- int nPos = frameBedName.find("-");
|
|
|
- if (nPos != -1) {
|
|
|
- frameBedName = frameBedName.substr(nPos + 1, frameBedName.length());
|
|
|
+ if (_functionWindows == "callBed") {
|
|
|
+ if (bedList.size() > 0) {
|
|
|
+ string frameBedName = bedList[index]["frame_bed"]["full_name"].asString();
|
|
|
+ int nPos = frameBedName.find("-");
|
|
|
+ if (nPos != -1) {
|
|
|
+ frameBedName = frameBedName.substr(nPos + 1, frameBedName.length());
|
|
|
+ }
|
|
|
+ string customerName = bedList[index]["customer_name"].asString();
|
|
|
+ pListItem->setText(frameBedName + " (" + customerName + ")");
|
|
|
}
|
|
|
- string customerName = bedList[index]["customer_name"].asString();
|
|
|
- pListItem->setText(frameBedName + " (" + customerName + ")");
|
|
|
+ }
|
|
|
+ else if (_functionWindows == "getPartFrame") {
|
|
|
+ pListItem->setText(_partFrameTree[index]["frame_part"]["full_name"].asString());
|
|
|
+ }
|
|
|
+ else if (_functionWindows == "getRoomFrame") {
|
|
|
+ pListItem->setText(_roomFrameTree[index]["frame_room"]["full_name"].asString());
|
|
|
+ }
|
|
|
+ else if (_functionWindows == "getBedFrame") {
|
|
|
+ pListItem->setText(_bedFrameTree[index]["frame_bed"]["full_name"].asString());
|
|
|
}
|
|
|
|
|
|
if (index == chooseId) {
|
|
|
pListItem->setSelected(true);
|
|
|
- chooseBed = bedList[index];
|
|
|
+ if (_functionWindows == "callBed") {
|
|
|
+ chooseBed = bedList[index];
|
|
|
+ }
|
|
|
}
|
|
|
else {
|
|
|
pListItem->setSelected(false);
|
|
@@ -499,24 +742,37 @@ static void onListItemClick_CallBedListView(ZKListView *pListView, int index, in
|
|
|
static bool onButtonClick_ConfirmCallButton(ZKButton *pButton) {
|
|
|
LOGD(" ButtonClick ConfirmCallButton !!!\n");
|
|
|
|
|
|
+ if (_functionWindows == "callBed") {
|
|
|
+ string toId = chooseBed["bed_device_id"].asString();
|
|
|
+ if (toId == "") {
|
|
|
+ mCallBedWindowPtr->hideWnd();
|
|
|
|
|
|
- string toId = chooseBed["bed_device_id"].asString();
|
|
|
- if (toId == "") {
|
|
|
-
|
|
|
- mCallBedWindowPtr->hideWnd();
|
|
|
-
|
|
|
- mWarnTextViewPtr->setText(LANGUAGEMANAGER->getValue("NoBedDevice"));
|
|
|
- mWarnWindowPtr->showWnd();
|
|
|
+ mWarnTextViewPtr->setText(LANGUAGEMANAGER->getValue("NoBedDevice"));
|
|
|
+ mWarnWindowPtr->showWnd();
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ Intent* intent = new Intent();
|
|
|
+ intent->putExtra(isOutgoing, "true");
|
|
|
+ intent->putExtra(audioOnly, "true");
|
|
|
+ intent->putExtra(toIdStr, toId);
|
|
|
+ intent->putExtra(callName, chooseBed["frame_bed"]["full_name"].asString() + " " + chooseBed["customer_name"].asString());
|
|
|
+ EASYUICONTEXT->openActivity("callActivity", intent);
|
|
|
+ EASYUICONTEXT->closeActivity("functionActivity");
|
|
|
+ }
|
|
|
}
|
|
|
- else {
|
|
|
- Intent* intent = new Intent();
|
|
|
- intent->putExtra(isOutgoing, "true");
|
|
|
- intent->putExtra(audioOnly, "true");
|
|
|
- intent->putExtra(toIdStr, toId);
|
|
|
- intent->putExtra(callName, chooseBed["frame_bed"]["full_name"].asString() + " " + chooseBed["customer_name"].asString());
|
|
|
- EASYUICONTEXT->openActivity("callActivity", intent);
|
|
|
- EASYUICONTEXT->closeActivity("functionActivity");
|
|
|
+ else if (_functionWindows == "getPartFrame") {
|
|
|
+ setPartFrameTree(chooseId);
|
|
|
+ EASYUICONTEXT->closeActivity("functionActivity");
|
|
|
+ }
|
|
|
+ else if (_functionWindows == "getRoomFrame") {
|
|
|
+ setRoomFrameTree(chooseId);
|
|
|
+ EASYUICONTEXT->closeActivity("functionActivity");
|
|
|
}
|
|
|
+ else if (_functionWindows == "getBedFrame") {
|
|
|
+ setBedFrameTree(chooseId);
|
|
|
+ EASYUICONTEXT->closeActivity("functionActivity");
|
|
|
+ }
|
|
|
+
|
|
|
return false;
|
|
|
}
|
|
|
|
|
@@ -542,8 +798,14 @@ static bool onButtonClick_FunctionButton(ZKButton *pButton) {
|
|
|
LOGD(" ButtonClick FunctionButton !!!\n");
|
|
|
if (_functionWindows == "help" ||
|
|
|
_functionWindows == "helpResonse" ||
|
|
|
+ _functionWindows == "success" ||
|
|
|
+ _functionWindows == "eventCall" ||
|
|
|
+ _functionWindows == "eventResponse" ||
|
|
|
_functionWindows == "position" ||
|
|
|
- _functionWindows == "roomPatrol"
|
|
|
+ _functionWindows == "roomPatrol" ||
|
|
|
+ _functionWindows == "nursing2" ||
|
|
|
+ _functionWindows == "blueCode"
|
|
|
+
|
|
|
) {
|
|
|
mActivityPtr->unregisterUserTimer(FUNCTION_TIMER_HANDLE);
|
|
|
EASYUICONTEXT->closeActivity("functionActivity");
|
|
@@ -681,6 +943,33 @@ static bool onButtonClick_PwdConfirmButton(ZKButton *pButton) {
|
|
|
mPwdPromptTextViewPtr->setTextColor(0xFFFF0000);
|
|
|
}
|
|
|
}
|
|
|
+ else if (_functionWindows == "nursing2") {
|
|
|
+ // 密码为888
|
|
|
+ string cpwd = "888";
|
|
|
+ if (pwd == cpwd){
|
|
|
+ // 关闭密码输入界面
|
|
|
+ mPwdWindowPtr->hideWnd();
|
|
|
+ nursing2();
|
|
|
+ setNursing2(true);
|
|
|
+ } else {
|
|
|
+ mPwdPromptTextViewPtr->setTextTr("PasswordWrong");
|
|
|
+ mPwdPromptTextViewPtr->setTextColor(0xFFFF0000);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (_functionWindows == "deviceAdd") {
|
|
|
+ // 密码为888
|
|
|
+ string cpwd = "888";
|
|
|
+ if (pwd == cpwd){
|
|
|
+ // 关闭密码输入界面
|
|
|
+ mPwdWindowPtr->hideWnd();
|
|
|
+ EASYUICONTEXT->closeActivity("functionActivity");
|
|
|
+ EASYUICONTEXT->openActivity("deviceAddActivity");
|
|
|
+ } else {
|
|
|
+ mPwdPromptTextViewPtr->setTextTr("PasswordWrong");
|
|
|
+ mPwdPromptTextViewPtr->setTextColor(0xFFFF0000);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
return false;
|
|
|
}
|
|
|
|
|
@@ -756,7 +1045,6 @@ static bool onButtonClick_RebootLineButton(ZKButton *pButton) {
|
|
|
tcpModel.type = TcpType::DEVICE;
|
|
|
tcpModel.action = DeviceAction::POWER_RESET;
|
|
|
tcpModel.from_id = StoragePreferences::getInt(STORE_DEVICE_ID,0);
|
|
|
- tcpModel.to_id = NULL;
|
|
|
|
|
|
std::string req = getTcpModelString(tcpModel);
|
|
|
LOGD("TCP DEVICE : %s",req.c_str());
|
|
@@ -880,3 +1168,82 @@ static bool onButtonClick_NursingTimeBackButton(ZKButton *pButton) {
|
|
|
nursingTime = 5;
|
|
|
return false;
|
|
|
}
|
|
|
+static bool onButtonClick_CompleteButton(ZKButton *pButton) {
|
|
|
+ LOGD(" ButtonClick CompleteButton !!!\n");
|
|
|
+
|
|
|
+ TcpModel tcpModel;
|
|
|
+ tcpModel.type = TcpType::EVENT;
|
|
|
+ tcpModel.action = EventAction::COMPLETED;
|
|
|
+ tcpModel.from_id = std::stoi(_functionTransmitDeviceId);
|
|
|
+ tcpModel.data = _functionText;
|
|
|
+ tcpModel.tid = base::format("t%d",TimeHelper::getCurrentTime());
|
|
|
+
|
|
|
+ std::string req = getTcpModelString(tcpModel);
|
|
|
+ LOGD("TCP DEVICE : %s",req.c_str());
|
|
|
+
|
|
|
+ TcpClient::instance()->sendMsg(req.c_str());
|
|
|
+
|
|
|
+ mediaPlayer.Play(CONFIGMANAGER->getResFilePath("response.wav"), "", 1000,
|
|
|
+ base::MediaPlayer::PlayMode::Default);
|
|
|
+
|
|
|
+ mEventHandleWindowPtr->hideWnd();
|
|
|
+ EASYUICONTEXT->closeActivity("functionActivity");
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+static bool onButtonClick_CancelButton(ZKButton *pButton) {
|
|
|
+ LOGD(" ButtonClick CancelButton !!!\n");
|
|
|
+
|
|
|
+ TcpModel tcpModel;
|
|
|
+ tcpModel.type = TcpType::EVENT;
|
|
|
+ tcpModel.action = EventAction::CANCEL;
|
|
|
+ tcpModel.from_id = std::stoi(_functionTransmitDeviceId);
|
|
|
+ tcpModel.data = _functionText;
|
|
|
+ tcpModel.tid = base::format("t%d",TimeHelper::getCurrentTime());
|
|
|
+
|
|
|
+ std::string req = getTcpModelString(tcpModel);
|
|
|
+ LOGD("TCP DEVICE : %s",req.c_str());
|
|
|
+
|
|
|
+ TcpClient::instance()->sendMsg(req.c_str());
|
|
|
+
|
|
|
+
|
|
|
+ mediaPlayer.Play(CONFIGMANAGER->getResFilePath("response.wav"), "", 1000,
|
|
|
+ base::MediaPlayer::PlayMode::Default);
|
|
|
+
|
|
|
+ mEventHandleWindowPtr->hideWnd();
|
|
|
+ EASYUICONTEXT->closeActivity("functionActivity");
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+static bool onButtonClick_HandleConfirmButton(ZKButton *pButton) {
|
|
|
+ LOGD(" ButtonClick HandleConfirmButton !!!\n");
|
|
|
+ if (_functionWindows == "customerAffair") {
|
|
|
+ doCutsomerAffair(1);
|
|
|
+ mHandleWindowPtr->hideWnd();
|
|
|
+ EASYUICONTEXT->closeActivity("functionActivity");
|
|
|
+ }
|
|
|
+ else if (_functionWindows == "nursingEnd2") {
|
|
|
+ setNursing2(false);
|
|
|
+ mHandleWindowPtr->hideWnd();
|
|
|
+ EASYUICONTEXT->closeActivity("functionActivity");
|
|
|
+
|
|
|
+ mediaPlayer.Play(CONFIGMANAGER->getResFilePath("response.wav"), "", 1000,
|
|
|
+ base::MediaPlayer::PlayMode::Default);
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
+static bool onButtonClick_HandleBackButton(ZKButton *pButton) {
|
|
|
+ LOGD(" ButtonClick HandleBackButton !!!\n");
|
|
|
+ if (_functionWindows == "customerAffair") {
|
|
|
+ mHandleWindowPtr->hideWnd();
|
|
|
+ EASYUICONTEXT->closeActivity("functionActivity");
|
|
|
+
|
|
|
+ }
|
|
|
+ else if (_functionWindows == "nursingEnd2") {
|
|
|
+ mHandleWindowPtr->hideWnd();
|
|
|
+ EASYUICONTEXT->closeActivity("functionActivity");
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|