Browse Source

宿舍版本:智能家居增加窗帘 ,护士主机增加宿舍端ui

xunchuanzhi 7 months ago
parent
commit
473dc3c724
21 changed files with 3474 additions and 18 deletions
  1. 4 1
      android_bed/src/main/java/com/wdkl/app/ncs/callingbed/activity/CallingbedDormitoryActivity.kt
  2. 85 0
      android_bed/src/main/java/com/wdkl/app/ncs/callingbed/fragment/DormCurtainSetFragment.kt
  3. 3 1
      android_bed/src/main/java/com/wdkl/app/ncs/callingbed/fragment/DormReceptacleSetFragment.kt
  4. 4 1
      android_bed/src/main/java/com/wdkl/app/ncs/callingbed/fragment/DormSmartHomeFragment.kt
  5. 3 1
      android_bed/src/main/java/com/wdkl/app/ncs/callingbed/fragment/DormThemeFragment.kt
  6. 5 4
      android_bed/src/main/res/drawable/po_seekbar_v.xml
  7. 28 0
      android_bed/src/main/res/drawable/po_seekbar_w.xml
  8. 7 0
      android_bed/src/main/res/drawable/shape_drom_curtain_bg.xml
  9. 295 0
      android_bed/src/main/res/layout/fragment_dorm_curtain_set.xml
  10. 9 7
      android_bed/src/main/res/layout/fragment_smart_home.xml
  11. BIN
      android_bed/src/main/res/mipmap-mdpi/curtain_bg.png
  12. BIN
      android_bed/src/main/res/mipmap-mdpi/curtain_img.png
  13. BIN
      android_bed/src/main/res/mipmap-mdpi/curtain_top.png
  14. BIN
      android_bed/src/main/res/mipmap-mdpi/d_xz_f.png
  15. BIN
      android_bed/src/main/res/mipmap-mdpi/d_xz_z.png
  16. BIN
      android_bed/src/main/res/mipmap-mdpi/thumb_img.png
  17. 10 3
      android_host/src/main/java/com/wdkl/ncs/android/component/nursehome/activity/CallingHostActivationActivity.kt
  18. 3008 0
      android_host/src/main/java/com/wdkl/ncs/android/component/nursehome/activity/NurseHome2Activity.kt
  19. 2 0
      android_host/src/main/java/com/wdkl/ncs/android/component/nursehome/di/NurseHomeComponent.kt
  20. 4 0
      android_host/src/main/java/com/wdkl/ncs/android/component/nursehome/hardware/HardTools.java
  21. 7 0
      android_host/src/main/java/com/wdkl/ncs/android/component/nursehome/hardware/imp/ZKEHardTools.java

+ 4 - 1
android_bed/src/main/java/com/wdkl/app/ncs/callingbed/activity/CallingbedDormitoryActivity.kt

@@ -98,12 +98,15 @@ class CallingbedDormitoryActivity :BaseActivity<BedCallingbedActivityPresenter,
     private lateinit var receiver: TimeReceiver
 
     private var curFragment = ""
-    //公寓首页
+    //宿舍首页
     private val dormFragment = "dorm_fragment"
     //交互记录页面
     private val dormCallRecordFragment = "dorm_call_record_fragment"
+    //更换背景
     private val dormThemeFragment = "dorm_theme_fragment"
+    //
     private val dormDialFragment = "dorm_dial_fragment"
+    //智能家居
     private val dormSmartHomeFragment = "dorm_smart_home_fragment"
 
     private var fullFragment: Fragment? = null

+ 85 - 0
android_bed/src/main/java/com/wdkl/app/ncs/callingbed/fragment/DormCurtainSetFragment.kt

