Browse Source

开发主题选择,暂存

vothin 1 year ago
parent
commit
931da78af5
43 changed files with 301 additions and 7 deletions
  1. 9 0
      i18n/zh_CN.tr
  2. 24 0
      jni/activity/functionActivity.cpp
  3. 7 0
      jni/activity/functionActivity.h
  4. 25 0
      jni/activity/settingActivity.cpp
  5. 7 0
      jni/activity/settingActivity.h
  6. 166 5
      jni/logic/functionLogic.cc
  7. 18 0
      jni/logic/mainLogic.cc
  8. 36 2
      jni/logic/settingLogic.cc
  9. 1 0
      jni/net/tcp_model.h
  10. 8 0
      jni/service/BusinessConfig.h
  11. BIN
      libs/armeabi/libzkgui.so
  12. BIN
      obj/activity/functionActivity.o
  13. BIN
      obj/activity/mainActivity.o
  14. BIN
      obj/activity/settingActivity.o
  15. BIN
      obj/service/time.o
  16. BIN
      resources/button/back_pink.png
  17. BIN
      resources/button/back_white_pink.png
  18. BIN
      resources/button/elliptic_pink.png
  19. BIN
      resources/button/elliptic_pink2.png
  20. BIN
      resources/button/elliptic_pink_100x35.png
  21. BIN
      resources/button/elliptic_pink_383x52.png
  22. BIN
      resources/button/elliptic_pink_491x61.png
  23. BIN
      resources/button/square_pink.png
  24. BIN
      resources/deviceInfo/saom-pink.png
  25. BIN
      resources/deviceInfo/shbei-pink.png
  26. BIN
      resources/deviceInfo/xinxi-pink.png
  27. BIN
      resources/function/chooseBed-pink.png
  28. BIN
      resources/function/chuangwei-pink.png
  29. BIN
      resources/function/dianhua-pink.png
  30. BIN
      resources/function/input-pink.png
  31. BIN
      resources/icon/chenggong-pink.png
  32. BIN
      resources/icon/chuang-l-pink.png
  33. BIN
      resources/icon/fang-pink.png
  34. BIN
      resources/medicalCare/dianhua-pink.png
  35. BIN
      resources/medicalCare/nfc-pink.png
  36. BIN
      resources/medicalCare/tishi-pink.png
  37. BIN
      resources/medicalCare/yanz-pink.png
  38. BIN
      resources/prompt/customInput-pink.png
  39. BIN
      resources/prompt/pink_150x48.png
  40. BIN
      resources/prompt/pink_270x48.png
  41. BIN
      resources/prompt/prompt-bg-pink.png
  42. BIN
      ui/function.ftu
  43. BIN
      ui/setting.ftu

+ 9 - 0
i18n/zh_CN.tr

@@ -84,6 +84,12 @@
     <string name="PostitionedMsg">已定位当前位置:</string>
     <string name="RoomPatrolMsg">已巡房:</string>
 	<string name="PromptQuit">提示语已结束</string>
+	<string name="RebootDevice">重启本机</string>
+    <string name="RebootPower">重启本机电源</string>
+    <string name="RebootLine">重启线路电源</string>
+	<string name="ThemeBlue">是否将主题颜色切换成蓝色</string>
+    <string name="ThemeRed">是否主题颜色切换成红色</string>
+    <string name="ThemeConfirm">确认切换主题颜色后,本机会重启</string>
     <!-- 医护界面 -->
     <string name="MedicalLoginMsg">请输入正确的密码,进入医护功能</string>
     <string name="InputMedicalPassword">输入密码进入医护</string>
@@ -169,6 +175,9 @@
     <string name="SettingText">设备设置</string>
     <string name="IsLight">是否常亮</string>
     <string name="IsVolume">开启音量控制</string>
+    <string name="ThemeChoice">选择主题颜色</string>
+    <string name="Blue">蓝</string>
+    <string name="Red">红</string>
     <!-- 测试界面 -->
     <string name="DebugText">设备调试</string>
     <string name="InputSip">请输入目标SIP账号</string>

