Explorar o código

门灯控制优化

weizhengliang hai 7 meses
pai
achega
65902dd409

+ 5 - 8
callingdoor/src/main/java/com/wdkl/app/ncs/callingdoor/activity/CallingdoorActivity.kt

@@ -266,8 +266,7 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
         //3288 15.6寸竖屏:width=1080, height=1920
         //3288 10.1寸竖屏:width=800,  height=1280
         Log.d(TAG, "device orientation: ${Constant.DEVICE_ORIENTATION}, width: ${dm.widthPixels}, height: ${dm.heightPixels}")
-        //显示分机呼叫
-        startScheduledExecutor()
+
     }
 
     //检查launch版本
@@ -338,7 +337,7 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
     private fun startScheduledExecutor() {
         val timerTask: TimerTask = object : TimerTask() {
             override fun run() {
-                checkCalls()
+                //checkCalls()
             }
         }
 
@@ -1349,12 +1348,10 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
                             SettingConfig.setNursingId(activity, nursingInteId)
                             SerialPortHelper.setDoorLight(1, Constant.nursingColor) //绿色
                         } else if (tcpModel.action == TcpAction.SideAction.SHOW || tcpModel.action == TcpAction.SideAction.CLEAR) {
+                            //显示分机呼叫或紧急呼叫
                             updateCallInfo(tcpModel)
-                        } else if (tcpModel.action == TcpAction.SideAction.CALL ) {
-                            updateBedCall(interactionVO, true)
-                        }else if (tcpModel.action == TcpAction.SideAction.ACCEPT ||tcpModel.action == TcpAction.SideAction.CANCEL ) {
-                            updateBedCall(interactionVO, false)
-                        }else{
+                        } else {
+                            //门灯控制
                             callControl(tcpModel)
                         }
                     } else if (tcpModel.action == TcpAction.TimeAction.SYNC && tcpModel.type == TcpType.TIME) {

+ 1 - 1
callingdoor/src/main/java/com/wdkl/app/ncs/callingdoor/fragment/MainFragment.kt

@@ -123,7 +123,7 @@ class MainFragment: BaseFragment<MainFragmentPresenter, MainViewLayoutBinding>()
             Constant.bedCustomIn = count > 0
 
             //当前没有呼叫则
-            if (Constant.callNums == 0 && !Constant.sosOn) {
+            if (!Constant.inNursing && !Constant.sosOn) {
                 DoorLightHelper.resetDoorLight()
             }
 

+ 3 - 2
callingdoor/src/main/java/com/wdkl/app/ncs/callingdoor/fragment/SipCallFragment.kt

@@ -207,6 +207,9 @@ class SipCallFragment: BaseCallFragment() {
         if (sky_voice_call_timer != null) {
             sky_voice_call_timer.stop()
         }
+        if (!Constant.inNursing && !Constant.sosOn) {
+            DoorLightHelper.resetDoorLight()
+        }
         RingPlayHelper.stopRingTone()
         SerialPortHelper.setCallStatus("0")
         handler.removeCallbacksAndMessages(null)
@@ -331,7 +334,6 @@ class SipCallFragment: BaseCallFragment() {
     //呼叫取消
     private fun cancelCall() {
         cancelTimer()
-        DoorLightHelper.resetDoorLight()
         Constant.CALL_STATE = Constant.CALL_STANDBY
         if (sky_voice_call_timer != null) {
             sky_voice_call_timer.stop()
@@ -371,7 +373,6 @@ class SipCallFragment: BaseCallFragment() {
     override fun callEnd(handoff: Boolean) {
         Log.e(TAG, ">>>>>>>>>>> call end !!!!!!!!!!!!!!!!!!")
         RingPlayHelper.stopRingTone()
-        DoorLightHelper.resetDoorLight()
         countDownTimer.cancel()
 
         synchronized(this) {

+ 2 - 7
callingdoor/src/main/java/com/wdkl/app/ncs/callingdoor/fragment/SkyCallFragment.kt

@@ -239,10 +239,9 @@ class SkyCallFragment: BaseCallFragment(), CallSessionCallback {
         RingPlayHelper.stopRingTone()
 
         //如果当前在护理中则不操作门灯,如果不在护理中则重置门灯
-        //if (("rk3128".equals(Build.MODEL) || "rk3368".equals(Build.MODEL)) && !Constant.inNursing) {
-            //SerialPortHelper.setDoorLight(1, "111") //白色
+        if (!Constant.inNursing && !Constant.sosOn) {
             DoorLightHelper.resetDoorLight()
-        //}
+        }
     }
 
     private fun voiceAccept() {
@@ -386,7 +385,6 @@ class SkyCallFragment: BaseCallFragment(), CallSessionCallback {
     //呼叫取消
     private fun cancelCall() {
         cancelTimer()
-        DoorLightHelper.resetDoorLight()
         Constant.CALL_STATE = Constant.CALL_STANDBY
         if (sky_voice_call_timer != null) {
             sky_voice_call_timer.stop()
@@ -395,9 +393,6 @@ class SkyCallFragment: BaseCallFragment(), CallSessionCallback {
     }
 
     private fun showCalling(audioOnly: Boolean) {
-        //接听后重置门灯
-        DoorLightHelper.resetDoorLight()
-
         if (callEnded) {
             return
         }

+ 3 - 3
callingdoor/src/main/java/com/wdkl/app/ncs/callingdoor/helper/DoorLightHelper.java

@@ -39,15 +39,15 @@ public class DoorLightHelper {
         //有人入住时点亮门灯,无人入住关闭门灯
         Constant.inNursing = SettingConfig.getInNursing(BaseApplication.appContext);
         if (Constant.inNursing) {
-//            SerialPortHelper.setDoorLight(1, Constant.nursingColor); //绿色
+            //SerialPortHelper.setDoorLight(1, Constant.nursingColor); //绿色
             HardWareFactroy.getHardTools().setDoorLight(1);
         } else {
             if (Constant.bedCustomIn) {
-//                SerialPortHelper.setDoorLight(1, "111"); //白色
+                //SerialPortHelper.setDoorLight(1, "111"); //白色
                 HardWareFactroy.getHardTools().setDoorLight(2);
             } else {
                 HardWareFactroy.getHardTools().setDoorLight(4);
-//                SerialPortHelper.setDoorLight(0, "000"); //关闭
+                //SerialPortHelper.setDoorLight(0, "000"); //关闭
             }
         }
     }

+ 1 - 1
callingdoor/src/main/res/layout-land/view_title_layout.xml

@@ -105,7 +105,7 @@
             android:id="@+id/view_title_layout_tv_point"
             android:layout_width="20dp"
             android:layout_height="20dp"
-            android:layout_centerVertical="true"
+            android:layout_gravity="center_vertical"
             android:layout_marginLeft="4dp"
             android:layout_marginRight="4dp"
             android:visibility="gone"

+ 1 - 1
callingdoor/src/main/res/layout/view_title_layout.xml

@@ -101,7 +101,7 @@
             android:id="@+id/view_title_layout_tv_point"
             android:layout_width="20dp"
             android:layout_height="20dp"
-            android:layout_centerVertical="true"
+            android:layout_gravity="center_vertical"
             android:layout_marginLeft="4dp"
             android:layout_marginRight="4dp"
             android:visibility="gone"