@@ -0,0 +1,85 @@
+package com.wdkl.app.ncs.callingbed.fragment
+
+import com.enation.javashop.net.engine.model.NetState
+import com.wdkl.app.ncs.callingbed.R
+import com.wdkl.app.ncs.callingbed.databinding.FragmentDormReceptacleSetBinding
+import com.wdkl.app.ncs.callingbed.launch.CallingbedLaunch
+import com.wdkl.ncs.android.lib.base.BaseFragment
+import com.wdkl.ncs.android.lib.utils.showMessage
+import com.wdkl.ncs.android.lib.vo.filter
+import com.wdkl.ncs.android.middleware.logic.contract.callingbed.BedMomMianFragmentContract
+import com.wdkl.ncs.android.middleware.logic.presenter.callingbed.BedMomMianFragmentPresenter
+import com.wdkl.ncs.android.middleware.model.dos.EventDO
+import com.wdkl.ncs.android.middleware.model.dos.PartSettingDO
+import com.wdkl.ncs.android.middleware.model.dos.RoleDO
+import com.wdkl.ncs.android.middleware.model.vo.BedRelativeVO
+import com.wdkl.ncs.android.middleware.model.vo.CustomerInfoVO
+import com.wdkl.ncs.android.middleware.model.vo.InteractionVO
+/**
+* 智能窗帘
+ * */
+class DormCurtainSetFragment: BaseFragment<BedMomMianFragmentPresenter, FragmentDormReceptacleSetBinding>(), BedMomMianFragmentContract.View {
+
+    override fun getLayId(): Int {
+        return R.layout.fragment_dorm_curtain_set
+    }
+
+    override fun bindDagger() {
+        CallingbedLaunch.component.inject(this)
+    }
+
+    override fun init() {
+        //todo
+    }
+
+    override fun bindEvent() {
+        //todo
+    }
+
+    override fun destory() {
+    }
+
+    override fun showCustomInfo(customInfo: CustomerInfoVO) {
+
+    }
+
+    override fun showRelativeInfo(bedRelativeVO: ArrayList<BedRelativeVO>) {
+
+    }
+
+    override fun showEvents(data: ArrayList<EventDO>) {
+
+    }
+
+    override fun setPartSettings(partSetting: PartSettingDO) {
+
+    }
+
+    override fun loadRoles(roles: List<RoleDO>) {
+
+    }
+
+    override fun showRoleData(data: InteractionVO) {
+
+    }
+
+    override fun onError(message: String, type: Int) {
+        showMessage(message)
+    }
+
+    override fun complete(message: String, type: Int) {
+    }
+
+    override fun start() {
+    }
+
+    override fun networkMonitor(state: NetState) {
+        state.filter(onWifi = {
+
+        }, onMobile = {
+
+        }, offline = {
+
+        })
+    }
+}

+ 3 - 1
android_bed/src/main/java/com/wdkl/app/ncs/callingbed/fragment/DormReceptacleSetFragment.kt

@@ -15,7 +15,9 @@ import com.wdkl.ncs.android.middleware.model.dos.RoleDO
 import com.wdkl.ncs.android.middleware.model.vo.BedRelativeVO
 import com.wdkl.ncs.android.middleware.model.vo.CustomerInfoVO
 import com.wdkl.ncs.android.middleware.model.vo.InteractionVO