+ 24 - 0
jni/activity/functionActivity.cpp

@@ -4,6 +4,13 @@
 #include "functionActivity.h"
 
 /*TAG:GlobalVariable全局变量*/
+static ZKButton* mRebootLineButtonPtr;
+static ZKTextView* mRebootLineTextViewPtr;
+static ZKButton* mRebootPowerButtonPtr;
+static ZKButton* mRebootDeviceButtonPtr;
+static ZKTextView* mRebootPowerTextViewPtr;
+static ZKTextView* mRebootDeviceTextViewPtr;
+static ZKWindow* mRebootWindowPtr;
 static ZKButton* mServerCancelButtonPtr;
 static ZKButton* mServerConfirmButtonPtr;
 static ZKTextView* mServerPromptTextViewPtr;
@@ -76,6 +83,9 @@ typedef struct {
 
 /*TAG:ButtonCallbackTab按键映射表*/
 static S_ButtonCallback sButtonCallbackTab[] = {
+    ID_FUNCTION_RebootLineButton, onButtonClick_RebootLineButton,
+    ID_FUNCTION_RebootPowerButton, onButtonClick_RebootPowerButton,
+    ID_FUNCTION_RebootDeviceButton, onButtonClick_RebootDeviceButton,
     ID_FUNCTION_ServerCancelButton, onButtonClick_ServerCancelButton,
     ID_FUNCTION_ServerConfirmButton, onButtonClick_ServerConfirmButton,
     ID_FUNCTION_PwdBackButton, onButtonClick_PwdBackButton,
@@ -162,6 +172,13 @@ functionActivity::~functionActivity() {
     unregisterProtocolDataUpdateListener(onProtocolDataUpdate);
     onUI_quit();
     mActivityPtr = NULL;
+    mRebootLineButtonPtr = NULL;
+    mRebootLineTextViewPtr = NULL;
+    mRebootPowerButtonPtr = NULL;
+    mRebootDeviceButtonPtr = NULL;
+    mRebootPowerTextViewPtr = NULL;
+    mRebootDeviceTextViewPtr = NULL;
+    mRebootWindowPtr = NULL;
     mServerCancelButtonPtr = NULL;
     mServerConfirmButtonPtr = NULL;
     mServerPromptTextViewPtr = NULL;
@@ -206,6 +223,13 @@ const char* functionActivity::getAppName() const{
 //TAG:onCreate
 void functionActivity::onCreate() {
 	Activity::onCreate();
+    mRebootLineButtonPtr = (ZKButton*)findControlByID(ID_FUNCTION_RebootLineButton);
+    mRebootLineTextViewPtr = (ZKTextView*)findControlByID(ID_FUNCTION_RebootLineTextView);
+    mRebootPowerButtonPtr = (ZKButton*)findControlByID(ID_FUNCTION_RebootPowerButton);
+    mRebootDeviceButtonPtr = (ZKButton*)findControlByID(ID_FUNCTION_RebootDeviceButton);
+    mRebootPowerTextViewPtr = (ZKTextView*)findControlByID(ID_FUNCTION_RebootPowerTextView);
+    mRebootDeviceTextViewPtr = (ZKTextView*)findControlByID(ID_FUNCTION_RebootDeviceTextView);
+    mRebootWindowPtr = (ZKWindow*)findControlByID(ID_FUNCTION_RebootWindow);
     mServerCancelButtonPtr = (ZKButton*)findControlByID(ID_FUNCTION_ServerCancelButton);
     mServerConfirmButtonPtr = (ZKButton*)findControlByID(ID_FUNCTION_ServerConfirmButton);
     mServerPromptTextViewPtr = (ZKTextView*)findControlByID(ID_FUNCTION_ServerPromptTextView);

+ 7 - 0
jni/activity/functionActivity.h

@@ -27,6 +27,13 @@
 #include "window/ZKSlideWindow.h"
 
 /*TAG:Macro宏ID*/
+#define ID_FUNCTION_RebootLineButton    20013
+#define ID_FUNCTION_RebootLineTextView    50012
+#define ID_FUNCTION_RebootPowerButton    20012
+#define ID_FUNCTION_RebootDeviceButton    20011
+#define ID_FUNCTION_RebootPowerTextView    50011
+#define ID_FUNCTION_RebootDeviceTextView    50010
+#define ID_FUNCTION_RebootWindow    110007
 #define ID_FUNCTION_ServerCancelButton    20010
 #define ID_FUNCTION_ServerConfirmButton    20009
 #define ID_FUNCTION_ServerPromptTextView    50009

+ 25 - 0
jni/activity/settingActivity.cpp

@@ -4,6 +4,8 @@
 #include "settingActivity.h"
 
 /*TAG:GlobalVariable全局变量*/
+static ZKRadioGroup* mThemeRadioGroupPtr;
+static ZKTextView* mThemeTextViewPtr;
 static ZKCheckBox* mVolumeCheckboxPtr;
 static ZKTextView* mVolumeTextViewPtr;
 static ZKTextView* mTitleTextViewPtr;
@@ -121,6 +123,16 @@ static S_CheckboxCallback SCheckboxCallbackTab[] = {
     ID_SETTING_LightCheckbox, onCheckedChanged_LightCheckbox,
 };
 
+typedef void (*RadioGroupCallback)(ZKRadioGroup*, int);
+typedef struct {
+  int id;
+  RadioGroupCallback onCheckedChanged;
+}S_RadioGroupCallback;
+/*TAG:RadioGroupCallbackTab*/
+static S_RadioGroupCallback SRadioGroupCallbackTab[] = {
+    ID_SETTING_ThemeRadioGroup, onCheckedChanged_ThemeRadioGroup,
+};
+
 settingActivity::settingActivity() {
 	//todo add init code here
 	mVideoLoopIndex = -1;
@@ -134,6 +146,8 @@ settingActivity::~settingActivity() {
     unregisterProtocolDataUpdateListener(onProtocolDataUpdate);
     onUI_quit();
     mActivityPtr = NULL;
+    mThemeRadioGroupPtr = NULL;
+    mThemeTextViewPtr = NULL;
     mVolumeCheckboxPtr = NULL;
     mVolumeTextViewPtr = NULL;
     mTitleTextViewPtr = NULL;
@@ -151,6 +165,8 @@ const char* settingActivity::getAppName() const{
 //TAG:onCreate
 void settingActivity::onCreate() {
 	Activity::onCreate();
+    mThemeRadioGroupPtr = (ZKRadioGroup*)findControlByID(ID_SETTING_ThemeRadioGroup);if(mThemeRadioGroupPtr!= NULL){mThemeRadioGroupPtr->setCheckedChangeListener(this);}
+    mThemeTextViewPtr = (ZKTextView*)findControlByID(ID_SETTING_ThemeTextView);
     mVolumeCheckboxPtr = (ZKCheckBox*)findControlByID(ID_SETTING_VolumeCheckbox);if(mVolumeCheckboxPtr!= NULL){mVolumeCheckboxPtr->setCheckedChangeListener(this);}
     mVolumeTextViewPtr = (ZKTextView*)findControlByID(ID_SETTING_VolumeTextView);
     mTitleTextViewPtr = (ZKTextView*)findControlByID(ID_SETTING_TitleTextView);
@@ -437,4 +453,13 @@ void settingActivity::onCheckedChanged(ZKCheckBox* pCheckBox, bool isChecked) {
             break;
         }
     }
+}
+void settingActivity::onCheckedChanged(ZKRadioGroup* pRadioGroup, int checkedID) {
+    int tablen = sizeof(SRadioGroupCallbackTab) / sizeof(S_RadioGroupCallback);
+    for (int i = 0; i < tablen; ++i) {
+        if (SRadioGroupCallbackTab[i].id == pRadioGroup->getID()) {
+        	SRadioGroupCallbackTab[i].onCheckedChanged(pRadioGroup, checkedID);
+            break;
+        }
+    }
 }

+ 7 - 0
jni/activity/settingActivity.h

@@ -25,9 +25,14 @@
 #include "control/ZKEditText.h"
 #include "control/ZKVideoView.h"
 #include "control/ZKCheckbox.h"
+#include "control/ZKRadioGroup.h"
 #include "window/ZKSlideWindow.h"
 
 /*TAG:Macro宏ID*/
+#define ID_SETTING_ThemeRadioButton2    22002
+#define ID_SETTING_ThemeRadioButton1    22001
+#define ID_SETTING_ThemeRadioGroup    94001
+#define ID_SETTING_ThemeTextView    50004
 #define ID_SETTING_VolumeCheckbox    21002
 #define ID_SETTING_VolumeTextView    50003
 #define ID_SETTING_TitleTextView    50002
@@ -44,6 +49,7 @@ class settingActivity : public Activity,
                      public ZKListView::AbsListAdapter,
                      public ZKSlideWindow::ISlideItemClickListener,
                      public EasyUIContext::ITouchListener,
+                     public ZKRadioGroup::ICheckedChangeListener,
                      public ZKCheckBox::ICheckedChangeListener,
                      public ZKEditText::ITextChangeListener,
                      public ZKVideoView::IVideoPlayerMessageListener
@@ -84,6 +90,7 @@ protected:
     virtual void onSlideItemClick(ZKSlideWindow *pSlideWindow, int index);
 
     virtual bool onTouchEvent(const MotionEvent &ev);
+    virtual void onCheckedChanged(ZKRadioGroup* pRadioGroup, int checkedID);
     virtual void onCheckedChanged(ZKCheckBox* pCheckBox, bool isChecked);
 
     virtual void onTextChanged(ZKTextView *pTextView, const string &text);

+ 166 - 5
jni/logic/functionLogic.cc

@@ -43,10 +43,59 @@ static string _functionText;
 static string _nursingText;
 static string _warnText;
 static string _goActivity;
+static int functionThemeInt = defaultThemeInt;
+static uint32_t functionColor = buleDeepColour;
+static bool isNetreset = false;
+static int netresetInt = 0;
 
 static base::MediaPlayer mediaPlayer;
 
-#define FUNCTION_TIMER_HANDLE 3	// 增援的定时器id
+#define FUNCTION_TIMER_HANDLE 3	// 功能模块的定时器id
+#define NETRESET_TIMER_HANDLE 101
+
+void setFunctionTheme() {
+    functionThemeInt = StoragePreferences::getInt(STORE_THEME, defaultThemeInt);
+    if (functionThemeInt == 1) {
+        mCallBedPicPainterPtr->setBackgroundPic("/function/chuangwei.png");
+        mConfirmCallButtonPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "button/elliptic_bule.png");
+        mConfirmLogoutButtonPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "button/elliptic_bule2.png");
+        mLogoutPicPainterPtr->setBackgroundPic("/medicalCare/dianhua.png");
+        mPwdPainterPtr->setBackgroundPic("/medicalCare/dianhua.png");
+        mPwdEditTextPtr->setBackgroundPic("/function/input.png");
+        mPwdConfirmButtonPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "button/elliptic_bule2.png");
+        mServerPainterPtr->setBackgroundPic("/medicalCare/dianhua.png");
+        mServerIpEditTextPtr->setBackgroundPic("/function/input.png");
+        mServerPortEditTextPtr->setBackgroundPic("/function/input.png");
+        mServerConfirmButtonPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "button/elliptic_bule2.png");
+        mRebootPowerButtonPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "button/elliptic_bule2.png");
+        mRebootDeviceButtonPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "button/elliptic_bule2.png");
+        mRebootLineButtonPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "button/elliptic_bule2.png");
+
+
+
+        functionColor = buleDeepColour;
+    }
+    else if (functionThemeInt == 2) {
+        mCallBedPicPainterPtr->setBackgroundPic("/function/chuangwei-pink.png");
+        mConfirmCallButtonPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "button/elliptic_pink.png");
+        mConfirmLogoutButtonPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "button/elliptic_pink2.png");
+        mLogoutPicPainterPtr->setBackgroundPic("/medicalCare/dianhua-pink.png");
+        mPwdPainterPtr->setBackgroundPic("/medicalCare/dianhua-pink.png");
+        mPwdEditTextPtr->setBackgroundPic("/function/input-pink.png");
+        mPwdConfirmButtonPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "button/elliptic_pink2.png");
+        mServerPainterPtr->setBackgroundPic("/medicalCare/dianhua-pink.png");
+        mServerIpEditTextPtr->setBackgroundPic("/function/input-pink.png");
+        mServerPortEditTextPtr->setBackgroundPic("/function/input-pink.png");
+        mServerConfirmButtonPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "button/elliptic_pink2.png");
+        mRebootPowerButtonPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "button/elliptic_pink2.png");
+        mRebootDeviceButtonPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "button/elliptic_pink2.png");
+        mRebootLineButtonPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "button/elliptic_pink2.png");
+//
+
+        functionColor = redDeepColour;
+    }
+
+}
 
 
 
