|
@@ -1,6 +1,8 @@
|
|
|
#pragma once
|
|
|
#include "uart/ProtocolSender.h"
|
|
|
#include "service/BusinessConfig.h"
|
|
|
+#include "voip/media_player.h"
|
|
|
+#include "manager/ConfigManager.h"
|
|
|
|
|
|
#include <sys/reboot.h>
|
|
|
/*
|
|
@@ -40,8 +42,12 @@ static string _functionWindows;
|
|
|
static string _functionText;
|
|
|
static string _nursingText;
|
|
|
static string _warnText;
|
|
|
+static string _goActivity;
|
|
|
+
|
|
|
+static base::MediaPlayer mediaPlayer;
|
|
|
+
|
|
|
+#define FUNCTION_TIMER_HANDLE 3 // 增援的定时器id
|
|
|
|
|
|
-#define HELP_TIMER_HANDLE 3 // 增援的定时器id
|
|
|
|
|
|
|
|
|
static void callBed() {
|
|
@@ -73,7 +79,7 @@ static void help() {
|
|
|
mFunctionButtonPtr->setText(LANGUAGEMANAGER->getValue("Confirm"));
|
|
|
mFunctionWindowPtr->showWnd();
|
|
|
|
|
|
- mActivityPtr->registerUserTimer(HELP_TIMER_HANDLE, 30 * 1000); // 30秒
|
|
|
+ mActivityPtr->registerUserTimer(FUNCTION_TIMER_HANDLE, 30 * 1000); // 30秒
|
|
|
}
|
|
|
|
|
|
static void helpResopnse() {
|
|
@@ -84,18 +90,14 @@ static void helpResopnse() {
|
|
|
mFunctionButtonPtr->setText(LANGUAGEMANAGER->getValue("Confirm"));
|
|
|
mFunctionWindowPtr->showWnd();
|
|
|
|
|
|
- mActivityPtr->registerUserTimer(HELP_TIMER_HANDLE, 30 * 1000); // 30秒
|
|
|
+ mActivityPtr->registerUserTimer(FUNCTION_TIMER_HANDLE, 30 * 1000); // 30秒
|
|
|
}
|
|
|
|
|
|
-void helpResopnseFoFunctionActivity() {
|
|
|
+void toFunctionActivity(std::string data) {
|
|
|
if (_functionWindows == "help") {
|
|
|
- mIconPainterPtr->setBackgroundPic("icon/xiangy.png");
|
|
|
- mFunctionTextViewPtr->setText(LANGUAGEMANAGER->getValue("HelpResponse"));
|
|
|
- mStateTextViewPtr->setVisible(false);
|
|
|
- mFunctionButtonPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "button/elliptic_yellow.png");
|
|
|
- mFunctionButtonPtr->setText(LANGUAGEMANAGER->getValue("Confirm"));
|
|
|
-
|
|
|
- mActivityPtr->registerUserTimer(HELP_TIMER_HANDLE, 30 * 1000); // 30秒
|
|
|
+ helpResopnse();
|
|
|
+ mediaPlayer.Play(CONFIGMANAGER->getResFilePath("response.wav"), "", 1000,
|
|
|
+ base::MediaPlayer::PlayMode::Default);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -105,12 +107,14 @@ void warn(string warnText) {
|
|
|
}
|
|
|
|
|
|
void position(string functionText) {
|
|
|
- mIconPainterPtr->setBackgroundPic("icon/chenggong.png");
|
|
|
+ mIconPainterPtr->setBackgroundPic("icon/chenggong_y.png");
|
|
|
mFunctionTextViewPtr->setText(LANGUAGEMANAGER->getValue("PostitionedMsg") + functionText);
|
|
|
mStateTextViewPtr->setVisible(false);
|
|
|
mFunctionButtonPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "button/elliptic_yellow.png");
|
|
|
mFunctionButtonPtr->setText(LANGUAGEMANAGER->getValue("Confirm"));
|
|
|
mFunctionWindowPtr->showWnd();
|
|
|
+
|
|
|
+ mActivityPtr->registerUserTimer(FUNCTION_TIMER_HANDLE, 30 * 1000); // 30秒
|
|
|
}
|
|
|
|
|
|
void roomPatrol(string functionText) {
|
|
@@ -120,8 +124,11 @@ void roomPatrol(string functionText) {
|
|
|
mFunctionButtonPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "button/elliptic_green.png");
|
|
|
mFunctionButtonPtr->setText(LANGUAGEMANAGER->getValue("Confirm"));
|
|
|
mFunctionWindowPtr->showWnd();
|
|
|
+
|
|
|
+ mActivityPtr->registerUserTimer(FUNCTION_TIMER_HANDLE, 30 * 1000); // 30秒
|
|
|
}
|
|
|
|
|
|
+
|
|
|
void nursing(string functionText, string nursingText) {
|
|
|
mIconPainterPtr->setBackgroundPic("icon/huli2.png");
|
|
|
mFunctionTextViewPtr->setText(functionText);
|
|
@@ -191,24 +198,33 @@ static void onUI_intent(const Intent *intentPtr) {
|
|
|
}
|
|
|
else if (_functionWindows == "help") {
|
|
|
help();
|
|
|
+ mediaPlayer.Play(CONFIGMANAGER->getResFilePath("response.wav"), "", 1000,
|
|
|
+ base::MediaPlayer::PlayMode::Default);
|
|
|
}
|
|
|
else if (_functionWindows == "helpResonse") {
|
|
|
helpResopnse();
|
|
|
+ mediaPlayer.Play(CONFIGMANAGER->getResFilePath("response.wav"), "", 1000,
|
|
|
+ base::MediaPlayer::PlayMode::Default);
|
|
|
}
|
|
|
else if (_functionWindows == "warn") {
|
|
|
_warnText = intentPtr->getExtra(warnText);
|
|
|
warn(_warnText);
|
|
|
}
|
|
|
else if (_functionWindows == "logoutMedicalCare") {
|
|
|
+ _goActivity = intentPtr->getExtra(goActivity);
|
|
|
mLogoutWindowPtr->showWnd();
|
|
|
}
|
|
|
else if (_functionWindows == "position") {
|
|
|
_functionText = intentPtr->getExtra(functionText);
|
|
|
position(_functionText);
|
|
|
+ mediaPlayer.Play(CONFIGMANAGER->getResFilePath("response.wav"), "", 1000,
|
|
|
+ base::MediaPlayer::PlayMode::Default);
|
|
|
}
|
|
|
else if (_functionWindows == "roomPatrol") {
|
|
|
_functionText = intentPtr->getExtra(functionText);
|
|
|
roomPatrol(_functionText);
|
|
|
+ mediaPlayer.Play(CONFIGMANAGER->getResFilePath("response.wav"), "", 1000,
|
|
|
+ base::MediaPlayer::PlayMode::Default);
|
|
|
}
|
|
|
else if (_functionWindows == "nursing") {
|
|
|
_functionText = intentPtr->getExtra(functionText);
|
|
@@ -269,7 +285,7 @@ static void onProtocolDataUpdate(const SProtocolData &data) {
|
|
|
*/
|
|
|
static bool onUI_Timer(int id){
|
|
|
switch (id) {
|
|
|
- case HELP_TIMER_HANDLE:
|
|
|
+ case FUNCTION_TIMER_HANDLE:
|
|
|
mFunctionWindowPtr->hideWnd();
|
|
|
EASYUICONTEXT->closeActivity("functionActivity");
|
|
|
return false;
|
|
@@ -383,8 +399,12 @@ static bool onButtonClick_backButton(ZKButton *pButton) {
|
|
|
}
|
|
|
static bool onButtonClick_FunctionButton(ZKButton *pButton) {
|
|
|
LOGD(" ButtonClick FunctionButton !!!\n");
|
|
|
- if (_functionWindows == "help" || _functionWindows == "helpResonse") {
|
|
|
- mActivityPtr->unregisterUserTimer(HELP_TIMER_HANDLE);
|
|
|
+ if (_functionWindows == "help" ||
|
|
|
+ _functionWindows == "helpResonse" ||
|
|
|
+ _functionWindows == "position" ||
|
|
|
+ _functionWindows == "roomPatrol"
|
|
|
+ ) {
|
|
|
+ mActivityPtr->unregisterUserTimer(FUNCTION_TIMER_HANDLE);
|
|
|
}
|
|
|
else if (_functionWindows == "nursing") {
|
|
|
setNursing(true);
|
|
@@ -400,6 +420,12 @@ static bool onButtonClick_ConfirmLogoutButton(ZKButton *pButton) {
|
|
|
LOGD(" ButtonClick ConfirmLogoutButton !!!\n");
|
|
|
logoutMedicalCare();
|
|
|
EASYUICONTEXT->closeActivity("functionActivity");
|
|
|
+ if (_goActivity == "home") {
|
|
|
+ goHome();
|
|
|
+ }
|
|
|
+ else if (_goActivity == "more") {
|
|
|
+ goMore();
|
|
|
+ }
|
|
|
return false;
|
|
|
}
|
|
|
|