-
+/**
+* 智能开关
+ * */
 class DormReceptacleSetFragment: BaseFragment<BedMomMianFragmentPresenter, FragmentDormReceptacleSetBinding>(), BedMomMianFragmentContract.View {
 
     override fun getLayId(): Int {

+ 4 - 1
android_bed/src/main/java/com/wdkl/app/ncs/callingbed/fragment/DormSmartHomeFragment.kt

@@ -17,7 +17,9 @@ import com.wdkl.ncs.android.middleware.model.vo.BedRelativeVO
 import com.wdkl.ncs.android.middleware.model.vo.CustomerInfoVO
 import com.wdkl.ncs.android.middleware.model.vo.InteractionVO
 import kotlinx.android.synthetic.main.fragment_smart_home.*
-
+/**
+ * 智能家居界面
+ * */
 class DormSmartHomeFragment: BaseFragment<BedMomMianFragmentPresenter, FragmentSmartHomeBinding>(), BedMomMianFragmentContract.View {
     val TAG = "DormSmartHomeFragment"
 
@@ -48,6 +50,7 @@ class DormSmartHomeFragment: BaseFragment<BedMomMianFragmentPresenter, FragmentS
 
                 R.id.radio_btn_curtain -> {
                     //窗帘
+                    switchChildFragment(DormCurtainSetFragment())
                 }
             }
         }

+ 3 - 1
android_bed/src/main/java/com/wdkl/app/ncs/callingbed/fragment/DormThemeFragment.kt

@@ -22,7 +22,9 @@ import kotlinx.android.synthetic.main.dorm_theme_layout.*
 import java.util.*
 import kotlin.collections.ArrayList
 
-
+/**
+ * 更换背景
+ * */
 class DormThemeFragment : BaseFragment<BedMomMianFragmentPresenter, DormThemeLayoutBinding>(), BedMomMianFragmentContract.View,
     DormThemeAdapter.OnItemClickListener {
 

+ 5 - 4
android_bed/src/main/res/drawable/po_seekbar_v.xml

@@ -4,22 +4,23 @@
     <item android:id="@android:id/background">
         <shape>
             <solid android:color="#33FFFFFF" />
-            <corners android:radius="8dp" />
+            <corners android:radius="20dp" />
         </shape>
     </item>
     <item android:id="@android:id/secondaryProgress">
         <clip>
             <shape>
                 <solid android:color="#33FFFFFF" />
-                <corners android:radius="8dp" />
+                <corners android:radius="20dp" />
             </shape>
         </clip>
     </item>
-    <item android:id="@android:id/progress">
+    <item android:id="@android:id/progress"
+        >
         <clip>
             <shape>
                 <solid android:color="#496BF2" />
-                <corners android:radius="8dp" />
+                <corners android:radius="20dp" />
             </shape>
         </clip>
     </item>

+ 28 - 0
android_bed/src/main/res/drawable/po_seekbar_w.xml

@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <item android:id="@android:id/background">
+        <shape>
+            <solid android:color="#33FFFFFF" />
+            <corners android:radius="20dp" />
+        </shape>
+    </item>
+    <item android:id="@android:id/secondaryProgress">
+        <clip>
+            <shape>
+                <solid android:color="#33FFFFFF" />
+                <corners android:radius="20dp" />
+            </shape>
+        </clip>
+    </item>
+    <item android:id="@android:id/progress"
+        >
+        <clip>
+            <shape>
+                <solid android:color="#fffbf5e5" />
+                <corners android:radius="20dp" />
+            </shape>
+        </clip>
+    </item>
+
+</layer-list>

+ 7 - 0
android_bed/src/main/res/drawable/shape_drom_curtain_bg.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+
+    <solid android:color="#1affffff" />
+    <corners android:radius="@dimen/d60" />
+</shape>

+ 295 - 0
android_bed/src/main/res/layout/fragment_dorm_curtain_set.xml

@@ -0,0 +1,295 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto">
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_marginTop="10dp"
+        android:layout_marginBottom="10dp"
+        android:background="@color/black"
+        android:orientation="horizontal">
+
+        <LinearLayout
+            android:layout_width="@dimen/d410"
+            android:layout_height="match_parent"
+            android:gravity="center_horizontal"
+            android:background="@drawable/shape_dorm_call_item_bg"
+            android:orientation="vertical">
+
+            <LinearLayout
+                android:id="@+id/f_drom_set_ll_1"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_centerInParent="true"
+                android:gravity="center_vertical"
+                android:layout_marginLeft="@dimen/d25"
+                android:layout_marginRight="@dimen/d16"
+                android:layout_marginTop="@dimen/d25"
+                android:orientation="horizontal">
+
+                <SeekBar
+                    android:id="@+id/volume_seek"
+                    android:layout_width="@dimen/d300"
+                    android:layout_height="@dimen/d58"
+                    android:max="100"
+                    android:splitTrack="false"
+                    android:thumb="@mipmap/thumb_img"
+                    android:thumbOffset="@dimen/d15"
+                    android:progressDrawable="@drawable/po_seekbar_v">
+
+                </SeekBar>
+
+                <ImageView
+                    android:layout_width="@dimen/d58"
+                    android:layout_height="@dimen/d58"
+                    android:layout_marginLeft="@dimen/d15"
+                    android:padding="@dimen/d15"
+                    android:background="@drawable/shape_drom_curtain_bg"
+                    android:src="@mipmap/d_xz_z"/>
+
+            </LinearLayout>
+
+            <RelativeLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content">
+
+                <ImageView
+                    android:id="@+id/curtain_bg"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="@dimen/d79"
+                    android:layout_centerInParent="true"
+                    android:src="@mipmap/curtain_bg"/>
+                <ImageView
+                    android:id="@+id/curtain_img1"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="@dimen/d49"
+                    android:layout_marginLeft="@dimen/d25"
+                    android:layout_centerVertical="true"
+                    android:src="@mipmap/curtain_img"/>
+
+                <ImageView
+                    android:id="@+id/curtain_img2"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_toRightOf="@+id/curtain_img1"
+                    android:layout_marginTop="@dimen/d49"
+                    android:layout_centerVertical="true"
+                    android:src="@mipmap/curtain_img"/>
+
+                <ImageView
+                    android:id="@+id/curtain_top"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="20dp"
+                    android:layout_centerHorizontal="true"
+                    android:src="@mipmap/curtain_top"/>
+
+
+
+            </RelativeLayout>
+
+
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="30dp"
+                android:text="客厅窗帘"
+                android:textColor="@color/white"
+                android:textSize="36sp"
+                android:textStyle="bold"/>
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:orientation="horizontal"
+                android:gravity="center"
+                android:layout_marginTop="@dimen/d45"
+                >
+                <TextView
+                    android:layout_width="@dimen/d160"
+                    android:layout_height="wrap_content"
+                    android:background="@mipmap/d_btn_bg"
+                    android:drawableLeft="@mipmap/d_light_off"
+                    android:drawablePadding="@dimen/d10"
+                    android:gravity="center_vertical"
+                    android:paddingLeft="@dimen/d40"
+                    android:text="开启"
+                    android:textColor="@color/white"
+                    android:textSize="24sp" />
+
+                <TextView
+                    android:layout_width="@dimen/d160"
+                    android:layout_height="wrap_content"
+                    android:background="@mipmap/d_btn_bg"
+                    android:layout_marginLeft="@dimen/d25"
+                    android:drawableLeft="@mipmap/d_timer"
+                    android:drawablePadding="@dimen/d10"
+                    android:gravity="center_vertical"
+                    android:paddingLeft="@dimen/d40"
+                    android:text="校准"
+                    android:textColor="@color/white"
+                    android:textSize="24sp" />
+
+            </LinearLayout>
+
+
+        </LinearLayout>
+
+        <LinearLayout
+            android:layout_width="@dimen/d410"
+            android:layout_height="match_parent"
+            android:gravity="center_horizontal"
+            android:layout_marginLeft="@dimen/d20"
+            android:background="@drawable/shape_dorm_call_item_bg"
+            android:orientation="vertical">
+
+            <LinearLayout
+                android:id="@+id/f_drom_set_ll_2"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_centerInParent="true"
+                android:gravity="center_vertical"
+                android:layout_marginLeft="@dimen/d25"
+                android:layout_marginRight="@dimen/d16"
+                android:layout_marginTop="@dimen/d25"
+                android:orientation="horizontal">
+
+                <SeekBar
+                    android:id="@+id/volume_seek_2"
+                    android:layout_width="@dimen/d300"
+                    android:layout_height="@dimen/d58"
+                    android:max="100"
+                    android:progress="20"
+                    android:splitTrack="false"
+                    android:thumb="@mipmap/thumb_img"
+                    android:thumbOffset="@dimen/d15"
+                    android:progressDrawable="@drawable/po_seekbar_w">
+
+                </SeekBar>
+
+                <ImageView
+                    android:layout_width="@dimen/d58"
+                    android:layout_height="@dimen/d58"
+                    android:layout_marginLeft="@dimen/d15"
+                    android:padding="@dimen/d15"
+                    android:background="@drawable/shape_drom_curtain_bg"
+                    android:src="@mipmap/d_xz_z"/>
+
+            </LinearLayout>
+
+            <RelativeLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content">
+
+                <ImageView
+                    android:id="@+id/curtain_bg_2"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="@dimen/d79"
+                    android:layout_centerInParent="true"
+                    android:src="@mipmap/curtain_bg"/>
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:orientation="horizontal"
+                    android:layout_marginTop="@dimen/d45"
+                    android:layout_marginLeft="@dimen/d25"
+                    android:clipChildren="false">
+
+
+                    <ImageView
+                        android:id="@+id/curtain_img1_2"
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="0.5"
+                        android:layout_centerVertical="true"
+                        android:src="@mipmap/curtain_img"
+                        android:scaleType="centerCrop"
+                        android:layout_gravity="right"
+
+                        />
+
+                    <ImageView
+                        android:id="@+id/curtain_img2_2"
+                        android:layout_width="0dp"
+                        android:layout_height="match_parent"
+                        android:layout_weight="0.5"
+                        android:layout_toRightOf="@+id/curtain_img1_2"
+                        android:layout_centerVertical="true"
+                        android:src="@mipmap/curtain_img"
+                        android:scaleType="centerCrop"
+                        android:layout_gravity="left"
+                        />
+
+                </LinearLayout>
+
+
+                <ImageView
+                    android:id="@+id/curtain_top_2"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="20dp"
+                    android:layout_centerHorizontal="true"
+                    android:src="@mipmap/curtain_top"/>
+
+
+
+            </RelativeLayout>
+
+
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="30dp"
+                android:text="客厅窗帘"
+                android:textColor="@color/white"
+                android:textSize="36sp"
+                android:textStyle="bold"/>
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:orientation="horizontal"
+                android:gravity="center"
+                android:layout_marginTop="@dimen/d45"
+                >
+                <TextView
+                    android:layout_width="@dimen/d160"
+                    android:layout_height="wrap_content"
+                    android:background="@mipmap/d_btn_bg"
+                    android:drawableLeft="@mipmap/d_light_off"
+                    android:drawablePadding="@dimen/d10"
+                    android:gravity="center_vertical"
+                    android:paddingLeft="@dimen/d40"
+                    android:text="开启"
+                    android:textColor="@color/white"
+                    android:textSize="24sp" />
+
+                <TextView
+                    android:layout_width="@dimen/d160"
+                    android:layout_height="wrap_content"
+                    android:background="@mipmap/d_btn_bg"
+                    android:layout_marginLeft="@dimen/d25"
+                    android:drawableLeft="@mipmap/d_timer"
+                    android:drawablePadding="@dimen/d10"
+                    android:gravity="center_vertical"
+                    android:paddingLeft="@dimen/d40"
+                    android:text="校准"
+                    android:textColor="@color/white"
+                    android:textSize="24sp" />
+
+            </LinearLayout>
+
+
+        </LinearLayout>
+
+    </LinearLayout>
+</layout>
+
+

+ 9 - 7
android_bed/src/main/res/layout/fragment_smart_home.xml

@@ -30,36 +30,38 @@
                 android:textStyle="bold"/>
 
             <com.wdkl.ncs.android.lib.widget.CustomRadioButton
-                android:id="@+id/radio_btn_receptacle"
+                android:id="@+id/radio_btn_curtain"
                 android:layout_width="wrap_content"
                 android:layout_height="match_parent"
                 android:layout_weight="1"
+                android:button="@null"
                 android:layout_marginLeft="20dp"
                 android:layout_marginRight="20dp"
-                android:button="@null"
-                android:drawableLeft="@drawable/ic_receptacle"
+                android:drawableLeft="@drawable/ic_curtain"
                 android:drawablePadding="20dp"
                 android:gravity="center"
                 android:background="@drawable/selector_smart_home_bg"
-                android:text="插座"
+                android:text="窗帘"
                 android:textColor="@color/white"
                 android:textSize="28sp"
                 android:textStyle="bold"/>
 
             <com.wdkl.ncs.android.lib.widget.CustomRadioButton
-                android:id="@+id/radio_btn_curtain"
+                android:id="@+id/radio_btn_receptacle"
                 android:layout_width="wrap_content"
                 android:layout_height="match_parent"
                 android:layout_weight="1"
                 android:button="@null"
-                android:drawableLeft="@drawable/ic_curtain"
+                android:drawableLeft="@drawable/ic_receptacle"
                 android:drawablePadding="20dp"
                 android:gravity="center"
                 android:background="@drawable/selector_smart_home_bg"
-                android:text="窗帘"
+                android:text="插座"
                 android:textColor="@color/white"
                 android:textSize="28sp"
                 android:textStyle="bold"/>
+
+
         </RadioGroup>
 
         <FrameLayout

BIN
android_bed/src/main/res/mipmap-mdpi/curtain_bg.png


BIN
android_bed/src/main/res/mipmap-mdpi/curtain_img.png


BIN
android_bed/src/main/res/mipmap-mdpi/curtain_top.png


BIN
android_bed/src/main/res/mipmap-mdpi/d_xz_f.png


BIN
android_bed/src/main/res/mipmap-mdpi/d_xz_z.png


BIN
android_bed/src/main/res/mipmap-mdpi/thumb_img.png


+ 10 - 3
android_host/src/main/java/com/wdkl/ncs/android/component/nursehome/activity/CallingHostActivationActivity.kt

@@ -529,10 +529,17 @@ class CallingHostActivationActivity : BaseActivity<DevicePresenter, CallinghostA
             deviceInfo.sipPassword = data.sipPassword
             DaoManager.getInstance().daoSession.deviceInfoBeanDao.insert(deviceInfo)
         }
+        if (BuildConfig.device_type.equals("1")) {
+            val intent = Intent()
+            intent.setClass(activity, NurseHomeActivity::class.java)
+            activity.startActivity(intent)
 
-        val intent = Intent()
-        intent.setClass(activity, NurseHomeActivity::class.java)
-        activity.startActivity(intent)
+        }else if (BuildConfig.device_type.equals("4")){//宿舍
+            val intent = Intent()
+//            intent.setClass(activity, CallingbedDormitoryActivity::class.java)
+//            activity.startActivity(intent)
+
+        }
         SPUtils.put(this, Constant.APP_ACTIVATION, "已激活")
         finish()
     }