@@ -72,10 +121,16 @@ static void callBed() {
 
 
 static void help() {
-	mIconPainterPtr->setBackgroundPic("icon/zengyuan2.png");
+    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(LANGUAGEMANAGER->getValue("HelpInfo"));
 	mStateTextViewPtr->setVisible(false);
-	mFunctionButtonPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "button/elliptic_bule2.png");
 	mFunctionButtonPtr->setText(LANGUAGEMANAGER->getValue("Confirm"));
 	mFunctionWindowPtr->showWnd();
 
@@ -134,7 +189,7 @@ void nursing(string functionText, string nursingText) {
 	mFunctionTextViewPtr->setText(functionText);
 	mStateTextViewPtr->setVisible(true);
 	mStateTextViewPtr->setText(nursingText + " " + LANGUAGEMANAGER->getValue("SetNursingMsg"));
-	mFunctionButtonPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "button/elliptic_pink.png");
+    mFunctionButtonPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "button/elliptic_pink2.png");
 	mFunctionButtonPtr->setText(LANGUAGEMANAGER->getValue("Nursing"));
 	mFunctionWindowPtr->showWnd();
 }
@@ -162,6 +217,27 @@ void pwdWindowInfo() {
 	mPwdPromptTextViewPtr->setTextColor(0xFF000000);
 }
 
