Browse Source

feat poc2.0界面拆分

lihao1 3 years ago
parent
commit
6735f7ffbe

+ 85 - 52
cadengine/src/main/java/cn/sagacloud/android/cadengine/Lasso.kt

@@ -1,21 +1,23 @@
-package cn.sagacloud.android.cadengine;
+package cn.sagacloud.android.cadengine
 
-import android.graphics.Point;
-import android.graphics.PointF;
-import android.util.Log;
-
-import java.util.List;
+import android.graphics.Point
+import android.graphics.PointF
+import android.util.Log
+import kotlin.math.abs
+import kotlin.math.pow
+import kotlin.math.sqrt
 
 /**
  * Created by lihao.
  * Date: 2021/6/4
  */
-public class Lasso {
+class Lasso {
     // polygon coordinates
-    private float[] mPolyX, mPolyY;
+    private var mPolyX: FloatArray
+    private var mPolyY: FloatArray
 
     // number of size in polygon
-    private int mPolySize;
+    private var mPolySize: Int
 
     /**
      * default constructor
@@ -24,10 +26,10 @@ public class Lasso {
      * @param py polygon coordinates Y
      * @param ps polygon sides count
      */
-    public Lasso(float[] px, float[] py, int ps) {
-        this.mPolyX = px;
-        this.mPolyY = py;
-        this.mPolySize = ps;
+    constructor(px: FloatArray, py: FloatArray, ps: Int) {
+        mPolyX = px
+        mPolyY = py
+        mPolySize = ps
     }
 
     /**
@@ -35,16 +37,15 @@ public class Lasso {
      *
      * @param pointFs points list of the lasso
      */
-    public Lasso(List<PointF> pointFs) {
-        this.mPolySize = pointFs.size();
-        this.mPolyX = new float[this.mPolySize];
-        this.mPolyY = new float[this.mPolySize];
-
-        for (int i = 0; i < this.mPolySize; i++) {
-            this.mPolyX[i] = pointFs.get(i).x;
-            this.mPolyY[i] = pointFs.get(i).y;
+    constructor(pointFs: List<PointF>) {
+        mPolySize = pointFs.size
+        mPolyX = FloatArray(mPolySize)
+        mPolyY = FloatArray(mPolySize)
+        for (i in 0 until mPolySize) {
+            mPolyX[i] = pointFs[i].x
+            mPolyY[i] = pointFs[i].y
         }
-        Log.d("lasso", "lasso size:" + mPolySize);
+        Log.d("lasso", "lasso size:$mPolySize")
     }
 
     /**
@@ -54,41 +55,73 @@ public class Lasso {
      * @param y point coordinate Y
      * @return point is in polygon flag
      */
-    public boolean contains(float x, float y) {
-        boolean result = false;
-        for (int i = 0, j = mPolySize - 1; i < mPolySize; j = i++) {
-            if ((mPolyY[i] < y && mPolyY[j] >= y)
-                    || (mPolyY[j] < y && mPolyY[i] >= y)) {
+    fun contains(x: Float, y: Float): Boolean {
+        var result = false
+        var i = 0
+        var j = mPolySize - 1
+        while (i < mPolySize) {
+            if (mPolyY[i] < y && mPolyY[j] >= y
+                || mPolyY[j] < y && mPolyY[i] >= y
+            ) {
                 if (mPolyX[i] + (y - mPolyY[i]) / (mPolyY[j] - mPolyY[i])
-                        * (mPolyX[j] - mPolyX[i]) < x) {
-                    result = !result;
+                    * (mPolyX[j] - mPolyX[i]) < x
+                ) {
+                    result = !result
                 }
             }
+            j = i++
         }
-        return result;
+        return result
     }
 
-    public static boolean isPolygonContainsPoint(List<PointF> mPoints, Point point) {
-        int nCross = 0;
-        for (int i = 0; i < mPoints.size(); i++) {
-            PointF p1 = mPoints.get(i);
-            PointF p2 = mPoints.get((i + 1) % mPoints.size());
-            // 取多边形任意一个边,做点point的水平延长线,求解与当前边的交点个数
-            // p1p2是水平线段,要么没有交点,要么有无限个交点
-            if (p1.y == p2.y)
-                continue;
-            // point 在p1p2 底部 --> 无交点
-            if (point.y < Math.min(p1.y, p2.y))
-                continue;
-            // point 在p1p2 顶部 --> 无交点
-            if (point.y >= Math.max(p1.y, p2.y))
-                continue;
-            // 求解 point点水平线与当前p1p2边的交点的 X 坐标
-            double x = (point.y - p1.y) * (p2.x - p1.x) / (p2.y - p1.y) + p1.x;
-            if (x > point.x) // 当x=point.x时,说明point在p1p2线段上
-                nCross++; // 只统计单边交点
+    companion object {
+        fun isPolygonContainsPoint(mPoints: List<PointF>, point: Point): Boolean {
+            var nCross = 0
+            for (i in mPoints.indices) {
+                val p1 = mPoints[i]
+                val p2 = mPoints[(i + 1) % mPoints.size]
+                // 取多边形任意一个边,做点point的水平延长线,求解与当前边的交点个数
+                // p1p2是水平线段,要么没有交点,要么有无限个交点
+                if (p1.y == p2.y) continue
+                // point 在p1p2 底部 --> 无交点
+                if (point.y < Math.min(p1.y, p2.y)) continue
+                // point 在p1p2 顶部 --> 无交点
+                if (point.y >= Math.max(p1.y, p2.y)) continue
+                // 求解 point点水平线与当前p1p2边的交点的 X 坐标
+                val x = ((point.y - p1.y) * (p2.x - p1.x) / (p2.y - p1.y) + p1.x).toDouble()
+                if (x > point.x) // 当x=point.x时,说明point在p1p2线段上
+                    nCross++ // 只统计单边交点
+            }
+            // 单边交点为偶数,点在多边形之外 ---
+            return nCross % 2 == 1
+        }
+
+        /**
+         * point3到(point1与point2的连线)的最短距离
+         */
+        fun beeline(
+            point1: PointF,
+            point2: PointF,
+            point3: PointF
+        ): Double {
+            val l1 = sqrt(
+                abs(point1.x - point2.x).toDouble()
+                    .pow(2.0) + abs(point1.y - point2.y)
+                    .toDouble().pow(2.0)
+            ).toFloat()
+            val l2 = sqrt(
+                abs(point1.x - point3.x).toDouble().pow(2.0) + abs(point1.y + point3.y)
+                    .toDouble().pow(2.0)
+            ).toFloat()
+            val l3 = sqrt(
+                abs(point2.x - point3.x).toDouble().pow(2.0) + abs(point2.y + point3.y)
+                    .toDouble().pow(2.0)
+            ).toFloat()
+            val halfP = (l1 + l2 + l3) / 2
+            val s =
+                sqrt(halfP * (halfP - l1) * (halfP - l2) * (halfP - l3).toDouble())
+            val h = 2 * s / l1
+            return h
         }
-        // 单边交点为偶数,点在多边形之外 ---
-        return (nCross % 2 == 1);
     }
-}
+}

+ 49 - 549
demo/src/main/java/com/sybotan/android/demo/activities/GraphyActivity.kt

@@ -188,44 +188,23 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
 
     private lateinit var graphyView: SGraphyView
     private lateinit var quesDetail: RelativeLayout
-    private lateinit var spaceStructure: LinearLayout
-    private lateinit var doneSpaceStructure: LinearLayout
-    private lateinit var spaceName: TextView
-    private lateinit var spaceName3: TextView
-    private lateinit var spaceName4: TextView
     private lateinit var spaceName2: TextView
     private lateinit var equipLl: LinearLayout
     private lateinit var drawLl: LinearLayout
     private lateinit var equipLocation: TextView
-    private lateinit var qrcodeLl: LinearLayout
-    private lateinit var addDot: TextView
-    private lateinit var nfc: TextView
-    private lateinit var qrcodeLocation: TextView
-    private lateinit var modelCheckBox: CheckBox
-    private lateinit var modelSubmit: TextView
     private lateinit var sceneCheckBox: CheckBox
     private lateinit var sceneSubmit: TextView
-    private lateinit var qrcode: TextView
-    private lateinit var qrcodeCancel: TextView
     private lateinit var pipeCancel: TextView
     private lateinit var pipeLl: LinearLayout
-    private lateinit var qrcodeNext: TextView
     private lateinit var pipeNext: TextView
     private lateinit var pipeEdit: EditText
     private lateinit var drawEquip: TextView
     private lateinit var drawPipe: TextView
     private lateinit var piprRv: RecyclerView
-    private lateinit var problemPicRecycler: MaxHeightRecyclerView
     private lateinit var equipCancel: TextView
     private lateinit var equipNext: TextView
     private lateinit var equipEdit: EditText
     private lateinit var equipRg: RadioGroup
-    private lateinit var eqSpServe: TextView
-    private lateinit var eqEqCtrl: TextView
-    private lateinit var eqEqSs: TextView
-    private lateinit var eqEqPower: TextView
-    private lateinit var eqEqVv: TextView
-    private lateinit var eqPipeCnct: TextView
     private lateinit var equipWwv: WordWrapView
     private lateinit var pipeWwv: WordWrapView
     private lateinit var roof: RadioButton
@@ -234,22 +213,10 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
     private lateinit var air: RadioButton
     private lateinit var quesTv: TextView
     private lateinit var quesSubmit: TextView
-    private lateinit var addSpaceDetail: TextView
-    private lateinit var addSpaceDetail2: TextView
-    private lateinit var resetSpaceState: TextView
-    private lateinit var qrcodeEdit: EditText
     private lateinit var webview: WebView
     private lateinit var quesIma: ImageView
-    private lateinit var problemLl: LinearLayoutCompat
-    private lateinit var ProblemRg: RadioGroup
-    private lateinit var pointRb: RadioButton
-    private lateinit var lineRb: RadioButton
-    private lateinit var problemClose: TextView
-    private lateinit var problemDone: TextView
-    private lateinit var problemSave: TextView
     private lateinit var equipDetail: TextView
     private lateinit var equipDelete: TextView
-    private lateinit var problemDesc: AppCompatEditText
 
     /**
      * 创建Activity时的回调函数
@@ -368,44 +335,23 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
     private fun initView() {
         graphyView = findViewById(R.id.graphyView)
         quesDetail = findViewById(R.id.quesDetail)
-        spaceStructure = findViewById(R.id.spaceStructure)
-        doneSpaceStructure = findViewById(R.id.doneSpaceStructure)
-        spaceName = findViewById(R.id.spaceName)
         spaceName2 = findViewById(R.id.spaceName2)
-        spaceName3 = findViewById(R.id.spaceName3)
-        spaceName4 = findViewById(R.id.spaceName4)
         equipLl = findViewById(R.id.equipLl)
         drawLl = findViewById(R.id.drawLl)
         equipLocation = findViewById(R.id.equipLocation)
-        qrcodeLl = findViewById(R.id.qrcodeLl)
-        addDot = findViewById(R.id.addDot)
-        nfc = findViewById(R.id.nfc)
-        qrcodeLocation = findViewById(R.id.qrcodeLocation)
-        modelCheckBox = findViewById(R.id.modelCheckBox)
-        modelSubmit = findViewById(R.id.modelSubmit)
         sceneCheckBox = findViewById(R.id.sceneCheckBox)
         sceneSubmit = findViewById(R.id.sceneSubmit)
-        qrcode = findViewById(R.id.qrcode)
-        qrcodeCancel = findViewById(R.id.qrcodeCancel)
         pipeCancel = findViewById(R.id.pipeCancel)
         pipeLl = findViewById(R.id.pipeLl)
-        qrcodeNext = findViewById(R.id.qrcodeNext)
         pipeNext = findViewById(R.id.pipeNext)
         pipeEdit = findViewById(R.id.pipeEdit)
         drawEquip = findViewById(R.id.drawEquip)
         drawPipe = findViewById(R.id.drawPipe)
         piprRv = findViewById(R.id.piprRv)
-        problemPicRecycler = findViewById(R.id.problemPicRecycler)
         equipCancel = findViewById(R.id.equipCancel)
         equipNext = findViewById(R.id.equipNext)
         equipEdit = findViewById(R.id.equipEdit)
         equipRg = findViewById(R.id.equipRg)
-        eqSpServe = findViewById(R.id.eqSpServe)
-        eqEqCtrl = findViewById(R.id.eqEqCtrl)
-        eqEqSs = findViewById(R.id.eqEqSs)
-        eqEqPower = findViewById(R.id.eqEqPower)
-        eqEqVv = findViewById(R.id.eqEqVv)
-        eqPipeCnct = findViewById(R.id.eqPipeCnct)
         equipWwv = findViewById(R.id.equipWwv)
         pipeWwv = findViewById(R.id.pipeWwv)
         roof = findViewById(R.id.roof)
@@ -414,22 +360,10 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
         air = findViewById(R.id.air)
         quesTv = findViewById(R.id.quesTv)
         quesSubmit = findViewById(R.id.quesSubmit)
-        qrcodeEdit = findViewById(R.id.qrcodeEdit)
         webview = findViewById(R.id.webview)
         quesIma = findViewById(R.id.quesIma)
-        addSpaceDetail = findViewById(R.id.addSpaceDetail)
-        addSpaceDetail2 = findViewById(R.id.addSpaceDetail2)
-        resetSpaceState = findViewById(R.id.resetSpaceState)
-        problemLl = findViewById(R.id.problemLl)
-        ProblemRg = findViewById(R.id.ProblemRg)
-        pointRb = findViewById(R.id.pointRb)
-        lineRb = findViewById(R.id.lineRb)
-        problemClose = findViewById(R.id.problemClose)
-        problemDone = findViewById(R.id.problemDone)
-        problemSave = findViewById(R.id.problemSave)
         equipDetail = findViewById(R.id.equipDetail)
         equipDelete = findViewById(R.id.equipDelete)
-        problemDesc = findViewById(R.id.problemDesc)
 
     }
 
@@ -445,22 +379,22 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
         projectId = floor.getString("projectId")!!
     }
 
-    private fun addPic() {
-        val config: ImgSelConfig = ImgSelConfig.Builder(this, loader) // 是否多选
-            .multiSelect(true) // 是否记住上次选中记录, 仅当multiSelect为true的时候配置,默认为true
-            .rememberSelected(false) // 确定按钮文字颜色
-            .btnTextColor(Color.WHITE) // 使用沉浸式状态栏
-            .statusBarColor(resources.getColor(R.color.blue_2E3679)) // 返回图标ResId
-            .backResId(R.mipmap.back_gray).title("选择图片").titleColor(Color.WHITE).titleBgColor(
-                resources.getColor(R.color.blue_2E3679)
-            ) //                .allImagesText("All Images")
-            .needCrop(false).cropSize(1, 1, 200, 200) // 第一个是否显示相机
-            .needCamera(true) // 最大选择图片数量
-            .build()
-        //选择图片activity
-        //选择图片activity
-        Repair_ImgSelActivity.startActivity(this, config, REQUEST_CODE_PIC)
-    }
+//    private fun addPic() {
+//        val config: ImgSelConfig = ImgSelConfig.Builder(this, loader) // 是否多选
+//            .multiSelect(true) // 是否记住上次选中记录, 仅当multiSelect为true的时候配置,默认为true
+//            .rememberSelected(false) // 确定按钮文字颜色
+//            .btnTextColor(Color.WHITE) // 使用沉浸式状态栏
+//            .statusBarColor(resources.getColor(R.color.blue_2E3679)) // 返回图标ResId
+//            .backResId(R.mipmap.back_gray).title("选择图片").titleColor(Color.WHITE).titleBgColor(
+//                resources.getColor(R.color.blue_2E3679)
+//            ) //                .allImagesText("All Images")
+//            .needCrop(false).cropSize(1, 1, 200, 200) // 第一个是否显示相机
+//            .needCamera(true) // 最大选择图片数量
+//            .build()
+//        //选择图片activity
+//        //选择图片activity
+//        Repair_ImgSelActivity.startActivity(this, config, REQUEST_CODE_PIC)
+//    }
 
     private fun doPicDatas(pathList: List<String>?) {
         LocalDataOperation.getInstance().dealLocalData<Photos>(this) { name, params ->
@@ -640,14 +574,6 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
                                         }
                                     }
                                     hasChoose = true
-                                    ProblemRg.visibility = View.GONE
-                                    pointRb.setOnCheckedChangeListener { buttonView, isChecked ->
-
-                                    }
-                                    lineRb.setOnCheckedChangeListener { buttonView, isChecked ->
-
-                                    }
-                                    lineRb.isChecked = true
                                     for (p in point.data.points) {
                                         var pipe = PipeLine()
                                         var pointf = PointF()
@@ -676,21 +602,12 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
                             ).toInt()
                             if (sqrt < realDistance) {
                                 hasChoose = true
-                                ProblemRg.visibility = View.GONE
-                                pointRb.setOnCheckedChangeListener { buttonView, isChecked ->
-
-                                }
-                                lineRb.setOnCheckedChangeListener { buttonView, isChecked ->
-
-                                }
-                                pointRb.isChecked = true
                                 showDotDetail(point)
                                 break
                             }
                         }
                     }
                     if (!hasChoose) {
-                        problemLl.visibility = View.GONE
                     } else {
                         return
                     }
@@ -807,7 +724,7 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
                 //计算控制点的边界
                 //是否已经拥有该点
                 /** 打点业务 */
-                if ("dot".equals(scene.type)) {
+                /*if ("dot".equals(scene.type)) {
 //                    for (space in scene.spaceList) {
 //                        val polygonContainsPoint = Lasso.isPolygonContainsPoint(
 //                            space.mPoints,
@@ -842,21 +759,10 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
                     if (!outSide) {
                         return
                     }
-                }
-
-                //打点业务
-//                if ("dot".equals(scene.type)) {
-//                    if (addPoint != null) {
-//                        scene.removeItem(addPoint!!)
-//                    }
-//                    ProblemDot.mX = x
-//                    ProblemDot.mY = y
-//                    addPoint = graphyHelper.addPoint(ProblemDot)
-//                    return
-//                }
+                } else*/
 
                 //绘制管道业务
-                else if ("pipe".equals(scene.type)) {
+                 if ("pipe".equals(scene.type)) {
                     var pipe = PipeLine()
                     var pointf = PointF()
                     pointf.x = x
@@ -873,22 +779,7 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
                         scene.addItem(item)
                     }
 
-                    //绘制二维码
-                } else if ("qrcode".equals(scene.type)) {
-                    scene.point.mX = x
-                    scene.point.mY = y
-
-                    if (scene.item != null) {
-                        scene.removeItem(scene.item!!)
-                    }
-                    scene.item =
-                        QrcodeItem(this@GraphyActivity, scene.point, null, scene.defaultPointScale)
-                    scene.item!!.isVisible = true
-                    scene.item!!.zOrder = 100000f
-                    scene.addItem(scene.item!!)
-
-                    //绘制设备
-                } else if ("equip".equals(scene.type)) {
+                }  else if ("equip".equals(scene.type)) {
                     scene.point.mX = x
                     scene.point.mY = y
 
@@ -1011,74 +902,19 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
 //                            min(w / rect.width(), h / rect.height()) * 0.8f)
 
 
-                    if ("space".equals(from)) {
-                        quesDetail.visibility = View.GONE
-                        if (!scene.choseSpace!!.data.jobStatus.equals("03")) {
-                            spaceStructure.visibility = View.VISIBLE
-                            doneSpaceStructure.visibility = View.GONE
-                            graphyVM.getProblem(scene.choseSpace)
-                            /** 跳转空间详情 */
-                            addSpaceDetail.setOnClickListener {
-                                val intent =
-                                    Intent(this@GraphyActivity, SpaceDetailActivity::class.java)
-                                val bundle = Bundle()
-                                bundle.putString("buildingId", buildingId)
-                                bundle.putString("floorId", floorId)
-                                bundle.putString("projectId", projectId)
-                                bundle.putString("spaceId", scene.choseSpace!!.data.id)
-                                bundle.putParcelable("space", scene.choseSpace!!.data)
-                                intent.putExtra("floor", bundle)
-                                startActivity(intent)
-                            }
-                        } else {
-                            doneSpaceStructure.visibility = View.VISIBLE
-                            spaceStructure.visibility = View.GONE
-                            /** 重置空间状态 */
-                            resetSpaceState.setOnClickListener {
-                                if ("space".equals(from)) {
-                                    graphyVM.setJob(scene.choseSpace, "01")
-                                } else {
-                                    graphyVM.setJob(scene.choseSpace, "04")
-                                }
-                            }
-                            /** 跳转空间详情 */
-                            addSpaceDetail2.setOnClickListener {
-                                val intent =
-                                    Intent(this@GraphyActivity, SpaceDetailActivity::class.java)
-                                val bundle = Bundle()
-                                bundle.putString("buildingId", buildingId)
-                                bundle.putString("floorId", floorId)
-                                bundle.putString("projectId", projectId)
-                                bundle.putString("spaceId", scene.choseSpace!!.data.id)
-                                bundle.putParcelable("space", scene.choseSpace!!.data)
-                                intent.putExtra("floor", bundle)
-                                startActivity(intent)
-                            }
-                        }
-                        spaceName.text = scene.choseSpace!!.data.localName
-                        spaceName3.text = scene.choseSpace!!.data.localName
-                        spaceName4.text = scene.choseSpace!!.data.localName
-                        graphyVM.getQrcode(scene.choseSpace)
-                    } else {
-                        if (equipLl.visibility == View.GONE) {
-                            drawLl.visibility = View.VISIBLE
-                            spaceName2.text = scene.choseSpace!!.data.localName
-                            graphyVM.getSpaceEq(scene.choseSpace)
+                    if (equipLl.visibility == View.GONE) {
+                        drawLl.visibility = View.VISIBLE
+                        spaceName2.text = scene.choseSpace!!.data.localName
+                        graphyVM.getSpaceEq(scene.choseSpace)
 //                            graphyVM.spacePipe(scene.choseSpace)
-                        }
-                        equipLocation.setText("($x,$y)")
-
                     }
+                    equipLocation.setText("($x,$y)")
+
                     //未选中空间
                 } else if (scene.mapType.equals("nothing")) {
-                    spaceStructure.visibility = View.GONE
-                    doneSpaceStructure.visibility = View.GONE
-                    qrcodeLl.visibility = View.GONE
-                    qrcodeLocation.setText("(0,0)")
                     quesDetail.visibility = View.GONE
                     equipLl.visibility = View.GONE
                     drawLl.visibility = View.GONE
-                    problemLl.visibility = View.GONE
                     for (item in scene.pointItemList) {
                         scene.removeItem(item)
                     }
@@ -1092,15 +928,6 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
                     scene.equipList.clear()
                     scene.qrcodeItemList.clear()
                 }
-
-                //绑定二位码业务
-                if ("qrcode".equals(scene.type)) {
-                    qrcodeLl.visibility = View.VISIBLE
-                    qrcodeLocation.setText("(${scene.point.mX},${scene.point.mY})")
-                    spaceStructure.visibility = View.GONE
-                    doneSpaceStructure.visibility = View.GONE
-                    return
-                }
             }
         })
     }
@@ -1126,19 +953,6 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
                 InstaCameraManager.getInstance().startNormalCapture(false)
             }
         }
-        /** nfc点击监听 */
-        nfc.setOnClickListener { Toast.makeText(this, "正在开发中,敬请期待", Toast.LENGTH_SHORT).show() }
-
-        /** checkBox */
-        modelCheckBox.setOnCheckedChangeListener { buttonView, isChecked ->
-            if (isChecked) {
-                modelSubmit.isEnabled = true
-                modelSubmit.alpha = 1f
-            } else {
-                modelSubmit.isEnabled = false
-                modelSubmit.alpha = 0.3f
-            }
-        }
 
         /** checkBox */
         sceneCheckBox.setOnCheckedChangeListener { buttonView, isChecked ->
@@ -1156,65 +970,6 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
             graphyVM.setJob(scene.choseSpace, "05")
         }
 
-        /** 设置空间的任务状态完成 */
-        modelSubmit.setOnClickListener {
-            if (scene.choseSpace!!.data.jobStatus.equals("02")) {
-                ToastUtils.showMyToast("空间内还有未解决的问题")
-                return@setOnClickListener
-            }
-            graphyVM.setJob(scene.choseSpace, "03")
-        }
-
-        /** 打点按钮 */
-        addDot.setOnClickListener {
-            scene.type = "dot"
-            ProblemDot.mX = 0f
-            ProblemDot.mY = 0f
-            spaceStructure.visibility = View.GONE
-            problemLl.visibility = View.VISIBLE
-            ProblemRg.visibility = View.VISIBLE
-            pointRb.setOnCheckedChangeListener { buttonView, isChecked ->
-                if (isChecked) {
-                    scene.type = "dot"
-                    for (item in scene.drawingPipeItemList) {
-                        scene.removeItem(item)
-                    }
-                    scene.pipeLineList.clear()
-                    scene.drawingPipeItemList.clear()
-                }
-            }
-            lineRb.setOnCheckedChangeListener { buttonView, isChecked ->
-                if (isChecked) {
-                    scene.type = "pipe"
-                    if (addPoint != null) {
-                        scene.removeItem(addPoint!!)
-                        scene.pointItemList.remove(addPoint)
-                    }
-
-                }
-            }
-            pointRb.isChecked = true
-            showDotDetail(null)
-            initProblemPicture(null)
-
-        }
-
-        /** 绑定二维码按钮 */
-        qrcode.setOnClickListener {
-            scene.type = "qrcode"
-            qrcodeLl.visibility = View.VISIBLE
-            spaceStructure.visibility = View.GONE
-        }
-
-        /** 取消绑定二维码 */
-        qrcodeCancel.setOnClickListener {
-            qrcodeLl.visibility = View.GONE
-            qrcodeLocation.setText("(0,0)")
-            spaceStructure.visibility = View.VISIBLE
-            scene.type = "normal"
-            scene.item?.let { it1 -> scene.removeItem(it1) }
-        }
-
         /** 取消绘制管道 */
         pipeCancel.setOnClickListener {
             pipeLl.visibility = View.GONE
@@ -1227,20 +982,6 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
             scene.drawingPipeItemList.clear()
         }
 
-        /** 绑定二维码下一步 */
-        qrcodeNext.setOnClickListener {
-            if (qrcodeLocation.text.equals("(0,0)")) {
-                ToastUtils.showMyToast("请扎点")
-                return@setOnClickListener
-            }
-            if (TextUtils.isEmpty(qrcodeEdit.text.trim())) {
-                ToastUtils.showMyToast("请输入高度")
-                return@setOnClickListener
-            }
-            val intent = Intent(this@GraphyActivity, CaptureActivity::class.java)
-            startActivityForResult(intent, REQUEST_CODE_SCAN)
-        }
-
         /** 添加管线下一步 */
         pipeNext.setOnClickListener {
 //            for (model in pipeTypeList) {
@@ -1364,33 +1105,20 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
                 equipEdit.alpha = 1f
             }
         }
-
-        /** 服务 */
-        eqSpServe.setOnClickListener { skipRelationship("eq_sp_serve", "eq_sp") }
-        /** 控制 */
-        eqEqCtrl.setOnClickListener { skipRelationship("eq_eq_ctrl", "eq_eq") }
-        /** 测量 */
-        eqEqSs.setOnClickListener { skipRelationship("eq_eq_ss", "eq_eq") }
-        /** 供电 */
-        eqEqPower.setOnClickListener { skipRelationship("eq_eq_power", "eq_eq") }
-        /** 阀门 */
-        eqEqVv.setOnClickListener { skipRelationship("eq_eq_vv", "eq_eq") }
-        /** 连接 */
-        eqPipeCnct.setOnClickListener { skipRelationship("eq_pipe_cnct", "eq_pipe") }
     }
 
     private fun initProblemPicture(point: PointItem?) {
-        beans.clear()
-        val photo = Photos()
-        photo.itemType = 1
-        beans.add(photo)
-        if (point != null) {
-            beans.addAll(point.data.photos)
-        }
-        pictureAdapter = PictureAdapter(this, beans, "", false, 0, 85)
-        pictureAdapter.setOnPicAdd { addPic() }
-        problemPicRecycler.setLayoutManager(GridLayoutManager(this, 3))
-        problemPicRecycler.adapter = pictureAdapter
+//        beans.clear()
+//        val photo = Photos()
+//        photo.itemType = 1
+//        beans.add(photo)
+//        if (point != null) {
+//            beans.addAll(point.data.photos)
+//        }
+//        pictureAdapter = PictureAdapter(this, beans, "", false, 0, 85)
+//        pictureAdapter.setOnPicAdd { addPic() }
+//        problemPicRecycler.setLayoutManager(GridLayoutManager(this, 3))
+//        problemPicRecycler.adapter = pictureAdapter
     }
 
     private fun skipRelationship(code: String, type: String) {
@@ -1410,23 +1138,19 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
         graphyVM = GraphyVM(this.application, BaseViewModelInterface { name, params ->
             when (name) {
                 GraphyVM.MAP_LOAD -> {
-                    val floorDate = FloorData()
                     val floorOfflineData = gson.fromJson(params.toString(), FloorData::class.java)
-                    floorDate.entityList.addAll(floorOfflineData.entityList)
-                    scene.loadData(floorDate)
+                    scene.loadData(floorOfflineData)
                     /** 适应屏幕大小 */
                     graphyView.fitSceneToView()
-//                graphyView.defaultScale = graphyView.scale
                     /** 限定移动范围不超出屏幕 */
-//                graphyView.moveRange()
-                    graphyView.post {
-                        Log.e("viewW", graphyView.width.toString())
+//                    graphyView.post {
+//                        Log.e("viewW", graphyView.width.toString())
 //                    val mapItem = BaseMapItem(this@GraphyActivity, null)
 //                    mapItem.zOrder = 1000000f
 //                    mapItem.isVisible = true
 //                    scene.addItem(mapItem)
-                        mapItem = BaseMapItem(this@GraphyActivity, null)
-                    }
+//                        mapItem = BaseMapItem(this@GraphyActivity, null)
+//                    }
                 }
                 /** 查询空间和任务 */
                 GraphyVM.SPACE_JOB -> {
@@ -1471,118 +1195,7 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
                             scene.addItem(item)
                         }
                     }
-                    if (from.equals("scene")) {
-                        graphyVM.floorPipe()
-                    }
-                }
-
-                /** 添加空间核查问题 */
-                GraphyVM.ADD_PROBLEM -> {
-                    problemDesc.setText("")
-                    Toast.makeText(this, "记录成功", Toast.LENGTH_SHORT).show()
-                    graphyVM.getProblem(scene.choseSpace)
-                    graphyVM.getSpaceJob(from, scene.spaceList)
-                }
-
-                /** 查询空间核查问题 */
-                GraphyVM.GET_PROBLEM -> {
-                    graphyHelper.removeAllPoint()
-                    var list = params as ArrayList<ProblemsModel>
-                    val mPoints = ArrayList<PointF>()
-                    val point1 = PointF()
-                    point1.set(scene.choseSpace!!.minX - 1000, scene.choseSpace!!.maxY + 1000)
-                    val point2 = PointF()
-                    point2.set(scene.choseSpace!!.maxX + 1000, scene.choseSpace!!.maxY + 1000)
-                    val point3 = PointF()
-                    point3.set(scene.choseSpace!!.minX - 1000, scene.choseSpace!!.minY - 1000)
-                    val point4 = PointF()
-                    point4.set(scene.choseSpace!!.maxX + 1000, scene.choseSpace!!.minY - 1000)
-                    mPoints.add(point1)
-                    mPoints.add(point2)
-                    mPoints.add(point4)
-                    mPoints.add(point3)
-
-                    for (model in list) {
-                        if (model.geomType.equals("point")) {
-                            var position = gson.fromJson(model.position, Position::class.java)
-//                        val polygonContainsPoint = Lasso.isPolygonContainsPoint(
-//                            mPoints,
-//                            android.graphics.Point(
-//                                position.x.toFloat().toInt(),
-//                                position.y.toFloat().toInt()
-//                            )
-//                        )
-//                        if (polygonContainsPoint) {
-                            val point = Point()
-                            val f = PointF()
-                            f.x = position.x.toFloat()
-                            f.y = position.y.toFloat()
-                            point.points.add(f)
-                            point.mX = position.x.toFloat()
-                            point.mY = position.y.toFloat()
-                            point.id = model.id
-                            point.content = model.content
-                            point.photos = model.photos
-                            val addPoint = graphyHelper.addPoint(point)
-                            addPoint.setOnActionMove(object : PointItem.ActionMove {
-                                override fun onActionMove(event: MotionEvent) {
-                                }
-
-                            })
-                        } else if (model.geomType.equals("line")) {
-                            val geomList = gson.fromJson<List<PointF>>(
-                                model.position,
-                                object : TypeToken<List<PointF?>?>() {}.type
-                            )
-                            val point = Point()
-                            point.points.addAll(geomList)
-                            point.id = model.id
-                            point.content = model.content
-                            point.photos = model.photos
-                            val addPoint = graphyHelper.addPoint(point)
-                            addPoint.setOnActionMove(object : PointItem.ActionMove {
-                                override fun onActionMove(event: MotionEvent) {
-                                }
-
-                            })
-                        }
-
-//                        }
-                    }
-                }
-
-                /** 关闭空间核查问题 */
-                GraphyVM.CLOSE_PROBLEM -> {
-                    graphyVM.getProblem(scene.choseSpace)
-                }
-
-                /** 绑定二维码 */
-                GraphyVM.BIND_QECODE -> {
-                    Toast.makeText(this, "绑定成功", Toast.LENGTH_SHORT).show()
-                    scene.type = "normal"
-                    qrcodeLl.visibility = View.GONE
-                    qrcodeLocation.setText("(0,0)")
-                    spaceStructure.visibility = View.VISIBLE
-                    scene.removeItem(scene.item!!)
-                    scene.qrcodeItemList.clear()
-                    graphyVM.getQrcode(scene.choseSpace)
-                }
-
-                /** 查询对象绑定的二维码 */
-                GraphyVM.GET_QECODE -> {
-                    for (item in scene.qrcodeItemList) {
-                        scene.removeItem(item)
-                    }
-                    scene.qrcodeItemList.clear()
-                    val models = params as ArrayList<QrcodeModel>
-                    for (model in models) {
-                        val point = Point()
-                        var position = gson.fromJson(model.position, Position::class.java)
-                        point.mX = position.x.toFloat()
-                        point.mY = position.y.toFloat()
-
-                        graphyHelper.addQrcode(this, point)
-                    }
+                    graphyVM.floorPipe()
                 }
 
                 /** 设置空间的任务状态(新建和修改) */
@@ -1733,29 +1346,6 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
         graphyVM.getSpaceJob(from, scene.spaceList)
     }
 
-    private fun initSpaceState(space: TunableSpace, archState: Int, equipState: Int) {
-        //space 结构核查
-        //survey 空间勘测
-        if ("space".equals(from)) {
-            if (archState == 1) {
-                space.jobStatus = "01";
-            } else if (archState == 2) {
-                space.jobStatus = "03";
-            }
-        } else if ("survey".equals(from)) {
-            if (archState == 1) {
-                space.jobStatus = "01";
-            } else if (archState == 2) {
-                if (equipState == 1) {
-                    space.jobStatus = "04"
-                } else if (equipState == 2) {
-                    space.jobStatus = "05"
-                }
-            }
-        }
-
-    }
-
     val graphyHelper: GraphyHelper = GraphyHelper(scene, this)
 
     /**
@@ -1882,14 +1472,11 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
         graphyHelper.removeAllEquip()
 
 
-        spaceStructure.visibility = View.GONE
-        doneSpaceStructure.visibility = View.GONE
         quesDetail.visibility = View.GONE
         drawLl.visibility = View.GONE
         equipLl.visibility = View.GONE
 
         scene.type = "normal"
-        modelCheckBox.isChecked = false
         equipLocation.setText("")
         scene.point = Point()
     }
@@ -1898,8 +1485,6 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
      * 显示点位信息框
      */
     private fun showDotDetail(point: PointItem?) {
-        spaceStructure.visibility = View.GONE
-        doneSpaceStructure.visibility = View.GONE
 //        quesDetail.visibility = View.VISIBLE
 //        quesTv.setText(
 //            "这是描述问题的文本,左侧是拍照图片。" +
@@ -1912,80 +1497,12 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
 ////            Toast.makeText(this@GraphyActivity, InstaCameraManager.getInstance(). + "======", Toast.LENGTH_LONG).show()
 //        }
 
-        problemLl.visibility = View.VISIBLE
-        if (point != null) {
-            problemDesc.setText(point.data.content)
-        } else {
-            problemDesc.setText("")
-        }
-        initProblemPicture(point)
-
-        /** 问题已解决按钮 */
-        problemDone.setOnClickListener {
-            if (point != null) {
-                graphyVM.closeProblem(point, scene.choseSpace)
-                spaceStructure.visibility = View.VISIBLE
-                quesDetail.visibility = View.GONE
-                problemLl.visibility = View.GONE
-                scene.pointItemList.remove(point)
-                scene.removeItem(point)
-                if (scene.pointItemList.isEmpty()) {
-                    for (item in scene.tunableSpaceList) {
-                        scene.removeItem(item)
-                    }
-                }
-                quesDetail.visibility = View.GONE
-                graphyVM.getSpaceJob(from, scene.spaceList)
-            }
-        }
-
-        /** 问题-关闭 */
-        problemClose.setOnClickListener {
-            if (addPoint != null) {
-                scene.removeItem(addPoint!!)
-                scene.pointItemList.remove(addPoint)
-            }
-            for (item in scene.drawingPipeItemList) {
-                scene.removeItem(item)
-            }
-            scene.drawingPipeItemList.clear()
-            scene.pipeLineList.clear()
-            scene.type = "normal"
-            problemLl.visibility = View.GONE
-            spaceStructure.visibility = View.VISIBLE
-        }
-
-        /** 问题-保存 */
-        problemSave.setOnClickListener {
-            if (pointRb.isChecked && (point == null || point.data.mX == 0f) && ProblemDot.mX == 0f) {
-                ToastUtils.showMyToast("请扎点")
-                return@setOnClickListener
-            }
-            if (point == null) {
-                if (lineRb.isChecked && (CommonUtils.IsNull(scene.drawingPipeItemList) || scene.drawingPipeItemList.size == 1)) {
-                    ToastUtils.showMyToast("请扎点")
-                    return@setOnClickListener
-                }
-            }
-            scene.choseSpace?.let {
-                graphyVM.addProblem(
-                    point,
-                    beans,
-                    problemDesc.text.toString(),
-                    it,
-                    ProblemDot.mX,
-                    ProblemDot.mY,
-                    scene.drawingPipeItemList, lineRb.isChecked
-                )
-            }
-            for (item in scene.drawingPipeItemList) {
-                scene.removeItem(item)
-            }
-            scene.pipeLineList.clear()
-            scene.drawingPipeItemList.clear()
-            scene.type = "normal"
-            problemLl.visibility = View.GONE
-        }
+//        if (point != null) {
+//            problemDesc.setText(point.data.content)
+//        } else {
+//            problemDesc.setText("")
+//        }
+//        initProblemPicture(point)
     }
 
     /**
@@ -1994,23 +1511,6 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
     override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
         super.onActivityResult(requestCode, resultCode, data)
         when (requestCode) {
-            /** 扫描二维码回传 */
-            REQUEST_CODE_SCAN ->
-                if (resultCode == RESULT_OK) {
-                    if (data != null) {
-                        //获取扫描结果
-                        val bundle = data.extras
-                        val result = bundle?.getString(CaptureActivity.EXTRA_STRING)
-                        Log.e("tag", "扫描结果:$result")
-                        graphyVM.bindQrcode(
-                            scene.choseSpace,
-                            result,
-                            scene.point,
-                            qrcodeEdit.text.toString()
-                        )
-                    }
-                }
-
             /** 添加设备成功 */
             REQUEST_CODE_EQUIP -> {
                 if (resultCode == RESULT_OK) {

+ 7 - 52
demo/src/main/java/com/sybotan/android/demo/activities/SpaceMapActivity.kt

@@ -322,30 +322,12 @@ class SpaceMapActivity : BaseActivity(), DIAware {
                             for (index in 0..point.data.points.size - 2) {
                                 val point1 = point.data.points[index]
                                 val point2 = point.data.points[index + 1]
-
-                                val l1 = sqrt(
-                                    abs(point1.x - point2.x).toDouble()
-                                        .pow(2.0) + abs(point1.y - point2.y)
-                                        .toDouble().pow(2.0)
-                                ).toFloat()
-                                val l2 = sqrt(
-                                    abs(point1.x - x).toDouble().pow(2.0) + abs(point1.y + y)
-                                        .toDouble().pow(2.0)
-                                ).toFloat()
-                                val l3 = sqrt(
-                                    abs(point2.x - x).toDouble().pow(2.0) + abs(point2.y + y)
-                                        .toDouble().pow(2.0)
-                                ).toFloat()
-                                val halfP = (l1 + l2 + l3) / 2
-                                val s =
-                                    sqrt(halfP * (halfP - l1) * (halfP - l2) * (halfP - l3).toDouble())
-                                val h = 2 * s / l1
+                                val point3 = PointF(x, y)
+                                //point3到(point1与point2的连线)的最短距离
+                                val h = Lasso.beeline(point1, point2, point3)
                                 if (h < dist) {
                                     hasChoose = true
                                     problemRg.visibility = View.GONE
-                                    pointRb.setOnCheckedChangeListener { _, _ ->
-
-                                    }
                                     lineRb.setOnCheckedChangeListener { _, _ ->
 
                                     }
@@ -380,9 +362,6 @@ class SpaceMapActivity : BaseActivity(), DIAware {
                                 pointRb.setOnCheckedChangeListener { _, _ ->
 
                                 }
-                                lineRb.setOnCheckedChangeListener { _, _ ->
-
-                                }
                                 pointRb.isChecked = true
                                 showDotDetail(point)
                                 break
@@ -711,10 +690,8 @@ class SpaceMapActivity : BaseActivity(), DIAware {
             when (name) {
                 /** 加载地图 */
                 SpaceMapVM.MAP_LOAD -> {
-                    val floorDate = FloorData()
                     val floorOfflineData = gson.fromJson(params.toString(), FloorData::class.java)
-                    floorDate.entityList.addAll(floorOfflineData.entityList)
-                    scene.loadData(floorDate)
+                    scene.loadData(floorOfflineData)
                     graphyView.fitSceneToView()
                 }
                 /** 查询空间和任务 */
@@ -772,19 +749,6 @@ class SpaceMapActivity : BaseActivity(), DIAware {
                 SpaceMapVM.GET_PROBLEM -> {
                     graphyHelper.removeAllPoint()
                     val list = params as ArrayList<ProblemsModel>
-                    val mPoints = ArrayList<PointF>()
-                    val point1 = PointF()
-                    point1.set(scene.choseSpace!!.minX - 1000, scene.choseSpace!!.maxY + 1000)
-                    val point2 = PointF()
-                    point2.set(scene.choseSpace!!.maxX + 1000, scene.choseSpace!!.maxY + 1000)
-                    val point3 = PointF()
-                    point3.set(scene.choseSpace!!.minX - 1000, scene.choseSpace!!.minY - 1000)
-                    val point4 = PointF()
-                    point4.set(scene.choseSpace!!.maxX + 1000, scene.choseSpace!!.minY - 1000)
-                    mPoints.add(point1)
-                    mPoints.add(point2)
-                    mPoints.add(point4)
-                    mPoints.add(point3)
 
                     for (model in list) {
                         if (model.geomType.equals("point")) {
@@ -815,11 +779,7 @@ class SpaceMapActivity : BaseActivity(), DIAware {
                             point.id = model.id
                             point.content = model.content
                             point.photos = model.photos
-                            val addPoint = graphyHelper.addPoint(point)
-                            addPoint.setOnActionMove(object : PointItem.ActionMove {
-                                override fun onActionMove(event: MotionEvent) {
-                                }
-                            })
+                            graphyHelper.addPoint(point)
                         }
                     }
                 }
@@ -884,19 +844,14 @@ class SpaceMapActivity : BaseActivity(), DIAware {
      */
     private fun refreshAll() {
         graphyHelper.removeAllPoint()
-
         for (item in scene.tunableSpaceList) {
             scene.removeItem(item)
         }
         scene.tunableSpaceList.clear()
-
         graphyHelper.removeAllQrcode()
         graphyHelper.removeAllEquip()
-
-
         spaceStructure.visibility = View.GONE
         doneSpaceStructure.visibility = View.GONE
-
         scene.type = "normal"
         modelCheckBox.isChecked = false
         scene.point = Point()
@@ -982,12 +937,12 @@ class SpaceMapActivity : BaseActivity(), DIAware {
     }
 
     /**
-     * 扫码返回uuid
+     * 回调
      */
     override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
         super.onActivityResult(requestCode, resultCode, data)
         when (requestCode) {
-            /** 扫描二维码回 */
+            /** 扫描二维码回 */
             REQUEST_CODE_SCAN ->
                 if (resultCode == RESULT_OK) {
                     if (data != null) {

+ 0 - 376
demo/src/main/java/com/sybotan/android/demo/viewmodel/GraphyVM.kt

@@ -138,327 +138,13 @@ class GraphyVM(
                         spaceJobModel.job = "05"
                     }
                 }
-//                if (spaceEntity.archState == 1) {
-//                    spaceJobModel.job = "01"
-//                } else if (spaceEntity.archState == 2 && spaceEntity.equipState == 1) {
-//                    if (from.equals("space")) {
-//                        spaceJobModel.job = "03"
-//                    } else {
-//                        spaceJobModel.job = "04"
-//                    }
-//                } else if (spaceEntity.archState == 2 && spaceEntity.equipState == 2) {
-//                    spaceJobModel.job = "05"
-//                }
                 spaceJobList.add(spaceJobModel)
             }
             mEmitter.SendDircetive(SPACE_JOB, spaceJobList)
 
         }
-//        val bean = ReqSpaceJob()
-//        bean.buildingId = buildingId
-//        bean.floorId = floorId
-//        if ("space" == from) {
-//            bean.jobStatus.add("01")
-//            bean.jobStatus.add("02")
-//            bean.jobStatus.add("03")
-//        } else {
-//            bean.jobStatus.add("04")
-//        }
-//        val observable = RetrofitFactory.getInstance().getSpaceJob(getRequestBody(bean))
-//        sendRequest(observable, object : BaseObserver<List<SpaceJobModel>>(mActivity, this) {
-//            override fun onSuccess(spaceJobModels: List<SpaceJobModel>) {
-//                mEmitter.SendDircetive(SPACE_JOB, spaceJobModels)
-//            }
-//        }, true)
     }
 
-    /**
-     * 添加空间核查问题
-     *
-     * @param choseSpace 选中的空间
-     * @param x          x坐标
-     * @param y          y坐标
-     */
-    fun addProblem(
-        point: PointItem?,
-        photos: ArrayList<Photos>,
-        content: String,
-        choseSpace: TunableSpaceItem,
-        x: Float,
-        y: Float,
-        linePoints: ArrayList<PipeLineItem>,
-        isLine: Boolean
-    ) {
-        viewModelScope.launch {
-            //插入问题数据
-            val array = ArrayList<PointF>()
-            var toJson = ""
-            if (!isLine) {
-                val position = PointF()
-                position.x = x
-                position.y = y
-                if (point != null && point.data.mX != 0f) {
-                    position.x = point.data.mX
-                    position.y = point.data.mY
-                }
-                array.add(position)
-            } else {
-                val list = linePoints.get(linePoints.size - 1)
-                for (p in list.data.points) {
-                    val position = PointF()
-                    position.x = p.x
-                    position.y = p.y
-                    array.add(position)
-                }
-            }
-            toJson = gson.toJson(array)
-            var toString = ""
-            if (point != null && !TextUtils.isEmpty(point.data.id)) {
-                toString = point.data.id!!
-            } else {
-                toString = UUID.randomUUID().toString().replace("-", "")
-            }
-
-            var problem = ProblemArchEntity(
-                id = toString,
-                floorId = floorId,
-                projectId = projectId,
-                buildingId = buildingId,
-                geomType = if (array.size == 1) "point" else "line",
-                workId = "",
-                problemType = "",
-                problemState = 1,
-                message = content,
-                creator = "",
-                creationTime = "",
-                modifier = "android",
-                modifiedTime = "",
-                uploadFlag = "",
-                valid = 1,
-                strGeom = toJson,
-                state = "1",
-                geom = null
-            )
-            repo.insProblem(problem)
-
-
-            //插入文件数据
-            var order = 0
-            for (photo in photos) {
-                if (order != 0) {
-                    var uuid = ""
-                    if (TextUtils.isEmpty(photo.id)) {
-                        uuid = UUID.randomUUID().toString().replace("-", "")
-                    } else {
-                        uuid = photo.id
-                    }
-
-                    val file = FileEntity(
-                        id = uuid,
-                        bizType = "problem_arch",
-                        filePath = photo.key,
-                        fileType = "photo",
-                        clientPath = photo.path,
-                        refObjId = toString,
-                        refInfoCode = "",
-                        remark = "",
-                        orderNum = order,
-                        projectId = projectId,
-                        buildingId = buildingId,
-                        floorId = floorId,
-                        creator = "android",
-                        creationTime = "",
-                        modifier = "",
-                        modifiedTime = null,
-                        valid = 1,
-                        uploadFlag = "", state = "1"
-                    )
-                    repo.insFile(file)
-                }
-                order++
-            }
-            mEmitter.SendDircetive(ADD_PROBLEM, null)
-        }
-//        val bean = ReqAddProblem()
-//        bean.spaceId = choseSpace.data.id
-//        bean.floorId = floorId
-//        val position = Position()
-//        position.x = x.toString() + ""
-//        position.y = y.toString() + ""
-//        bean.position = position
-//        val observable = RetrofitFactory.getInstance().addProblem(getRequestBody(bean))
-//        sendRequest(observable, object : BaseObserver<AddProblemModel>(mActivity, this) {
-//            override fun onSuccess(model: AddProblemModel) {
-//                mEmitter.SendDircetive(ADD_PROBLEM, model)
-//            }
-//        }, true)
-    }
-
-    /**
-     * 查询空间核查问题
-     *
-     * @param choseSpace 选中的空间
-     */
-    fun getProblem(choseSpace: TunableSpaceItem?) {
-        viewModelScope.launch {
-            val problems = repo.getProblemByFloor(floorId)
-            var models: ArrayList<ProblemsModel> = ArrayList()
-            for (problem in problems) {
-                if (problem.problemState == 1) {
-                    val promodel = ProblemsModel()
-                    promodel.content = problem.message
-                    promodel.floorId = floorId
-                    promodel.spaceId = choseSpace!!.data.id
-                    promodel.id = problem.id
-
-                    val geomList = gson.fromJson<List<PointF>>(
-                        problem.strGeom,
-                        object : TypeToken<List<PointF?>?>() {}.type
-                    )
-                    promodel.geomType = problem.geomType
-                    if (problem.geomType!!.equals("point")) {
-                        promodel.position = gson.toJson(geomList.get(0))
-                    } else if (problem.geomType.equals("line")) {
-                        promodel.position = gson.toJson(geomList)
-                    }
-                    val refFiles = repo.getRefFile(problem.id)
-                    for (file in refFiles) {
-                        var photo = Photos()
-                        photo.key = file.filePath
-                        photo.id = file.id
-                        photo.itemType = 0
-                        photo.path = file.clientPath
-                        promodel.photos.add(photo)
-                    }
-                    models.add(promodel)
-                }
-            }
-            mEmitter.SendDircetive(GET_PROBLEM, models)
-        }
-
-//        val bean = ReqProblems()
-//        bean.floorId = floorId
-////        bean.spaceId = choseSpace!!.data.id
-//        val observable = RetrofitFactory.getInstance().problems(getRequestBody(bean))
-//        sendRequest(observable, object : BaseObserver<List<ProblemsModel>>(mActivity, this) {
-//            override fun onSuccess(models: List<ProblemsModel>) {
-//                mEmitter.SendDircetive(GET_PROBLEM, models)
-//            }
-//        }, true)
-    }
-
-    /**
-     * 关闭空间核查问题
-     *
-     * @param point      点位
-     * @param choseSpace 选中的空间
-     */
-    fun closeProblem(point: PointItem, choseSpace: TunableSpaceItem?) {
-        viewModelScope.launch {
-            val problem = repo.getProblemById(point.data.id!!)
-            problem.problemState = 2
-            repo.insProblem(problem)
-            mEmitter.SendDircetive(CLOSE_PROBLEM, null)
-        }
-//        val bean = ReqCloseProblem()
-//        bean.problemId = point.data.id
-//        bean.spaceId = choseSpace!!.data.id
-//        val observable = RetrofitFactory.getInstance().closeProblem(getRequestBody(bean))
-//        sendRequest(observable, object : BaseObserver<CloseProblemModel>(mActivity, this) {
-//            override fun onSuccess(setProblemModel: CloseProblemModel) {
-//                mEmitter.SendDircetive(CLOSE_PROBLEM, null)
-//            }
-//        }, true)
-    }
-
-    /**
-     * 绑定二维码
-     *
-     * @param choseSpace 选中的空间
-     * @param result     二维码uuid
-     * @param point      点位信息
-     * @param toString   z轴描述
-     */
-    fun bindQrcode(choseSpace: TunableSpaceItem?, result: String?, point: Point, toString: String) {
-        viewModelScope.launch {
-            var pointZ = PointZ()
-            pointZ.x = point.mX
-            pointZ.y = point.mY
-            pointZ.z = toString.toFloat()
-            val toJson = gson.toJson(pointZ)
-            var time = SimpleDateFormat("yyyyMMddHHmmss").format(Date(System.currentTimeMillis()))
-            val qrcode = QrCodeEntity(
-                id = UUID.randomUUID().toString(),
-                qrCode = result!!,
-                objId = choseSpace!!.data.id!!,
-                projectId = projectId,
-                buildingId = buildingId,
-                floorId = floorId,
-                strLocation = toJson,
-                remark = "wall",
-                creator = "Anroid",
-                creationTime = "",
-                modifier = "Android",
-                modifiedTime = "",
-                valid = 1,
-                uploadFlag = "", state = "1", location = null
-            )
-            repo.insQrcode(qrcode)
-            mEmitter.SendDircetive(BIND_QECODE, null)
-        }
-//        val bean = ReqBindQrcode()
-//        bean.objId = choseSpace!!.data.id
-//        bean.objType = "space"
-//        bean.uuid = result
-//        val position = Position()
-//        position.x = java.lang.String.valueOf(point.mX)
-//        position.y = java.lang.String.valueOf(point.mY)
-//        position.z = Z()
-//        position.z.offset = toString
-//        position.z.region = "wall"
-//        bean.position = position
-//        val observable = RetrofitFactory.getInstance().bindQrcode(getRequestBody(bean))
-//        sendRequest(observable, object : BaseObserver<BindQrcodeModel?>(mActivity, this) {
-//            override fun onSuccess(bindQrcodeModel: BindQrcodeModel?) {
-//                mEmitter.SendDircetive(BIND_QECODE, null)
-//            }
-//        }, true)
-    }
-
-    /**
-     * 查询对象绑定的二维码
-     *
-     * @param choseSpace 选中的空间
-     */
-    fun getQrcode(choseSpace: TunableSpaceItem?) {
-        viewModelScope.launch {
-            val qrcodes = repo.getQrcode(choseSpace!!.data.id!!)
-            val qrcodeModels = ArrayList<QrcodeModel>()
-            for (qrcode in qrcodes!!) {
-                var qrcodeModel = QrcodeModel()
-                qrcodeModel.obj_id = qrcode.objId
-                qrcodeModel.qr_code = qrcode.qrCode
-                var pointZ = gson.fromJson(qrcode.strLocation, PointZ::class.java)
-                val position = Position()
-                position.x = pointZ.x.toString()
-                position.y = pointZ.y.toString()
-                position.z = Z()
-                position.z.offset = pointZ.z.toString()
-                position.z.region = "wall"
-                qrcodeModel.position = gson.toJson(position)
-                qrcodeModels.add(qrcodeModel)
-            }
-            mEmitter.SendDircetive(GET_QECODE, qrcodeModels)
-        }
-//        val bean = ReqQrcode()
-//        bean.objId = choseSpace!!.data.id
-//        val observable = RetrofitFactory.getInstance().qrcode(getRequestBody(bean))
-//        sendRequest(observable, object : BaseObserver<ArrayList<QrcodeModel>>(mActivity, this) {
-//            override fun onSuccess(qrcodeModels: ArrayList<QrcodeModel>) {
-//                mEmitter.SendDircetive(GET_QECODE, qrcodeModels)
-//            }
-//        }, true)
-    }
 
     /**
      * 设置空间的任务状态(新建和修改)
@@ -491,18 +177,6 @@ class GraphyVM(
             repo.insSpace(space)
             mEmitter.SendDircetive(SET_JOB, null)
         }
-//        val bean = ReqSetJob()
-//        bean.buildingId = buildingId
-//        bean.floorId = floorId
-//        bean.spaceId.add(choseSpace!!.data.id)
-//        bean.jobStatus = jobStatus
-//        bean.spaceCode = "test"
-//        val observable = RetrofitFactory.getInstance().setJob(getRequestBody(bean))
-//        sendRequest(observable, object : BaseObserver<SetJobModel>(mActivity, this) {
-//            override fun onSuccess(model: SetJobModel) {
-//                mEmitter.SendDircetive(SET_JOB, null)
-//            }
-//        }, true)
     }
 
     /**
@@ -574,15 +248,6 @@ class GraphyVM(
             }
             mEmitter.SendDircetive(SPACE_EQ, models)
         }
-//        val bean = ReqSpaceEq()
-//        bean.group = true
-//        bean.spaceId = choseSpace!!.data.id
-//        val observable = RetrofitFactory.getInstance().getSpaceEq(getRequestBody(bean))
-//        sendRequest(observable, object : BaseObserver<List<SpaceEqModel>>(mActivity, this) {
-//            override fun onSuccess(models: List<SpaceEqModel>) {
-//                mEmitter.SendDircetive(SPACE_EQ, models)
-//            }
-//        }, true)
     }
 
     /**
@@ -691,20 +356,6 @@ class GraphyVM(
         }
     }
 
-    fun jsonObjectToHashMap(jsonObj: JSONObject?): HashMap<String, String>? {
-        if (jsonObj == null) {
-            return null
-        }
-        val data = HashMap<String, String>()
-        val it: Iterator<*> = jsonObj.keys()
-        while (it.hasNext()) {
-            val key = it.next().toString()
-            data[key] = jsonObj[key].toString()
-        }
-        System.out.println(data)
-        return data
-    }
-
     fun refreshObject(space: TunableSpace, hashMap: HashMap<String, Any>) {
         viewModelScope.launch {
             var space = repo.getObject(space.id!!)
@@ -714,12 +365,6 @@ class GraphyVM(
             repo.insObject(space)
             mActivity.setResult(RESULT_OK)
             mActivity.finish()
-//            var objectEntity = ObjectEntity(
-//                id = space.id!!,
-//                name = space.name!!,
-//
-//            )
-//            repo.insObject()
         }
     }
 
@@ -741,10 +386,6 @@ class GraphyVM(
                 mEmitter.SendDircetive(SPACE_INFOS, infos)
                 mEmitter.SendDircetive(Equip_INFOS, equip)
             }
-
-
-//            var infoList = gson.fromJson(strInfos, ArrayList<Infos>()::class.java)
-
         }
     }
 
@@ -1373,30 +1014,15 @@ class GraphyVM(
         const val MAP_LOAD = "MAP_LOAD"
         const val EQUIP_CLASS = "EQUIP_CLASS"
 
-        //
-        const val REFRESH_OBJECT = "SPACE_JOB"
-
         //查询空间和任务
         const val SPACE_JOB = "SPACE_JOB"
 
-        //添加空间核查问题
-        const val ADD_PROBLEM = "ADD_PROBLEM"
-
         //查询空间核查问题
         const val GET_PROBLEM = "GET_PROBLEM"
 
         //设置空间核查问题的信息和状态
         const val SET_PROBLEM = "SET_PROBLEM"
 
-        //关闭空间核查问题
-        const val CLOSE_PROBLEM = "CLOSE_PROBLEM"
-
-        //绑定二维码
-        const val BIND_QECODE = "BIND_QECODE"
-
-        //查询对象绑定的二维码
-        const val GET_QECODE = "GET_QECODE"
-
         //设置空间的任务状态(新建和修改)
         const val SET_JOB = "SET_JOB"
 
@@ -1416,12 +1042,10 @@ class GraphyVM(
         const val SPACE_INFO = "SPACE_INFO"
         const val SPACE_INFOS = "SPACE_INFOS"
 
-
         //查询设备详情
         const val EQUIP_INFO = "EQUIP_INFO"
         const val Equip_INFOS = "Equip_INFOS"
         const val EQUIP_REL = "EQUIP_REL"
-
         const val REL_OBJECT = "REL_OBJECT"
         const val PIPE_OBJECT = "PIPE_OBJECT"
         const val PIPE = "PIPE"

+ 0 - 521
demo/src/main/res/layout/activity_graphy.xml

@@ -74,182 +74,6 @@
         android:layout_height="wrap_content"
         android:background="@color/grey_100">
 
-        <LinearLayout
-            android:id="@+id/spaceStructure"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_marginTop="5dp"
-            android:layout_marginBottom="20dp"
-            android:orientation="vertical"
-            android:visibility="gone">
-
-            <TextView
-                android:id="@+id/spaceName"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_gravity="center_horizontal"
-                android:layout_marginBottom="5dp"
-                android:paddingLeft="90dp"
-                android:paddingTop="5dp"
-                android:paddingRight="90dp"
-                android:textColor="@color/grey_900"
-                android:textSize="12sp" />
-
-            <TextView
-                android:id="@+id/addDot"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_gravity="center_horizontal"
-                android:background="@drawable/bg_red_f76b65"
-                android:paddingLeft="90dp"
-                android:paddingTop="10dp"
-                android:paddingRight="90dp"
-                android:paddingBottom="10dp"
-                android:text="记录空间问题"
-                android:textColor="@color/white"
-                android:textSize="15sp" />
-
-            <LinearLayout
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_gravity="center_horizontal"
-                android:layout_marginTop="12dp"
-                android:orientation="horizontal">
-
-                <TextView
-                    android:id="@+id/qrcode"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:layout_gravity="center_horizontal"
-                    android:background="@drawable/bg_blue_3bacb2"
-                    android:paddingLeft="20dp"
-                    android:paddingTop="10dp"
-                    android:paddingRight="20dp"
-                    android:paddingBottom="10dp"
-                    android:text="绑定二维码"
-                    android:textColor="@color/white"
-                    android:textSize="15sp" />
-
-                <TextView
-                    android:id="@+id/nfc"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:layout_gravity="center_horizontal"
-                    android:layout_marginLeft="20dp"
-                    android:background="@drawable/bg_blue_3bacb2"
-                    android:paddingLeft="20dp"
-                    android:paddingTop="10dp"
-                    android:paddingRight="20dp"
-                    android:paddingBottom="10dp"
-                    android:text="绑定NFC标签"
-                    android:textColor="@color/white"
-                    android:textSize="15sp" />
-            </LinearLayout>
-
-            <CheckBox
-                android:id="@+id/modelCheckBox"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_gravity="center_horizontal"
-                android:layout_marginTop="22dp"
-                android:text="此空间核查完毕,模型和现场无区别" />
-
-            <TextView
-                android:id="@+id/addSpaceDetail"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_gravity="center_horizontal"
-                android:background="@drawable/bg_yellow_700"
-                android:paddingLeft="90dp"
-                android:paddingTop="10dp"
-                android:paddingRight="90dp"
-                android:paddingBottom="10dp"
-                android:text="记录空间信息"
-                android:textColor="@color/black_272727"
-                android:textSize="15sp" />
-
-            <EditText
-                android:id="@+id/codeEdit"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:layout_gravity="center_horizontal"
-                android:layout_marginLeft="65dp"
-                android:layout_marginTop="12dp"
-                android:layout_marginRight="65dp"
-                android:hint="输入数字化交付编码"
-                android:textColor="@color/black_272727"
-                android:textColorHint="@color/grey_500"
-                android:textSize="16sp"
-                android:visibility="gone" />
-
-            <TextView
-                android:id="@+id/modelSubmit"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_gravity="center_horizontal"
-                android:layout_marginTop="12dp"
-                android:alpha="0.3"
-                android:background="@drawable/bg_blue_3bacb2"
-                android:enabled="false"
-                android:paddingLeft="100dp"
-                android:paddingTop="10dp"
-                android:paddingRight="100dp"
-                android:paddingBottom="10dp"
-                android:text="核查完成"
-                android:textColor="@color/white"
-                android:textSize="15sp" />
-        </LinearLayout>
-
-        <LinearLayout
-            android:id="@+id/doneSpaceStructure"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:orientation="vertical"
-            android:visibility="gone">
-
-            <TextView
-                android:id="@+id/spaceName4"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_gravity="center_horizontal"
-                android:layout_marginBottom="5dp"
-                android:paddingLeft="90dp"
-                android:paddingTop="5dp"
-                android:paddingRight="90dp"
-                android:textColor="@color/grey_900"
-                android:textSize="12sp" />
-
-            <TextView
-                android:id="@+id/addSpaceDetail2"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_gravity="center_horizontal"
-                android:background="@drawable/bg_yellow_700"
-                android:paddingLeft="90dp"
-                android:paddingTop="10dp"
-                android:paddingRight="90dp"
-                android:paddingBottom="10dp"
-                android:text="记录空间信息"
-                android:textColor="@color/black_272727"
-                android:textSize="15sp" />
-
-            <TextView
-                android:id="@+id/resetSpaceState"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_gravity="center_horizontal"
-                android:layout_marginTop="15dp"
-                android:layout_marginBottom="10dp"
-                android:background="@drawable/bg_yellow_700"
-                android:paddingLeft="90dp"
-                android:paddingTop="10dp"
-                android:paddingRight="90dp"
-                android:paddingBottom="10dp"
-                android:text="重置空间状态"
-                android:textColor="@color/black_272727"
-                android:textSize="15sp" />
-        </LinearLayout>
-
         <RelativeLayout
             android:id="@+id/quesDetail"
             android:layout_width="match_parent"
@@ -299,90 +123,6 @@
         </RelativeLayout>
 
         <LinearLayout
-            android:id="@+id/qrcodeLl"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:background="@color/white"
-            android:orientation="vertical"
-            android:paddingTop="20dp"
-            android:paddingBottom="20dp"
-            android:visibility="gone">
-
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_gravity="center_horizontal"
-                android:text="请在平面图上放置二维码或NFC标签位置"
-                android:textColor="@color/grey_900"
-                android:textSize="16sp" />
-
-            <TextView
-                android:id="@+id/qrcodeLocation"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_gravity="center_horizontal"
-                android:layout_marginTop="12dp"
-                android:text="(0,0)"
-                android:textColor="@color/grey_900"
-                android:textSize="16sp" />
-
-            <EditText
-                android:id="@+id/qrcodeEdit"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:layout_gravity="center_horizontal"
-                android:layout_marginLeft="50dp"
-                android:layout_marginTop="12dp"
-                android:layout_marginRight="50dp"
-                android:hint="距离地面高度,米"
-                android:inputType="numberDecimal"
-                android:textColor="@color/black_272727"
-                android:textColorHint="@color/grey_500"
-                android:textSize="16sp" />
-
-            <TextView
-                android:id="@+id/qrcodeNext"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:layout_below="@+id/quesTv"
-                android:layout_centerHorizontal="true"
-                android:layout_gravity="center_horizontal"
-                android:layout_marginLeft="50dp"
-                android:layout_marginTop="12dp"
-                android:layout_marginRight="50dp"
-                android:background="@drawable/bg_blue_3bacb2"
-                android:gravity="center"
-                android:paddingLeft="15dp"
-                android:paddingTop="10dp"
-                android:paddingRight="15dp"
-                android:paddingBottom="10dp"
-                android:text="下一步"
-                android:textColor="@color/white"
-                android:textSize="15sp" />
-
-            <TextView
-                android:id="@+id/qrcodeCancel"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:layout_below="@+id/quesTv"
-                android:layout_centerHorizontal="true"
-                android:layout_gravity="center_horizontal"
-                android:layout_marginLeft="50dp"
-                android:layout_marginTop="12dp"
-                android:layout_marginRight="50dp"
-                android:background="@drawable/bg_grey_e6e6e6"
-                android:gravity="center"
-                android:paddingLeft="15dp"
-                android:paddingTop="10dp"
-                android:paddingRight="15dp"
-                android:paddingBottom="10dp"
-                android:text="取消"
-                android:textColor="@color/grey_900"
-                android:textSize="15sp" />
-
-        </LinearLayout>
-
-        <LinearLayout
             android:id="@+id/drawLl"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
@@ -456,134 +196,6 @@
                     android:visibility="gone" />
             </LinearLayout>
 
-            <LinearLayout
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:layout_marginLeft="20dp"
-                android:orientation="vertical">
-
-                <TextView
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="设备服务当前空间"
-                    android:textColor="@color/grey_900"
-                    android:textSize="12sp"
-                    android:visibility="gone" />
-
-                <TextView
-                    android:id="@+id/eqSpServe"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:layout_marginTop="5dp"
-                    android:background="@drawable/bg_blue_3bacb2"
-                    android:gravity="center"
-                    android:paddingLeft="20dp"
-                    android:paddingTop="2dp"
-                    android:paddingRight="20dp"
-                    android:paddingBottom="2dp"
-                    android:text="服务"
-                    android:textColor="@color/white"
-                    android:textSize="14sp"
-                    android:visibility="gone" />
-
-                <TextView
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:layout_marginTop="5dp"
-                    android:text="当前空间内设备与设备"
-                    android:textColor="@color/grey_900"
-                    android:textSize="12sp"
-                    android:visibility="gone" />
-
-                <LinearLayout
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:layout_marginTop="5dp"
-                    android:layout_marginRight="20dp"
-                    android:orientation="horizontal"
-                    android:visibility="gone">
-
-                    <TextView
-                        android:id="@+id/eqEqCtrl"
-                        android:layout_width="0dp"
-                        android:layout_height="wrap_content"
-                        android:layout_weight="1"
-                        android:background="@drawable/bg_blue_3bacb2"
-                        android:gravity="center"
-                        android:paddingTop="2dp"
-                        android:paddingBottom="2dp"
-                        android:text="控制"
-                        android:textColor="@color/white"
-                        android:textSize="14sp" />
-
-                    <TextView
-                        android:id="@+id/eqEqSs"
-                        android:layout_width="0dp"
-                        android:layout_height="wrap_content"
-                        android:layout_marginLeft="20dp"
-                        android:layout_weight="1"
-                        android:background="@drawable/bg_blue_3bacb2"
-                        android:gravity="center"
-                        android:paddingTop="2dp"
-                        android:paddingBottom="2dp"
-                        android:text="测量"
-                        android:textColor="@color/white"
-                        android:textSize="14sp" />
-
-                    <TextView
-                        android:id="@+id/eqEqPower"
-                        android:layout_width="0dp"
-                        android:layout_height="wrap_content"
-                        android:layout_marginLeft="20dp"
-                        android:layout_weight="1"
-                        android:background="@drawable/bg_blue_3bacb2"
-                        android:gravity="center"
-                        android:paddingTop="2dp"
-                        android:paddingBottom="2dp"
-                        android:text="供电"
-                        android:textColor="@color/white"
-                        android:textSize="14sp" />
-
-                    <TextView
-                        android:id="@+id/eqEqVv"
-                        android:layout_width="0dp"
-                        android:layout_height="wrap_content"
-                        android:layout_marginLeft="20dp"
-                        android:layout_weight="1"
-                        android:background="@drawable/bg_blue_3bacb2"
-                        android:gravity="center"
-                        android:paddingTop="2dp"
-                        android:paddingBottom="2dp"
-                        android:text="阀门"
-                        android:textColor="@color/white"
-                        android:textSize="14sp" />
-                </LinearLayout>
-
-                <TextView
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:layout_marginTop="5dp"
-                    android:text="当前空间内设备与管道"
-                    android:textColor="@color/grey_900"
-                    android:textSize="12sp"
-                    android:visibility="gone" />
-
-                <TextView
-                    android:id="@+id/eqPipeCnct"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:layout_marginTop="5dp"
-                    android:background="@drawable/bg_blue_3bacb2"
-                    android:gravity="center"
-                    android:paddingLeft="20dp"
-                    android:paddingTop="2dp"
-                    android:paddingRight="20dp"
-                    android:paddingBottom="2dp"
-                    android:text="连接"
-                    android:textColor="@color/white"
-                    android:textSize="14sp"
-                    android:visibility="gone" />
-            </LinearLayout>
 
             <TextView
                 android:id="@+id/equipDetail"
@@ -863,138 +475,5 @@
                 android:textSize="15sp" />
         </LinearLayout>
 
-        <androidx.appcompat.widget.LinearLayoutCompat
-            android:id="@+id/problemLl"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:background="@color/white_ffffff"
-            android:orientation="vertical"
-            android:padding="10dp"
-            android:visibility="gone">
-
-            <TextView
-                android:id="@+id/spaceName3"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_gravity="center_horizontal"
-                android:layout_marginBottom="5dp"
-                android:paddingLeft="90dp"
-                android:paddingTop="5dp"
-                android:paddingRight="90dp"
-                android:textColor="@color/grey_900"
-                android:textSize="12sp"
-                tools:text="12" />
-
-            <RadioGroup
-                android:id="@+id/ProblemRg"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_gravity="center_horizontal"
-                android:orientation="horizontal">
-
-                <RadioButton
-                    android:id="@+id/pointRb"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:checked="true"
-                    android:paddingLeft="10dp"
-                    android:paddingRight="20dp"
-                    android:text="点"
-                    android:textSize="16dp" />
-
-                <RadioButton
-                    android:id="@+id/lineRb"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:paddingLeft="10dp"
-                    android:paddingRight="20dp"
-                    android:text="线段"
-                    android:textSize="16dp" />
-            </RadioGroup>
-
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="问题描述"
-                android:textColor="@color/black_272727"
-                android:textSize="13sp" />
-
-            <androidx.appcompat.widget.AppCompatEditText
-                android:id="@+id/problemDesc"
-                android:layout_width="match_parent"
-                android:layout_height="60dp"
-                android:layout_marginTop="8dp"
-                android:background="@drawable/bg_gray_f2f3f6"
-                android:gravity="start"
-                android:hint="请输入问题描述"
-                android:padding="5dp"
-                android:textColor="@color/black_272727"
-                android:textSize="13sp" />
-
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_marginTop="8dp"
-                android:text="照片补充"
-                android:textColor="@color/black_272727"
-                android:textSize="13sp" />
-
-            <com.sybotan.android.demo.view.MaxHeightRecyclerView
-                android:id="@+id/problemPicRecycler"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:minHeight="20dp"
-                app:maxHeight="120dp" />
-
-            <androidx.appcompat.widget.LinearLayoutCompat
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:layout_marginLeft="16dp"
-                android:layout_marginTop="8dp"
-                android:layout_marginRight="16dp"
-                android:orientation="horizontal">
-
-                <TextView
-                    android:id="@+id/problemClose"
-                    android:layout_width="0dp"
-                    android:layout_height="wrap_content"
-                    android:layout_weight="1"
-                    android:background="@drawable/bg_grey_e6e6e6"
-                    android:gravity="center"
-                    android:paddingTop="5dp"
-                    android:paddingBottom="5dp"
-                    android:text="关闭"
-                    android:textColor="@color/black_272727"
-                    android:textSize="13sp" />
-
-                <TextView
-                    android:id="@+id/problemDone"
-                    android:layout_width="0dp"
-                    android:layout_height="wrap_content"
-                    android:layout_marginLeft="16dp"
-                    android:layout_weight="1"
-                    android:background="@drawable/bg_grey_e6e6e6"
-                    android:gravity="center"
-                    android:paddingTop="5dp"
-                    android:paddingBottom="5dp"
-                    android:text="已解决"
-                    android:textColor="@color/black_272727"
-                    android:textSize="13sp" />
-
-                <TextView
-                    android:id="@+id/problemSave"
-                    android:layout_width="0dp"
-                    android:layout_height="wrap_content"
-                    android:layout_marginLeft="16dp"
-                    android:layout_weight="1"
-                    android:background="@drawable/bg_yellow_700"
-                    android:gravity="center"
-                    android:paddingTop="5dp"
-                    android:paddingBottom="5dp"
-                    android:text="保存"
-                    android:textColor="@color/black_272727"
-                    android:textSize="13sp" />
-            </androidx.appcompat.widget.LinearLayoutCompat>
-        </androidx.appcompat.widget.LinearLayoutCompat>
     </RelativeLayout>
 </LinearLayout>