File diff suppressed because it is too large
+ 3008 - 0
android_host/src/main/java/com/wdkl/ncs/android/component/nursehome/activity/NurseHome2Activity.kt


+ 2 - 0
android_host/src/main/java/com/wdkl/ncs/android/component/nursehome/di/NurseHomeComponent.kt

@@ -64,4 +64,6 @@ interface NurseHomeComponent{
     fun inject(fragment: PushMessageTemplateFragment)
     fun inject(fragment: PushMessageListFragment)
 
+    fun inject(activity: NurseHome2Activity)
+
 }

+ 4 - 0
android_host/src/main/java/com/wdkl/ncs/android/component/nursehome/hardware/HardTools.java

@@ -6,6 +6,7 @@ import android.content.Context;
 
 import com.wdkl.ncs.android.component.nursehome.activity.AppUpdateActivity;
 import com.wdkl.ncs.android.component.nursehome.activity.CallingHostActivationActivity;
+import com.wdkl.ncs.android.component.nursehome.activity.NurseHome2Activity;
 import com.wdkl.ncs.android.component.nursehome.activity.NurseHomeActivity;
 
 
@@ -24,6 +25,9 @@ public  class HardTools {
     public void uninstallApp(Context context , boolean isuninstall, String name){}
     //串口设置
     public void setSerial(NurseHomeActivity activity){}
+    //串口设置 宿舍端
+    public void setSerial2(NurseHome2Activity activity){}
+
     //导航栏隐藏或者显示
     public void toggleStatusBar(Context context,boolean is){}
 

+ 7 - 0
android_host/src/main/java/com/wdkl/ncs/android/component/nursehome/hardware/imp/ZKEHardTools.java

@@ -9,6 +9,7 @@ import android.util.Log;
 
 import com.wdkl.ncs.android.component.nursehome.activity.AppUpdateActivity;
 import com.wdkl.ncs.android.component.nursehome.activity.CallingHostActivationActivity;
+import com.wdkl.ncs.android.component.nursehome.activity.NurseHome2Activity;
 import com.wdkl.ncs.android.component.nursehome.activity.NurseHomeActivity;
 import com.wdkl.ncs.android.component.nursehome.hardware.HardTools;
 import com.wdkl.ncs.android.component.nursehome.util.AppUpdateHelper;
@@ -89,6 +90,12 @@ public class ZKEHardTools extends HardTools {
     }
 
     @Override
+    public void setSerial2(NurseHome2Activity activity) {
+        activity.kaerregReceiver();
+        activity.updatePower();
+    }
+
+    @Override
     public void uninstallApp(Context context, boolean isuninstall, String name) {
         //卸载原来二代系统apk
         if (isuninstall) {