+void theme(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");
+	}
+	if (functionText == "蓝色") {
+		mFunctionTextViewPtr->setText(LANGUAGEMANAGER->getValue("ThemeBlue"));
+	}
+	else if (functionText == "红色") {
+		mFunctionTextViewPtr->setText(LANGUAGEMANAGER->getValue("ThemeRed"));
+	}
+	mStateTextViewPtr->setVisible(true);
+	mStateTextViewPtr->setText(LANGUAGEMANAGER->getValue("ThemeConfirm"));
+	mFunctionButtonPtr->setText(LANGUAGEMANAGER->getValue("Confirm"));
+	mFunctionWindowPtr->showWnd();
+}
+
 
 
 
@@ -237,9 +313,14 @@ static void onUI_intent(const Intent *intentPtr) {
 		}
 		else if (_functionWindows == "serverChange" ||
 				_functionWindows == "setting" ||
-				_functionWindows == "init") {
+				_functionWindows == "init" ||
+				_functionWindows == "reboot") {
 			pwdWindowInfo();
 		}
+		else if (_functionWindows == "theme") {
+			_functionText = intentPtr->getExtra(functionText);
+			theme(_functionText);
+		}
     }
 }
 
@@ -247,6 +328,9 @@ static void onUI_intent(const Intent *intentPtr) {
  * 当界面显示时触发
  */
 static void onUI_show() {
+    EASYUICONTEXT->hideStatusBar();
+    EASYUICONTEXT->hideNaviBar();
+    setFunctionTheme();
 }
 
 /*
@@ -290,6 +374,16 @@ static bool onUI_Timer(int id){
 			EASYUICONTEXT->closeActivity("functionActivity");
 			return false;
 			break;
+		case NETRESET_TIMER_HANDLE:
+			netresetInt += 1;
+		    lightControl("NETRESET", "1F");
+
+		    if (netresetInt == 15) {
+		    	//重启
+		    	sync();
+		    	reboot(RB_AUTOBOOT);
+		    }
+			break;
 		default:
 			break;
 	}
@@ -330,6 +424,13 @@ static int getListItemCount_CallBedListView(const ZKListView *pListView) {
 
 static void obtainListItemData_CallBedListView(ZKListView *pListView,ZKListView::ZKListItem *pListItem, int index) {
     //LOGD(" obtainListItemData_ CallBedListView  !!!\n");
+	if (functionThemeInt == 1) {
+		pListItem->setButtonStatusPic(ZK_CONTROL_STATUS_SELECTED, "/function/chooseBed.png");
+	}
+	else if (functionThemeInt == 2) {
+		pListItem->setButtonStatusPic(ZK_CONTROL_STATUS_SELECTED, "/function/chooseBed-pink.png");
+	}
+	pListItem->setTextStatusColor(ZK_CONTROL_STATUS_SELECTED, functionColor);
 
 	if (bedList.size() > 0) {
 		string frameBedName = bedList[index]["frame_bed"]["full_name"].asString();
@@ -412,6 +513,16 @@ static bool onButtonClick_FunctionButton(ZKButton *pButton) {
     else if (_functionWindows == "nursingEnd") {
     	setNursing(false);
     }
+    else if (_functionWindows == "theme") {
+    	if (_functionText == "蓝色") {
+            StoragePreferences::putInt(STORE_THEME, 1);
+    	}
+    	else if (_functionText == "红色") {
+            StoragePreferences::putInt(STORE_THEME, 2);
+    	}
+		sync();
+		reboot(RB_AUTOBOOT);
+    }
 
 	EASYUICONTEXT->closeActivity("functionActivity");
     return false;
@@ -500,6 +611,20 @@ static bool onButtonClick_PwdConfirmButton(ZKButton *pButton) {
 			mPwdPromptTextViewPtr->setTextColor(0xFFFF0000);
 		}
 	}
+	else if (_functionWindows == "reboot") {
+
+		// 密码为888
+		string cpwd = "888";
+		if (pwd == cpwd){
+			// 关闭密码输入界面
+			mPwdWindowPtr->hideWnd();
+			// 打开初始化界面
+			mRebootWindowPtr->showWnd();
+		} else {
+			mPwdPromptTextViewPtr->setTextTr("PasswordWrong");
+			mPwdPromptTextViewPtr->setTextColor(0xFFFF0000);
+		}
+	}
     return false;
 }
 
@@ -551,3 +676,39 @@ static bool onButtonClick_ServerCancelButton(ZKButton *pButton) {
 	EASYUICONTEXT->closeActivity("functionActivity");
     return false;
 }
+static bool onButtonClick_RebootDeviceButton(ZKButton *pButton) {
+    LOGD(" ButtonClick RebootDeviceButton !!!\n");
+	const char* req = "-1";
+	TcpClient::instance()->sendMsg(req);
+
+    lightControl("CALLLED", "000F");
+	//重启
+	sync();
+	reboot(RB_AUTOBOOT);
+    return false;
+}
+
+static bool onButtonClick_RebootPowerButton(ZKButton *pButton) {
+    LOGD(" ButtonClick RebootPowerButton !!!\n");
+    if (!isNetreset) {
+    	isNetreset = true;
+        lightControl("CALLLED", "000F");
+    	mActivityPtr->registerUserTimer(NETRESET_TIMER_HANDLE, 1000);
+    }
+    return false;
+}
+
+static bool onButtonClick_RebootLineButton(ZKButton *pButton) {
+    LOGD(" ButtonClick RebootLineButton !!!\n");
+	TcpModel tcpModel;
+	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());
+
+    TcpClient::instance()->sendMsg(req.c_str());
+    return false;
+}

+ 18 - 0
jni/logic/mainLogic.cc

@@ -77,6 +77,24 @@ static int emptyBedCount = 0;
 #define SLEEP_STRAT_TIME_HANDLE 9	// 息屏
 
 
+void setMainTheme() {
+//    int themeInt = StoragePreferences::getInt(STORE_THEME, defaultThemeInt);
+//    LOGD("themeInt =====> %d", themeInt);
+//    if (themeInt == 1) {
+//        mRoomPainterPtr->setBackgroundPic("/main/roomBg.png");
+//        mRoomPrcPainterPtr->setBackgroundPic("/main/fang.png");
+//        mInBedNumTextViewPtr->setTextColor(buleDeepColour);
+//        mInBedPicPainterPtr->setBackgroundPic("/main/chuang-l.png");
+//    }
+//    else if (themeInt == 2) {
+//        mRoomPainterPtr->setBackgroundPic("/main/roomBg-pink.png");
+//        mRoomPrcPainterPtr->setBackgroundPic("/main/fang-pink.png");
+//        mInBedNumTextViewPtr->setTextColor(redDeepColour);
+//        mInBedPicPainterPtr->setBackgroundPic("/main/chuang-l-pink.png");
+//    }
+}
+
+
 
 static void getServerInfo(){
 

+ 36 - 2
jni/logic/settingLogic.cc

@@ -33,6 +33,18 @@
 * 在Eclipse编辑器中  使用 “alt + /”  快捷键可以打开智能提示
 */
 
+static int themeRadioButton = StoragePreferences::getInt(STORE_THEME, defaultThemeInt);
+
+void setSettingTheme() {
+    if (themeRadioButton == 1) {
+        msys_backPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "/button/back_bule.png");
+        mTestButtonPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "/button/elliptic_bule2.png");
+    }
+    else if (themeRadioButton == 2) {
+        msys_backPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "/button/back_pink.png");
+        mTestButtonPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "/button/elliptic_pink2.png");
+    }
+}
 
 /**
  * 注册定时器
@@ -49,8 +61,6 @@ static S_ACTIVITY_TIMEER REGISTER_ACTIVITY_TIMER_TAB[] = {
  */
 static void onUI_init(){
     //Tips :添加 UI初始化的显示代码到这里,如:mText1Ptr->setText("123");
-	mLightCheckboxPtr->setChecked(StoragePreferences::getBool(STORE_LIGHT, false));
-    mVolumeCheckboxPtr->setChecked(StoragePreferences::getBool(STORE_VOLUME, false));
 }
 
 /**
@@ -66,9 +76,14 @@ static void onUI_intent(const Intent *intentPtr) {
  * 当界面显示时触发
  */
 static void onUI_show() {
+	mLightCheckboxPtr->setChecked(StoragePreferences::getBool(STORE_LIGHT, false));
+    mVolumeCheckboxPtr->setChecked(StoragePreferences::getBool(STORE_VOLUME, false));
+
 	EASYUICONTEXT->hideNaviBar();
 	EASYUICONTEXT->hideStatusBar();
 
+	setSettingTheme();
+
 }
 
 /*
@@ -153,3 +168,22 @@ static void onCheckedChanged_VolumeCheckbox(ZKCheckBox* pCheckBox, bool isChecke
     LOGD(" Checkbox VolumeCheckbox checked %d", isChecked);
     StoragePreferences::putBool(STORE_VOLUME, isChecked);
 }
+static void onCheckedChanged_ThemeRadioGroup(ZKRadioGroup* pRadioGroup, int checkedID) {
+    LOGD(" RadioGroup ThemeRadioGroup checked %d", checkedID);
+    string themeStr = "蓝色";
+    switch (checkedID) {
+    case ID_SETTING_ThemeRadioButton1:
+        LOGD("选择蓝色");
+        themeStr = "蓝色";
+        break;
+    case ID_SETTING_ThemeRadioButton2:
+        LOGD("选择红色");
+        themeStr = "红色";
+        break;
+    }
+
+    Intent* intent = new Intent();
+    intent->putExtra(functionWindows, "theme");
+    intent->putExtra(functionText, themeStr);
+    EASYUICONTEXT->openActivity("functionActivity", intent);
+}

+ 1 - 0
jni/net/tcp_model.h

@@ -75,6 +75,7 @@ public:
 	inline static std::string DEVICE_REFRESH = "DEVICE_REFRESH";
 	inline static std::string SYSTEM_SETTING = "SYSTEM_SETTING";
 	inline static std::string SERVER_CHANGE = "SERVER_CHANGE";
+	inline static std::string POWER_RESET = "POWER_RESET";
 };
 
 class DataAction {

+ 8 - 0
jni/service/BusinessConfig.h

@@ -56,6 +56,7 @@
 
 #define STORE_LIGHT "light"
 #define STORE_VOLUME "volume"
+#define STORE_THEME "theme"
 
 #define SIGNAL_TYPE "TCP" //TCP,SIP
 
@@ -64,6 +65,13 @@
 
 #define STORE_MAC_ADDR "mac_addr"
 
+static uint32_t redLightColour = 0xFEB8BF;
+static uint32_t redDeepColour = 0xF78B8F;
+static uint32_t buleLightColour = 0x759FFF;
+static uint32_t buleDeepColour = 0x3A78EF;
+static uint32_t whiteColour = 0xFFFFFF;
+static int defaultThemeInt = 2;
+
 static std::string versionCode = "v2.0.3";
 static int versionNo = 38;
 static std::string serverIP = "172.28.100.100";

BIN
libs/armeabi/libzkgui.so


BIN
obj/activity/functionActivity.o


BIN
obj/activity/mainActivity.o


BIN
obj/activity/settingActivity.o


BIN
obj/service/time.o


BIN
resources/button/back_pink.png


BIN
resources/button/back_white_pink.png


BIN
resources/button/elliptic_pink.png


BIN
resources/button/elliptic_pink2.png


BIN
resources/button/elliptic_pink_100x35.png


BIN
resources/button/elliptic_pink_383x52.png


BIN
resources/button/elliptic_pink_491x61.png


BIN
resources/button/square_pink.png


BIN
resources/deviceInfo/saom-pink.png


BIN
resources/deviceInfo/shbei-pink.png


BIN
resources/deviceInfo/xinxi-pink.png


BIN
resources/function/chooseBed-pink.png


BIN
resources/function/chuangwei-pink.png


BIN
resources/function/dianhua-pink.png


BIN
resources/function/input-pink.png


BIN
resources/icon/chenggong-pink.png


BIN
resources/icon/chuang-l-pink.png


BIN
resources/icon/fang-pink.png


BIN
resources/medicalCare/dianhua-pink.png


BIN
resources/medicalCare/nfc-pink.png


BIN
resources/medicalCare/tishi-pink.png


BIN
resources/medicalCare/yanz-pink.png


BIN
resources/prompt/customInput-pink.png


BIN
resources/prompt/pink_150x48.png


BIN
resources/prompt/pink_270x48.png


BIN
resources/prompt/prompt-bg-pink.png


BIN
ui/function.ftu


BIN
ui/setting.ftu