|
@@ -80,431 +80,377 @@ static std::string cencalByDoorTid = "";
|
|
|
#define SLEEP_STRAT_TIME_HANDLE 9 // 息屏
|
|
|
|
|
|
|
|
|
+static bool deviceRequest = false;
|
|
|
+static bool frameRequest = false;
|
|
|
+#define REQUEST_TIME_HANDLE 200 // 重新请求
|
|
|
|
|
|
|
|
|
-//======================================= udp 请示服务器信息
|
|
|
-static net::Conn* udpConn;
|
|
|
-class UdpThread: public Thread {
|
|
|
-public:
|
|
|
- static void getServerInfo(){
|
|
|
-
|
|
|
- string url = getHttpGateway() + "/ncs_url/server_info";
|
|
|
- LOGD("请求服务器信息. url = %s", url.c_str());
|
|
|
- //发起HTTP GET请求
|
|
|
- RestClient::Response r = RestClient::get(url);
|
|
|
- LOGD("请求服务器信息. result = %s", r.body.c_str());
|
|
|
- if (r.code != 200) {
|
|
|
- LOGD("请求服务器信息错误. 错误代码 = %d", r.code);
|
|
|
-
|
|
|
- string serverIP = StoragePreferences::getString(STORE_GATEWAY, "172.28.100.100");
|
|
|
- int serverPort = StoragePreferences::getInt(STORE_HTTP_PORT, 8006);
|
|
|
- LOGD("serverIP ===> %s", serverIP.c_str());
|
|
|
- LOGD("serverPort ===> %d", serverPort);
|
|
|
- if (!checkAddr(serverIP) || serverPort == 0) {
|
|
|
- // http
|
|
|
- StoragePreferences::putString(STORE_GATEWAY, "172.28.100.100");
|
|
|
- StoragePreferences::putInt(STORE_HTTP_PORT, 8006);
|
|
|
-
|
|
|
- //重启
|
|
|
- sync();
|
|
|
- reboot(RB_AUTOBOOT);
|
|
|
- }
|
|
|
- return;
|
|
|
- }
|
|
|
- //解析json
|
|
|
- Json::Reader reader;
|
|
|
- Json::Value root;
|
|
|
- if (reader.parse(r.body, root, false)){
|
|
|
- // http
|
|
|
- StoragePreferences::putString(STORE_GATEWAY, root["http_local_ip"].asString());
|
|
|
- StoragePreferences::putInt(STORE_HTTP_PORT, root["http_port"].asInt());
|
|
|
+static void requestTimeHandle() {
|
|
|
+ if (deviceRequest != frameRequest) {
|
|
|
+ LOGD("启动定时任务,重新请求数据");
|
|
|
+ mActivityPtr->registerUserTimer(REQUEST_TIME_HANDLE, 10 * 60 * 1000);
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
- // tcp
|
|
|
- StoragePreferences::putString(STORE_TCP_LOCAL_IP, root["tcp_local_ip"].asString());
|
|
|
- StoragePreferences::putInt(STORE_TCP_PORT, root["tcp_port"].asInt());
|
|
|
|
|
|
- // sip
|
|
|
- StoragePreferences::putString(SIP_REG_DOMAIN, root["sip_ip"].asString());
|
|
|
- StoragePreferences::putInt(SIP_REG_PORT, root["sip_port"].asInt());
|
|
|
+static void getServerInfo(){
|
|
|
|
|
|
- serverInfo = false; // 只有请求成功了,才不需要重复请求
|
|
|
- }
|
|
|
+ string url = getHttpGateway() + "/ncs_url/server_info";
|
|
|
+ LOGD("请求服务器信息. url = %s", url.c_str());
|
|
|
+ //发起HTTP GET请求
|
|
|
+ RestClient::Response r = RestClient::get(url);
|
|
|
+ LOGD("请求服务器信息. result = %s", r.body.c_str());
|
|
|
+ if (r.code != 200) {
|
|
|
+ LOGD("请求服务器信息错误. 错误代码 = %d", r.code);
|
|
|
|
|
|
- }
|
|
|
+ string serverIP = StoragePreferences::getString(STORE_GATEWAY, "172.28.100.100");
|
|
|
+ int serverPort = StoragePreferences::getInt(STORE_HTTP_PORT, 8006);
|
|
|
+ LOGD("serverIP ===> %s", serverIP.c_str());
|
|
|
+ LOGD("serverPort ===> %d", serverPort);
|
|
|
+ if (!checkAddr(serverIP) || serverPort == 0) {
|
|
|
+ // http
|
|
|
+ StoragePreferences::putString(STORE_GATEWAY, "172.28.100.100");
|
|
|
+ StoragePreferences::putInt(STORE_HTTP_PORT, 8006);
|
|
|
|
|
|
- static void getDeviceInfo(){
|
|
|
- if (dataInit){
|
|
|
- getFrameInfo();
|
|
|
- //getPartSetting(StoragePreferences::getString(STORE_PARTID, ""));
|
|
|
- reinforceDispaly();
|
|
|
- setDirectorAndHeadNurse();
|
|
|
- getTemplate();
|
|
|
- return;
|
|
|
- }
|
|
|
- string url = getHttpGateway() + "/deviceRoom/get_device_by_eth_mac/" + StoragePreferences::getString(STORE_MAC_ADDR, "0.0.0.0");
|
|
|
- LOGD("请求设备信息. url = %s", url.c_str());
|
|
|
- //发起HTTP GET请求
|
|
|
- RestClient::Response r = RestClient::get(url);
|
|
|
- LOGD("获得设备信息. result = %s", r.body.c_str());
|
|
|
- //解析json
|
|
|
- Json::Reader reader;
|
|
|
- Json::Value root;
|
|
|
- if (reader.parse(r.body, root, false)){
|
|
|
- string partName = root["part_display"].asString();
|
|
|
- StoragePreferences::putString(STORE_PARTNAME,partName);
|
|
|
- NavibarSetPartName(partName);
|
|
|
- //设备
|
|
|
- StoragePreferences::putInt(STORE_DEVICE_ID, root["id"].asInt());
|
|
|
- StoragePreferences::putInt(STORE_DEVICE_TYPE, root["device_type"].asInt());
|
|
|
-
|
|
|
- //SIP存储
|
|
|
-// StoragePreferences::putString(SIP_REG_DOMAIN, root["sip_ip"].asString()); // 应该去找配置文件里的sip-ip
|
|
|
- StoragePreferences::putString(SIP_REG_ACCOUNT,root["sip_id"].asString());
|
|
|
- StoragePreferences::putString(SIP_REG_PASSWORD, root["sip_password"].asString());
|
|
|
-
|
|
|
- frameInfo["frame_id"] = root["frame_id"].asInt();
|
|
|
- frameInfo["full_name"] = root["full_name"].asString();
|
|
|
- frameInfo["part_id"] = root["part_id"].asInt();
|
|
|
- getFrameInfo();
|
|
|
-
|
|
|
- //获取科室设置
|
|
|
- string partId = root["part_id"].asString();
|
|
|
- StoragePreferences::putString(STORE_PARTID, partId);
|
|
|
- getPartSetting(partId);
|
|
|
- getVersion();
|
|
|
+ //重启
|
|
|
+ sync();
|
|
|
+ reboot(RB_AUTOBOOT);
|
|
|
}
|
|
|
+ return;
|
|
|
}
|
|
|
- // 读取空间缓存的数据
|
|
|
- static void getFrameInfo() {
|
|
|
- mRoomNamePtr->setText(frameInfo["full_name"].asString());
|
|
|
+ //解析json
|
|
|
+ Json::Reader reader;
|
|
|
+ Json::Value root;
|
|
|
+ if (reader.parse(r.body, root, false)){
|
|
|
+ // http
|
|
|
+ StoragePreferences::putString(STORE_GATEWAY, root["http_local_ip"].asString());
|
|
|
+ StoragePreferences::putInt(STORE_HTTP_PORT, root["http_port"].asInt());
|
|
|
+
|
|
|
+ // tcp
|
|
|
+ StoragePreferences::putString(STORE_TCP_LOCAL_IP, root["tcp_local_ip"].asString());
|
|
|
+ StoragePreferences::putInt(STORE_TCP_PORT, root["tcp_port"].asInt());
|
|
|
+
|
|
|
+ // sip
|
|
|
+ StoragePreferences::putString(SIP_REG_DOMAIN, root["sip_ip"].asString());
|
|
|
+ StoragePreferences::putInt(SIP_REG_PORT, root["sip_port"].asInt());
|
|
|
+
|
|
|
+ serverInfo = false; // 只有请求成功了,才不需要重复请求
|
|
|
}
|
|
|
|
|
|
- static void getFrameRoom(int frame_id) {
|
|
|
- string url = getHttpGateway() + "/deviceRoom/get_frame_room/" + to_string(frame_id);
|
|
|
- LOGD("请求房间信息. url = %s", url.c_str());
|
|
|
- //发起HTTP GET请求
|
|
|
- RestClient::Response r = RestClient::get(url);
|
|
|
- LOGD("获得房间信息. result = %s", r.body.c_str());
|
|
|
- //解析json
|
|
|
- Json::Reader reader;
|
|
|
- Json::Value root;
|
|
|
- if (reader.parse(r.body, root, false)){
|
|
|
- frameRoom = root;
|
|
|
- frameBedList = root["frame_bed_list"];
|
|
|
- if (mBedListViewPtr != NULL) {
|
|
|
- mBedListViewPtr->refreshListView();
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+}
|
|
|
|
|
|
+// 读取空间缓存的数据
|
|
|
+static void getFrameInfo() {
|
|
|
+ mRoomNamePtr->setText(frameInfo["full_name"].asString());
|
|
|
+}
|
|
|
|
|
|
- static void getPartSetting(string partId){
|
|
|
- string url = getHttpGateway() + "/deviceBed/getPartSetting/" + partId;
|
|
|
- LOGD("请求科室信息. url = %s", url.c_str());
|
|
|
- //发起HTTP GET请求
|
|
|
- RestClient::Response r = RestClient::get(url);
|
|
|
- LOGD("获得科室信息. result = %s", r.body.c_str());
|
|
|
- //解析json
|
|
|
- Json::Reader reader;
|
|
|
- Json::Value root;
|
|
|
- if (reader.parse(r.body, root, false)){
|
|
|
- partSetting.partId = root["part_id"].asInt();
|
|
|
- partSetting.dayStart = root["day_start"].asString();
|
|
|
- partSetting.dayLight = root["day_light"].asInt();
|
|
|
- partSetting.dayVol = root["day_vol"].asInt();
|
|
|
- partSetting.dayRingVol = root["day_ring_vol"].asInt();
|
|
|
- partSetting.dayRingTimes = root["day_ring_times"].asInt();
|
|
|
- partSetting.dayNurseLed = root["day_nurse_led"].asInt();
|
|
|
- partSetting.dayDoorVol = root["day_door_vol"].asInt();
|
|
|
- partSetting.dayBedVol = root["day_bed_vol"].asInt();
|
|
|
- partSetting.dayTransferBoxVol = root["day_transfer_box_vol"].asInt();
|
|
|
- partSetting.dayTransferBoxSystemVol = root["day_transfer_box_system_vol"].asInt();
|
|
|
- partSetting.nightStart = root["night_start"].asString();
|
|
|
- partSetting.nightLight = root["night_light"].asInt();
|
|
|
- partSetting.nightVol = root["night_vol"].asInt();
|
|
|
- partSetting.nightRingVol = root["night_ring_vol"].asInt();
|
|
|
- partSetting.nightRingTimes = root["night_ring_times"].asInt();
|
|
|
- partSetting.nightNurseLed = root["night_nurse_led"].asInt();
|
|
|
- partSetting.nightDoorVol = root["night_door_vol"].asInt();
|
|
|
- partSetting.nightBedVol = root["night_bed_vol"].asInt();
|
|
|
- partSetting.nightTransferBoxVol = root["night_transfer_box_vol"].asInt();
|
|
|
- partSetting.nightTransferBoxSystemVol = root["night_transfer_box_system_vol"].asInt();
|
|
|
- partSetting.sleepSecondsNurse = root["sleep_seconds_nurse"].asInt();
|
|
|
- partSetting.sleepSecondsDoor = root["sleep_seconds_door"].asInt();
|
|
|
- partSetting.sleepSecondsBed = root["sleep_seconds_bed"].asInt();
|
|
|
- partSetting.sipOvertime = root["sip_overtime"].asInt();
|
|
|
- partSetting.transferDuration = root["transfer_duration"].asInt();
|
|
|
- partSetting.transferDurationLeader = root["transfer_duration_leader"].asInt();
|
|
|
- partSetting.communicationModeBed = root["communication_mode_bed"].asInt();
|
|
|
- partSetting.communicationModeNurse = root["communication_mode_nurse"].asInt();
|
|
|
- partSetting.communicationModeMobile = root["communication_model_mobile"].asInt();
|
|
|
- partSetting.customizeRoleCallFirst = root["customize_role_call_first"].asInt();
|
|
|
- partSetting.customizeRoleCallSecond = root["customize_role_call_second"].asInt();
|
|
|
- partSetting.customizeRoleCallThird = root["customize_role_call_third"].asInt();
|
|
|
- partSetting.customizeRoleCallFourth = root["customize_role_call_fourth"].asInt();
|
|
|
- partSetting.customizeRoleCallFifth = root["customize_role_call_fifth"].asInt();
|
|
|
- partSetting.customizeHospitalCallFirst = root["customize_hospital_call_first"].asInt();
|
|
|
- partSetting.customizeHospitalCallFirstName = root["customize_hospital_call_first_name"].asString();
|
|
|
- partSetting.customizeHospitalCallSecond = root["customize_hospital_call_second"].asInt();
|
|
|
- partSetting.customizeHospitalCallSecondName = root["customize_hospital_second_name"].asString();
|
|
|
- partSetting.customizeHospitalCallThird = root["customize_hospital_call_third"].asInt();
|
|
|
- partSetting.customizeHospitalCallThirdName = root["customize_hospital_call_third_name"].asString();
|
|
|
- partSetting.doctorTitle = root["doctor_title"].asString();
|
|
|
- partSetting.doctorValid = root["doctor_valid"].asInt();
|
|
|
- partSetting.nurseTitle = root["nurse_title"].asString();
|
|
|
- partSetting.nurseValid = root["nurse_valid"].asInt();
|
|
|
- partSetting.partDirector = root["part_director"].asString();
|
|
|
- partSetting.partNurseHead = root["part_nurse_head"].asString();
|
|
|
- partSetting.doorNurseTitle = root["door_nurse_title"].asString();
|
|
|
- partSetting.doorNurseValid = root["door_nurse_valid"].asInt();
|
|
|
- partSetting.doorNursingTitle = root["door_nursing_title"].asString();
|
|
|
- partSetting.doorNursingValid = root["door_nursing_valid"].asInt();
|
|
|
- partSetting.upSeconds = root["up_seconds"].asInt();
|
|
|
- partSetting.autoAccept = root["auto_accept"].asInt();
|
|
|
- partSetting.eventForward = root["event_forward"].asInt();
|
|
|
- partSetting.nursingColorRgb = root["nursing_color_rgb"].asString();
|
|
|
- partSetting.twoColorDoorLightValid = root["two_color_door_light_valid"].asInt();
|
|
|
- partSetting.qrUrl = root["qr_url"].asString();
|
|
|
- partSetting.screenLight = root["screen_light"].asInt();
|
|
|
- partSetting.roomCallBed = root["room_call_bed"].asInt();
|
|
|
-
|
|
|
- if (root["linux_door_volume_native"].size() != 0) {
|
|
|
- partSetting.linuxDoorVolumeNative = root["linux_door_volume_native"].asInt();
|
|
|
- partSetting.linuxDoorGainSize = root["linux_door_gain_size"].asInt();
|
|
|
-
|
|
|
- zk_audio_input_set_volume_native(0, 0);
|
|
|
- zk_audio_input_set_volume_native(1, partSetting.linuxDoorVolumeNative);
|
|
|
- GetTelephone()->SetInputPcmGainSize(partSetting.linuxDoorGainSize);
|
|
|
-
|
|
|
- StoragePreferences::putInt(STORE_VOLUME_NATIVE, partSetting.linuxDoorVolumeNative);
|
|
|
- StoragePreferences::putInt(STORE_GAIN_SIZE, partSetting.linuxDoorGainSize);
|
|
|
- }
|
|
|
+static void getFrameRoom(int frame_id) {
|
|
|
+ string url = getHttpGateway() + "/deviceRoom/get_frame_room/" + to_string(frame_id);
|
|
|
+ LOGD("请求房间信息. url = %s", url.c_str());
|
|
|
+ RestClient::Response r = RestClient::get(url);
|
|
|
+ //发起HTTP GET请求
|
|
|
+ if (r.code != 200) {
|
|
|
+ LOGD("请求房间信息错误. 错误代码 = %d", r.code);
|
|
|
+ if (!frameRequest) {
|
|
|
+ frameRequest = true;
|
|
|
+ requestTimeHandle();
|
|
|
+ }
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ LOGD("获得房间信息. result = %s", r.body.c_str());
|
|
|
+ frameRequest = false;
|
|
|
+ //解析json
|
|
|
+ Json::Reader reader;
|
|
|
+ Json::Value root;
|
|
|
+ if (reader.parse(r.body, root, false)){
|
|
|
+ frameRoom = root;
|
|
|
+ frameBedList = root["frame_bed_list"];
|
|
|
+ if (mBedListViewPtr != NULL) {
|
|
|
+ mBedListViewPtr->refreshListView();
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
- StoragePreferences::putString(STORE_DAY_START, partSetting.dayStart);
|
|
|
- StoragePreferences::putInt(STORE_DAY_LIGHT,partSetting.dayLight);
|
|
|
- StoragePreferences::putInt(STORE_DAY_VOL,partSetting.dayBedVol);
|
|
|
- StoragePreferences::putInt(STORE_DAY_RING_TIMES,partSetting.dayRingTimes);
|
|
|
+static void callBedButtonSetVisible() {
|
|
|
+ int roomCallBed = StoragePreferences::getInt(STORE_ROOM_CALL_BED, 1);
|
|
|
+ if (!roomCallBed) {
|
|
|
+ // 如果roomCallBed是0的话,那就隐藏
|
|
|
+ mCallBedButtonPtr->setVisible(roomCallBed);
|
|
|
|
|
|
- StoragePreferences::putString(STORE_NIGHT_START, partSetting.nightStart);
|
|
|
- StoragePreferences::putInt(STORE_NIGHT_LIGHT,partSetting.nightLight);
|
|
|
- StoragePreferences::putInt(STORE_NIGHT_VOL,partSetting.nightBedVol);
|
|
|
- StoragePreferences::putInt(STORE_NIGHT_RING_TIMES,partSetting.nightRingTimes);
|
|
|
+ mCallNurseButtonPtr->setPosition(LayoutPosition(869, 160, 140, 55));
|
|
|
+ mCallCencelButtonPtr->setPosition(LayoutPosition(869, 241, 140, 55));
|
|
|
+ mHelpButtonPtr->setPosition(LayoutPosition(869, 323, 140, 55));
|
|
|
+ mNursingButtonPtr->setPosition(LayoutPosition(869, 404, 140, 55));
|
|
|
+ mMoreButtonPtr->setPosition(LayoutPosition(869, 485, 140, 55));
|
|
|
|
|
|
- StoragePreferences::putInt(STORE_SLEEP_TIME, partSetting.sleepSecondsDoor);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ // 如果roomCallBed是1的话,那就显示
|
|
|
+ mCallBedButtonPtr->setVisible(roomCallBed);
|
|
|
+
|
|
|
+ mCallNurseButtonPtr->setPosition(LayoutPosition(869, 185, 140, 55));
|
|
|
+ mCallCencelButtonPtr->setPosition(LayoutPosition(869, 260, 140, 55));
|
|
|
+ mHelpButtonPtr->setPosition(LayoutPosition(869, 335, 140, 55));
|
|
|
+ mNursingButtonPtr->setPosition(LayoutPosition(869, 410, 140, 55));
|
|
|
+ mMoreButtonPtr->setPosition(LayoutPosition(869, 485, 140, 55));
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
- StoragePreferences::putString(STORE_DOCTOR_TITLE, partSetting.doctorTitle);
|
|
|
- StoragePreferences::putBool(STORE_DOCTOR_VISIBLE, partSetting.doctorValid==1);
|
|
|
- StoragePreferences::putString(STORE_NURSE_TITLE, partSetting.nurseTitle);
|
|
|
- StoragePreferences::putBool(STORE_NURSE_VISIBLE, partSetting.nurseValid==1);
|
|
|
+// 将医生和护士别称缓存起来
|
|
|
+static void setRightTitle(Json::Value partSetting) {
|
|
|
+ rightTitleInfo["doctor_title"] = partSetting["doctor_title"].asString();
|
|
|
+ rightTitleInfo["doctor_valid"] = partSetting["doctor_valid"].asInt();
|
|
|
+ rightTitleInfo["nurse_title"] = partSetting["nurse_title"].asString();
|
|
|
+ rightTitleInfo["nurse_valid"] = partSetting["nurse_valid"].asInt();
|
|
|
+}
|
|
|
|
|
|
- StoragePreferences::putString(STORE_NURSING_COLOR_RGB, partSetting.nursingColorRgb);
|
|
|
- StoragePreferences::putBool(STORE_AUDO_ANSWER, partSetting.autoAccept==1);
|
|
|
- StoragePreferences::putInt(STORE_SCREEN_LIGHT, partSetting.screenLight);
|
|
|
- StoragePreferences::putInt(STORE_ROOM_CALL_BED, partSetting.roomCallBed);
|
|
|
+static void setDirectorAndHeadNurse() {
|
|
|
+ mDirectorTextViewPtr->setText(partSetting.partDirector);
|
|
|
+ mHeadNurseTextViewPtr->setText(partSetting.partNurseHead);
|
|
|
+}
|
|
|
|
|
|
- setRightTitle(root);
|
|
|
- callBedButtonSetVisible();
|
|
|
- setDirectorAndHeadNurse();
|
|
|
+static void getVersion() {
|
|
|
+ std::string url = getHttpGateway() + "/deviceRoom/get_app_version?device_type=303&part_id=" + StoragePreferences::getString(STORE_PARTID, "");
|
|
|
+ std::string content_type = std::string("application/json");
|
|
|
|
|
|
- getFrameRoom(frameInfo["frame_id"].asInt());
|
|
|
+ LOGD("请求版本信息. url = %s", url.c_str());
|
|
|
+ //发起HTTP POST请求
|
|
|
+ RestClient::Response r = RestClient::post(url, content_type, "");
|
|
|
+ if (r.code != 200) {
|
|
|
+ LOGD("请求版本信息-> 错误代码: %d", r.code);
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
- dataInit = true;
|
|
|
+ LOGD("获得版本信息. result = %s", r.body.c_str());
|
|
|
+ //解析json
|
|
|
+ Json::Reader reader;
|
|
|
+ Json::Value root;
|
|
|
+
|
|
|
+ if(reader.parse(r.body, root, false)) {
|
|
|
+ int currentVersionNo = getVersionNo();
|
|
|
+ int responseVersionNo = root["version_no"].asInt();
|
|
|
+ std::string responseVersion = root["version_code"].asString();
|
|
|
+ LOGD("服务器版本 : %s %d, 当前设备版本: %d", responseVersion.c_str(), responseVersionNo, currentVersionNo);
|
|
|
+
|
|
|
+ if (currentVersionNo < responseVersionNo) {
|
|
|
+ Intent* intent = new Intent();
|
|
|
+ intent->putExtra(appUpdate, "true");
|
|
|
+ EASYUICONTEXT->openActivity("DeviceUpdateActivity", intent);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- static void callBedButtonSetVisible() {
|
|
|
- int roomCallBed = StoragePreferences::getInt(STORE_ROOM_CALL_BED, 1);
|
|
|
- if (!roomCallBed) {
|
|
|
- // 如果roomCallBed是0的话,那就隐藏
|
|
|
- mCallBedButtonPtr->setVisible(roomCallBed);
|
|
|
+}
|
|
|
|
|
|
- mCallNurseButtonPtr->setPosition(LayoutPosition(869, 160, 140, 55));
|
|
|
- mCallCencelButtonPtr->setPosition(LayoutPosition(869, 241, 140, 55));
|
|
|
- mHelpButtonPtr->setPosition(LayoutPosition(869, 323, 140, 55));
|
|
|
- mNursingButtonPtr->setPosition(LayoutPosition(869, 404, 140, 55));
|
|
|
- mMoreButtonPtr->setPosition(LayoutPosition(869, 485, 140, 55));
|
|
|
+// 判断是否处于增援状态,处于增援状态,就要显示蓝色
|
|
|
+static void reinforceDispaly() {
|
|
|
+ if (reinforce) {
|
|
|
+// SetPainterInfo(0xFF2F9DF1, "增援已发出");
|
|
|
+// setHelpButton("/button/button_help3.png" ,false);
|
|
|
+ setPainterInfo(StoragePreferences::getInt(STORE_DEVICE_ID,0), 0xFF2F9DF1, LANGUAGEMANAGER->getValue("HelpInfo"), "REINFORCE", "ADD", 60);
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
- }
|
|
|
- else {
|
|
|
- // 如果roomCallBed是1的话,那就显示
|
|
|
- mCallBedButtonPtr->setVisible(roomCallBed);
|
|
|
-
|
|
|
- mCallNurseButtonPtr->setPosition(LayoutPosition(869, 185, 140, 55));
|
|
|
- mCallCencelButtonPtr->setPosition(LayoutPosition(869, 260, 140, 55));
|
|
|
- mHelpButtonPtr->setPosition(LayoutPosition(869, 335, 140, 55));
|
|
|
- mNursingButtonPtr->setPosition(LayoutPosition(869, 410, 140, 55));
|
|
|
- mMoreButtonPtr->setPosition(LayoutPosition(869, 485, 140, 55));
|
|
|
- }
|
|
|
+static void getTemplate() {
|
|
|
+ int templateInt = StoragePreferences::getInt(STORE_TEMPLATE, 1);
|
|
|
+ LOGD("templateInt =====> %d", templateInt);
|
|
|
+ if (templateInt == 1) {
|
|
|
+ mDirectorTextViewPtr->setVisible(false);
|
|
|
+ mDirectorTitleTextViewPtr->setVisible(false);
|
|
|
+ mHeadNurseTextViewPtr->setVisible(false);
|
|
|
+ mHeadNurseTitleTextViewPtr->setVisible(false);
|
|
|
+
|
|
|
+ mBedListViewPtr->setPosition(LayoutPosition(6, 90, 855, 465));
|
|
|
}
|
|
|
+ else if (templateInt == 2) {
|
|
|
+ mDirectorTextViewPtr->setVisible(true);
|
|
|
+ mDirectorTitleTextViewPtr->setVisible(true);
|
|
|
+ mHeadNurseTextViewPtr->setVisible(true);
|
|
|
+ mHeadNurseTitleTextViewPtr->setVisible(true);
|
|
|
|
|
|
- // 将医生和护士别称缓存起来
|
|
|
- static void setRightTitle(Json::Value partSetting) {
|
|
|
- rightTitleInfo["doctor_title"] = partSetting["doctor_title"].asString();
|
|
|
- rightTitleInfo["doctor_valid"] = partSetting["doctor_valid"].asInt();
|
|
|
- rightTitleInfo["nurse_title"] = partSetting["nurse_title"].asString();
|
|
|
- rightTitleInfo["nurse_valid"] = partSetting["nurse_valid"].asInt();
|
|
|
+ mBedListViewPtr->setPosition(LayoutPosition(6, 90, 855, 395));
|
|
|
}
|
|
|
+ else if (templateInt == 3) {
|
|
|
+ mDirectorTextViewPtr->setVisible(false);
|
|
|
+ mDirectorTitleTextViewPtr->setVisible(false);
|
|
|
+ mHeadNurseTextViewPtr->setVisible(false);
|
|
|
+ mHeadNurseTitleTextViewPtr->setVisible(false);
|
|
|
|
|
|
- static void setDirectorAndHeadNurse() {
|
|
|
- mDirectorTextViewPtr->setText(partSetting.partDirector);
|
|
|
- mHeadNurseTextViewPtr->setText(partSetting.partNurseHead);
|
|
|
+ mBedListViewPtr->setPosition(LayoutPosition(6, 90, 855, 465));
|
|
|
}
|
|
|
|
|
|
- static void getVersion() {
|
|
|
- std::string url = getHttpGateway() + "/deviceRoom/get_app_version?device_type=303&part_id=" + StoragePreferences::getString(STORE_PARTID, "");
|
|
|
- std::string content_type = std::string("application/json");
|
|
|
+}
|
|
|
|
|
|
- LOGD("请求版本信息. url = %s", url.c_str());
|
|
|
- //发起HTTP POST请求
|
|
|
- RestClient::Response r = RestClient::post(url, content_type, "");
|
|
|
- if (r.code != 200) {
|
|
|
- LOGD("请求版本信息-> 错误代码: %d", r.code);
|
|
|
- return;
|
|
|
+static void getPartSetting(string partId){
|
|
|
+ string url = getHttpGateway() + "/deviceBed/getPartSetting/" + partId;
|
|
|
+ LOGD("请求科室信息. url = %s", url.c_str());
|
|
|
+ //发起HTTP GET请求
|
|
|
+ RestClient::Response r = RestClient::get(url);
|
|
|
+ LOGD("获得科室信息. result = %s", r.body.c_str());
|
|
|
+ //解析json
|
|
|
+ Json::Reader reader;
|
|
|
+ Json::Value root;
|
|
|
+ if (reader.parse(r.body, root, false)){
|
|
|
+ partSetting.partId = root["part_id"].asInt();
|
|
|
+ partSetting.dayStart = root["day_start"].asString();
|
|
|
+ partSetting.dayLight = root["day_light"].asInt();
|
|
|
+ partSetting.dayVol = root["day_vol"].asInt();
|
|
|
+ partSetting.dayRingVol = root["day_ring_vol"].asInt();
|
|
|
+ partSetting.dayRingTimes = root["day_ring_times"].asInt();
|
|
|
+ partSetting.dayNurseLed = root["day_nurse_led"].asInt();
|
|
|
+ partSetting.dayDoorVol = root["day_door_vol"].asInt();
|
|
|
+ partSetting.dayBedVol = root["day_bed_vol"].asInt();
|
|
|
+ partSetting.dayTransferBoxVol = root["day_transfer_box_vol"].asInt();
|
|
|
+ partSetting.dayTransferBoxSystemVol = root["day_transfer_box_system_vol"].asInt();
|
|
|
+ partSetting.nightStart = root["night_start"].asString();
|
|
|
+ partSetting.nightLight = root["night_light"].asInt();
|
|
|
+ partSetting.nightVol = root["night_vol"].asInt();
|
|
|
+ partSetting.nightRingVol = root["night_ring_vol"].asInt();
|
|
|
+ partSetting.nightRingTimes = root["night_ring_times"].asInt();
|
|
|
+ partSetting.nightNurseLed = root["night_nurse_led"].asInt();
|
|
|
+ partSetting.nightDoorVol = root["night_door_vol"].asInt();
|
|
|
+ partSetting.nightBedVol = root["night_bed_vol"].asInt();
|
|
|
+ partSetting.nightTransferBoxVol = root["night_transfer_box_vol"].asInt();
|
|
|
+ partSetting.nightTransferBoxSystemVol = root["night_transfer_box_system_vol"].asInt();
|
|
|
+ partSetting.sleepSecondsNurse = root["sleep_seconds_nurse"].asInt();
|
|
|
+ partSetting.sleepSecondsDoor = root["sleep_seconds_door"].asInt();
|
|
|
+ partSetting.sleepSecondsBed = root["sleep_seconds_bed"].asInt();
|
|
|
+ partSetting.sipOvertime = root["sip_overtime"].asInt();
|
|
|
+ partSetting.transferDuration = root["transfer_duration"].asInt();
|
|
|
+ partSetting.transferDurationLeader = root["transfer_duration_leader"].asInt();
|
|
|
+ partSetting.communicationModeBed = root["communication_mode_bed"].asInt();
|
|
|
+ partSetting.communicationModeNurse = root["communication_mode_nurse"].asInt();
|
|
|
+ partSetting.communicationModeMobile = root["communication_model_mobile"].asInt();
|
|
|
+ partSetting.customizeRoleCallFirst = root["customize_role_call_first"].asInt();
|
|
|
+ partSetting.customizeRoleCallSecond = root["customize_role_call_second"].asInt();
|
|
|
+ partSetting.customizeRoleCallThird = root["customize_role_call_third"].asInt();
|
|
|
+ partSetting.customizeRoleCallFourth = root["customize_role_call_fourth"].asInt();
|
|
|
+ partSetting.customizeRoleCallFifth = root["customize_role_call_fifth"].asInt();
|
|
|
+ partSetting.customizeHospitalCallFirst = root["customize_hospital_call_first"].asInt();
|
|
|
+ partSetting.customizeHospitalCallFirstName = root["customize_hospital_call_first_name"].asString();
|
|
|
+ partSetting.customizeHospitalCallSecond = root["customize_hospital_call_second"].asInt();
|
|
|
+ partSetting.customizeHospitalCallSecondName = root["customize_hospital_second_name"].asString();
|
|
|
+ partSetting.customizeHospitalCallThird = root["customize_hospital_call_third"].asInt();
|
|
|
+ partSetting.customizeHospitalCallThirdName = root["customize_hospital_call_third_name"].asString();
|
|
|
+ partSetting.doctorTitle = root["doctor_title"].asString();
|
|
|
+ partSetting.doctorValid = root["doctor_valid"].asInt();
|
|
|
+ partSetting.nurseTitle = root["nurse_title"].asString();
|
|
|
+ partSetting.nurseValid = root["nurse_valid"].asInt();
|
|
|
+ partSetting.partDirector = root["part_director"].asString();
|
|
|
+ partSetting.partNurseHead = root["part_nurse_head"].asString();
|
|
|
+ partSetting.doorNurseTitle = root["door_nurse_title"].asString();
|
|
|
+ partSetting.doorNurseValid = root["door_nurse_valid"].asInt();
|
|
|
+ partSetting.doorNursingTitle = root["door_nursing_title"].asString();
|
|
|
+ partSetting.doorNursingValid = root["door_nursing_valid"].asInt();
|
|
|
+ partSetting.upSeconds = root["up_seconds"].asInt();
|
|
|
+ partSetting.autoAccept = root["auto_accept"].asInt();
|
|
|
+ partSetting.eventForward = root["event_forward"].asInt();
|
|
|
+ partSetting.nursingColorRgb = root["nursing_color_rgb"].asString();
|
|
|
+ partSetting.twoColorDoorLightValid = root["two_color_door_light_valid"].asInt();
|
|
|
+ partSetting.qrUrl = root["qr_url"].asString();
|
|
|
+ partSetting.screenLight = root["screen_light"].asInt();
|
|
|
+ partSetting.roomCallBed = root["room_call_bed"].asInt();
|
|
|
+ partSetting.customerAgeHiddenOnDoor = root["customer_age_hidden_on_door"].asInt();
|
|
|
+
|
|
|
+ if (root["linux_door_volume_native"].size() != 0) {
|
|
|
+ partSetting.linuxDoorVolumeNative = root["linux_door_volume_native"].asInt();
|
|
|
+ partSetting.linuxDoorGainSize = root["linux_door_gain_size"].asInt();
|
|
|
+
|
|
|
+ zk_audio_input_set_volume_native(0, 0);
|
|
|
+ zk_audio_input_set_volume_native(1, partSetting.linuxDoorVolumeNative);
|
|
|
+ GetTelephone()->SetInputPcmGainSize(partSetting.linuxDoorGainSize);
|
|
|
+
|
|
|
+ StoragePreferences::putInt(STORE_VOLUME_NATIVE, partSetting.linuxDoorVolumeNative);
|
|
|
+ StoragePreferences::putInt(STORE_GAIN_SIZE, partSetting.linuxDoorGainSize);
|
|
|
}
|
|
|
|
|
|
- LOGD("获得版本信息. result = %s", r.body.c_str());
|
|
|
- //解析json
|
|
|
- Json::Reader reader;
|
|
|
- Json::Value root;
|
|
|
-
|
|
|
- if(reader.parse(r.body, root, false)) {
|
|
|
- int currentVersionNo = getVersionNo();
|
|
|
- int responseVersionNo = root["version_no"].asInt();
|
|
|
- std::string responseVersion = root["version_code"].asString();
|
|
|
- LOGD("服务器版本 : %s %d, 当前设备版本: %d", responseVersion.c_str(), responseVersionNo, currentVersionNo);
|
|
|
-
|
|
|
- if (currentVersionNo < responseVersionNo) {
|
|
|
- Intent* intent = new Intent();
|
|
|
- intent->putExtra(appUpdate, "true");
|
|
|
- EASYUICONTEXT->openActivity("DeviceUpdateActivity", intent);
|
|
|
- }
|
|
|
- }
|
|
|
+ StoragePreferences::putString(STORE_DAY_START, partSetting.dayStart);
|
|
|
+ StoragePreferences::putInt(STORE_DAY_LIGHT,partSetting.dayLight);
|
|
|
+ StoragePreferences::putInt(STORE_DAY_VOL,partSetting.dayBedVol);
|
|
|
+ StoragePreferences::putInt(STORE_DAY_RING_TIMES,partSetting.dayRingTimes);
|
|
|
|
|
|
- }
|
|
|
+ StoragePreferences::putString(STORE_NIGHT_START, partSetting.nightStart);
|
|
|
+ StoragePreferences::putInt(STORE_NIGHT_LIGHT,partSetting.nightLight);
|
|
|
+ StoragePreferences::putInt(STORE_NIGHT_VOL,partSetting.nightBedVol);
|
|
|
+ StoragePreferences::putInt(STORE_NIGHT_RING_TIMES,partSetting.nightRingTimes);
|
|
|
|
|
|
- // 判断是否处于增援状态,处于增援状态,就要显示蓝色
|
|
|
- static void reinforceDispaly() {
|
|
|
- if (reinforce) {
|
|
|
-// SetPainterInfo(0xFF2F9DF1, "增援已发出");
|
|
|
-// setHelpButton("/button/button_help3.png" ,false);
|
|
|
- setPainterInfo(StoragePreferences::getInt(STORE_DEVICE_ID,0), 0xFF2F9DF1, LANGUAGEMANAGER->getValue("HelpInfo"), "REINFORCE", "ADD", 60);
|
|
|
- }
|
|
|
- }
|
|
|
+ StoragePreferences::putInt(STORE_SLEEP_TIME, partSetting.sleepSecondsDoor);
|
|
|
|
|
|
- static void getTemplate() {
|
|
|
- int templateInt = StoragePreferences::getInt(STORE_TEMPLATE, 1);
|
|
|
- LOGD("templateInt =====> %d", templateInt);
|
|
|
- if (templateInt == 1) {
|
|
|
- mDirectorTextViewPtr->setVisible(false);
|
|
|
- mDirectorTitleTextViewPtr->setVisible(false);
|
|
|
- mHeadNurseTextViewPtr->setVisible(false);
|
|
|
- mHeadNurseTitleTextViewPtr->setVisible(false);
|
|
|
+ StoragePreferences::putString(STORE_DOCTOR_TITLE, partSetting.doctorTitle);
|
|
|
+ StoragePreferences::putBool(STORE_DOCTOR_VISIBLE, partSetting.doctorValid==1);
|
|
|
+ StoragePreferences::putString(STORE_NURSE_TITLE, partSetting.nurseTitle);
|
|
|
+ StoragePreferences::putBool(STORE_NURSE_VISIBLE, partSetting.nurseValid==1);
|
|
|
|
|
|
- mBedListViewPtr->setPosition(LayoutPosition(6, 90, 855, 465));
|
|
|
- }
|
|
|
- else if (templateInt == 2) {
|
|
|
- mDirectorTextViewPtr->setVisible(true);
|
|
|
- mDirectorTitleTextViewPtr->setVisible(true);
|
|
|
- mHeadNurseTextViewPtr->setVisible(true);
|
|
|
- mHeadNurseTitleTextViewPtr->setVisible(true);
|
|
|
+ StoragePreferences::putString(STORE_NURSING_COLOR_RGB, partSetting.nursingColorRgb);
|
|
|
+ StoragePreferences::putBool(STORE_AUDO_ANSWER, partSetting.autoAccept==1);
|
|
|
+ StoragePreferences::putInt(STORE_SCREEN_LIGHT, partSetting.screenLight);
|
|
|
+ StoragePreferences::putInt(STORE_ROOM_CALL_BED, partSetting.roomCallBed);
|
|
|
|
|
|
- mBedListViewPtr->setPosition(LayoutPosition(6, 90, 855, 395));
|
|
|
- }
|
|
|
- else if (templateInt == 3) {
|
|
|
- mDirectorTextViewPtr->setVisible(false);
|
|
|
- mDirectorTitleTextViewPtr->setVisible(false);
|
|
|
- mHeadNurseTextViewPtr->setVisible(false);
|
|
|
- mHeadNurseTitleTextViewPtr->setVisible(false);
|
|
|
+ setRightTitle(root);
|
|
|
+ callBedButtonSetVisible();
|
|
|
+ setDirectorAndHeadNurse();
|
|
|
|
|
|
- mBedListViewPtr->setPosition(LayoutPosition(6, 90, 855, 465));
|
|
|
- }
|
|
|
+ getFrameRoom(frameInfo["frame_id"].asInt());
|
|
|
|
|
|
+ dataInit = true;
|
|
|
}
|
|
|
+}
|
|
|
|
|
|
|
|
|
- /**
|
|
|
- * 线程创建成功后会调用该函数,可以在该函数中做一些初始化操作
|
|
|
- * return true 继续线程
|
|
|
- * false 退出线程
|
|
|
- */
|
|
|
- virtual bool readyToRun() {
|
|
|
- LOGD("Thread 已经创建完成");
|
|
|
- return true;
|
|
|
- }
|
|
|
|
|
|
- /**
|
|
|
- * 线程循环函数
|
|
|
- *
|
|
|
- * return true 继续线程循环
|
|
|
- * false 推出线程
|
|
|
- */
|
|
|
- virtual bool threadLoop() {
|
|
|
- LOGD("线程循环函数");
|
|
|
-
|
|
|
- //检查是否有退出线程的请求,如果有,则返回false,立即退出线程
|
|
|
- if (exitPending()) {
|
|
|
- return false;
|
|
|
+static void getDeviceInfo(){
|
|
|
+ if (dataInit){
|
|
|
+ getFrameInfo();
|
|
|
+ //getPartSetting(StoragePreferences::getString(STORE_PARTID, ""));
|
|
|
+ reinforceDispaly();
|
|
|
+ setDirectorAndHeadNurse();
|
|
|
+ getTemplate();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ string url = getHttpGateway() + "/deviceRoom/get_device_by_eth_mac/" + StoragePreferences::getString(STORE_MAC_ADDR, "0.0.0.0");
|
|
|
+ LOGD("请求设备信息. url = %s", url.c_str());
|
|
|
+ //发起HTTP GET请求
|
|
|
+ RestClient::Response r = RestClient::get(url);
|
|
|
+ if (r.code != 200) {
|
|
|
+ LOGD("请求设备信息错误. 错误代码 = %d", r.code);
|
|
|
+ if (!deviceRequest) {
|
|
|
+ deviceRequest = true;
|
|
|
+ requestTimeHandle();
|
|
|
}
|
|
|
|
|
|
- udpConn = net::Dial("udp", "192.168.1.255:10010");
|
|
|
- if (udpConn) {
|
|
|
- byte buf[1024] = {0};
|
|
|
- const char* req = "search_server";
|
|
|
- //发送
|
|
|
- udpConn->Write((byte*)req, strlen(req));
|
|
|
- while (true && !exitPending()) {
|
|
|
- //读取,超时10*1000毫秒
|
|
|
- int n = udpConn->Read(buf, sizeof(buf) - 1, 10*1000);
|
|
|
- if (n > 0) {
|
|
|
- buf[n] = 0;
|
|
|
- char serverStr[1024];
|
|
|
- sprintf(serverStr,"%s",buf);
|
|
|
- LOGD("读取 %d字节: %s", n, serverStr);
|
|
|
-
|
|
|
- //解析json
|
|
|
- Json::Reader reader;
|
|
|
- Json::Value root;
|
|
|
- if (reader.parse(serverStr, root, false)){
|
|
|
- if (root.isMember("success") && root["success"].asBool()){
|
|
|
- serverIP = root["data"]["third_server"].asString();
|
|
|
- serverHttpPort = root["data"]["third_server_port"].asInt();
|
|
|
-
|
|
|
- StoragePreferences::putString(STORE_GATEWAY, serverIP);
|
|
|
- StoragePreferences::putInt(STORE_HTTP_PORT, serverHttpPort);
|
|
|
-
|
|
|
- //先获取服务器信息
|
|
|
- //getServerInfo();
|
|
|
- //就当在获取服务器信息完成后获取用户信息,这里测试用
|
|
|
- //getCustomerInfo();
|
|
|
- //退出UDP线程
|
|
|
- pthread_exit(NULL);
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- } else if (n == 0) {
|
|
|
- LOGD("连接正常断开");
|
|
|
- break;
|
|
|
- } else if (n == net::E_TIMEOUT) {
|
|
|
- udpConn->Write((byte*)req, strlen(req));
|
|
|
- LOGD("读取超时");
|
|
|
- } else {
|
|
|
- LOGD("出错");
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- //关闭连接
|
|
|
- udpConn->Close();
|
|
|
- //释放内存
|
|
|
- delete udpConn;
|
|
|
- udpConn = NULL;
|
|
|
- }
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
- //返回真,继续下次线程循环
|
|
|
- return true;
|
|
|
+ LOGD("获得设备信息. result = %s", r.body.c_str());
|
|
|
+ deviceRequest = false;
|
|
|
+ //解析json
|
|
|
+ Json::Reader reader;
|
|
|
+ Json::Value root;
|
|
|
+ if (reader.parse(r.body, root, false)){
|
|
|
+ string partName = root["part_display"].asString();
|
|
|
+ StoragePreferences::putString(STORE_PARTNAME,partName);
|
|
|
+ NavibarSetPartName(partName);
|
|
|
+ //设备
|
|
|
+ StoragePreferences::putInt(STORE_DEVICE_ID, root["id"].asInt());
|
|
|
+ StoragePreferences::putInt(STORE_DEVICE_TYPE, root["device_type"].asInt());
|
|
|
+
|
|
|
+ //SIP存储
|
|
|
+// StoragePreferences::putString(SIP_REG_DOMAIN, root["sip_ip"].asString()); // 应该去找配置文件里的sip-ip
|
|
|
+ StoragePreferences::putString(SIP_REG_ACCOUNT,root["sip_id"].asString());
|
|
|
+ StoragePreferences::putString(SIP_REG_PASSWORD, root["sip_password"].asString());
|
|
|
+
|
|
|
+ frameInfo["frame_id"] = root["frame_id"].asInt();
|
|
|
+ frameInfo["full_name"] = root["full_name"].asString();
|
|
|
+ frameInfo["part_id"] = root["part_id"].asInt();
|
|
|
+ getFrameInfo();
|
|
|
+
|
|
|
+ //获取科室设置
|
|
|
+ string partId = root["part_id"].asString();
|
|
|
+ StoragePreferences::putString(STORE_PARTID, partId);
|
|
|
+ getPartSetting(partId);
|
|
|
+ getVersion();
|
|
|
}
|
|
|
-};
|
|
|
+}
|
|
|
|
|
|
-static UdpThread udp_thread;
|
|
|
|
|
|
|
|
|
void setReinforce(bool result) {
|
|
@@ -635,15 +581,15 @@ void dataRefresh() {
|
|
|
}
|
|
|
|
|
|
if (serverInfo) {
|
|
|
- udp_thread.getServerInfo();
|
|
|
+ getServerInfo();
|
|
|
}
|
|
|
dataInit = false;
|
|
|
- udp_thread.getDeviceInfo();
|
|
|
+ getDeviceInfo();
|
|
|
mBedListViewPtr->refreshListView();
|
|
|
}
|
|
|
|
|
|
void getPartSetting() {
|
|
|
- udp_thread.getPartSetting(StoragePreferences::getString(STORE_PARTID, ""));
|
|
|
+ getPartSetting(StoragePreferences::getString(STORE_PARTID, ""));
|
|
|
}
|
|
|
|
|
|
|
|
@@ -696,7 +642,7 @@ void sendNursingEnd() {
|
|
|
}
|
|
|
|
|
|
void setTemplate() {
|
|
|
- udp_thread.getTemplate();
|
|
|
+ getTemplate();
|
|
|
mBedListViewPtr->refreshListView();
|
|
|
}
|
|
|
|
|
@@ -719,9 +665,9 @@ static void onUI_init(){
|
|
|
LOGD("进入mainLogic页面, 触发 onUI_init");
|
|
|
if (ETHERNETMANAGER->isConnected() || WIFIMANAGER->isConnected()) {
|
|
|
if(serverInfo) { // 如果是false,就是不需要
|
|
|
- udp_thread.getServerInfo();
|
|
|
+ getServerInfo();
|
|
|
}
|
|
|
- udp_thread.getDeviceInfo();
|
|
|
+ getDeviceInfo();
|
|
|
}
|
|
|
|
|
|
if (StoragePreferences::getBool(STORE_NURSING_TYPE, false)) { // 如果处于护理状态
|
|
@@ -826,6 +772,20 @@ static bool onUI_Timer(int id){
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
|
+
|
|
|
+ case REQUEST_TIME_HANDLE:
|
|
|
+ {
|
|
|
+ if (deviceRequest) {
|
|
|
+ getDeviceInfo();
|
|
|
+ }
|
|
|
+ if (frameRequest) {
|
|
|
+ getFrameRoom(frameInfo["frame_id"].asInt());
|
|
|
+ }
|
|
|
+ if (!deviceRequest && !frameRequest) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ break;
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
@@ -950,7 +910,17 @@ static void obtainListItemData_BedListView(ZKListView *pListView,ZKListView::ZKL
|
|
|
} else {
|
|
|
pListItem->findSubItemByID(ID_MAIN_CustomerName)->setText(customerName);
|
|
|
}
|
|
|
- pListItem->findSubItemByID(ID_MAIN_CustomerAge)->setText(frameBedList[index]["customer_age"].asString() + frameBedList[index]["customer_age_unit"].asString());
|
|
|
+
|
|
|
+ if (partSetting.customerAgeHiddenOnDoor != 0) {
|
|
|
+ if (frameBedList[index]["customer_age"].asString() == "") {
|
|
|
+ pListItem->findSubItemByID(ID_MAIN_CustomerAge)->setText("");
|
|
|
+ } else {
|
|
|
+ pListItem->findSubItemByID(ID_MAIN_CustomerAge)->setText("*" + frameBedList[index]["customer_age_unit"].asString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ pListItem->findSubItemByID(ID_MAIN_CustomerAge)->setText(frameBedList[index]["customer_age"].asString() + frameBedList[index]["customer_age_unit"].asString());
|
|
|
+ }
|
|
|
|
|
|
string customerSex = frameBedList[index]["customer_sex"].asString();
|
|
|
if (customerSex == "0") { // 如果性别为女性,则替换成女性头像,和女性的图标
|