|
@@ -25,6 +25,7 @@ import android.support.annotation.Nullable;
|
|
|
import android.support.design.widget.Snackbar;
|
|
|
import android.support.v4.content.ContextCompat;
|
|
|
import android.support.v7.widget.RecyclerView;
|
|
|
+import android.text.TextUtils;
|
|
|
import android.view.Gravity;
|
|
|
import android.view.MotionEvent;
|
|
|
import android.view.View;
|
|
@@ -335,6 +336,12 @@ public class CallingBedActivity extends BaseActivity implements ISerialPortBedOn
|
|
|
TextView tvAgeGender;
|
|
|
@Bind(R.id.activity_calling_bed_layout_tv_illness)
|
|
|
TextView tvIllness;
|
|
|
+ @Bind(R.id.tv_patient_number)
|
|
|
+ TextView tvPatientNo;
|
|
|
+ @Bind(R.id.tv_patient_indate)
|
|
|
+ TextView tvPatientIndate;
|
|
|
+ @Bind(R.id.tv_app_version)
|
|
|
+ TextView tvAppVersion;
|
|
|
|
|
|
|
|
|
//医嘱界面
|
|
@@ -445,6 +452,9 @@ public class CallingBedActivity extends BaseActivity implements ISerialPortBedOn
|
|
|
float moveY;
|
|
|
long currentMS;
|
|
|
|
|
|
+ //床位是否入住
|
|
|
+ private boolean isEmptyInfo = true;
|
|
|
+
|
|
|
/**
|
|
|
* 时间线程
|
|
|
*/
|
|
@@ -488,9 +498,9 @@ public class CallingBedActivity extends BaseActivity implements ISerialPortBedOn
|
|
|
}
|
|
|
|
|
|
//拉起增长页面(20191017 waderson)
|
|
|
- if(MyApplication.have_long_main_page){
|
|
|
- callLongNursePage(second);
|
|
|
- }
|
|
|
+ //if(MyApplication.have_long_main_page){
|
|
|
+ // callLongNursePage(second);
|
|
|
+ //}
|
|
|
|
|
|
//自动回来主页面 add by waderson 20190707
|
|
|
comeBackMainPage();
|
|
@@ -894,6 +904,8 @@ public class CallingBedActivity extends BaseActivity implements ISerialPortBedOn
|
|
|
* 由于机器性能方面的差异有些机子的串口反应速度比较慢;急速初始化将失效!
|
|
|
* */
|
|
|
handler.sendEmptyMessageDelayed(INIT_SYSTEM, 3000);
|
|
|
+
|
|
|
+ tvAppVersion.setText("V" + BuildConfig.VERSION_NAME);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -997,6 +1009,10 @@ public class CallingBedActivity extends BaseActivity implements ISerialPortBedOn
|
|
|
String str_m = str.substring(0, 6 - initDataEntity.getId().length()) + initDataEntity.getId();
|
|
|
|
|
|
tvExtensionNum.setText("分机号:" + str_m);
|
|
|
+
|
|
|
+ if (!TextUtils.isEmpty(initDataEntity.getHospital()) && !TextUtils.isEmpty(initDataEntity.getDepartments())) {
|
|
|
+ tvHospitalName.setText(initDataEntity.getHospital() + initDataEntity.getDepartments());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1211,7 +1227,8 @@ public class CallingBedActivity extends BaseActivity implements ISerialPortBedOn
|
|
|
});
|
|
|
} else {
|
|
|
LogUtil.d("getMainData", "setWelcomeView==succeed==");
|
|
|
- setWelcomeView();
|
|
|
+ //setWelcomeView();
|
|
|
+ setDefaultMainView();
|
|
|
dismissNurseBrightness();
|
|
|
}
|
|
|
}
|
|
@@ -1333,12 +1350,22 @@ public class CallingBedActivity extends BaseActivity implements ISerialPortBedOn
|
|
|
vWelcome.setVisibility(View.VISIBLE);
|
|
|
}
|
|
|
|
|
|
+ private void setDefaultMainView() {
|
|
|
+ isEmptyInfo = true;
|
|
|
+ setTitle();
|
|
|
+ vMain.setVisibility(View.VISIBLE);
|
|
|
+ if (initDataEntity != null) {
|
|
|
+ tvBedNum.setText(initDataEntity.getDeviceBedNum());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 更新主界面UI
|
|
|
*/
|
|
|
private void setMainView() {
|
|
|
if (null != mainDataEntity) {
|
|
|
//关闭欢迎界面
|
|
|
+ isEmptyInfo = false;
|
|
|
vWelcome.setVisibility(View.GONE);
|
|
|
vMain.setVisibility(View.VISIBLE);
|
|
|
|
|
@@ -1384,7 +1411,13 @@ public class CallingBedActivity extends BaseActivity implements ISerialPortBedOn
|
|
|
tvAgeGender.setText(ageGender);
|
|
|
|
|
|
//病情
|
|
|
- tvIllness.setText(mainDataEntity.getIllness());
|
|
|
+ if (TextUtils.isEmpty(mainDataEntity.getIllness())) {
|
|
|
+ tvIllness.setText("暂无");
|
|
|
+ } else {
|
|
|
+ tvIllness.setText(mainDataEntity.getIllness());
|
|
|
+ }
|
|
|
+ tvPatientNo.setText("住院号: " + mainDataEntity.getInpatientNum());
|
|
|
+ tvPatientIndate.setText("入院日期: " + mainDataEntity.getAdmissionTime());
|
|
|
|
|
|
setTitle();
|
|
|
}
|
|
@@ -1553,9 +1586,9 @@ public class CallingBedActivity extends BaseActivity implements ISerialPortBedOn
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (null != vWelcome) {
|
|
|
+ if (!isEmptyInfo) {
|
|
|
//只有在欢迎界面没有显示的时候串口才能用
|
|
|
- if (vWelcome.getVisibility() == View.GONE) {
|
|
|
+ //if (vWelcome.getVisibility() == View.GONE) {
|
|
|
//面板呼叫按键
|
|
|
if (buffer[5] == -1) {//按键常态
|
|
|
LogUtil.d("WWW", "呼叫护士键==-1");
|
|
@@ -1612,7 +1645,7 @@ public class CallingBedActivity extends BaseActivity implements ISerialPortBedOn
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
- }
|
|
|
+ //}
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -2380,9 +2413,11 @@ public class CallingBedActivity extends BaseActivity implements ISerialPortBedOn
|
|
|
protected void showLlRightView() {
|
|
|
timeOfHideSlideView = 0;
|
|
|
//changeTextColor(null);
|
|
|
- Animation animation = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.in_righttoleft);
|
|
|
- llRight.setAnimation(animation);
|
|
|
- llRight.setVisibility(View.VISIBLE);
|
|
|
+ if (!isEmptyInfo) {
|
|
|
+ Animation animation = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.in_righttoleft);
|
|
|
+ llRight.setAnimation(animation);
|
|
|
+ llRight.setVisibility(View.VISIBLE);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -2626,9 +2661,9 @@ public class CallingBedActivity extends BaseActivity implements ISerialPortBedOn
|
|
|
@Override
|
|
|
public void onStatusVvsipCallEvent(VvsipCall call) {
|
|
|
LogUtil.d("QQWW", "onStatusVvsipCallEvent----call.mState:==" + call.mState + call.isIncomingCall());
|
|
|
- if (!isVisible(vWelcome)) {
|
|
|
- vMain_big.setVisibility(View.GONE);//显示增长页面20191017
|
|
|
- }
|
|
|
+// if (!isVisible(vWelcome)) {
|
|
|
+// vMain_big.setVisibility(View.GONE);//显示增长页面20191017
|
|
|
+// }
|
|
|
switch (call.mState) {
|
|
|
case 0://正在呼叫中:子机自动接通 isIncomingCall() = true mState = 0 //正在通话中:isIncomingCall() = true
|
|
|
CALL_STATUS = Constants.IN_CALL;
|
|
@@ -2774,7 +2809,7 @@ public class CallingBedActivity extends BaseActivity implements ISerialPortBedOn
|
|
|
protected void comeBackMainPage() {
|
|
|
timeOfBackMainPage++;
|
|
|
timeOut--;
|
|
|
- if (!isVisible(vMain) && timeOfBackMainPage >= callTimeOutBack && !CALL_STATUS.equals(Constants.IN_CALLING) && !isVisible(vWelcome)) {
|
|
|
+ if (!isVisible(vMain) && timeOfBackMainPage >= callTimeOutBack && !CALL_STATUS.equals(Constants.IN_CALLING) && !isEmptyInfo) {
|
|
|
// if (callNurse) {//超时自动取消呼叫了,20191118 之前是长按取消呼叫,后来又改成了根据UI的改变来取消,说让客户一目了然
|
|
|
// callNurse = false;
|
|
|
// UdpSendUtil.sendHangUp(initDataEntity, mainDataEntity);//取消呼叫 add by waderson 20191118
|
|
@@ -2820,7 +2855,7 @@ public class CallingBedActivity extends BaseActivity implements ISerialPortBedOn
|
|
|
* 自动拉起护理项加长页面
|
|
|
*/
|
|
|
protected void callLongNursePage(String second) {
|
|
|
- if (!isVisible(vWelcome) && !CALL_STATUS.equals(Constants.IN_CALLING)) {
|
|
|
+ if (!isEmptyInfo && !CALL_STATUS.equals(Constants.IN_CALLING)) {
|
|
|
|
|
|
if ("0".equals(second) || "30".equals(second)) {//一分钟跳4次
|
|
|
if (isVisible(vMain) && !isVisible(vMain_big)) {
|