Browse Source

升级版本为1.0.5,修改版本号显示

vothin 2 năm trước cách đây
mục cha
commit
6a987f58ef

+ 13 - 13
jni/activity/mainActivity.cpp

@@ -4,10 +4,10 @@
 #include "mainActivity.h"
 #include "mainActivity.h"
 
 
 /*TAG:GlobalVariable全局变量*/
 /*TAG:GlobalVariable全局变量*/
-static ZKButton* mErrorConfirmButtonPtr;
-static ZKTextView* mErrorTextViewPtr;
-static ZKPainter* mErrorPainterPtr;
-static ZKWindow* mErrorWinPtr;
+static ZKButton* mWarnConfirmButtonPtr;
+static ZKTextView* mWarnTextViewPtr;
+static ZKPainter* mWarnPainterPtr;
+static ZKWindow* mWarnWinPtr;
 static ZKButton* mCallBedCancelPtr;
 static ZKButton* mCallBedCancelPtr;
 static ZKListView* mCallBedListViewPtr;
 static ZKListView* mCallBedListViewPtr;
 static ZKPainter* mCallBedPainterPtr;
 static ZKPainter* mCallBedPainterPtr;
@@ -67,7 +67,7 @@ typedef struct {
 
 
 /*TAG:ButtonCallbackTab按键映射表*/
 /*TAG:ButtonCallbackTab按键映射表*/
 static S_ButtonCallback sButtonCallbackTab[] = {
 static S_ButtonCallback sButtonCallbackTab[] = {
-    ID_MAIN_ErrorConfirmButton, onButtonClick_ErrorConfirmButton,
+    ID_MAIN_WarnConfirmButton, onButtonClick_WarnConfirmButton,
     ID_MAIN_CallBedCancel, onButtonClick_CallBedCancel,
     ID_MAIN_CallBedCancel, onButtonClick_CallBedCancel,
     ID_MAIN_FunctionBack, onButtonClick_FunctionBack,
     ID_MAIN_FunctionBack, onButtonClick_FunctionBack,
     ID_MAIN_FunctionButton, onButtonClick_FunctionButton,
     ID_MAIN_FunctionButton, onButtonClick_FunctionButton,
@@ -150,10 +150,10 @@ mainActivity::~mainActivity() {
     EASYUICONTEXT->unregisterGlobalTouchListener(this);
     EASYUICONTEXT->unregisterGlobalTouchListener(this);
     onUI_quit();
     onUI_quit();
     unregisterProtocolDataUpdateListener(onProtocolDataUpdate);
     unregisterProtocolDataUpdateListener(onProtocolDataUpdate);
-    mErrorConfirmButtonPtr = NULL;
-    mErrorTextViewPtr = NULL;
-    mErrorPainterPtr = NULL;
-    mErrorWinPtr = NULL;
+    mWarnConfirmButtonPtr = NULL;
+    mWarnTextViewPtr = NULL;
+    mWarnPainterPtr = NULL;
+    mWarnWinPtr = NULL;
     mCallBedCancelPtr = NULL;
     mCallBedCancelPtr = NULL;
     mCallBedListViewPtr = NULL;
     mCallBedListViewPtr = NULL;
     mCallBedPainterPtr = NULL;
     mCallBedPainterPtr = NULL;
@@ -186,10 +186,10 @@ const char* mainActivity::getAppName() const{
 //TAG:onCreate
 //TAG:onCreate
 void mainActivity::onCreate() {
 void mainActivity::onCreate() {
 	Activity::onCreate();
 	Activity::onCreate();
-    mErrorConfirmButtonPtr = (ZKButton*)findControlByID(ID_MAIN_ErrorConfirmButton);
-    mErrorTextViewPtr = (ZKTextView*)findControlByID(ID_MAIN_ErrorTextView);
-    mErrorPainterPtr = (ZKPainter*)findControlByID(ID_MAIN_ErrorPainter);
-    mErrorWinPtr = (ZKWindow*)findControlByID(ID_MAIN_ErrorWin);
+    mWarnConfirmButtonPtr = (ZKButton*)findControlByID(ID_MAIN_WarnConfirmButton);
+    mWarnTextViewPtr = (ZKTextView*)findControlByID(ID_MAIN_WarnTextView);
+    mWarnPainterPtr = (ZKPainter*)findControlByID(ID_MAIN_WarnPainter);
+    mWarnWinPtr = (ZKWindow*)findControlByID(ID_MAIN_WarnWin);
     mCallBedCancelPtr = (ZKButton*)findControlByID(ID_MAIN_CallBedCancel);
     mCallBedCancelPtr = (ZKButton*)findControlByID(ID_MAIN_CallBedCancel);
     mCallBedListViewPtr = (ZKListView*)findControlByID(ID_MAIN_CallBedListView);if(mCallBedListViewPtr!= NULL){mCallBedListViewPtr->setListAdapter(this);mCallBedListViewPtr->setItemClickListener(this);}
     mCallBedListViewPtr = (ZKListView*)findControlByID(ID_MAIN_CallBedListView);if(mCallBedListViewPtr!= NULL){mCallBedListViewPtr->setListAdapter(this);mCallBedListViewPtr->setItemClickListener(this);}
     mCallBedPainterPtr = (ZKPainter*)findControlByID(ID_MAIN_CallBedPainter);
     mCallBedPainterPtr = (ZKPainter*)findControlByID(ID_MAIN_CallBedPainter);

+ 4 - 4
jni/activity/mainActivity.h

@@ -27,10 +27,10 @@
 #include "window/ZKSlideWindow.h"
 #include "window/ZKSlideWindow.h"
 
 
 /*TAG:Macro宏ID*/
 /*TAG:Macro宏ID*/
-#define ID_MAIN_ErrorConfirmButton    20010
-#define ID_MAIN_ErrorTextView    50002
-#define ID_MAIN_ErrorPainter    52003
-#define ID_MAIN_ErrorWin    110002
+#define ID_MAIN_WarnConfirmButton    20010
+#define ID_MAIN_WarnTextView    50002
+#define ID_MAIN_WarnPainter    52003
+#define ID_MAIN_WarnWin    110002
 #define ID_MAIN_CallBedBtn    24027
 #define ID_MAIN_CallBedBtn    24027
 #define ID_MAIN_CallBedName    24026
 #define ID_MAIN_CallBedName    24026
 #define ID_MAIN_CallBedCancel    20009
 #define ID_MAIN_CallBedCancel    20009

+ 0 - 422
jni/activity/testActivity.cpp

@@ -1,422 +0,0 @@
-/***********************************************
-/gen auto by zuitools
-***********************************************/
-#include "testActivity.h"
-
-/*TAG:GlobalVariable全局变量*/
-static ZKButton* mButton8Ptr;
-static ZKButton* mButton7Ptr;
-static ZKButton* mButton6Ptr;
-static ZKButton* mButton4Ptr;
-static ZKButton* mButton3Ptr;
-static ZKButton* mButton2Ptr;
-static ZKButton* mButton1Ptr;
-static testActivity* mActivityPtr;
-
-/*register activity*/
-REGISTER_ACTIVITY(testActivity);
-
-typedef struct {
-	int id; // 定时器ID , 不能重复
-	int time; // 定时器  时间间隔  单位 毫秒
-}S_ACTIVITY_TIMEER;
-
-#include "../logic/testLogic.cc"
-
-/***********/
-typedef struct {
-    int id;
-    const char *pApp;
-} SAppInfo;
-
-/**
- *点击跳转window
- */
-static SAppInfo sAppInfoTab[] = {
-//  { ID_TEST_TEXT, "TextViewActivity" },
-};
-
-/***************/
-typedef bool (*ButtonCallback)(ZKButton *pButton);
-/**
- * button onclick表
- */
-typedef struct {
-    int id;
-    ButtonCallback callback;
-}S_ButtonCallback;
-
-/*TAG:ButtonCallbackTab按键映射表*/
-static S_ButtonCallback sButtonCallbackTab[] = {
-    ID_TEST_Button8, onButtonClick_Button8,
-    ID_TEST_Button7, onButtonClick_Button7,
-    ID_TEST_Button6, onButtonClick_Button6,
-    ID_TEST_Button4, onButtonClick_Button4,
-    ID_TEST_Button3, onButtonClick_Button3,
-    ID_TEST_Button2, onButtonClick_Button2,
-    ID_TEST_Button1, onButtonClick_Button1,
-};
-/***************/
-
-
-typedef void (*SeekBarCallback)(ZKSeekBar *pSeekBar, int progress);
-typedef struct {
-    int id;
-    SeekBarCallback callback;
-}S_ZKSeekBarCallback;
-/*TAG:SeekBarCallbackTab*/
-static S_ZKSeekBarCallback SZKSeekBarCallbackTab[] = {
-};
-
-
-typedef int (*ListViewGetItemCountCallback)(const ZKListView *pListView);
-typedef void (*ListViewobtainListItemDataCallback)(ZKListView *pListView,ZKListView::ZKListItem *pListItem, int index);
-typedef void (*ListViewonItemClickCallback)(ZKListView *pListView, int index, int id);
-typedef struct {
-    int id;
-    ListViewGetItemCountCallback getListItemCountCallback;
-    ListViewobtainListItemDataCallback obtainListItemDataCallback;
-    ListViewonItemClickCallback onItemClickCallback;
-}S_ListViewFunctionsCallback;
-/*TAG:ListViewFunctionsCallback*/
-static S_ListViewFunctionsCallback SListViewFunctionsCallbackTab[] = {
-};
-
-
-typedef void (*SlideWindowItemClickCallback)(ZKSlideWindow *pSlideWindow, int index);
-typedef struct {
-    int id;
-    SlideWindowItemClickCallback onSlideItemClickCallback;
-}S_SlideWindowItemClickCallback;
-/*TAG:SlideWindowFunctionsCallbackTab*/
-static S_SlideWindowItemClickCallback SSlideWindowItemClickCallbackTab[] = {
-};
-
-
-typedef void (*EditTextInputCallback)(const std::string &text);
-typedef struct {
-    int id;
-    EditTextInputCallback onEditTextChangedCallback;
-}S_EditTextInputCallback;
-/*TAG:EditTextInputCallback*/
-static S_EditTextInputCallback SEditTextInputCallbackTab[] = {
-};
-
-typedef void (*VideoViewCallback)(ZKVideoView *pVideoView, int msg);
-typedef struct {
-    int id; //VideoView ID
-    bool loop; // 是否是轮播类型
-    int defaultvolume;//轮播类型时,默认视频音量
-    VideoViewCallback onVideoViewCallback;
-}S_VideoViewCallback;
-/*TAG:VideoViewCallback*/
-static S_VideoViewCallback SVideoViewCallbackTab[] = {
-};
-
-
-testActivity::testActivity() {
-	//todo add init code here
-	mVideoLoopIndex = -1;
-	mVideoLoopErrorCount = 0;
-}
-
-testActivity::~testActivity() {
-  //todo add init file here
-  // 退出应用时需要反注册
-    EASYUICONTEXT->unregisterGlobalTouchListener(this);
-    onUI_quit();
-    unregisterProtocolDataUpdateListener(onProtocolDataUpdate);
-    mButton8Ptr = NULL;
-    mButton7Ptr = NULL;
-    mButton6Ptr = NULL;
-    mButton4Ptr = NULL;
-    mButton3Ptr = NULL;
-    mButton2Ptr = NULL;
-    mButton1Ptr = NULL;
-    mActivityPtr = NULL;
-}
-
-const char* testActivity::getAppName() const{
-	return "test.ftu";
-}
-
-//TAG:onCreate
-void testActivity::onCreate() {
-	Activity::onCreate();
-    mButton8Ptr = (ZKButton*)findControlByID(ID_TEST_Button8);
-    mButton7Ptr = (ZKButton*)findControlByID(ID_TEST_Button7);
-    mButton6Ptr = (ZKButton*)findControlByID(ID_TEST_Button6);
-    mButton4Ptr = (ZKButton*)findControlByID(ID_TEST_Button4);
-    mButton3Ptr = (ZKButton*)findControlByID(ID_TEST_Button3);
-    mButton2Ptr = (ZKButton*)findControlByID(ID_TEST_Button2);
-    mButton1Ptr = (ZKButton*)findControlByID(ID_TEST_Button1);
-	mActivityPtr = this;
-	onUI_init();
-    registerProtocolDataUpdateListener(onProtocolDataUpdate); 
-    rigesterActivityTimer();
-}
-
-void testActivity::onClick(ZKBase *pBase) {
-	//TODO: add widget onClik code 
-    int buttonTablen = sizeof(sButtonCallbackTab) / sizeof(S_ButtonCallback);
-    for (int i = 0; i < buttonTablen; ++i) {
-        if (sButtonCallbackTab[i].id == pBase->getID()) {
-            if (sButtonCallbackTab[i].callback((ZKButton*)pBase)) {
-            	return;
-            }
-            break;
-        }
-    }
-
-
-    int len = sizeof(sAppInfoTab) / sizeof(sAppInfoTab[0]);
-    for (int i = 0; i < len; ++i) {
-        if (sAppInfoTab[i].id == pBase->getID()) {
-            EASYUICONTEXT->openActivity(sAppInfoTab[i].pApp);
-            return;
-        }
-    }
-
-	Activity::onClick(pBase);
-}
-
-void testActivity::onResume() {
-	Activity::onResume();
-	EASYUICONTEXT->registerGlobalTouchListener(this);
-	startVideoLoopPlayback();
-	onUI_show();
-}
-
-void testActivity::onPause() {
-	Activity::onPause();
-	EASYUICONTEXT->unregisterGlobalTouchListener(this);
-	stopVideoLoopPlayback();
-	onUI_hide();
-}
-
-void testActivity::onIntent(const Intent *intentPtr) {
-	Activity::onIntent(intentPtr);
-	onUI_intent(intentPtr);
-}
-
-bool testActivity::onTimer(int id) {
-	return onUI_Timer(id);
-}
-
-void testActivity::onProgressChanged(ZKSeekBar *pSeekBar, int progress){
-
-    int seekBarTablen = sizeof(SZKSeekBarCallbackTab) / sizeof(S_ZKSeekBarCallback);
-    for (int i = 0; i < seekBarTablen; ++i) {
-        if (SZKSeekBarCallbackTab[i].id == pSeekBar->getID()) {
-            SZKSeekBarCallbackTab[i].callback(pSeekBar, progress);
-            break;
-        }
-    }
-}
-
-int testActivity::getListItemCount(const ZKListView *pListView) const{
-    int tablen = sizeof(SListViewFunctionsCallbackTab) / sizeof(S_ListViewFunctionsCallback);
-    for (int i = 0; i < tablen; ++i) {
-        if (SListViewFunctionsCallbackTab[i].id == pListView->getID()) {
-            return SListViewFunctionsCallbackTab[i].getListItemCountCallback(pListView);
-            break;
-        }
-    }
-    return 0;
-}
-
-void testActivity::obtainListItemData(ZKListView *pListView,ZKListView::ZKListItem *pListItem, int index){
-    int tablen = sizeof(SListViewFunctionsCallbackTab) / sizeof(S_ListViewFunctionsCallback);
-    for (int i = 0; i < tablen; ++i) {
-        if (SListViewFunctionsCallbackTab[i].id == pListView->getID()) {
-            SListViewFunctionsCallbackTab[i].obtainListItemDataCallback(pListView, pListItem, index);
-            break;
-        }
-    }
-}
-
-void testActivity::onItemClick(ZKListView *pListView, int index, int id){
-    int tablen = sizeof(SListViewFunctionsCallbackTab) / sizeof(S_ListViewFunctionsCallback);
-    for (int i = 0; i < tablen; ++i) {
-        if (SListViewFunctionsCallbackTab[i].id == pListView->getID()) {
-            SListViewFunctionsCallbackTab[i].onItemClickCallback(pListView, index, id);
-            break;
-        }
-    }
-}
-
-void testActivity::onSlideItemClick(ZKSlideWindow *pSlideWindow, int index) {
-    int tablen = sizeof(SSlideWindowItemClickCallbackTab) / sizeof(S_SlideWindowItemClickCallback);
-    for (int i = 0; i < tablen; ++i) {
-        if (SSlideWindowItemClickCallbackTab[i].id == pSlideWindow->getID()) {
-            SSlideWindowItemClickCallbackTab[i].onSlideItemClickCallback(pSlideWindow, index);
-            break;
-        }
-    }
-}
-
-bool testActivity::onTouchEvent(const MotionEvent &ev) {
-    return ontestActivityTouchEvent(ev);
-}
-
-void testActivity::onTextChanged(ZKTextView *pTextView, const std::string &text) {
-    int tablen = sizeof(SEditTextInputCallbackTab) / sizeof(S_EditTextInputCallback);
-    for (int i = 0; i < tablen; ++i) {
-        if (SEditTextInputCallbackTab[i].id == pTextView->getID()) {
-            SEditTextInputCallbackTab[i].onEditTextChangedCallback(text);
-            break;
-        }
-    }
-}
-
-void testActivity::rigesterActivityTimer() {
-    int tablen = sizeof(REGISTER_ACTIVITY_TIMER_TAB) / sizeof(S_ACTIVITY_TIMEER);
-    for (int i = 0; i < tablen; ++i) {
-        S_ACTIVITY_TIMEER temp = REGISTER_ACTIVITY_TIMER_TAB[i];
-        registerTimer(temp.id, temp.time);
-    }
-}
-
-
-void testActivity::onVideoPlayerMessage(ZKVideoView *pVideoView, int msg) {
-    int tablen = sizeof(SVideoViewCallbackTab) / sizeof(S_VideoViewCallback);
-    for (int i = 0; i < tablen; ++i) {
-        if (SVideoViewCallbackTab[i].id == pVideoView->getID()) {
-        	if (SVideoViewCallbackTab[i].loop) {
-                //循环播放
-        		videoLoopPlayback(pVideoView, msg, i);
-        	} else if (SVideoViewCallbackTab[i].onVideoViewCallback != NULL){
-        	    SVideoViewCallbackTab[i].onVideoViewCallback(pVideoView, msg);
-        	}
-            break;
-        }
-    }
-}
-
-void testActivity::videoLoopPlayback(ZKVideoView *pVideoView, int msg, size_t callbackTabIndex) {
-
-	switch (msg) {
-	case ZKVideoView::E_MSGTYPE_VIDEO_PLAY_STARTED:
-		LOGD("ZKVideoView::E_MSGTYPE_VIDEO_PLAY_STARTED\n");
-    if (callbackTabIndex >= (sizeof(SVideoViewCallbackTab)/sizeof(S_VideoViewCallback))) {
-      break;
-    }
-		pVideoView->setVolume(SVideoViewCallbackTab[callbackTabIndex].defaultvolume / 10.0);
-		mVideoLoopErrorCount = 0;
-		break;
-	case ZKVideoView::E_MSGTYPE_VIDEO_PLAY_ERROR:
-		/**错误处理 */
-		++mVideoLoopErrorCount;
-		if (mVideoLoopErrorCount > 100) {
-			LOGD("video loop error counts > 100, quit loop playback !");
-            break;
-		} //不用break, 继续尝试播放下一个
-	case ZKVideoView::E_MSGTYPE_VIDEO_PLAY_COMPLETED:
-		LOGD("ZKVideoView::E_MSGTYPE_VIDEO_PLAY_COMPLETED\n");
-        std::vector<std::string> videolist;
-        std::string fileName(getAppName());
-        if (fileName.size() < 4) {
-             LOGD("getAppName size < 4, ignore!");
-             break;
-        }
-        fileName = fileName.substr(0, fileName.length() - 4) + "_video_list.txt";
-        fileName = "/mnt/extsd/" + fileName;
-        if (!parseVideoFileList(fileName.c_str(), videolist)) {
-            LOGD("parseVideoFileList failed !");
-		    break;
-        }
-		if (pVideoView && !videolist.empty()) {
-			mVideoLoopIndex = (mVideoLoopIndex + 1) % videolist.size();
-			pVideoView->play(videolist[mVideoLoopIndex].c_str());
-		}
-		break;
-	}
-}
-
-void testActivity::startVideoLoopPlayback() {
-    int tablen = sizeof(SVideoViewCallbackTab) / sizeof(S_VideoViewCallback);
-    for (int i = 0; i < tablen; ++i) {
-    	if (SVideoViewCallbackTab[i].loop) {
-    		ZKVideoView* videoView = (ZKVideoView*)findControlByID(SVideoViewCallbackTab[i].id);
-    		if (!videoView) {
-    			return;
-    		}
-    		//循环播放
-    		videoLoopPlayback(videoView, ZKVideoView::E_MSGTYPE_VIDEO_PLAY_COMPLETED, i);
-    		return;
-    	}
-    }
-}
-
-void testActivity::stopVideoLoopPlayback() {
-    int tablen = sizeof(SVideoViewCallbackTab) / sizeof(S_VideoViewCallback);
-    for (int i = 0; i < tablen; ++i) {
-    	if (SVideoViewCallbackTab[i].loop) {
-    		ZKVideoView* videoView = (ZKVideoView*)findControlByID(SVideoViewCallbackTab[i].id);
-    		if (!videoView) {
-    			return;
-    		}
-    		if (videoView->isPlaying()) {
-    		    videoView->stop();
-    		}
-    		return;
-    	}
-    }
-}
-
-bool testActivity::parseVideoFileList(const char *pFileListPath, std::vector<string>& mediaFileList) {
-	mediaFileList.clear();
-	if (NULL == pFileListPath || 0 == strlen(pFileListPath)) {
-        LOGD("video file list is null!");
-		return false;
-	}
-
-	ifstream is(pFileListPath, ios_base::in);
-	if (!is.is_open()) {
-		LOGD("cann't open file %s \n", pFileListPath);
-		return false;
-	}
-	char tmp[1024] = {0};
-	while (is.getline(tmp, sizeof(tmp))) {
-		string str = tmp;
-		removeCharFromString(str, '\"');
-		removeCharFromString(str, '\r');
-		removeCharFromString(str, '\n');
-		if (str.size() > 1) {
-     		mediaFileList.push_back(str.c_str());
-		}
-	}
-  LOGD("(f:%s, l:%d) parse fileList[%s], get [%d]files", __FUNCTION__,
-      __LINE__, pFileListPath, int(mediaFileList.size()));
-  for (std::vector<string>::size_type i = 0; i < mediaFileList.size(); i++) {
-    LOGD("file[%u]:[%s]", ::size_t(i), mediaFileList[i].c_str());
-  }
-	is.close();
-
-	return true;
-}
-
-int testActivity::removeCharFromString(string& nString, char c) {
-    string::size_type   pos;
-    while(1) {
-        pos = nString.find(c);
-        if(pos != string::npos) {
-            nString.erase(pos, 1);
-        } else {
-            break;
-        }
-    }
-    return (int)nString.size();
-}
-
-void testActivity::registerUserTimer(int id, int time) {
-	registerTimer(id, time);
-}
-
-void testActivity::unregisterUserTimer(int id) {
-	unregisterTimer(id);
-}
-
-void testActivity::resetUserTimer(int id, int time) {
-	resetTimer(id, time);
-}

+ 0 - 103
jni/activity/testActivity.h

@@ -1,103 +0,0 @@
-/***********************************************
-/gen auto by zuitools
-***********************************************/
-#ifndef __TESTACTIVITY_H__
-#define __TESTACTIVITY_H__
-
-
-#include "app/Activity.h"
-#include "entry/EasyUIContext.h"
-
-#include "uart/ProtocolData.h"
-#include "uart/ProtocolParser.h"
-
-#include "utils/Log.h"
-#include "control/ZKDigitalClock.h"
-#include "control/ZKButton.h"
-#include "control/ZKCircleBar.h"
-#include "control/ZKDiagram.h"
-#include "control/ZKListView.h"
-#include "control/ZKPointer.h"
-#include "control/ZKQRCode.h"
-#include "control/ZKTextView.h"
-#include "control/ZKSeekBar.h"
-#include "control/ZKEditText.h"
-#include "control/ZKVideoView.h"
-#include "window/ZKSlideWindow.h"
-
-/*TAG:Macro宏ID*/
-#define ID_TEST_Button8    20008
-#define ID_TEST_Button7    20007
-#define ID_TEST_Button6    20006
-#define ID_TEST_Button4    20004
-#define ID_TEST_Button3    20003
-#define ID_TEST_Button2    20002
-#define ID_TEST_Button1    20001
-/*TAG:Macro宏ID END*/
-
-class testActivity : public Activity,
-                     public ZKSeekBar::ISeekBarChangeListener, 
-                     public ZKListView::IItemClickListener,
-                     public ZKListView::AbsListAdapter,
-                     public ZKSlideWindow::ISlideItemClickListener,
-                     public EasyUIContext::ITouchListener,
-                     public ZKEditText::ITextChangeListener,
-                     public ZKVideoView::IVideoPlayerMessageListener
-{
-public:
-    testActivity();
-    virtual ~testActivity();
-
-    /**
-     * 注册定时器
-     */
-	void registerUserTimer(int id, int time);
-	/**
-	 * 取消定时器
-	 */
-	void unregisterUserTimer(int id);
-	/**
-	 * 重置定时器
-	 */
-	void resetUserTimer(int id, int time);
-
-protected:
-    /*TAG:PROTECTED_FUNCTION*/
-    virtual const char* getAppName() const;
-    virtual void onCreate();
-    virtual void onClick(ZKBase *pBase);
-    virtual void onResume();
-    virtual void onPause();
-    virtual void onIntent(const Intent *intentPtr);
-    virtual bool onTimer(int id);
-
-    virtual void onProgressChanged(ZKSeekBar *pSeekBar, int progress);
-
-    virtual int getListItemCount(const ZKListView *pListView) const;
-    virtual void obtainListItemData(ZKListView *pListView, ZKListView::ZKListItem *pListItem, int index);
-    virtual void onItemClick(ZKListView *pListView, int index, int subItemIndex);
-
-    virtual void onSlideItemClick(ZKSlideWindow *pSlideWindow, int index);
-
-    virtual bool onTouchEvent(const MotionEvent &ev);
-
-    virtual void onTextChanged(ZKTextView *pTextView, const string &text);
-
-    void rigesterActivityTimer();
-
-    virtual void onVideoPlayerMessage(ZKVideoView *pVideoView, int msg);
-    void videoLoopPlayback(ZKVideoView *pVideoView, int msg, size_t callbackTabIndex);
-    void startVideoLoopPlayback();
-    void stopVideoLoopPlayback();
-    bool parseVideoFileList(const char *pFileListPath, std::vector<string>& mediaFileList);
-    int removeCharFromString(string& nString, char c);
-
-
-private:
-    /*TAG:PRIVATE_VARIABLE*/
-    int mVideoLoopIndex;
-    int mVideoLoopErrorCount;
-
-};
-
-#endif

+ 67 - 67
jni/logic/callLogic.cc

@@ -242,78 +242,78 @@ static void onUI_intent(const Intent *intentPtr) {
 		_isSleepTimerRegistered = getSleepTimerRegistered();
 		_isSleepTimerRegistered = getSleepTimerRegistered();
 		setSleepTimerRegistered(false);
 		setSleepTimerRegistered(false);
 
 
-		wavPlayer.Play(CONFIGMANAGER->getResFilePath("ring1.wav"));
+		wavPlayer.Play(CONFIGMANAGER->getResFilePath("ring.wav"));
 		//wavPlayer.Play(CONFIGMANAGER->getResFilePath("1.mp3"));
 		//wavPlayer.Play(CONFIGMANAGER->getResFilePath("1.mp3"));
 		// 键值解析
 		// 键值解析
 		_isOutgoing = intentPtr->getExtra(isOutgoing);
 		_isOutgoing = intentPtr->getExtra(isOutgoing);
 		std::string _audioOnly = intentPtr->getExtra(audioOnly);
 		std::string _audioOnly = intentPtr->getExtra(audioOnly);
 
 
-//		if (_isOutgoing == "true"){
-//			int toId = 0;
-//			_toIdStr = intentPtr->getExtra(toIdStr);
-//			if (_toIdStr != "") {
-//				toId = atoi(_toIdStr.c_str());
-//			}
-//
-//			//TCP call
-//			TcpModel tcpModel;
-//			tcpModel.tid = base::format("t%d", TimeHelper::getCurrentTime());
-//			tcpModel.type = TcpType::VOICE;
-//			tcpModel.action = VoiceAction::CALL;
-//			tcpModel.from_id = StoragePreferences::getInt(STORE_DEVICE_ID,0);
-//			tcpModel.to_id = toId;
-//			std::string req = getTcpModelString(tcpModel);
-//			LOGD("TCP CALL : %s",req.c_str());
-////			TcpClient::instance()->sendMsg(req.c_str());
-//
-//			//回调注册
-//			TcpCallback callback;
-//			callback.tid = tcpModel.tid;
-//			callback.jsonStr = req;
-//			callback.onSuccess = [](Json::Value json){
-//				LOGD("voice callback success");
-//				return 0;
-//			};
-//			callback.onFalied = [](Json::Value json){
-//				LOGD("voice callback failed");
-//				return 0;
-//			};
-//			TcpClient::instance()->sendMsgWithCb(req.c_str(), callback);
-//
-//
-//			// 呼叫的时候需要把tid放进去
-//			tid = tcpModel.tid;
-//			mButtonAnswerPtr->setVisible(false);
-//
-//			std::string _callName = intentPtr->getExtra(callName);
-//			if (_callName != "") {
-//				mTextViewNamePtr->setText(LANGUAGEMANAGER->getValue("Call") + _callName);
-//			} else {
-//				mTextViewNamePtr->setTextTr("CallOutTitle");
-//			}
-//
-//			mActivityPtr->registerUserTimer(CALLING_TIME, 60000);	// 如果对方没接听,则发送一个CANCEL回去
-//		} else {
-//			TcpModel storeModel = CallingStatus::instance()->getTcpModel();
-//            TcpModel backTcp = storeModel;
-//            backTcp.data = storeModel.json["id"].asString();
-//            //back voice success
-//            sendVoiceTcp(VoiceAction::SUCCESS, backTcp, storeModel.from_id);
-//
-//			mTextViewNamePtr->setText(storeModel.json["fromFrameName"].asString());
-//			//自动接听处理
-//			if (StoragePreferences::getBool(STORE_AUDO_ANSWER,false)){
-//				mButtonAnswerPtr->setVisible(false);
-//				voip::CallInfo info = GetTelephone()->GetCallInfo();
-//				if (info.state == voip::STATE_CALL_INCOMING
-//						|| info.state == voip::STATE_CALL_EARLY) {
-//					GetTelephone()->Answer();
-//
-//					//发出TCP
-//					sendVoiceTcp(VoiceAction::ACCEPT, storeModel, storeModel.from_id);
-//				}
-//			}
-//		}
+		if (_isOutgoing == "true"){
+			int toId = 0;
+			_toIdStr = intentPtr->getExtra(toIdStr);
+			if (_toIdStr != "") {
+				toId = atoi(_toIdStr.c_str());
+			}
+
+			//TCP call
+			TcpModel tcpModel;
+			tcpModel.tid = base::format("t%d", TimeHelper::getCurrentTime());
+			tcpModel.type = TcpType::VOICE;
+			tcpModel.action = VoiceAction::CALL;
+			tcpModel.from_id = StoragePreferences::getInt(STORE_DEVICE_ID,0);
+			tcpModel.to_id = toId;
+			std::string req = getTcpModelString(tcpModel);
+			LOGD("TCP CALL : %s",req.c_str());
+//			TcpClient::instance()->sendMsg(req.c_str());
+
+			//回调注册
+			TcpCallback callback;
+			callback.tid = tcpModel.tid;
+			callback.jsonStr = req;
+			callback.onSuccess = [](Json::Value json){
+				LOGD("voice callback success");
+				return 0;
+			};
+			callback.onFalied = [](Json::Value json){
+				LOGD("voice callback failed");
+				return 0;
+			};
+			TcpClient::instance()->sendMsgWithCb(req.c_str(), callback);
+
+
+			// 呼叫的时候需要把tid放进去
+			tid = tcpModel.tid;
+			mButtonAnswerPtr->setVisible(false);
+
+			std::string _callName = intentPtr->getExtra(callName);
+			if (_callName != "") {
+				mTextViewNamePtr->setText(LANGUAGEMANAGER->getValue("Call") + _callName);
+			} else {
+				mTextViewNamePtr->setTextTr("CallOutTitle");
+			}
+
+			mActivityPtr->registerUserTimer(CALLING_TIME, 60000);	// 如果对方没接听,则发送一个CANCEL回去
+		} else {
+			TcpModel storeModel = CallingStatus::instance()->getTcpModel();
+            TcpModel backTcp = storeModel;
+            backTcp.data = storeModel.json["id"].asString();
+            //back voice success
+            sendVoiceTcp(VoiceAction::SUCCESS, backTcp, storeModel.from_id);
+
+			mTextViewNamePtr->setText(storeModel.json["fromFrameName"].asString());
+			//自动接听处理
+			if (StoragePreferences::getBool(STORE_AUDO_ANSWER,false)){
+				mButtonAnswerPtr->setVisible(false);
+				voip::CallInfo info = GetTelephone()->GetCallInfo();
+				if (info.state == voip::STATE_CALL_INCOMING
+						|| info.state == voip::STATE_CALL_EARLY) {
+					GetTelephone()->Answer();
+
+					//发出TCP
+					sendVoiceTcp(VoiceAction::ACCEPT, storeModel, storeModel.from_id);
+				}
+			}
+		}
 
 
 	}
 	}
 }
 }

+ 12 - 7
jni/logic/mainLogic.cc

@@ -71,6 +71,7 @@ static bool isHelpTimerRegistered = false;
 #define NURSING_TIME_HANDLE 6	// 护理的定时器id
 #define NURSING_TIME_HANDLE 6	// 护理的定时器id
 #define OXYGEN_TIME_HANDLE 7	// 吸氧倒计时
 #define OXYGEN_TIME_HANDLE 7	// 吸氧倒计时
 #define EVENT_TIME_HANDLE 8		// 事件定时器
 #define EVENT_TIME_HANDLE 8		// 事件定时器
+#define SLEEP_STRAT_TIME_HANDLE 9	// 息屏
 
 
 
 
 
 
@@ -667,8 +668,8 @@ static bool onButtonClick_CallBedButton(ZKButton *pButton) {
     if (frameBedList.size() > 0) {
     if (frameBedList.size() > 0) {
     	mCallBebWinPtr->showWnd();
     	mCallBebWinPtr->showWnd();
     } else {
     } else {
-    	mErrorWinPtr->showWnd();
-    	mErrorTextViewPtr->setText(LANGUAGEMANAGER->getValue("NoBedList"));
+    	mWarnWinPtr->showWnd();
+    	mWarnTextViewPtr->setText(LANGUAGEMANAGER->getValue("NoBedList"));
     }
     }
     return false;
     return false;
 }
 }
@@ -855,12 +856,12 @@ static void onListItemClick_CallBedListView(ZKListView *pListView, int index, in
     string customerName = frameBedList[index]["customer_name"].asString();
     string customerName = frameBedList[index]["customer_name"].asString();
     string toId = frameBedList[index]["bed_device_id"].asString();
     string toId = frameBedList[index]["bed_device_id"].asString();
     if (customerName == "") {
     if (customerName == "") {
-    	mErrorTextViewPtr->setText(LANGUAGEMANAGER->getValue("NoCustomer"));
-    	mErrorWinPtr->showWnd();
+    	mWarnTextViewPtr->setText(LANGUAGEMANAGER->getValue("NoCustomer"));
+    	mWarnWinPtr->showWnd();
     }
     }
     else if (toId == "") {
     else if (toId == "") {
-    	mErrorTextViewPtr->setText(LANGUAGEMANAGER->getValue("NoBedDevice"));
-    	mErrorWinPtr->showWnd();
+    	mWarnTextViewPtr->setText(LANGUAGEMANAGER->getValue("NoBedDevice"));
+    	mWarnWinPtr->showWnd();
     }
     }
     else {
     else {
 		mCallBebWinPtr->hideWnd();
 		mCallBebWinPtr->hideWnd();
@@ -880,6 +881,10 @@ static bool onButtonClick_CallBedCancel(ZKButton *pButton) {
 }
 }
 static bool onButtonClick_ErrorConfirmButton(ZKButton *pButton) {
 static bool onButtonClick_ErrorConfirmButton(ZKButton *pButton) {
     LOGD(" ButtonClick ErrorConfirmButton !!!\n");
     LOGD(" ButtonClick ErrorConfirmButton !!!\n");
-    mErrorWinPtr->hideWnd();
+    mWarnWinPtr->hideWnd();
+    return false;
+}
+static bool onButtonClick_WarnConfirmButton(ZKButton *pButton) {
+    LOGD(" ButtonClick WarnConfirmButton !!!\n");
     return false;
     return false;
 }
 }

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 262
jni/logic/testLogic.cc


+ 1 - 1
jni/logic/ui3Logic.cc

@@ -251,7 +251,7 @@ static void onUI_init(){
 	string voicePwd = StoragePreferences::getString(SIP_REG_PASSWORD, SIP_REG_PASSWORD_DEFAULT);
 	string voicePwd = StoragePreferences::getString(SIP_REG_PASSWORD, SIP_REG_PASSWORD_DEFAULT);
 	mVoiceDomainPtr->setText(StoragePreferences::getString(SIP_REG_DOMAIN, SIP_REG_DOMAIN_DEFAULT));
 	mVoiceDomainPtr->setText(StoragePreferences::getString(SIP_REG_DOMAIN, SIP_REG_DOMAIN_DEFAULT));
 
 
-	mVersionPtr->setText(StoragePreferences::getString(WDKL_VERSION, GetVersion()));
+	mVersionPtr->setText(version);
 
 
 	//server ip
 	//server ip
 	string sIP = StoragePreferences::getString(STORE_GATEWAY, serverIP);
 	string sIP = StoragePreferences::getString(STORE_GATEWAY, serverIP);

+ 2 - 2
jni/service/BusinessConfig.h

@@ -48,8 +48,8 @@
 #define STORE_AUDO_ANSWER "auto_answer"
 #define STORE_AUDO_ANSWER "auto_answer"
 #define SIGNAL_TYPE "TCP" //TCP,SIP
 #define SIGNAL_TYPE "TCP" //TCP,SIP
 
 
-static std::string version = "v1.0.4";
-static int versionNo = 4;
+static std::string version = "v1.0.5";
+static int versionNo = 5;
 static std::string serverIP = "172.28.100.100";
 static std::string serverIP = "172.28.100.100";
 static std::string tcpIP = "172.28.100.100";
 static std::string tcpIP = "172.28.100.100";
 static int serverHttpPort = 8006;
 static int serverHttpPort = 8006;

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/testActivity.o


BIN
obj/activity/ui3Activity.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/main.ftu


BIN
ui/test.ftu