|
@@ -95,6 +95,19 @@ void setMainTheme() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+void setMainMode() {
|
|
|
+ if (mainModeInt == 3) {
|
|
|
+ mDirectorPainterPtr->setVisible(true);
|
|
|
+ mDirectLinePainterPtr->setVisible(true);
|
|
|
+ mDirectorTitleTextViewPtr->setVisible(true);
|
|
|
+ mDirectorTextViewPtr->setVisible(true);
|
|
|
+ mNurseHeadPainterPtr->setVisible(true);
|
|
|
+ mNurseHeadLinePainterPtr->setVisible(true);
|
|
|
+ mNurseTitleTextViewPtr->setVisible(true);
|
|
|
+ mNurseHeadTextViewPtr->setVisible(true);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
static void getServerInfo(){
|
|
|
|
|
|
string url = getHttpGateway() + "/ncs_url/server_info";
|
|
@@ -164,7 +177,7 @@ static void getFrameRoom(int frame_id) {
|
|
|
if (mainModeInt == 1) {
|
|
|
mBedListViewPtr->refreshListView();
|
|
|
}
|
|
|
- else {
|
|
|
+ else if (mainModeInt == 2) {
|
|
|
if (frameBedList.size() <= 3) {
|
|
|
mBedListViewPtr->refreshListView();
|
|
|
mBedListViewPtr->setVisible(true);
|
|
@@ -185,6 +198,11 @@ static void getFrameRoom(int frame_id) {
|
|
|
mBedListView3Ptr->setVisible(true);
|
|
|
}
|
|
|
}
|
|
|
+ else if (mainModeInt == 3) {
|
|
|
+ mBedListView4Ptr->refreshListView();
|
|
|
+ mBedListViewPtr->setVisible(false);
|
|
|
+ mBedListView4Ptr->setVisible(true);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -198,6 +216,10 @@ static void setRightTitle(Json::Value partSetting) {
|
|
|
rightTitleInfo["nurse_valid"] = partSetting["nurse_valid"].asInt();
|
|
|
}
|
|
|
|
|
|
+static void setDirectorAndHeadNurse() {
|
|
|
+ mDirectorTextViewPtr->setText(partSetting.partDirector);
|
|
|
+ mNurseHeadTextViewPtr->setText(partSetting.partNurseHead);
|
|
|
+}
|
|
|
|
|
|
|
|
|
static void getPartSetting(string partId){
|
|
@@ -259,6 +281,8 @@ static void getPartSetting(string partId){
|
|
|
partSetting.doorNurseValid = root["door_nurse_valid"].asInt();
|
|
|
partSetting.doorNursingTitle = root["door_nursing_title"].asString();
|
|
|
partSetting.doorNursingValid = root["door_nursing_valid"].asInt();
|
|
|
+ partSetting.partDirector = root["part_director"].asString();
|
|
|
+ partSetting.partNurseHead = root["part_nurse_head"].asString();
|
|
|
partSetting.upSeconds = root["up_seconds"].asInt();
|
|
|
partSetting.autoAccept = root["auto_accept"].asInt();
|
|
|
partSetting.eventForward = root["event_forward"].asInt();
|
|
@@ -307,6 +331,7 @@ static void getPartSetting(string partId){
|
|
|
|
|
|
setRightTitle(root);
|
|
|
callBedButtonSetVisible();
|
|
|
+ setDirectorAndHeadNurse();
|
|
|
|
|
|
getFrameRoom(frameInfo["frame_id"].asInt());
|
|
|
|
|
@@ -412,6 +437,7 @@ static void getDeviceInfo(){
|
|
|
if (dataInit){
|
|
|
getFrameInfo();
|
|
|
getBedCount();
|
|
|
+ setDirectorAndHeadNurse();
|
|
|
return;
|
|
|
}
|
|
|
string url = getHttpGateway() + "/deviceRoom/get_device_by_eth_mac/" + StoragePreferences::getString(STORE_MAC_ADDR, "0.0.0.0");
|
|
@@ -497,6 +523,7 @@ static void onUI_init(){
|
|
|
}
|
|
|
getDeviceInfo();
|
|
|
}
|
|
|
+ setMainMode();
|
|
|
|
|
|
}
|
|
|
|
|
@@ -591,11 +618,6 @@ static int getListItemCount_BedListView(const ZKListView *pListView) {
|
|
|
static void obtainListItemData_BedListView(ZKListView *pListView,ZKListView::ZKListItem *pListItem, int index) {
|
|
|
//LOGD(" obtainListItemData_ BedListView !!!\n");
|
|
|
|
|
|
- if (mainModeInt == 2) {
|
|
|
- if (frameBedList.size() > 3) {
|
|
|
- return;
|
|
|
- }
|
|
|
- }
|
|
|
if (frameBedList.size() > 0) {
|
|
|
ZKListView::ZKListSubItem* bedNum = pListItem->findSubItemByID(ID_MAIN_BedNumSubItem);
|
|
|
ZKListView::ZKListSubItem* name = pListItem->findSubItemByID(ID_MAIN_CustomerNameSubItem);
|
|
@@ -606,6 +628,13 @@ static void obtainListItemData_BedListView(ZKListView *pListView,ZKListView::ZKL
|
|
|
ZKListView::ZKListSubItem* doctor = pListItem->findSubItemByID(ID_MAIN_DoctorSubItem);
|
|
|
ZKListView::ZKListSubItem* nurse = pListItem->findSubItemByID(ID_MAIN_NurseSubItem);
|
|
|
|
|
|
+
|
|
|
+ if (mainModeInt == 2) {
|
|
|
+ if (frameBedList.size() > 3) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if (mainThemeInt == 1) {
|
|
|
bedNum->setBackgroundPic("/9/chuanghao_bg.9.png");
|
|
|
}
|
|
@@ -937,3 +966,98 @@ static void obtainListItemData_BedListView3(ZKListView *pListView,ZKListView::ZK
|
|
|
static void onListItemClick_BedListView3(ZKListView *pListView, int index, int id) {
|
|
|
//LOGD(" onListItemClick_ BedListView3 !!!\n");
|
|
|
}
|
|
|
+static int getListItemCount_BedListView4(const ZKListView *pListView) {
|
|
|
+ //LOGD("getListItemCount_BedListView4 !\n");
|
|
|
+ return frameBedList.size();
|
|
|
+}
|
|
|
+
|
|
|
+static void obtainListItemData_BedListView4(ZKListView *pListView,ZKListView::ZKListItem *pListItem, int index) {
|
|
|
+ //LOGD(" obtainListItemData_ BedListView4 !!!\n");
|
|
|
+ if (mainModeInt == 3 && frameBedList.size()> 0) {
|
|
|
+ ZKListView::ZKListSubItem* bedNum = pListItem->findSubItemByID(ID_MAIN_BedNumSubItem4);
|
|
|
+ ZKListView::ZKListSubItem* name = pListItem->findSubItemByID(ID_MAIN_CustomerNameSubItem4);
|
|
|
+ ZKListView::ZKListSubItem* age = pListItem->findSubItemByID(ID_MAIN_AgeSubItem4);
|
|
|
+ ZKListView::ZKListSubItem* sex = pListItem->findSubItemByID(ID_MAIN_SexSubItem4);
|
|
|
+ ZKListView::ZKListSubItem* doctorTitle = pListItem->findSubItemByID(ID_MAIN_DoctorTitleSubItem4);
|
|
|
+ ZKListView::ZKListSubItem* nurseTitle = pListItem->findSubItemByID(ID_MAIN_NurseTitleSubItem4);
|
|
|
+ ZKListView::ZKListSubItem* doctor = pListItem->findSubItemByID(ID_MAIN_DoctorSubItem4);
|
|
|
+ ZKListView::ZKListSubItem* nurse = pListItem->findSubItemByID(ID_MAIN_NurseSubItem4);
|
|
|
+
|
|
|
+ if (mainThemeInt == 1) {
|
|
|
+ bedNum->setBackgroundPic("/9/chuanghao_bg.9.png");
|
|
|
+ }
|
|
|
+ else if (mainThemeInt == 2) {
|
|
|
+ bedNum->setBackgroundPic("/9/chuanghao_bg_pink.9.png");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ string frameBedName = frameBedList[index]["frame_bed"]["full_name"].asString();
|
|
|
+ if (frameBedName == "") {
|
|
|
+ bedNum->setText(LANGUAGEMANAGER->getValue("EmptyBed"));
|
|
|
+ } else {
|
|
|
+ int nPos = frameBedName.find("-");
|
|
|
+ if (nPos != -1) {
|
|
|
+ frameBedName = frameBedName.substr(nPos + 1, frameBedName.length());
|
|
|
+ }
|
|
|
+ bedNum->setText(frameBedName);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 用户相关
|
|
|
+ string customerName = frameBedList[index]["customer_name"].asString();
|
|
|
+ if (customerName == "") {
|
|
|
+ name->setText(LANGUAGEMANAGER->getValue("EmptyCustomer"));
|
|
|
+ } else {
|
|
|
+ name->setText(customerName);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if (partSetting.customerAgeHiddenOnDoor != 0) {
|
|
|
+ if (frameBedList[index]["customer_age"].asString() == "") {
|
|
|
+ age->setText("");
|
|
|
+ } else {
|
|
|
+ age->setText("*" + frameBedList[index]["customer_age_unit"].asString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ age->setText(frameBedList[index]["customer_age"].asString() + frameBedList[index]["customer_age_unit"].asString());
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ string customerSex = frameBedList[index]["customer_sex"].asString();
|
|
|
+ if (customerSex == "0") { // 如果性别为女性,替换成女性,底色为粉色
|
|
|
+ sex->setText(LANGUAGEMANAGER->getValue("Woman"));
|
|
|
+ sex->setTextColor(0xFF9F9F);
|
|
|
+ sex->setBackgroundPic("9/lightRed.9.png");
|
|
|
+ }
|
|
|
+ else if (customerSex == "1") {
|
|
|
+ sex->setText(LANGUAGEMANAGER->getValue("Man"));
|
|
|
+ sex->setTextColor(0x3A78EF);
|
|
|
+ sex->setBackgroundPic("9/lightBlue.9.png");
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ sex->setText(LANGUAGEMANAGER->getValue("Unknown"));
|
|
|
+ sex->setTextColor(0x37B643);
|
|
|
+ sex->setBackgroundPic("9/lightGreen.9.png");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ // 医生护士相关
|
|
|
+ if (rightTitleInfo["doctor_valid"] != 1){
|
|
|
+ doctorTitle->setVisible(false);
|
|
|
+ } else {
|
|
|
+ doctorTitle->setText(rightTitleInfo["doctor_title"].asString());
|
|
|
+ }
|
|
|
+
|
|
|
+ if (rightTitleInfo["nurse_valid"] != 1){
|
|
|
+ nurseTitle->setVisible(false);
|
|
|
+ } else {
|
|
|
+ nurseTitle->setText(rightTitleInfo["nurse_title"].asString());
|
|
|
+ }
|
|
|
+ doctor->setText(frameBedList[index]["doctor_name"].asString());
|
|
|
+ nurse->setText(frameBedList[index]["nurse_name"].asString());
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+static void onListItemClick_BedListView4(ZKListView *pListView, int index, int id) {
|
|
|
+ //LOGD(" onListItemClick_ BedListView4 !!!\n");
|
|
|
+}
|