bai 3 лет назад
Родитель
Сommit
2bf305fcd3
66 измененных файлов с 3594 добавлено и 1 удалено
  1. 1 0
      adm-cad/.gitignore
  2. 51 0
      adm-cad/build.gradle.kts
  3. 0 0
      adm-cad/consumer-rules.pro
  4. 21 0
      adm-cad/proguard-rules.pro
  5. 24 0
      adm-cad/src/androidTest/java/com/ys/bdtp/cad/ExampleInstrumentedTest.kt
  6. 5 0
      adm-cad/src/main/AndroidManifest.xml
  7. 452 0
      adm-cad/src/main/java/com/ys/bdtp/cad/FloorScene.kt
  8. 53 0
      adm-cad/src/main/java/com/ys/bdtp/cad/Opt.kt
  9. 40 0
      adm-cad/src/main/java/com/ys/bdtp/cad/http/DownloadData.kt
  10. 87 0
      adm-cad/src/main/java/com/ys/bdtp/cad/items/AreaNodeItem.kt
  11. 43 0
      adm-cad/src/main/java/com/ys/bdtp/cad/items/BaseMapItem.kt
  12. 88 0
      adm-cad/src/main/java/com/ys/bdtp/cad/items/ColumnItem.kt
  13. 125 0
      adm-cad/src/main/java/com/ys/bdtp/cad/items/DoorItem.kt
  14. 109 0
      adm-cad/src/main/java/com/ys/bdtp/cad/items/EquipItem.kt
  15. 48 0
      adm-cad/src/main/java/com/ys/bdtp/cad/items/GestureItem.kt
  16. 145 0
      adm-cad/src/main/java/com/ys/bdtp/cad/items/GridItem.kt
  17. 64 0
      adm-cad/src/main/java/com/ys/bdtp/cad/items/MarkItem.kt
  18. 97 0
      adm-cad/src/main/java/com/ys/bdtp/cad/items/PipeLineItem.kt
  19. 87 0
      adm-cad/src/main/java/com/ys/bdtp/cad/items/PipeNodeItem.kt
  20. 194 0
      adm-cad/src/main/java/com/ys/bdtp/cad/items/PointItem.kt
  21. 121 0
      adm-cad/src/main/java/com/ys/bdtp/cad/items/QrcodeItem.kt
  22. 62 0
      adm-cad/src/main/java/com/ys/bdtp/cad/items/ServeAreaItem.kt
  23. 113 0
      adm-cad/src/main/java/com/ys/bdtp/cad/items/SpaceItem.kt
  24. 137 0
      adm-cad/src/main/java/com/ys/bdtp/cad/items/SpaceNameItem.kt
  25. 79 0
      adm-cad/src/main/java/com/ys/bdtp/cad/items/SpatialCenterItem.kt
  26. 226 0
      adm-cad/src/main/java/com/ys/bdtp/cad/items/TunableSpaceItem.kt
  27. 103 0
      adm-cad/src/main/java/com/ys/bdtp/cad/items/UserMark.kt
  28. 96 0
      adm-cad/src/main/java/com/ys/bdtp/cad/items/VirtualWallItem.kt
  29. 93 0
      adm-cad/src/main/java/com/ys/bdtp/cad/items/WallItem.kt
  30. 94 0
      adm-cad/src/main/java/com/ys/bdtp/cad/items/WindowItem.kt
  31. 117 0
      adm-cad/src/main/java/com/ys/bdtp/cad/test/GraphyFmItem.kt
  32. 127 0
      adm-cad/src/main/java/com/ys/bdtp/cad/test/GraphyTwoItem.kt
  33. 23 0
      adm-cad/src/main/java/com/ys/bdtp/cad/types/Column.kt
  34. 34 0
      adm-cad/src/main/java/com/ys/bdtp/cad/types/Door.kt
  35. 21 0
      adm-cad/src/main/java/com/ys/bdtp/cad/types/Elements.kt
  36. 13 0
      adm-cad/src/main/java/com/ys/bdtp/cad/types/Entity.kt
  37. 13 0
      adm-cad/src/main/java/com/ys/bdtp/cad/types/FloorData.kt
  38. 25 0
      adm-cad/src/main/java/com/ys/bdtp/cad/types/Grid.kt
  39. 17 0
      adm-cad/src/main/java/com/ys/bdtp/cad/types/Marker.kt
  40. 22 0
      adm-cad/src/main/java/com/ys/bdtp/cad/types/Photos.kt
  41. 17 0
      adm-cad/src/main/java/com/ys/bdtp/cad/types/PipeLine.kt
  42. 15 0
      adm-cad/src/main/java/com/ys/bdtp/cad/types/Place.kt
  43. 40 0
      adm-cad/src/main/java/com/ys/bdtp/cad/types/Point.kt
  44. 13 0
      adm-cad/src/main/java/com/ys/bdtp/cad/types/PointZ.kt
  45. 43 0
      adm-cad/src/main/java/com/ys/bdtp/cad/types/Pointz2.java
  46. 23 0
      adm-cad/src/main/java/com/ys/bdtp/cad/types/Space.kt
  47. 72 0
      adm-cad/src/main/java/com/ys/bdtp/cad/types/TunableSpace.kt
  48. 21 0
      adm-cad/src/main/java/com/ys/bdtp/cad/types/VirtualWall.kt
  49. 25 0
      adm-cad/src/main/java/com/ys/bdtp/cad/types/Wall.kt
  50. 29 0
      adm-cad/src/main/java/com/ys/bdtp/cad/types/Window.kt
  51. BIN
      adm-cad/src/main/res/drawable/centertack_img.png
  52. BIN
      adm-cad/src/main/res/drawable/equip6.png
  53. BIN
      adm-cad/src/main/res/drawable/equip_blue.png
  54. BIN
      adm-cad/src/main/res/drawable/equip_green.png
  55. BIN
      adm-cad/src/main/res/drawable/equip_notdone.png
  56. BIN
      adm-cad/src/main/res/drawable/equip_purple.png
  57. BIN
      adm-cad/src/main/res/drawable/equip_red.png
  58. BIN
      adm-cad/src/main/res/drawable/img.png
  59. BIN
      adm-cad/src/main/res/drawable/pipecadcolor.png
  60. BIN
      adm-cad/src/main/res/drawable/pipecadsmall.png
  61. BIN
      adm-cad/src/main/res/drawable/qrcode.png
  62. BIN
      adm-cad/src/main/res/drawable/yellow_equip.png
  63. 3 0
      adm-cad/src/main/res/values/strings.xml
  64. 17 0
      adm-cad/src/test/java/com/ys/bdtp/cad/ExampleUnitTest.kt
  65. 1 1
      adm-graph/build.gradle.kts
  66. 5 0
      settings.gradle.kts

+ 1 - 0
adm-cad/.gitignore

@@ -0,0 +1 @@
+/build

+ 51 - 0
adm-cad/build.gradle.kts

@@ -0,0 +1,51 @@
+plugins {
+    id("com.android.library")
+    id("org.jetbrains.kotlin.android")
+}
+
+android {
+    compileSdk = 31
+
+    defaultConfig {
+        minSdk = 28
+        targetSdk = 31
+        testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
+    }
+
+    buildTypes {
+        release {
+            isMinifyEnabled = false
+            proguardFiles(
+                getDefaultProguardFile("proguard-android-optimize.txt"),
+                "proguard-rules.pro"
+            )
+        }
+    }
+
+    compileOptions {
+        sourceCompatibility = JavaVersion.VERSION_1_8
+        targetCompatibility = JavaVersion.VERSION_1_8
+    }
+
+    kotlinOptions {
+        jvmTarget = "1.8"
+    }
+}
+
+dependencies {
+
+    implementation(project(":adm-graph"))
+    implementation(project(":adm-base"))
+    implementation("androidx.core:core-ktx:1.7.0")
+    implementation("androidx.appcompat:appcompat:1.4.0")
+    implementation("com.google.android.material:material:1.4.0")
+    implementation("com.google.zxing:core:3.3.0")
+    implementation("cn.sagacloud:saga-kotlin-base:1.4.105")
+    implementation("com.google.code.gson:gson:2.8.9")
+    implementation("org.greenrobot:eventbus:3.3.1")
+    //implementation("pub.devrel:easypermissions:1.2.0")
+
+    testImplementation("junit:junit:4.13.2")
+    androidTestImplementation("androidx.test.ext:junit:1.1.3")
+    androidTestImplementation("androidx.test.espresso:espresso-core:3.4.0")
+}

+ 0 - 0
adm-cad/consumer-rules.pro


+ 21 - 0
adm-cad/proguard-rules.pro

@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+#   http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+#   public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile

+ 24 - 0
adm-cad/src/androidTest/java/com/ys/bdtp/cad/ExampleInstrumentedTest.kt

@@ -0,0 +1,24 @@
+package com.ys.bdtp.cad
+
+import androidx.test.platform.app.InstrumentationRegistry
+import androidx.test.ext.junit.runners.AndroidJUnit4
+
+import org.junit.Test
+import org.junit.runner.RunWith
+
+import org.junit.Assert.*
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * See [testing documentation](http://d.android.com/tools/testing).
+ */
+@RunWith(AndroidJUnit4::class)
+class ExampleInstrumentedTest {
+    @Test
+    fun useAppContext() {
+        // Context of the app under test.
+        val appContext = InstrumentationRegistry.getInstrumentation().targetContext
+        assertEquals("com.ys.bdtp.cad.test", appContext.packageName)
+    }
+}

+ 5 - 0
adm-cad/src/main/AndroidManifest.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+          package="com.ys.bdtp.cad">
+
+</manifest>

+ 452 - 0
adm-cad/src/main/java/com/ys/bdtp/cad/FloorScene.kt

@@ -0,0 +1,452 @@
+package com.ys.bdtp.cad
+
+import android.graphics.PointF
+import android.text.TextUtils
+import android.util.Log
+import com.sybotan.base.utils.SHttpUtil
+import com.sybotan.base.utils.SJsonUtil
+import com.ys.bdtp.cad.items.ColumnItem
+import com.ys.bdtp.cad.items.DoorItem
+import com.ys.bdtp.cad.items.EquipItem
+import com.ys.bdtp.cad.items.PipeLineItem
+import com.ys.bdtp.cad.items.PipeNodeItem
+import com.ys.bdtp.cad.items.PointItem
+import com.ys.bdtp.cad.items.QrcodeItem
+import com.ys.bdtp.cad.items.SpaceItem
+import com.ys.bdtp.cad.items.SpaceNameItem
+import com.ys.bdtp.cad.items.TunableSpaceItem
+import com.ys.bdtp.cad.items.VirtualWallItem
+import com.ys.bdtp.cad.items.WallItem
+import com.ys.bdtp.cad.items.WindowItem
+import com.ys.bdtp.cad.types.Column
+import com.ys.bdtp.cad.types.Door
+import com.ys.bdtp.cad.types.FloorData
+import com.ys.bdtp.cad.types.Point
+import com.ys.bdtp.cad.types.Space
+import com.ys.bdtp.cad.types.VirtualWall
+import com.ys.bdtp.cad.types.Wall
+import com.ys.bdtp.cad.types.Window
+import com.ys.bdtp.graph.SGraphyScene
+import com.ys.bdtp.graph.SMotionEvent
+import com.ys.bdtp.graph.events.SGraphyViewMoveEvent
+import org.greenrobot.eventbus.Subscribe
+import org.greenrobot.eventbus.ThreadMode
+
+/**
+ * 楼层场景
+ *
+ * @author  庞利祥(sybotan@126.com)
+ */
+open class FloorScene : SGraphyScene() {
+    //点击事件回调到界面
+    lateinit var topUp: OnSingleTopUp
+
+    //    var item: PointItem? = null
+//    val point = Point()
+    var canEdit = true
+    var point = Point()
+    var item: QrcodeItem? = null
+    var eqItem: EquipItem? = null
+
+    var pipeItem: PipeLineItem? = null
+
+    /** 默认缩放比例,用于指定最小缩放比例*/
+    var defaultPointScale = 0.01785718f
+
+    /**
+     * normol 普通可以查看,可以点击问题点的模式
+     * dot 绘制问题点
+     * pipe 绘制管道模式
+     * qrcode 绘制二维码
+     * equip 绘制设备
+     */
+    var type: String? = "normal"
+
+    /**
+     * nothing 不显示任何操作界面
+     * space 选中某一空间
+     */
+    var mapType: String? = "nothing"
+    var choseSpace: TunableSpaceItem? = null
+    var pipeLineList: ArrayList<PointF> = ArrayList()
+
+    /**  正在绘制的管道 */
+    val drawingPipeItemList = ArrayList<PipeLineItem>()
+
+    /** item 数据  */
+    var data: FloorData? = null
+        set(value) {
+            addBaseMapItem(value!!)
+            field = value
+        } // Set data
+
+    /** 初始化 */
+    init {
+        //addItem(SGraphyClockItem(SizeF(500f, 500f), null))
+    } // Init()
+
+    /** 是否显示墙体  */
+    var isShowColumn: Boolean = true
+        set(value) {
+            field = value
+            for (column in columnList) {
+                column.isVisible = value
+            }
+        } // Set isShowColumn
+
+    /** 是否显示墙体  */
+    var isShowWall: Boolean = true
+        set(value) {
+            field = value
+            for (wall in wallList) {
+                wall.isVisible = value
+            }
+        } // Set isShowWall
+
+    /** 是否显示虚拟墙  */
+    var isShowVirtualWall: Boolean = true
+        set(value) {
+            field = value
+            for (wall in virtualWallList) {
+                wall.isVisible = value
+            }
+        } // Set isShowWall
+
+    /** 是否显示空间  */
+    var isShowSpace: Boolean = true
+        set(value) {
+            field = value
+            for (space in spaceList) {
+                space.isVisible = value
+            }
+        } // Set isShowSpace
+
+    /** 是否显示门  */
+    var isShowDoor: Boolean = true
+        set(value) {
+            field = value
+            for (door in doorList) {
+                door.isVisible = value
+            }
+        } // Set isShowDoor
+
+    /** 是否显示窗户  */
+    var isShowWindow: Boolean = true
+        set(value) {
+            field = value
+            for (window in windowList) {
+                window.isVisible = value
+            }
+        } // Set isShowWindow
+
+    /** 墙 list   */
+    val wallList = ArrayList<WallItem>()
+
+    /** 虚拟墙 list   */
+    val virtualWallList = ArrayList<VirtualWallItem>()
+
+    /** 柱子 list   */
+    var columnList = ArrayList<ColumnItem>()
+
+    /** 空间 list   */
+    var spaceList = ArrayList<SpaceItem>()
+
+    /** 空间名称 list   */
+    val spaceNameList = ArrayList<SpaceNameItem>()
+
+    /** 门 list   */
+    var doorList = ArrayList<DoorItem>()
+
+    /** 空间 list   */
+    var windowList = ArrayList<WindowItem>()
+
+    /** 点 */
+    val pointItemList = java.util.ArrayList<PointItem>()
+
+    /** 二维码 */
+    val qrcodeItemList = java.util.ArrayList<QrcodeItem>()
+
+    /** 管道 */
+    val pipeItemList = ArrayList<PipeLineItem>()
+    val pipeNodeList = ArrayList<PipeNodeItem>()
+
+    /** 有任务的空间 list   */
+    var tunableSpaceList = ArrayList<TunableSpaceItem>()
+
+    /** 设备 list   */
+    var equipList = ArrayList<EquipItem>()
+
+    /**
+     *  获取底图压缩文件
+     *
+     *  @param  url         请求数据文件路径
+     *  @param  isGzip      是否为压缩格式
+     */
+    fun loadUrl(url: String, isGzip: Boolean = true) {
+//        //Log.e("数据源", "url = $url")
+        try {
+            val json = if (isGzip) {
+                SHttpUtil.getZipRequest(url)
+            } else {
+                SHttpUtil.getRequest(url)
+            }
+//            SJsonUtil.propertyNamingStrategy = PropertyNamingStrategy.PascalCase
+            val d = SJsonUtil.fromJson<FloorData>(json)
+//            //Log.e("数据源", "json = ${d?.toJson()}")
+            data = SJsonUtil.fromJson(json, FloorData::class.java)
+//            Log.e("数据源", "json = ${d?.toJson()}")
+        } catch (e: Exception) {
+            e.printStackTrace()
+        }
+    } // Function loadUrl()
+
+    fun loadData(json: FloorData) {
+        try {
+//            SJsonUtil.propertyNamingStrategy = PropertyNamingStrategy.PascalCase
+//            //Log.e("数据源", "json = ${json?.toJson()}")
+            data = json
+//            Log.e("数据源", "json = ${json?.toJson()}")
+        } catch (e: Exception) {
+            e.printStackTrace()
+        }
+    } // Function loadUrl()
+
+
+    /**
+     *  增添所有底图 item;
+     *
+     *  @param  data    itemList对象
+     */
+    private fun addBaseMapItem(data: FloorData) {
+        if (data.entityList.size < 1) {
+            return;
+        }
+        val elements = data.entityList[0].elements ?: return
+
+        // 添加墙
+        if (elements.walls != null) {
+            for (wall in elements.walls!!) {
+                addWall(wall);
+            }
+        }
+
+        // 添加虚拟墙
+        if (elements.virtualWalls != null) {
+            for (wall in elements.virtualWalls!!) {
+                addVirtualWall(wall);
+            }
+        }
+
+        // 添加柱子
+        if (elements.columns != null) {
+            for (column in elements.columns!!) {
+                addColumn(column);
+            }
+        }
+
+        // 添加空间
+        if (elements.spaces != null) {
+            for (space in elements.spaces!!) {
+                addSpace(space)
+            }
+        }
+
+        // 添加空间名称
+//        if (elements.spaces != null) {
+//            for (space in elements.spaces!!) {
+//                addSpaceName(space)
+//            }
+//        }
+
+        // 添加门
+        if (elements.doors != null) {
+            for (door in elements.doors!!) {
+                addDoor(door);
+            }
+        }
+
+        // 添加窗户
+        if (elements.windows != null) {
+            for (window in elements.windows!!) {
+                addWindow(window);
+            }
+        }
+
+        //添加问题点
+        for (item in pointItemList) {
+            item.isVisible = isShowSpace
+            item.zOrder = 100000f
+            addItem(item)
+        }
+
+        //添加管道
+        for (item in pipeItemList) {
+            item.isVisible = isShowSpace
+            item.zOrder = 100000f
+            addItem(item)
+        }
+
+        // 添加空间
+        for (tunableSpace in tunableSpaceList) {
+            tunableSpace.isVisible = isShowSpace
+            tunableSpace.zOrder = 99996f
+            addItem(tunableSpace)
+
+//            val space = Space()
+//            space.outLine = tunableSpace.data.outLine
+//            space.name = tunableSpace.data.name
+//            val item = SpaceNameItem(space)
+//            item.zOrder = 99999f
+//            item.isVisible = isShowSpace
+//            spaceNameList.add(item)
+//            addItem(item)
+        }
+    } // Function addBaseMapItem()
+
+    /**
+     *  添加柱子到 scene 中
+     *
+     *  @param  column   柱子
+     */
+    open fun addColumn(column: Column) {
+        val item = ColumnItem(column)
+        item.isVisible = isShowColumn
+        item.zOrder = 100000f
+        columnList.add(item)
+        addItem(item)
+    } // Function addColumn()
+
+    /**
+     *  添加墙到 scene 中
+     *
+     *  @param  wall   墙
+     */
+    open fun addWall(wall: Wall) {
+        val item = WallItem(wall)
+        item.isVisible = isShowWall
+        item.zOrder = 1000000f
+        wallList.add(item)
+        addItem(item)
+    } // Function addWall()
+
+    /**
+     *  添加所有虚拟墙到 scene 中
+     *
+     *  @param  wall   墙
+     */
+    open fun addVirtualWall(wall: VirtualWall) {
+        val item = VirtualWallItem(wall)
+        item.isVisible = isShowVirtualWall
+        item.zOrder = 100000f
+        virtualWallList.add(item)
+        addItem(item)
+    } // Function addVirtualWall()
+
+    /**
+     *  添加空间到 scene 中
+     *
+     *  @param  space       空间
+     */
+    open fun addSpace(space: Space) {
+        val item = SpaceItem(space)
+//        Log.e("打印数据", space.toJson())
+        item.isVisible = isShowSpace
+        spaceList.add(item)
+        addItem(item)
+    } // Function addSpace()
+
+    /**
+     *  添加空间名称 scene 中
+     *
+     *  @param  space       空间
+     */
+//    open fun addSpaceName(space: Space) {
+//        if (space.outLine != null) {
+//            val scitem = SpatialCenterItem(space.name!!)
+//            scitem.moveTo(PointF(space.location!!.points!![0].x, -space.location!!.points!![0].y))
+//            scitem.zOrder = 100f
+//            scitem.isVisible = true
+//            spaceNameList.add(scitem)
+//            this.addItem(scitem)
+//
+//        }
+//    } // Function addSpace()
+
+    /**
+     *  添加门到 scene 中
+     *
+     *  @param  door        门
+     */
+    open fun addDoor(door: Door) {
+        val item = DoorItem(door)
+        item.isVisible = isShowSpace
+        item.zOrder = 100001f
+        doorList.add(item)
+        addItem(item)
+    } // Function addWindow()
+
+
+    /**
+     *  添加窗户到 scene 中
+     *
+     *  @param  window     窗户
+     */
+    open fun addWindow(window: Window) {
+        val item = WindowItem(window)
+        item.isVisible = isShowSpace
+        item.zOrder = 100001f
+        windowList.add(item)
+        addItem(item)
+    } // Function addWindow()
+
+    /**
+     * 截断输出日志
+     * 解决Log打印不全的问题
+     */
+    fun println1(msg: String) {
+        var msg = msg
+        if (TextUtils.isEmpty(msg))
+            return
+        val segmentSize = 3 * 1024
+        val length = msg.length.toLong()
+        if (length <= segmentSize) {// 长度小于等于限制直接打印
+            //Log.e("数据源", msg)
+        } else {
+            while (msg.length > segmentSize) {// 循环分段打印日志
+                val logContent = msg.substring(0, segmentSize)
+                msg = msg.replace(logContent, "")
+                //Log.e("数据源", logContent)
+            }
+            //Log.e("数据源", msg)// 打印剩余日志
+        }
+    }
+
+    /**
+     *  接收移动坐标
+     */
+    @Subscribe(threadMode = ThreadMode.MAIN)
+    fun onMoveEvent(event: SGraphyViewMoveEvent) {
+        Log.e("x", event.x.toString())
+        Log.e("y", event.y.toString())
+//        mapToScene = this.mapToScene( PointF(this.width/2f,this.height/2f))
+//        if (cadViewMovePointF!=null){
+//            cadViewMovePointF!!.viewMovePointF(mapToScene)
+//        }
+    }
+
+    override fun onSingleTapUp(e: SMotionEvent): Boolean {
+
+        topUp.onSingUp(e.x, e.y)
+        return super.onSingleTapUp(e)
+    }
+
+
+    interface OnSingleTopUp {
+        fun onSingUp(x: Float, y: Float)
+    }
+
+    fun setOnSingleTopUp(topUp: OnSingleTopUp) {
+        this.topUp = topUp
+    }
+
+} // Class FloorScene

+ 53 - 0
adm-cad/src/main/java/com/ys/bdtp/cad/Opt.kt

@@ -0,0 +1,53 @@
+package com.ys.bdtp.cad
+
+import android.graphics.Color
+
+/**
+ * 颜色类
+ *
+ * @author  庞利祥(sybotan@126.com)
+ */
+class Opt {
+    companion object {
+        /** 墙颜色 */
+        val wallColor = Color.rgb(0x55, 0x55, 0x55)
+        /** 柱子颜色 */
+        val columnColor = Color.rgb(0x5b, 0x5b, 0x5b)
+        /** 虚拟墙颜色 */
+        val virtualWallColor = Color.rgb(0xff,0x00,0xff)
+        /** 默认空间颜色 */
+        val spaceColor = Color.rgb(0xf1, 0xf3, 0xf7)
+        /** 门颜色 */
+        val doorColor = Color.rgb(0xcc, 0xcc, 0xcc)
+        /** 窗户颜色 */
+        val windowColor = Color.rgb(0xba, 0xe0, 0xfd)
+
+//        /** 墙颜色 */
+//        val wallColor = Color.rgb(0x55, 0x57, 0x67)
+//        /** 柱子颜色 */
+//        val columnColor = Color.rgb(0x19, 0x1b, 0x26)
+//        /** 虚拟墙颜色 */
+//        val virtualWallColor = Color.rgb(0x6c, 0x6d, 0x70)
+//        /** 门颜色 */
+//        val doorColor = Color.rgb(0x6c, 0x6d, 0x70)
+//        /** 窗户颜色 */
+//        val windowColor = Color.rgb(0x98, 0x9b, 0xa9)
+//        /** 默认空间颜色 */
+//        val spaceColor = Color.rgb(0x38, 0x3a, 0x4a)
+
+
+        /** 空间-梯颜色 */
+        val ladderSpaceColor = Color.rgb(225, 242, 255)
+        /** 空间-井颜色 */
+        val wellSpaceColor = Color.rgb(238, 246, 198)
+        /** 空间-机房颜色 */
+        val engineRoomSpaceColor = Color.rgb(254, 233, 210)
+        /** 被选中的空间颜色 */
+        val spaceChoseColor = Color.rgb(0xe6, 0xfa, 0xff)
+        /** 文字颜色 */
+        val textColor = Color.rgb(0x44, 0x71, 0xa3)
+
+        /** 可调节空间颜色 */
+        val tunableSpaceColor = Color.parseColor("#4d7E96FF")
+    }
+} // Class Opt

+ 40 - 0
adm-cad/src/main/java/com/ys/bdtp/cad/http/DownloadData.kt

@@ -0,0 +1,40 @@
+package com.ys.bdtp.cad.http
+
+import com.ys.bdtp.cad.types.FloorData
+import com.sybotan.base.utils.SHttpUtil
+import com.sybotan.base.utils.SJsonUtil
+
+/**
+ * 下载数据
+ *
+ * @author 张维新
+ */
+object DownloadData {
+
+    /**
+     *  获取底图压缩文件
+     *
+     *  @param  url         请求数据文件路径
+     *  @param  isGzip      是否为压缩格式
+     */
+    fun loadUrlFile(url: String, isGzip: Boolean = true): FloorData? {
+        //Log.e("数据源","url = $url")
+        var floorData: FloorData? = null
+       return try {
+            val json = if (isGzip) {
+                SHttpUtil.getZipRequest(url)
+            } else {
+                SHttpUtil.getRequest(url)
+            }
+//            SJsonUtil.propertyNamingStrategy = PropertyNamingStrategy.PascalCase
+            val d = SJsonUtil.fromJson<FloorData>(json)
+            //Log.e("数据源", "json = ${d?.toJson()}")
+           floorData = SJsonUtil.fromJson(json, FloorData::class.java)
+           floorData
+        } catch (e: Exception) {
+            e.printStackTrace()
+           floorData
+        }
+    } // Function loadUrlFile()
+
+} // Object DownloadData

+ 87 - 0
adm-cad/src/main/java/com/ys/bdtp/cad/items/AreaNodeItem.kt

@@ -0,0 +1,87 @@
+package com.ys.bdtp.cad.items
+
+import android.graphics.*
+import com.ys.bdtp.graph.SGraphyItem
+import com.ys.bdtp.graph.SMotionEvent
+import java.util.*
+
+/**
+ * Created by lihao.
+ * Date: 2021/6/7
+ * 区域节点
+ */
+class AreaNodeItem(val data: PointF, parent: SGraphyItem? = null) : SGraphyItem(parent) {
+    /** 画笔 */
+    val paint = Paint()
+    val mPaint_inner = Paint()
+
+    val outPaint = Paint()
+
+    var x: Float = 0f
+    var y: Float = 0f
+    lateinit var onScroll: OnScroll
+
+    init {
+        try {
+//            flags = EnumSet.of(SGraphyItemFlag.ItemIsMovable, SGraphyItemFlag.ItemIsSelectable, SGraphyItemFlag.ItemIsFocusable)
+
+        } catch (e: Exception) {
+            e.printStackTrace()
+        }
+        outPaint.style = Paint.Style.STROKE
+        outPaint.strokeJoin = Paint.Join.ROUND
+        outPaint.isAntiAlias = true
+        outPaint.color = Color.rgb(0x66, 0x66, 0xff)
+        outPaint.strokeWidth = 150f
+        x = data.x
+        y = data.y
+
+        //内圈
+        mPaint_inner.color = Color.RED
+        mPaint_inner.isAntiAlias = true
+        mPaint_inner.style = Paint.Style.FILL
+    } // Constructor
+
+    override fun boundingRect(): RectF {
+        return RectF(data.x - 800f, -data.y - 800f, data.x + 800f, -data.y + 800f)
+    }
+
+    override fun onScroll(e1: SMotionEvent, e2: SMotionEvent, distanceX: Float, distanceY: Float): Boolean {
+        val fx = pos.x - distanceX * scale.x
+        val fy = pos.y - distanceY * scale.y
+        x = data.x + fx
+        y = data.y - fy
+        moveTo(pos.x - distanceX * scale.x, pos.y - distanceY * scale.y)
+        onScroll.onScroll(data.x + fx, data.y + fy)
+        return true
+
+
+//        moveTo(pos.x - distanceX * scale.x, pos.y - distanceY * scale.y)
+
+//        onScroll.onScroll(data.x + pos.x - distanceX * scale.x, data.y - pos.y - distanceY * scale.y)
+//        onScroll.onScroll(data.x, data.y)
+
+
+//        return super.onScroll(e1, e2, distanceX, distanceY)
+    }
+
+    interface OnScroll {
+        fun onScroll(x: Float, y: Float)
+    }
+
+    fun setOnScrollListener(onScroll: OnScroll) {
+        this.onScroll = onScroll
+    }
+
+
+    /**
+     * Item绘制操作
+     *
+     * @param   canvas          画布
+     * @param   rect            绘制区域
+     */
+    override fun onDraw(canvas: Canvas) {
+        canvas.drawCircle(data.x, -data.y, 120f, mPaint_inner)
+    } // Function onDraw()
+
+}

+ 43 - 0
adm-cad/src/main/java/com/ys/bdtp/cad/items/BaseMapItem.kt

@@ -0,0 +1,43 @@
+package com.ys.bdtp.cad.items
+
+
+import android.content.Context
+import android.graphics.*
+import com.ys.bdtp.cad.R
+import com.ys.bdtp.graph.SGraphyItem
+import com.ys.bdtp.graph.enums.SGraphyItemFlag
+import java.util.*
+
+
+/**
+ * Created by lihao.
+ * Date: 2021/6/23
+ */
+class BaseMapItem(context: Context, parent: SGraphyItem? = null) :
+        SGraphyItem(parent) {
+
+    val mPaint = Paint()
+    var mBitmap: Bitmap
+
+    init {
+        mPaint.alpha = 0X80
+        mBitmap = BitmapFactory.decodeResource(context.resources, R.drawable.pipecadcolor)
+        flags = EnumSet.of(SGraphyItemFlag.ItemIsMovable)
+        val contains = flags.contains(SGraphyItemFlag.ItemIsMovable)
+    }
+
+    /**
+     * Item绘制操作
+     *
+     * @param   canvas          画布
+     * @param   rect            绘制区域
+     */
+    override fun onDraw(canvas: Canvas) {
+        val matrix = Matrix()
+        matrix.postScale(17.0000007f, 17.0000007f)
+        matrix.postTranslate(-10200f, -79500f)
+        canvas.drawBitmap(mBitmap, matrix, mPaint)
+        super.onDraw(canvas)
+    } // Function onDraw()
+
+}

+ 88 - 0
adm-cad/src/main/java/com/ys/bdtp/cad/items/ColumnItem.kt

@@ -0,0 +1,88 @@
+package com.ys.bdtp.cad.items
+
+import android.graphics.*
+import com.ys.bdtp.cad.types.Column
+import com.ys.bdtp.cad.Opt
+import com.ys.bdtp.graph.SGraphyItem
+
+/**
+ * 柱子 Item
+ *
+ * @author 付国宝
+ */
+class ColumnItem(private val data: Column, parent: SGraphyItem? = null) : SGraphyItem(parent) {
+    /** 画笔 */
+    private val paint = Paint()
+    /** 墙轮廓 */
+    private val pathList = ArrayList<Path>()
+    /** X坐标最小值  */
+    private var minX = 0f
+    /** X坐标最大值  */
+    private var maxX = 0f
+    /** Y坐标最小值  */
+    private var minY = 0f
+    /** Y坐标最大值  */
+    private var maxY = 0f
+
+    init {
+        paint.style = Paint.Style.FILL
+        try {
+            if (data.outLine != null && data.outLine!!.size > 0 && data.outLine!![0].size > 0) {
+                minX = data.outLine!![0][0].x
+                maxX = data.outLine!![0][0].x
+                minY = data.outLine!![0][0].y
+                maxY = data.outLine!![0][0].y
+                for (out in data.outLine!!) {
+                    if (out.size < 1) {
+                        continue
+                    }
+
+                    val path = Path()
+                    path.moveTo(out[0].x, -out[0].y)
+                    for (p in out) {
+                        if (p.x < minX) {
+                            minX = p.x
+                        }
+                        if (p.x > maxX) {
+                            maxX = p.x
+                        }
+                        if (-p.y < minY) {
+                            minY = -p.y
+                        }
+                        if (-p.y > maxY) {
+                            maxY = -p.y
+                        }
+                        path.lineTo(p.x, -p.y)
+                    }
+                    path.close()
+                    pathList.add(path)
+                }
+            }
+        } catch (e: Exception) {
+            e.printStackTrace()
+        }
+    } // Init
+
+    /**
+     * Item对象边界区域
+     *
+     * @return  边界区域
+     */
+    override fun boundingRect(): RectF {
+        return RectF(minX, minY, maxX, maxY)
+    } // Function boundingRect()
+
+    /**
+     * Item绘制操作
+     *
+     * @param   canvas          画布
+     * @param   rect            绘制区域
+     */
+    override fun onDraw(canvas : Canvas) {
+        paint.style = Paint.Style.FILL
+        paint.color = Opt.columnColor;
+        for (path in pathList) {
+            canvas.drawPath(path, paint);
+        }
+    } // Function onDraw()
+} // Class ColumnItem

+ 125 - 0
adm-cad/src/main/java/com/ys/bdtp/cad/items/DoorItem.kt

@@ -0,0 +1,125 @@
+package com.ys.bdtp.cad.items
+
+import android.graphics.*
+import com.ys.bdtp.cad.Opt
+import com.ys.bdtp.cad.types.Door
+import com.ys.bdtp.graph.SGraphyItem
+import com.ys.bdtp.graph.enums.SGraphyItemFlag
+import java.util.*
+import kotlin.math.sqrt
+
+
+class DoorItem(private val data: Door, parent: SGraphyItem? = null) : SGraphyItem(parent) {
+    /** 画笔 */
+    private val paint1 = Paint()
+    private val paint2 = Paint()
+
+    /** 门长度 */
+    private var d = 0f
+
+    /** 角度  */
+    private var angle = 0f
+
+    /** 旋转点 */
+    private var p = PointF(0f, 0f)
+
+    /** 旋转起始角度 */
+    private var startAng = 0f
+
+    /**
+     * 构造
+     */
+    init {
+        flags = EnumSet.of(SGraphyItemFlag.ItemIsSelectable, SGraphyItemFlag.ItemIsFocusable)
+        try {
+            paint1.style = Paint.Style.STROKE
+            paint1.color = Opt.doorColor
+            paint1.strokeWidth = 100f
+            paint2.style = Paint.Style.STROKE
+            paint2.color = Opt.doorColor
+            paint2.strokeWidth = 50f
+            paint2.pathEffect = DashPathEffect(floatArrayOf(200f, 200f), 0f)
+
+            zOrder = 2f
+            if (data.outLine != null && data.outLine!!.size > 0 && data.outLine!![0].size >= 2) {
+                // 取门的两个端点
+                val p1 = PointF(data.outLine!![0][0].x, -data.outLine!![0][0].y)
+                val p2 = PointF(data.outLine!![0][1].x, -data.outLine!![0][1].y)
+                d = sqrt((p1.x - p2.x) * (p1.x - p2.x) + (p1.y - p2.y) * (p1.y - p2.y))
+
+                // 角度为
+//                val fo = atan2(-data.faceDirection!!.y, data.faceDirection!!.x)
+//                // 门朝向角度
+//                angle =
+//                        if (data.faceDirection!!.x > 0) {
+//                            fo
+//                        } else {
+//                            fo + Math.PI.toFloat()
+//                        }
+
+////                val dir = data.faceDirection!!.x * (data.handDirection!!.y - data.faceDirection!!.y) - data.faceDirection!!.y * (data.handDirection!!.x - data.faceDirection!!.x)
+////                if (dir < 0) {
+////                    startAng = -90f
+////                }
+
+                // 计算旋转点
+//                if (abs(data.handDirection!!.x) > abs(data.handDirection!!.y)) {
+//                    p = if (data.handDirection!!.x > 0) {
+//                        if (p1.x > p2.x) {
+//                            p1
+//                        } else {
+//                            p2
+//                        }
+//                    } else {
+//                        if (p1.x < p2.x) {
+//                            p1
+//                        } else {
+//                            p2
+//                        }
+//                    }
+//                } else {
+//                    p = if (data.handDirection!!.y > 0) {
+//                        if (p1.y > p2.y) {
+//                            p1
+//                        } else {
+//                            p2
+//                        }
+//                    } else {
+//                        if (p1.y < p2.y) {
+//                            p1
+//                        } else {
+//                            p2
+//                        }
+//                    }
+//                }
+            }
+        } catch (e: Exception) {
+            e.printStackTrace()
+        }
+    } // Constructor
+
+    override fun boundingRect(): RectF {
+        return RectF(data.outLine!![0][0].x, data.outLine!![0][0].y, data.outLine!![0][1].x, data.outLine!![0][1].y)
+    }
+
+    /**
+     * Item绘制操作
+     *
+     * @param   canvas          画布
+     * @param   rect            绘制区域
+     */
+    override fun onDraw(canvas: Canvas) {
+//        canvas.translate(p.x, p.y);
+//        canvas.rotate(angle * 180f / Math.PI.toFloat())
+//
+//        canvas.drawLine(0f, 0f, d, 0f, paint1)
+        paint1.color = if (this.focus) {
+            Color.RED
+        } else {
+            Opt.doorColor
+        }
+        canvas.drawLine(data.outLine!![0][0].x, -data.outLine!![0][0].y, data.outLine!![0][1].x, -data.outLine!![0][1].y, paint1)
+//        canvas.drawArc(-d, -d, d, d, startAng, 90f, false, paint2)
+        super.onDraw(canvas)
+    } // Function onDraw()
+} // Class DoorItem

+ 109 - 0
adm-cad/src/main/java/com/ys/bdtp/cad/items/EquipItem.kt

@@ -0,0 +1,109 @@
+package com.ys.bdtp.cad.items
+
+
+import android.content.Context
+import android.graphics.*
+import android.util.Log
+import com.ys.bdtp.cad.types.Point
+import com.ys.bdtp.cad.R
+import com.ys.bdtp.graph.SGraphyItem
+import com.ys.bdtp.graph.SMotionEvent
+import com.ys.bdtp.graph.enums.SGraphyItemFlag
+import java.util.*
+
+
+/**
+ * Created by lihao.
+ * Date: 2021/6/4
+ */
+class EquipItem(
+    var context: Context,
+    val data: Point,
+    parent: SGraphyItem? = null,
+    defaultScale: Float? = null
+) :
+    SGraphyItem(parent) {
+    /** 新建 画笔 */
+    val mPaint_inner = Paint()
+    val mPaint_center = Paint()
+    var mDefaultScale = 0f
+    var mRedBitmap: Bitmap
+    var mPurpleBitmap: Bitmap
+    var mBlueBitmap: Bitmap
+    var mGreenBitmap: Bitmap
+    var myellowBitmap: Bitmap
+    var mRedBitmap2: Bitmap
+
+    init {
+        if (defaultScale != null) {
+            mDefaultScale = defaultScale
+        }
+        //1-蓝 2-绿 3-红 4-黄
+
+        mBlueBitmap = BitmapFactory.decodeResource(context.resources, R.drawable.equip_blue)
+
+
+        mGreenBitmap = BitmapFactory.decodeResource(context.resources, R.drawable.equip_green)
+
+        mRedBitmap = BitmapFactory.decodeResource(context.resources, R.drawable.equip_red)
+        mRedBitmap2 = BitmapFactory.decodeResource(context.resources, R.drawable.equip6)
+        mPurpleBitmap = BitmapFactory.decodeResource(context.resources, R.drawable.equip_notdone)
+        myellowBitmap = BitmapFactory.decodeResource(context.resources, R.drawable.yellow_equip)
+
+
+        /** 新建 */
+        //内圈
+        mPaint_inner.color = Color.parseColor("#66272727")
+        mPaint_inner.isAntiAlias = true
+        mPaint_inner.style = Paint.Style.FILL
+        //中圈
+        mPaint_center.color = Color.parseColor("#ff00ff")
+        mPaint_center.isAntiAlias = true
+        mPaint_center.style = Paint.Style.FILL
+        flags = EnumSet.of(
+            SGraphyItemFlag.ItemIsMovable,
+            SGraphyItemFlag.ItemIsSelectable,
+            SGraphyItemFlag.ItemIsFocusable
+        )
+    }
+
+    override fun onSingleTapUp(e: SMotionEvent): Boolean {
+        Log.e("TAG", "x=" + e.viewX.toString() + ",y=" + e.viewY.toString())
+        return super.onSingleTapUp(e)
+    }
+
+    /**
+     * Item绘制操作
+     *
+     * @param   canvas          画布
+     * @param   rect            绘制区域
+     */
+
+    override fun onDraw(canvas: Canvas) {
+        data.scalePoint = mDefaultScale / scene!!.view!!.scale
+        val matrix = Matrix()
+        matrix.postScale(3.0000007f, 3.0000007f)
+        matrix.postTranslate(data.mX - 400f, data.mY - 400f)
+        //1-蓝 2-绿 3-红
+        if (data.equipState == 1) {
+            canvas.drawBitmap(mBlueBitmap, matrix, mPaint_center)
+        } else if (data.equipState == 2) {
+            canvas.drawBitmap(mGreenBitmap, matrix, mPaint_center)
+        } else if (data.equipState == 3) {
+            canvas.drawBitmap(mRedBitmap, matrix, mPaint_center)
+        } else if (data.equipState == 4) {
+            canvas.drawBitmap(myellowBitmap, matrix, mPaint_center)
+        }  else if (data.equipState == 5) {
+            canvas.drawBitmap(mPurpleBitmap, matrix, mPaint_center)
+        }  else if (data.equipState == 6) {
+            canvas.drawBitmap(mRedBitmap2, matrix, mPaint_center)
+        } else {
+            canvas.drawBitmap(mBlueBitmap, matrix, mPaint_center)
+        }
+
+//        canvas.drawCircle(data.mX, data.mY, 500f, mPaint_center)
+//        canvas.drawCircle(data.mX, -data.mY, 1500f, mPaint_inner)
+        super.onDraw(canvas)
+    } // Function onDraw()
+
+}

+ 48 - 0
adm-cad/src/main/java/com/ys/bdtp/cad/items/GestureItem.kt

@@ -0,0 +1,48 @@
+package com.ys.bdtp.cad.items
+
+import android.graphics.*
+import android.view.MotionEvent
+import com.ys.bdtp.graph.SGraphyItem
+import java.util.*
+
+
+class GestureItem(parent: SGraphyItem? = null) : SGraphyItem(parent) {
+    /** 画笔 */
+    private val paint = Paint()
+    private val path = Path()
+
+    /**
+     * 构造
+     */
+    init {
+
+//        this.mContext = context;
+        paint.setAntiAlias(true)
+        paint.setStyle(Paint.Style.STROKE)
+        paint.setStrokeWidth(5f)
+        paint.setColor(Color.BLACK)
+    } // Constructor
+
+    override fun onActionMove(event: MotionEvent) {
+        super.onActionMove(event)
+
+    }
+
+    override fun onActionUp() {
+        super.onActionUp()
+    }
+
+
+
+    /**
+     * Item绘制操作
+     *
+     * @param   canvas          画布
+     * @param   rect            绘制区域
+     */
+    override fun onDraw(canvas: Canvas) {
+        // 通过画布绘制多点形成的图形
+        canvas.drawPath(path, paint)
+        super.onDraw(canvas)
+    } // Function onDraw()
+} // Class DoorItem

+ 145 - 0
adm-cad/src/main/java/com/ys/bdtp/cad/items/GridItem.kt

@@ -0,0 +1,145 @@
+package com.ys.bdtp.cad.items
+
+import android.annotation.SuppressLint
+import android.graphics.*
+import android.text.TextPaint
+import com.ys.bdtp.cad.Opt
+import com.ys.bdtp.cad.types.Grid
+import com.ys.bdtp.graph.SGraphyItem
+import com.ys.bdtp.graph.SGraphyView
+
+
+/**
+ * 墙item
+ *
+ * @author  郝建龙
+ */
+class GridItem(private val data: Grid, parent: SGraphyItem? = null, view: SGraphyView) : SGraphyItem(parent) {
+    /** 画笔 */
+    private val paint = Paint()
+
+    /** 画笔 */
+    private val paintText = TextPaint()
+
+    /** 墙轮廓 */
+    private val pathList = ArrayList<Path>()
+
+    /** X坐标最小值  */
+    private var minX = 0f
+
+    /** X坐标最大值  */
+    private var maxX = 0f
+
+    /** Y坐标最小值  */
+    private var minY = 0f
+
+    /** Y坐标最大值  */
+    private var maxY = 0f
+    lateinit var view: SGraphyView
+
+    /**
+     * 构造
+     */
+    init {
+        try {
+            this.view = view
+            val path = Path()
+            path.moveTo(data.location!!.points!![0].x, -data.location!!.points!![0].y)
+            path.lineTo(data.location!!.points!![1].x, -data.location!!.points!![1].y)
+            pathList.add(path)
+
+            paintText.style = Paint.Style.FILL
+            paintText.flags = Paint.ANTI_ALIAS_FLAG
+            paintText.color = Opt.textColor
+            paintText.textSize = 1500f
+            val font: Typeface = Typeface.create(Typeface.SANS_SERIF, Typeface.BOLD)
+            paintText.setTypeface(font)
+
+//            if (data.outLine != null && data.outLine!!.size > 0 && data.outLine!![0].size > 0) {
+//                minX = data.outLine!![0][0].x
+//                maxX = data.outLine!![0][0].x
+//                minY = data.outLine!![0][0].y
+//                maxY = data.outLine!![0][0].y
+//
+//                for (line in data.outLine!!) {
+//                    if (line.size < 1) {
+//                        continue
+//                    }
+//
+//                    val path = Path()
+//                    path.moveTo(line[0].x, -line[0].y)
+//                    for (p in line) {
+//                        if (p.x < minX) {
+//                            minX = p.x
+//                        }
+//                        if (p.x > maxX) {
+//                            maxX = p.x
+//                        }
+//                        if (-p.y < minY) {
+//                            minY = -p.y
+//                        }
+//                        if (-p.y > maxY) {
+//                            maxY = -p.y
+//                        }
+//                        path.lineTo(p.x, -p.y)
+//                    }
+//                    path.close()
+//                    pathList.add(path)
+//                }
+//            }
+        } catch (e: Exception) {
+            e.printStackTrace()
+        }
+    } // Constructor
+
+    /**
+     * Item对象边界区域
+     *
+     * @return  边界区域
+     */
+    override fun boundingRect(): RectF {
+        return RectF(minX, minY, maxX, maxY)
+    } // Function boundingRect()
+
+    /**
+     * Item绘制操作
+     *
+     * @param   canvas          画布
+     * @param   rect            绘制区域
+     */
+    @SuppressLint("DrawAllocation")
+    override fun onDraw(canvas: Canvas) {
+        paint.color = Opt.engineRoomSpaceColor
+        paint.style = Paint.Style.STROKE
+        paint.strokeJoin = Paint.Join.ROUND
+        paint.isAntiAlias = true
+        paint.pathEffect = DashPathEffect(floatArrayOf(800f, 600f), 0f)
+        for (path in pathList) {
+            canvas.drawPath(path, paint)
+        }
+
+
+        var k = (data.location!!.points!![0].y - data.location!!.points!![1].y) / (data.location!!.points!![0].x - data.location!!.points!![1].x)
+        if (data.location!!.points!![0].x - data.location!!.points!![1].x == 0f) {
+            k = 1f
+        }
+        val b = data.location!!.points!![0].y - k * data.location!!.points!![0].x
+        val mapFromScene = view.mapToScene(0f, 0f)
+        var y = 0f
+        var x = 0f
+        if (k >= 1 || k <= -1) {
+            y = mapFromScene.y + 2000
+            if (mapFromScene.y < -data.location!!.points!![0].y) {
+                y = -data.location!!.points!![0].y
+            }
+            x = data.location!!.points!![0].x
+        } else {
+            x = mapFromScene.x
+            if (mapFromScene.x < data.location!!.points!![0].x) {
+                x = data.location!!.points!![0].x
+            }
+            y = -(k * mapFromScene.x + b)
+        }
+        canvas.drawText(data.name!!, x, y, paintText)
+    } // Function onDraw()
+} // Class WallItem

Разница между файлами не показана из-за своего большого размера
+ 64 - 0
adm-cad/src/main/java/com/ys/bdtp/cad/items/MarkItem.kt


+ 97 - 0
adm-cad/src/main/java/com/ys/bdtp/cad/items/PipeLineItem.kt

@@ -0,0 +1,97 @@
+package com.ys.bdtp.cad.items
+
+import android.graphics.*
+import com.ys.bdtp.cad.types.PipeLine
+import com.ys.bdtp.graph.SGraphyItem
+import java.util.*
+
+/**
+ * Created by lihao.
+ * Date: 2021/6/7
+ */
+class PipeLineItem(val data: PipeLine, parent: SGraphyItem? = null) : SGraphyItem(parent) {
+    /** 画笔 */
+    val paint = Paint()
+    val mPaint_inner = Paint()
+
+    /** 管道轮廓 */
+    private var pipePath: Path? = null
+
+    /** 管道轮廓线坐标list  */
+    private val pointArr = ArrayList<ArrayList<PointF>>()
+
+    val outPaint = Paint()
+
+    var mPoints = ArrayList<PointF>()
+
+    /** X坐标最小值  */
+    private var minX = 0f
+
+    /** X坐标最大值  */
+    private var maxX = 0f
+
+    /** Y坐标最小值  */
+    private var minY = 0f
+
+    /** Y坐标最大值  */
+    private var maxY = 0f
+
+    init {
+        try {
+            zOrder = 1f
+
+            minX = data.points!![0].x
+            maxX = data.points!![0].x
+            minY = data.points!![0].y
+            maxY = data.points!![0].y
+            val path = Path()
+            path.moveTo(data.points!![0].x, -data.points!![0].y)
+            for (line in data.points!!) {
+
+                path.lineTo(line.x, -line.y)
+
+                if (pipePath == null) {
+                    pipePath = path;
+                } else {
+                    // spacePath.b
+                }
+            }
+
+        } catch (e: Exception) {
+            e.printStackTrace()
+        }
+        outPaint.style = Paint.Style.STROKE
+        outPaint.strokeJoin = Paint.Join.ROUND
+        outPaint.isAntiAlias = true
+        outPaint.color = Color.rgb(0x66, 0x66, 0xff)
+        outPaint.strokeWidth = 150f
+
+        //内圈
+        mPaint_inner.color = Color.parseColor("#0c90eb")
+        mPaint_inner.isAntiAlias = true
+        mPaint_inner.style = Paint.Style.FILL
+    } // Constructor
+
+
+    /**
+     * Item绘制操作
+     *
+     * @param   canvas          画布
+     * @param   rect            绘制区域
+     */
+    override fun onDraw(canvas: Canvas) {
+        if (null != pipePath) {
+//            paint.style = Paint.Style.FILL
+
+//            canvas.drawPath(pipePath!!, paint)
+
+
+            canvas.drawPath(pipePath!!, outPaint)
+            val size = data.points!!.size - 1
+            val get = data.points!!.get(size)
+            val get1 = data.points!!.get(0)
+            canvas.drawCircle(get1.x, -get1.y, 60f, mPaint_inner)
+            canvas.drawCircle(get.x, -get.y, 60f, mPaint_inner)
+        }
+    } // Function onDraw()
+}

+ 87 - 0
adm-cad/src/main/java/com/ys/bdtp/cad/items/PipeNodeItem.kt

@@ -0,0 +1,87 @@
+package com.ys.bdtp.cad.items
+
+import android.graphics.*
+import com.ys.bdtp.graph.SGraphyItem
+import com.ys.bdtp.graph.SMotionEvent
+import java.util.*
+
+/**
+ * Created by lihao.
+ * Date: 2021/6/7
+ */
+class PipeNodeItem(val data: PointF, parent: SGraphyItem? = null) : SGraphyItem(parent) {
+    /** 画笔 */
+    val paint = Paint()
+    val mPaint_inner = Paint()
+
+    val outPaint = Paint()
+
+    var x: Float = 0f
+    var y: Float = 0f
+    lateinit var onScroll: OnScroll
+
+    init {
+        try {
+//            flags = EnumSet.of(SGraphyItemFlag.ItemIsMovable, SGraphyItemFlag.ItemIsSelectable, SGraphyItemFlag.ItemIsFocusable)
+
+        } catch (e: Exception) {
+            e.printStackTrace()
+        }
+        outPaint.style = Paint.Style.STROKE
+        outPaint.strokeJoin = Paint.Join.ROUND
+        outPaint.isAntiAlias = true
+        outPaint.color = Color.rgb(0x66, 0x66, 0xff)
+        outPaint.strokeWidth = 150f
+        x = data.x
+        y = data.y
+
+        //内圈
+        mPaint_inner.color = Color.RED
+        mPaint_inner.isAntiAlias = true
+        mPaint_inner.style = Paint.Style.FILL
+    } // Constructor
+
+    override fun boundingRect(): RectF {
+        return RectF(data.x - 800f, -data.y - 800f, data.x + 800f, -data.y + 800f)
+    }
+
+    override fun onScroll(e1: SMotionEvent, e2: SMotionEvent, distanceX: Float, distanceY: Float): Boolean {
+        val fx = pos.x - distanceX * scale.x
+        val fy = pos.y - distanceY * scale.y
+        x = data.x + fx
+        y = data.y - fy
+        moveTo(pos.x - distanceX * scale.x, pos.y - distanceY * scale.y)
+        onScroll.onScroll(data.x + fx, data.y + fy)
+        return true
+
+
+//        moveTo(pos.x - distanceX * scale.x, pos.y - distanceY * scale.y)
+
+//        onScroll.onScroll(data.x + pos.x - distanceX * scale.x, data.y - pos.y - distanceY * scale.y)
+//        onScroll.onScroll(data.x, data.y)
+
+
+
+//        return super.onScroll(e1, e2, distanceX, distanceY)
+    }
+
+    interface OnScroll {
+        fun onScroll(x: Float, y: Float)
+    }
+
+    fun setOnScrollListener(onScroll: OnScroll) {
+        this.onScroll = onScroll
+    }
+
+
+    /**
+     * Item绘制操作
+     *
+     * @param   canvas          画布
+     * @param   rect            绘制区域
+     */
+    override fun onDraw(canvas: Canvas) {
+        canvas.drawCircle(data.x, -data.y, 120f, mPaint_inner)
+    } // Function onDraw()
+
+}

+ 194 - 0
adm-cad/src/main/java/com/ys/bdtp/cad/items/PointItem.kt

@@ -0,0 +1,194 @@
+package com.ys.bdtp.cad.items
+
+
+import android.graphics.*
+import android.util.Log
+import android.view.MotionEvent
+import com.ys.bdtp.cad.types.Point
+import com.ys.bdtp.graph.SGraphyItem
+import com.ys.bdtp.graph.SMotionEvent
+import com.ys.bdtp.graph.enums.SGraphyItemFlag
+import java.util.*
+
+/**
+ * Created by lihao.
+ * Date: 2021/6/4
+ */
+class PointItem(val data: Point, parent: SGraphyItem? = null, defaultScale: Float? = null) :
+    SGraphyItem(parent) {
+    private lateinit var actionMove: ActionMove
+
+    /** 新建 画笔 */
+    val mPaint_inner = Paint()
+    val mPaint_center = Paint()
+    val mPaint_outer = Paint()
+
+    /** 按时 画笔 */
+    val not_overTime_inner = Paint()
+    val not_overTime_outer = Paint()
+
+    /** 逾期 画笔 */
+    val overTime_inner = Paint()
+    val overTime_outer = Paint()
+
+    /** 承接查验复核中 */
+    val checkReviewing_inner = Paint()
+    val checkReviewing_outer = Paint()
+    var mDefaultScale = 0f
+
+    //var defaultScale = 1.0f
+    //var mScale = 1f
+    val outPaint = Paint()
+
+    /** 管道轮廓 */
+    private var pipePath: Path? = null
+
+    /** X坐标最小值  */
+    private var minX = 0f
+
+    /** X坐标最大值  */
+    private var maxX = 0f
+
+    /** Y坐标最小值  */
+    private var minY = 0f
+
+    /** Y坐标最大值  */
+    private var maxY = 0f
+
+    init {
+        if (data.points.size != 1 && data.points.size != 0) {
+            flags = EnumSet.of(
+                SGraphyItemFlag.ItemIsMovable,
+                SGraphyItemFlag.ItemIsSelectable,
+                SGraphyItemFlag.ItemIsFocusable
+            )
+        }
+        if (defaultScale != null) {
+            mDefaultScale = defaultScale
+        }
+        /** 按时 */
+        /** 按时 */
+        not_overTime_inner.color = Color.parseColor("#ffffff")
+        not_overTime_inner.isAntiAlias = true
+        not_overTime_inner.style = Paint.Style.FILL
+
+        not_overTime_outer.color = Color.parseColor("#04df97")//绿色
+        not_overTime_outer.isAntiAlias = true
+        not_overTime_outer.style = Paint.Style.FILL
+
+        /** 逾期 */
+
+        /** 逾期 */
+        overTime_inner.color = Color.parseColor("#ffffff")
+        overTime_inner.isAntiAlias = true
+        overTime_inner.style = Paint.Style.FILL
+
+        overTime_outer.color = Color.parseColor("#ff3b33")//红色
+        overTime_outer.isAntiAlias = true
+        overTime_outer.style = Paint.Style.FILL
+
+        /** 承接查验复核中 */
+
+        /** 承接查验复核中 */
+        checkReviewing_inner.color = Color.parseColor("#ffffff")
+        checkReviewing_inner.isAntiAlias = true
+        checkReviewing_inner.style = Paint.Style.FILL
+
+        checkReviewing_outer.color = Color.parseColor("#F7B500")//黄色
+        checkReviewing_outer.isAntiAlias = true
+        checkReviewing_outer.style = Paint.Style.FILL
+
+        /** 新建 */
+
+        /** 新建 */
+        //中圈
+        mPaint_center.color = Color.parseColor("#ffffff")
+        mPaint_center.isAntiAlias = true
+        mPaint_center.style = Paint.Style.FILL
+        //内圈
+        mPaint_inner.color = Color.parseColor("#0c90eb")
+        mPaint_inner.isAntiAlias = true
+        mPaint_inner.style = Paint.Style.FILL
+        //外圈
+        mPaint_outer.color = Color.parseColor("#0CC2EB")
+        mPaint_outer.isAntiAlias = true
+        mPaint_outer.style = Paint.Style.FILL
+
+
+        outPaint.style = Paint.Style.STROKE
+        outPaint.strokeJoin = Paint.Join.ROUND
+        outPaint.isAntiAlias = true
+        outPaint.color = Color.rgb(0x66, 0x66, 0xff)
+        outPaint.strokeWidth = 150f
+
+        try {
+            zOrder = 1f
+
+            minX = data.points!![0].x
+            maxX = data.points!![0].x
+            minY = data.points!![0].y
+            maxY = data.points!![0].y
+            val path = Path()
+            path.moveTo(data.points!![0].x, -data.points!![0].y)
+            for (line in data.points!!) {
+
+                path.lineTo(line.x, -line.y)
+
+                if (pipePath == null) {
+                    pipePath = path;
+                } else {
+                    // spacePath.b
+                }
+            }
+
+        } catch (e: Exception) {
+            e.printStackTrace()
+        }
+    }
+
+    override fun boundingRect(): RectF {
+        return RectF(data.mX - 500f, data.mY - 500f, data.mX + 500f, data.mY + 500f)
+    }
+
+    override fun onSingleTapUp(e: SMotionEvent): Boolean {
+        Log.e("TAG", "x=" + e.viewX.toString() + ",y=" + e.viewY.toString())
+        return super.onSingleTapUp(e)
+    }
+
+    /**
+     * Item绘制操作
+     *
+     * @param   canvas          画布
+     * @param   rect            绘制区域
+     */
+    override fun onDraw(canvas: Canvas) {
+        data.scalePoint = mDefaultScale / scene!!.view!!.scale
+        if (data.points.size == 1 || data.points.size == 0) {
+            canvas.drawCircle(data.mX, data.mY, 500f, mPaint_outer)
+            canvas.drawCircle(data.mX, data.mY, 200f, mPaint_center)
+            canvas.drawCircle(data.mX, data.mY, 100f, mPaint_inner)
+        } else {
+            canvas.drawPath(pipePath!!, outPaint)
+            val size = data.points!!.size - 1
+            val get = data.points!!.get(size)
+            val get1 = data.points!!.get(0)
+            canvas.drawCircle(get1.x, -get1.y, 60f, mPaint_inner)
+            canvas.drawCircle(get.x, -get.y, 60f, mPaint_inner)
+        }
+
+        super.onDraw(canvas)
+    } // Function onDraw()
+
+    override fun onActionMove(event: MotionEvent) {
+        super.onActionMove(event)
+    }
+
+    interface ActionMove {
+        fun onActionMove(event: MotionEvent)
+    }
+
+    fun setOnActionMove(actionMove: ActionMove) {
+        this.actionMove = actionMove
+    }
+
+}

+ 121 - 0
adm-cad/src/main/java/com/ys/bdtp/cad/items/QrcodeItem.kt

@@ -0,0 +1,121 @@
+package com.ys.bdtp.cad.items
+
+
+import android.content.Context
+import android.graphics.*
+import com.ys.bdtp.cad.types.Point
+import com.ys.bdtp.cad.R
+import com.ys.bdtp.graph.SGraphyItem
+import java.util.*
+
+/**
+ * Created by lihao.
+ * Date: 2021/6/4
+ */
+class QrcodeItem(
+    var context: Context,
+    val data: Point,
+    parent: SGraphyItem? = null,
+    defaultScale: Float? = null
+) :
+    SGraphyItem(parent) {
+    /** 新建 画笔 */
+    val mPaint_inner = Paint()
+    val mPaint_center = Paint()
+    val mPaint_outer = Paint()
+
+    /** 按时 画笔 */
+    val not_overTime_inner = Paint()
+    val not_overTime_outer = Paint()
+
+    /** 逾期 画笔 */
+    val overTime_inner = Paint()
+    val overTime_outer = Paint()
+
+    /** 承接查验复核中 */
+    val checkReviewing_inner = Paint()
+    val checkReviewing_outer = Paint()
+    var mDefaultScale = 0f
+
+    //var defaultScale = 1.0f
+    //var mScale = 1f
+    var mBitmap: Bitmap
+
+    init {
+        if (defaultScale != null) {
+            mDefaultScale = defaultScale
+        }
+//        flags = EnumSet.of(
+//            SGraphyItemFlag.ItemIsMovable,
+//            SGraphyItemFlag.ItemIsSelectable,
+//            SGraphyItemFlag.ItemIsFocusable
+//        )
+        /** 按时 */
+        not_overTime_inner.color = Color.parseColor("#ffffff")
+        not_overTime_inner.isAntiAlias = true
+        not_overTime_inner.style = Paint.Style.FILL
+
+        not_overTime_outer.color = Color.parseColor("#04df97")//绿色
+        not_overTime_outer.isAntiAlias = true
+        not_overTime_outer.style = Paint.Style.FILL
+
+        /** 逾期 */
+        overTime_inner.color = Color.parseColor("#ffffff")
+        overTime_inner.isAntiAlias = true
+        overTime_inner.style = Paint.Style.FILL
+
+        overTime_outer.color = Color.parseColor("#ff3b33")//红色
+        overTime_outer.isAntiAlias = true
+        overTime_outer.style = Paint.Style.FILL
+
+        /** 承接查验复核中 */
+        checkReviewing_inner.color = Color.parseColor("#ffffff")
+        checkReviewing_inner.isAntiAlias = true
+        checkReviewing_inner.style = Paint.Style.FILL
+
+        checkReviewing_outer.color = Color.parseColor("#F7B500")//黄色
+        checkReviewing_outer.isAntiAlias = true
+        checkReviewing_outer.style = Paint.Style.FILL
+
+        /** 新建 */
+        //内圈
+        mPaint_inner.color = Color.parseColor("#5E59E1")
+        mPaint_inner.isAntiAlias = true
+        mPaint_inner.style = Paint.Style.FILL
+        //中圈
+        mPaint_center.color = Color.parseColor("#ffffff")
+        mPaint_center.isAntiAlias = true
+        mPaint_center.style = Paint.Style.FILL
+        //外圈
+        mPaint_outer.color = Color.parseColor("#260c90eb")
+        mPaint_outer.isAntiAlias = true
+        mPaint_outer.style = Paint.Style.FILL
+        mBitmap = BitmapFactory.decodeResource(context.resources, R.drawable.qrcode)
+    }
+
+    override fun boundingRect(): RectF {
+        return RectF(data.mX - 250f, data.mY - 250f, data.mX + 250f, data.mY + 250f)
+    }
+
+    /**
+     * Item绘制操作
+     *
+     * @param   canvas          画布
+     * @param   rect            绘制区域
+     */
+    override fun onDraw(canvas: Canvas) {
+//        data.scalePoint = mDefaultScale / scene!!.view!!.scale
+//        mPaint_inner.color = if (this.isSelected) {
+//            Color.RED
+//        } else {
+//            Color.BLUE
+//        }
+//        canvas.drawCircle(data.mX, data.mY, 500f, mPaint_inner)
+        val matrix = Matrix()
+        matrix.postScale(4.0000007f, 4.0000007f)
+        matrix.postTranslate(data.mX - 400f, data.mY - 400f)
+        canvas.drawBitmap(mBitmap, matrix, mPaint_center)
+        super.onDraw(canvas)
+    } // Function onDraw()
+
+}

+ 62 - 0
adm-cad/src/main/java/com/ys/bdtp/cad/items/ServeAreaItem.kt

@@ -0,0 +1,62 @@
+package com.ys.bdtp.cad.items
+
+import android.graphics.*
+import com.ys.bdtp.graph.SGraphyItem
+import java.util.*
+
+/**
+ * Created by lihao.
+ * Date: 2021/6/7
+ * 服务区域图形
+ */
+class ServeAreaItem(datas: ArrayList<PointF>, parent: SGraphyItem? = null) :
+    SGraphyItem(parent) {
+    /** 画笔 */
+    val paint = Paint()
+    val innerPaint = Paint()
+    val path = Path()
+
+    init {
+        try {
+//            flags = EnumSet.of(SGraphyItemFlag.ItemIsMovable, SGraphyItemFlag.ItemIsSelectable, SGraphyItemFlag.ItemIsFocusable)
+
+        } catch (e: Exception) {
+            e.printStackTrace()
+        }
+        paint.style = Paint.Style.STROKE
+        paint.strokeJoin = Paint.Join.ROUND
+        paint.isAntiAlias = true
+        paint.color = Color.rgb(0x66, 0x66, 0xff)
+        paint.strokeWidth = 150f
+
+        innerPaint.color = Color.parseColor("#33ffb6c1")
+        innerPaint.isAntiAlias = true
+        innerPaint.style = Paint.Style.FILL
+
+        val data1 = datas[0]
+        val data2 = datas[1]
+        path.moveTo(data1.x, -data1.y)
+        path.lineTo(data1.x, -data2.y)
+        path.lineTo(data2.x, -data2.y)
+        path.lineTo(data2.x, -data1.y)
+        path.close()
+    } // Constructor
+
+    override fun boundingRect(): RectF {
+//        return RectF(data.x - 200f, -data.y - 200f, data.x + 200f, -data.y + 200f)
+        return RectF()
+    }
+
+
+    /**
+     * Item绘制操作
+     *
+     * @param   canvas          画布
+     * @param   rect            绘制区域
+     */
+    override fun onDraw(canvas: Canvas) {
+        canvas.drawPath(path, paint)
+        canvas.drawPath(path, innerPaint)
+    } // Function onDraw()
+
+}

+ 113 - 0
adm-cad/src/main/java/com/ys/bdtp/cad/items/SpaceItem.kt

@@ -0,0 +1,113 @@
+package com.ys.bdtp.cad.items
+
+import android.graphics.*
+import com.ys.bdtp.cad.Opt
+import com.ys.bdtp.cad.types.Space
+import com.ys.bdtp.graph.SGraphyItem
+
+/**
+ * 空间item
+ *
+ * @author 付国宝
+ */
+class SpaceItem(val data: Space, parent: SGraphyItem? = null) : SGraphyItem(parent) {
+    /** 画笔 */
+    val paint = Paint()
+
+    /** 墙轮廓 */
+    private var spacePath: Path? = null
+
+    /** 空间轮廓线坐标list  */
+    private val pointArr = ArrayList<ArrayList<PointF>>()
+
+    /** X坐标最小值  */
+    private var minX = 0f
+
+    /** X坐标最大值  */
+    private var maxX = 0f
+
+    /** Y坐标最小值  */
+    private var minY = 0f
+
+    /** Y坐标最大值  */
+    private var maxY = 0f
+    val outPaint = Paint()
+    var mPoints = ArrayList<PointF>()
+
+    init {
+        try {
+            zOrder = 1f
+            if (data.outLine != null && data.outLine!!.size > 0 && data.outLine!![0].size > 0) {
+                minX = data.outLine!![0][0].x
+                maxX = data.outLine!![0][0].x
+                minY = data.outLine!![0][0].y
+                maxY = data.outLine!![0][0].y
+
+                for (line in data.outLine!!) {
+                    if (line.size < 1) {
+                        mPoints.add(PointF(data.outLine!![0][0].x, data.outLine!![0][0].y))
+                        continue
+                    }
+
+                    val path = Path()
+                    path.moveTo(line[0].x, -line[0].y)
+                    for (p in line) {
+                        if (p.x < minX) {
+                            minX = p.x
+                        }
+                        if (p.x > maxX) {
+                            maxX = p.x
+                        }
+                        if (-p.y < minY) {
+                            minY = -p.y
+                        }
+                        if (-p.y > maxY) {
+                            maxY = -p.y
+                        }
+                        mPoints.add(PointF(p.x, p.y))
+                        path.lineTo(p.x, -p.y)
+                    }
+                    path.close()
+                    if (spacePath == null) {
+                        spacePath = path;
+                    } else {
+                        // spacePath.b
+                    }
+                }
+            }
+        } catch (e: Exception) {
+            e.printStackTrace()
+        }
+
+        outPaint.style = Paint.Style.STROKE
+        outPaint.color = Color.rgb(0xff, 0xff, 0xff)
+        outPaint.strokeWidth = 20f
+    } // Constructor
+
+    /**
+     * Item对象边界区域
+     *
+     * @return SRect
+     */
+    override fun boundingRect(): RectF {
+        return RectF(minX, minY, maxX, maxY)
+    } // Function boundingRect()
+
+    /**
+     * Item绘制操作
+     *
+     * @param   canvas          画布
+     * @param   rect            绘制区域
+     */
+    override fun onDraw(canvas: Canvas) {
+        if (null != spacePath) {
+            paint.style = Paint.Style.FILL
+            paint.color = Opt.spaceColor
+            canvas.drawPath(spacePath!!, paint)
+
+
+//            canvas.drawPath(spacePath!!, outPaint)
+        }
+    } // Function onDraw()
+
+} // Class SpaceItem

+ 137 - 0
adm-cad/src/main/java/com/ys/bdtp/cad/items/SpaceNameItem.kt

@@ -0,0 +1,137 @@
+package com.ys.bdtp.cad.items
+
+import android.graphics.Canvas
+import android.graphics.RectF
+import android.text.TextPaint
+import com.ys.bdtp.cad.types.Space
+import com.ys.bdtp.graph.SGraphyItem
+
+
+/**
+ * 空间名称item
+ *
+ * @author 付国宝re
+ */
+class SpaceNameItem(val data: Space, parent: SGraphyItem? = null) : SGraphyItem(parent) {
+    /** 画笔 */
+    private val paintText = TextPaint()
+
+    /** X坐标最小值  */
+    private var minX = 0f
+
+    /** X坐标最大值  */
+    private var maxX = 0f
+
+    /** Y坐标最小值  */
+    private var minY = 0f
+
+    /** Y坐标最大值  */
+    private var maxY = 0f
+    private var textX = 0f
+    private var textY = 0f
+
+
+//    init {
+//        try {
+//            zOrder = 1f
+//            if (data.outLine != null && data.outLine!!.size > 0 && data.outLine!![0].size > 0) {
+//                minX = 9999999f
+//                maxX = -9999999f
+//                minY = 9999999f
+//                maxY = -9999999f
+//
+//                for (line in data.outLine!!) {
+//                    if (line.size < 1) {
+//                        continue
+//                    }
+//                    for (p in line) {
+//                        if (p.x < minX) {
+//                            minX = p.x
+//                        }
+//                        if (p.x > maxX) {
+//                            maxX = p.x
+//                        }
+//                        if (-p.y < minY) {
+//                            minY = -p.y
+//                        }
+//                        if (-p.y > maxY) {
+//                            maxY = -p.y
+//                        }
+//                    }
+//                }
+//            }
+//        } catch (e: Exception) {
+//            e.printStackTrace()
+//        }
+//        paintText.style = Paint.Style.FILL
+//        paintText.flags = Paint.ANTI_ALIAS_FLAG
+//        paintText.color = Opt.textColor
+//        paintText.textSize = 700f
+//        val font: Typeface = Typeface.create(Typeface.SANS_SERIF, Typeface.BOLD)
+//        paintText.setTypeface(font)
+////        paintText.textSkewX - 0.5f
+//
+////        textX = (minX + ((maxX - minX) / 2)) /*- 250*/
+////        textY = (minY + ((maxY - minY) / 2)) - paintText.measureText(data.name!!) / 2
+////
+////        if (data.name!!.contains("走廊2")) {
+////            textX -= 400f
+////        } else if (data.name!!.contains("走廊1")) {
+////            textY -= 5000f
+////        } else if (data.name!!.contains("财务室旁开间办公区")) {
+////            textY -= 2000f
+////        }
+//        textX = (minX + ((maxX - minX) / 2)) - paintText.measureText(data.name!!) / 2 /*- 250*/
+//        textY = (minY + ((maxY - minY) / 2)) + 125f
+//    } // Constructor
+
+
+    /**
+     * Item对象边界区域
+     *
+     * @return SRect
+     */
+    override fun boundingRect(): RectF {
+        return RectF(minX, minY, maxX, maxY)
+    } // Function boundingRect()
+
+    /**
+     * 判断点是否在区域内
+     *
+     * @param x
+     * @param y
+     */
+    override fun contains(x: Float, y: Float): Boolean {
+        return false
+    } // Function contains()
+
+    /**
+     * Item绘制操作
+     *
+     * @param   canvas          画布
+     * @param   rect            绘制区域
+     */
+    override fun onDraw(canvas: Canvas) {
+        canvas.save()
+        canvas.rotate(-30f, textX, textY)
+//        if (data.name!!.equals("张联庆旁办公室")) {
+//            val layout = StaticLayout(data.name!!, paintText, 3500, Layout.Alignment.ALIGN_CENTER, 1.0f, 0.0f, true)
+//            canvas.translate(textY + 1000, -textX - 1000)
+//            layout.draw(canvas)
+//        } else if (data.name!!.equals("会议室11") || data.name!!.equals("会议室12")) {
+//            val layout = StaticLayout(data.name!!, paintText, 2300, Layout.Alignment.ALIGN_CENTER, 1.0f, 0.0f, true)
+//            canvas.translate(textY + 500, -textX - 1000)
+//            layout.draw(canvas)
+//        } else {
+//            canvas.drawText(data.name!!, textY, -textX, paintText)
+//        }
+//        canvas.rotate(-90f)
+//        canvas.restore()
+        var x = textX
+        var y = textY * 0.95
+
+        canvas.rotate(30f)
+        canvas.restore()
+        super.onDraw(canvas)
+    } // Function onDraw()
+} // Class SpaceItem

+ 79 - 0
adm-cad/src/main/java/com/ys/bdtp/cad/items/SpatialCenterItem.kt

@@ -0,0 +1,79 @@
+package com.ys.bdtp.cad.items
+
+import android.graphics.*
+import com.ys.bdtp.graph.SGraphyItem
+import com.ys.bdtp.graph.SMotionEvent
+
+
+/**
+ *   空间中心点
+ * @author  Andy
+ */
+class SpatialCenterItem(name :String,parent: SGraphyItem? = null) : SGraphyItem(parent) {
+        // 画笔
+    private var pen = Paint()
+    private var pain = Paint()
+    private var panText = Paint()
+    private var panT = Paint()
+     var flag:Boolean = false
+    private var codename:String
+
+    /**
+     * 默认构造函数
+     */
+    init {
+        this.hide()
+        pen.color = Color.BLACK
+        pen.strokeWidth = 5f
+        pen.isAntiAlias = true
+        pen.style = Paint.Style.FILL
+
+        pain.color = Color.BLUE
+        pain.strokeWidth = 5f
+        pain.isAntiAlias = false
+
+        panText.color = Color.BLACK
+        panText.strokeWidth = 5f
+        panText.isAntiAlias = true
+        panText.textSize=800f
+
+        panT.color = Color.BLUE
+        panT.strokeWidth = 5f
+        panT.isAntiAlias = false
+        panT.textSize=40f
+        this.codename=name
+        /** item获取焦点ItemIsFocusable,移动ItemIsMovable */
+//        flags= EnumSet.of(SGraphyItemFlag.ItemIsFocusable)
+//        flags = EnumSet.of(SGraphyItemFlag.ItemIsMovable)
+    } // init
+
+
+    /**
+     * Item对象边界区域
+     */
+    override fun boundingRect(): RectF {
+        return RectF(-10f, -10f,
+                50f, 50f)
+    } // Function boundingRect()
+
+    /**
+     * @param   canvas      画布对象
+     */
+    override fun onDraw(canvas: Canvas) {
+        canvas.drawText(codename.trim(),-10f,0f,panText)
+        return
+    } // Function paint()
+
+    /**
+     *  点击
+     */
+    override fun onSingleTapUp(e: SMotionEvent): Boolean {
+        return false
+    }
+
+    override fun onScroll(e1: SMotionEvent, e2: SMotionEvent, distanceX: Float, distanceY: Float): Boolean {
+        flag=false
+        return super.onScroll(e1, e2, distanceX, distanceY)
+    }
+
+} // Class GraphyWallItem

+ 226 - 0
adm-cad/src/main/java/com/ys/bdtp/cad/items/TunableSpaceItem.kt

@@ -0,0 +1,226 @@
+package com.ys.bdtp.cad.items
+
+import android.graphics.*
+import android.text.TextPaint
+import com.ys.bdtp.cad.Opt
+import com.ys.bdtp.cad.types.TunableSpace
+import com.ys.bdtp.graph.SGraphyItem
+
+
+/**
+ * 可调节item
+ *
+ */
+class TunableSpaceItem(val data: TunableSpace, parent: SGraphyItem? = null) : SGraphyItem(parent) {
+    /** 画笔 */
+    val paint = Paint()
+    val centerPaint = Paint()
+    val outPaint = Paint()
+    private val paintText = TextPaint()
+
+    /** 墙轮廓 */
+    private var spacePathList: ArrayList<Path> = ArrayList()
+    /** 空间轮廓线坐标list  */
+    //private val pointArr = ArrayList<ArrayList<PointF>>()
+    /** X坐标最小值  */
+    public var minX = 0f
+
+    /** X坐标最大值  */
+    public var maxX = 0f
+
+    /** Y坐标最小值  */
+    public var minY = 0f
+
+    /** Y坐标最大值  */
+    public var maxY = 0f
+
+    var mPoints = ArrayList<PointF>()
+
+    init {
+        try {
+            zOrder = 1f
+            if (data.outLine != null && data.outLine!!.size > 0) {
+                for (outLineList in data.outLine!!){
+                    minX = 9999999f
+                    maxX = -9999999f
+                    minY = 9999999f
+                    maxY = -9999999f
+
+                    for (line in outLineList) {
+                        if (line.size < 1) {
+                            mPoints.add(PointF(line[0].x, line[0].y))
+                            continue
+                        }
+                        var path = Path()
+                        path.moveTo(line[0].x, -line[0].y)
+                        for (p in line) {
+                            if (p.x < minX) {
+                                minX = p.x
+                            }
+                            if (p.x > maxX) {
+                                maxX = p.x
+                            }
+                            if (-p.y < minY) {
+                                minY = -p.y
+                            }
+                            if (-p.y > maxY) {
+                                maxY = -p.y
+                            }
+                            mPoints.add(PointF(p.x, p.y))
+                            path.lineTo(p.x, -p.y)
+                        }
+                        path.close()
+                        spacePathList.add(path)
+                    }
+                }
+
+            }
+        } catch (e: Exception) {
+            e.printStackTrace()
+        }
+
+        paintText.style = Paint.Style.FILL
+        paintText.flags = Paint.ANTI_ALIAS_FLAG
+        paintText.color = Opt.textColor
+        paintText.textSize = 800f
+
+        paint.style = Paint.Style.FILL
+        paint.flags = Paint.ANTI_ALIAS_FLAG
+        paint.isAntiAlias = true
+        paint.color = Color.parseColor("#007CDB")
+        //paint.color = Opt.spaceColor
+
+        outPaint.style = Paint.Style.STROKE
+        outPaint.color = Color.parseColor("#7E96FF")
+        outPaint.setAntiAlias(true)
+        outPaint.strokeWidth = 50f
+
+        centerPaint.style = Paint.Style.STROKE
+        centerPaint.color = Color.parseColor("#7E96FF")
+        centerPaint.setAntiAlias(true)
+        centerPaint.strokeWidth = 200f
+
+    } // Constructor
+
+    /**
+     * 计算任意多边形的面积
+     * @param latLngLines 经纬度坐标点
+     * @return
+     */
+    fun calculateArea(): Float {
+        val pointFList: MutableList<DoubleArray> = ArrayList()
+        for (i in mPoints.indices) {
+            val latLng: PointF = mPoints[i]
+            //经纬度转换成平面直角坐标系
+            wGS2flat(latLng.x.toDouble(), latLng.y.toDouble())?.let { pointFList.add(it) }
+        }
+        var iCycle: Int
+        val iCount: Int
+        iCycle = 0
+        var iArea = 0.0
+        iCount = pointFList.size
+        iCycle = 0
+        while (iCycle < iCount) {
+            iArea = iArea + (pointFList[iCycle][0] * pointFList[(iCycle + 1) % iCount][1] - pointFList[(iCycle + 1) % iCount][0] * pointFList[iCycle][1])
+            iCycle++
+        }
+        return Math.abs(0.5 * iArea).toFloat()
+    }
+
+    // 地球长半轴
+    val EARTH_RADIUS = 6378.137
+
+    /**
+     * 经纬度转换成以米为单位的平面直角坐标
+     *
+     * @param lon 经度
+     * @param lat 纬度
+     * @return 平面直角坐标double型数组,以米为单位
+     */
+    fun wGS2flat(lon: Double, lat: Double): DoubleArray? {
+        val L = CalcRad(lon)
+        val l = L - CalcRad(120.0)
+        val B = CalcRad(lat)
+        val cosb = Math.cos(B)
+        val sinb = Math.sin(B)
+        val a = EARTH_RADIUS * 1000
+        // 地球短半轴
+        val b = 6356752.3142451793
+        val t = Math.tan(B)
+        // double r = 3600 * 180 / Math.PI;
+        val e2 = (Math.pow(a, 2.0) - Math.pow(b, 2.0)) / Math.pow(a, 2.0)
+        val e12 = (Math.pow(a, 2.0) - Math.pow(b, 2.0)) / Math.pow(b, 2.0)
+        val n2 = e12 * Math.pow(cosb, 2.0)
+        val N = a / Math.sqrt(1 - e2 * Math.pow(sinb, 2.0))
+        val x = 6367449.1458 * B - 32009.8185 * cosb * sinb - (133.9975
+                * cosb * Math.pow(sinb, 3.0)) - 0.6975 * cosb * Math.pow(sinb, 5.0)
+        val X = x + N / 2 * t * Math.pow(cosb, 2.0) * Math.pow(l, 2.0) + (N / 24 * t * Math.pow(cosb, 4.0)
+                * (5 - Math.pow(t, 2.0) + 9 * n2 + 4 * Math.pow(n2, 2.0))
+                * Math.pow(l, 4.0))
+        val Y = N * cosb * l + (N / 6 * Math.pow(cosb, 3.0)
+                * (1 - Math.pow(t, 2.0) + n2) * Math.pow(l, 3.0))
+        return doubleArrayOf(X, Y)
+    }
+
+    /**
+     * 计算弧度
+     *
+     * @param d 以度为单位的经纬度数值
+     * @return 以弧度为单位的经纬度数值
+     */
+    fun CalcRad(d: Double): Double {
+        return d * Math.PI / 180.0
+    }
+
+    /**
+     * Item对象边界区域
+     *
+     * @return SRect
+     */
+    override fun boundingRect(): RectF {
+        return RectF(minX, minY, maxX, maxY)
+    } // Function boundingRect()
+
+    /**
+     * Item对象边界区域+2m
+     *
+     * @return SRect
+     */
+    fun boundingLargeRect(): RectF {
+        return RectF(minX - 2000, minY - 2000, maxX + 2000, maxY + 2000)
+    } // Function boundingRect()
+
+
+    /**
+     * Item绘制操作
+     *
+     * @param   canvas          画布
+     * @param   rect            绘制区域
+     */
+    override fun onDraw(canvas: Canvas) {
+        if (spacePathList != null && spacePathList.size > 0) {
+            if (data.isShow) {
+                paint.color = Color.parseColor("#FFDAAD")
+            } else if (paint.color == Opt.spaceChoseColor) {
+                paint.color = Opt.spaceChoseColor
+            } else {
+                if (data.jobStatus.equals("01") || data.jobStatus.equals("04")) {
+                    //黄
+                    paint.color = Color.parseColor("#FFDAAD")
+                } else if (data.jobStatus.equals("02")) {
+                    //红
+                    paint.color = Color.parseColor("#FFADAD")
+                } else if (data.jobStatus.equals("03") || data.jobStatus.equals("05")) {
+                    //绿
+                    paint.color = Color.parseColor("#50E3C2")
+                }
+            }
+            outPaint.color = Color.parseColor("#7E96FF")
+//            canvas.drawPath(spacePath!!, outPaint)
+            for (spacePath in spacePathList) {
+                canvas.drawPath(spacePath, paint)
+            }
+        }
+        super.onDraw(canvas)
+    } // Function onDraw()
+} // Class SpaceItem

+ 103 - 0
adm-cad/src/main/java/com/ys/bdtp/cad/items/UserMark.kt

@@ -0,0 +1,103 @@
+//package cn.sagacloud.android.cadengine.items
+//
+///**
+// * 标志item
+// *
+// * @author 付国宝
+// */
+//class UserMark {
+//    /** 标志宽度 */
+//    private var width: Double = 10.0
+//    /** 标志高度 */
+//    private var height: Double = 10.0
+//    /** 轮廓线坐标 */
+//    var outLine: ArrayList<SPoint>? = null
+//    /** 是否闭合 */
+//    var closeFlag = false
+//
+//    /**
+//     * 构造函数
+//     *
+//     * @param parent    指向父对象
+//     * @param data      标志数据
+//     */
+//    constructor(parent: SGraphyItem?, data: SPoint){
+//        super(parent)
+//        this.outLine.add(data)
+//    } // Constructor
+//
+//    /**
+//     * Item 对象边界区域
+//     *
+//     * @return	SRect
+//     */
+//    fun boundingRect() : SRect {
+//        return SRect(0, 0, this.width, this.height)
+//    } // Function boundingRect()
+//
+//    /**
+//     * 鼠标按下
+//     *
+//     * @param	event         事件参数
+//     * @return	boolean
+//     */
+//    fun onMouseDown(event: SMouseEvent) : Boolean {
+//        if (!this.closeFlag) {
+//            var newPoint = this.outLine?.get(this.outLine!!.size - 1)
+//            if (newPoint.x == this.outLine?.get(0).x && newPoint.y == this.outLine?.get(0).y) {
+//                this.closeFlag = true
+//            } else {
+//                newPoint = SPoint(event.x, event.y)
+//                this.outLine!!.add(newPoint)
+//            }
+//        }
+//        return true
+//    } // Function onMouseDown()
+//
+//    /**
+//     * 鼠标移动事件
+//     *
+//     * @param	event         事件参数
+//     * @return	boolean
+//     */
+//    fun onMouseMove(event: SMouseEvent) : Boolean {
+//        if (!this.closeFlag) {
+//            var first: SPoint? = null
+//            var newLast: SPoint? = null
+//            if (this.outLine!!.size > 1) {
+//                this.outLine.pop()
+//                first = this.outLine?.get(0)
+//            }
+//            newLast = SPoint(event.x, event.y)
+//            if(this.outLine!!.size > 2 && first != null){
+//                if (event.x + 20 >= first.x && event.x - 20 <= first.x && event.y + 20 >= first.y && event.y - 20 <= first.y) {
+//                    newLast = first
+//                }
+//            }
+//            this.outLine!!.add(newLast)
+//        }
+//        return true
+//    } // Function onMouseMove()
+//
+//    /**
+//     * Item绘制操作
+//     *
+//     * @param   painter       painter对象
+//     * @param   rect          绘制区域
+//     */
+//    fun onDraw(painter: SPainter, rect/*?*/: SRect){
+//        if (this.visible) {
+//            painter.pen.color = SColor("#00ff00")
+//            painter.pen.lineWidth = 2
+//            if (this.closeFlag) {
+//                painter.brush.color = SColor("#00ff00")
+//            }else{
+//                painter.brush.color = SColor("#ffffff80")
+//            }
+////            this.outLine.map(t => {
+////                painter.drawRect(t.x - 4, t.y - 4, 8, 8)
+////            })
+//            painter.drawPolyline(this.outLine)
+//        }
+//    } // Function onDraw()
+//} // Class UserMark

+ 96 - 0
adm-cad/src/main/java/com/ys/bdtp/cad/items/VirtualWallItem.kt

@@ -0,0 +1,96 @@
+package com.ys.bdtp.cad.items
+
+import android.graphics.*
+import com.ys.bdtp.cad.Opt
+import com.ys.bdtp.cad.types.VirtualWall
+import com.ys.bdtp.graph.SGraphyItem
+
+
+/**
+ * 墙item
+ *
+ * @author 付国宝
+ */
+class VirtualWallItem(private val data: VirtualWall, parent: SGraphyItem? = null) : SGraphyItem(parent) {
+    /** 画笔 */
+    private val paint = Paint()
+    /** 虚拟墙路径 */
+    private val pathList = ArrayList<Path>()
+
+    /** X坐标最小值  */
+    private var minX = 0f
+    /** X坐标最大值  */
+    private var maxX = 0f
+    /** Y坐标最小值  */
+    private var minY = 0f
+    /** Y坐标最大值  */
+    private var maxY = 0f
+
+    /**
+     * 构造
+     */
+    init {
+        try {
+            if (data.outLine != null && data.outLine!!.size > 0 && data.outLine!![0].size > 0) {
+                minX = data.outLine!![0][0].x
+                maxX = data.outLine!![0][0].x
+                minY = data.outLine!![0][0].y
+                maxY = data.outLine!![0][0].y
+
+                for (line in data.outLine!!) {
+                    if (line.size < 1) {
+                        continue
+                    }
+
+                    val path = Path()
+                    path.moveTo(line[0].x, -line[0].y)
+                    for (p in line) {
+                        if (p.x < minX) {
+                            minX = p.x
+                        }
+                        if (p.x > maxX) {
+                            maxX = p.x
+                        }
+                        if (-p.y < minY) {
+                            minY = -p.y
+                        }
+                        if (-p.y > maxY) {
+                            maxY = -p.y
+                        }
+                        path.lineTo(p.x, -p.y)
+                    }
+                    path.close()
+                    pathList.add(path)
+                }
+            }
+        } catch (e: Exception) {
+            e.printStackTrace()
+        }
+    } // Init
+
+    /**
+     * Item对象边界区域
+     *
+     * @return  边界区域
+     */
+    override fun boundingRect(): RectF {
+        return RectF(minX, minY, maxX, maxY)
+    } // Function boundingRect()
+
+    /**
+     * Item绘制操作
+     *
+     * @param   canvas          画布
+     * @param   rect            绘制区域
+     */
+    override fun onDraw(canvas : Canvas) {
+        paint.color = Opt.virtualWallColor
+        paint.pathEffect = DashPathEffect(floatArrayOf(200f, 200f), 0f)
+        paint.style = Paint.Style.STROKE
+        paint.strokeWidth = 100f
+        for (path in pathList) {
+            canvas.drawPath(path, paint);
+        }
+
+    } // Function onDraw()
+} // Class VirtualWallItem

+ 93 - 0
adm-cad/src/main/java/com/ys/bdtp/cad/items/WallItem.kt

@@ -0,0 +1,93 @@
+package com.ys.bdtp.cad.items
+
+import android.graphics.*
+import com.ys.bdtp.cad.Opt
+import com.ys.bdtp.cad.types.Wall
+import com.ys.bdtp.graph.SGraphyItem
+import java.util.*
+
+/**
+ * 墙item
+ *
+ * @author  郝建龙
+ */
+class WallItem(private val data: Wall, parent: SGraphyItem? = null) : SGraphyItem(parent) {
+    /** 画笔 */
+    private val paint = Paint()
+    /** 墙轮廓 */
+    private val pathList = ArrayList<Path>()
+    /** X坐标最小值  */
+    private var minX = 0f
+    /** X坐标最大值  */
+    private var maxX = 0f
+    /** Y坐标最小值  */
+    private var minY = 0f
+    /** Y坐标最大值  */
+    private var maxY = 0f
+
+    /**
+     * 构造
+     */
+    init {
+        try {
+            if (data.outLine != null && data.outLine!!.size > 0 && data.outLine!![0].size > 0) {
+                minX = data.outLine!![0][0].x
+                maxX = data.outLine!![0][0].x
+                minY = data.outLine!![0][0].y
+                maxY = data.outLine!![0][0].y
+
+                for (line in data.outLine!!) {
+                    if (line.size < 1) {
+                        continue
+                    }
+
+                    val path = Path()
+                    path.moveTo(line[0].x, -line[0].y)
+                    for (p in line) {
+                        if (p.x < minX) {
+                            minX = p.x
+                        }
+                        if (p.x > maxX) {
+                            maxX = p.x
+                        }
+                        if (-p.y < minY) {
+                            minY = -p.y
+                        }
+                        if (-p.y > maxY) {
+                            maxY = -p.y
+                        }
+                        path.lineTo(p.x, -p.y)
+                    }
+                    path.close()
+                    pathList.add(path)
+                }
+            }
+        } catch (e: Exception) {
+            e.printStackTrace()
+        }
+    } // Constructor
+
+    /**
+     * Item对象边界区域
+     *
+     * @return  边界区域
+     */
+    override fun boundingRect(): RectF {
+        return RectF(minX, minY, maxX, maxY)
+    } // Function boundingRect()
+
+    /**
+     * Item绘制操作
+     *
+     * @param   canvas          画布
+     * @param   rect            绘制区域
+     */
+    override fun onDraw(canvas: Canvas) {
+        paint.style = Paint.Style.FILL
+        paint.color = Opt.wallColor
+        for (path in pathList) {
+            canvas.drawPath(path, paint)
+        }
+
+    } // Function onDraw()
+} // Class WallItem

+ 94 - 0
adm-cad/src/main/java/com/ys/bdtp/cad/items/WindowItem.kt

@@ -0,0 +1,94 @@
+package com.ys.bdtp.cad.items
+
+import android.graphics.Canvas
+import android.graphics.Paint
+import android.graphics.Path
+import android.graphics.RectF
+import com.ys.bdtp.cad.Opt
+import com.ys.bdtp.cad.types.Window
+import com.ys.bdtp.graph.SGraphyItem
+
+/**
+ * 窗户item
+ *
+ * @author 付国宝
+ */
+class WindowItem(private val data: Window, parent: SGraphyItem? = null) : SGraphyItem(parent) {
+    /** 画笔 */
+    private val paint = Paint()
+    /** 墙轮廓 */
+    private val pathList = ArrayList<Path>()
+    /** X坐标最小值  */
+    private var minX = 0f
+    /** X坐标最大值  */
+    private var maxX = 0f
+    /** Y坐标最小值  */
+    private var minY = 0f
+    /** Y坐标最大值  */
+    private var maxY = 0f
+
+    /**
+     * 构造
+     */
+    init {
+        try {
+            if (data.outLine != null && data.outLine!!.size > 0 && data.outLine!![0].size > 0) {
+                minX = data.outLine!![0][0].x
+                maxX = data.outLine!![0][0].x
+                minY = data.outLine!![0][0].y
+                maxY = data.outLine!![0][0].y
+
+                for (line in data.outLine!!) {
+                    if (line.size < 1) {
+                        continue
+                    }
+
+                    val path = Path()
+                    path.moveTo(line[0].x, -line[0].y)
+                    for (p in line) {
+                        if (p.x < minX) {
+                            minX = p.x
+                        }
+                        if (p.x > maxX) {
+                            maxX = p.x
+                        }
+                        if (-p.y < minY) {
+                            minY = -p.y
+                        }
+                        if (-p.y > maxY) {
+                            maxY = -p.y
+                        }
+                        path.lineTo(p.x, -p.y)
+                    }
+                    path.close()
+                    pathList.add(path)
+                }
+            }
+        } catch (e: Exception) {
+            e.printStackTrace()
+        }
+    } // Constructor
+
+    /**
+     * Item对象边界区域
+     *
+     * @return  边界区域
+     */
+    override fun boundingRect(): RectF {
+        return RectF(minX, minY, maxX, maxY)
+    } // Function boundingRect()
+
+    /**
+     * Item绘制操作
+     *
+     * @param   canvas          画布
+     * @param   rect            绘制区域
+     */
+    override fun onDraw(canvas : Canvas) {
+        paint.style = Paint.Style.FILL
+        paint.color = Opt.windowColor
+        for (path in pathList) {
+            canvas.drawPath(path, paint);
+        }
+    } // Function onDraw()
+} // Class WindowItem

+ 117 - 0
adm-cad/src/main/java/com/ys/bdtp/cad/test/GraphyFmItem.kt

@@ -0,0 +1,117 @@
+package com.ys.bdtp.cad.test
+
+
+import android.graphics.Bitmap
+import android.graphics.Canvas
+import android.graphics.Color
+import android.graphics.Matrix
+import android.graphics.Paint
+import android.graphics.RectF
+import android.util.Log
+import com.ys.bdtp.graph.SGraphyItem
+import com.ys.bdtp.graph.SMotionEvent
+import com.ys.bdtp.graph.enums.SGraphyItemFlag
+import java.util.*
+
+
+/**
+ * 设备
+ * @author  Andy
+ */
+class GraphyFmItem(parent: SGraphyItem? = null) : SGraphyItem(parent) {
+
+    // 画笔
+    private var pen = Paint()
+    var flag:Boolean = false
+    var isClick:Boolean = false
+    /** 当前设备 */
+    var isCurrent:Boolean=false
+    private lateinit var bitmapdianbiao:Bitmap
+    private lateinit var bitmapequipment:Bitmap
+    private lateinit var decodeResource:Bitmap
+    private var bitheight = 0
+    private var bitwidth = 0
+
+    /** png图数据 */
+    private var pngWidth = 16
+    private var pngHeight = 16
+    /** png定位点的坐标 */
+    private val pngLocatX = 8
+    private val pngLocatY = 14
+
+    /** 原始宽 */
+    private var originalWidth = 0
+    /** 原始高 */
+    private var originalHeight = 0
+    private var rate = 1f
+    var color = Color.BLACK
+
+    /**
+     * 默认构造函数
+     */
+    init {
+
+//        hide()
+        isClick=true
+        isCurrent=false
+        pen.color = color
+        pen.strokeWidth = 5f
+        pen.isAntiAlias=false
+
+        /** item获取焦点ItemIsFocusable,移动ItemIsMovable */
+        flags= EnumSet.of(SGraphyItemFlag.ItemIsFocusable)
+
+
+
+    } // init
+
+    /**
+     * Item对象边界区域
+     */
+    override fun boundingRect(): RectF {
+        return RectF(0f,0f,600f,300f)
+    } // Function boundingRect()
+
+    /**
+     * @param   canvas      画布对象
+     */
+    override fun onDraw(canvas: Canvas) {
+        try {
+            canvas.drawRect(0f,0f,600f,300f,pen)
+            invalidate()
+        } catch (e: Exception) {
+            e.printStackTrace()
+        }
+        return
+    } // Function paint()
+
+    /**
+     *  点击
+     */
+    override fun onSingleTapUp(e: SMotionEvent): Boolean {
+       Log.e("被点击1","**************************************")
+        return true
+    }
+
+    /**
+     *
+     * @param bm        传入的bitmap
+     * @param newWidth  指定的图片宽
+     * @param newHeight 指定的图片高
+     * @return  newbm   返回 bitmap类型
+     */
+    private fun setImgSize(bm: Bitmap?, newWidth: Int, newHeight: Int): Bitmap {
+        // 获得图片的宽高.
+        val width = bm!!.width
+        val height = bm.height
+        // 计算缩放比例.
+        val scaleWidth = newWidth.toFloat() / width
+        val scaleHeight = newHeight.toFloat() / height
+        // 取得想要缩放的matrix参数.
+        val matrix = Matrix()
+        matrix.postScale(scaleWidth, scaleHeight)
+//        bm.config = Bitmap.Config.RGB_565
+        // 得到新的图片.
+        return Bitmap.createBitmap(bm, 0, 0, width, height, matrix, true)
+    }
+} // Class GraphyWallItem

+ 127 - 0
adm-cad/src/main/java/com/ys/bdtp/cad/test/GraphyTwoItem.kt

@@ -0,0 +1,127 @@
+package com.ys.bdtp.cad.test
+
+import android.graphics.Bitmap
+import android.graphics.Canvas
+import android.graphics.Color
+import android.graphics.Matrix
+import android.graphics.Paint
+import android.graphics.RectF
+import android.util.Log
+import com.ys.bdtp.graph.SGraphyItem
+import com.ys.bdtp.graph.SMotionEvent
+import com.ys.bdtp.graph.enums.SGraphyItemFlag
+import java.util.*
+
+
+/**
+ * 设备
+ * @author  Andy
+ */
+class GraphyTwoItem(parent: SGraphyItem? = null) : SGraphyItem(parent) {
+
+    // 画笔
+    private var pen = Paint()
+    var flag:Boolean = false
+    var isClick:Boolean = false
+    /** 当前设备 */
+    var isCurrent:Boolean=false
+    private lateinit var bitmapdianbiao:Bitmap
+    private lateinit var bitmapequipment:Bitmap
+    private lateinit var decodeResource:Bitmap
+    private var bitheight = 0
+    private var bitwidth = 0
+
+    /** png图数据 */
+    private var pngWidth = 16
+    private var pngHeight = 16
+    /** png定位点的坐标 */
+    private val pngLocatX = 8
+    private val pngLocatY = 14
+
+    /** 原始宽 */
+    private var originalWidth = 0
+    /** 原始高 */
+    private var originalHeight = 0
+    private var rate = 1f
+    var color = Color.RED
+    /**
+     * 默认构造函数
+     */
+    init {
+
+//        hide()
+        isClick=true
+        isCurrent=false
+        pen.color = color
+        pen.strokeWidth = 5f
+        pen.isAntiAlias=false
+
+        /** item获取焦点ItemIsFocusable,移动ItemIsMovable */
+        flags= EnumSet.of(SGraphyItemFlag.ItemIsFocusable)
+//        this.parent = parent
+
+
+    } // init
+
+    /**
+     * Item对象边界区域
+     */
+    override fun boundingRect(): RectF {
+        return RectF(0f,0f,600f,300f)
+    } // Function boundingRect()
+
+    /**
+     * @param   canvas      画布对象
+     */
+    override fun onDraw(canvas: Canvas) {
+        try {
+            canvas.drawRect(0f,0f,600f,300f,pen)
+            invalidate()
+        } catch (e: Exception) {
+            e.printStackTrace()
+        }
+        return
+    } // Function paint()
+
+    /**
+     *  点击
+     */
+    override fun onSingleTapUp(e: SMotionEvent): Boolean {
+        Log.e("被点击2","**************************************")
+        Log.e("X",e.x.toString())
+        Log.e("y",e.y.toString())
+        return true
+    }
+
+    override fun onScroll(e1: SMotionEvent, e2: SMotionEvent, distanceX: Float, distanceY: Float): Boolean {
+        flag=false
+        Log.e("item","滑动")
+        return super.onScroll(e1, e2, distanceX, distanceY)
+    }
+
+
+
+
+
+    /**
+     *
+     * @param bm        传入的bitmap
+     * @param newWidth  指定的图片宽
+     * @param newHeight 指定的图片高
+     * @return  newbm   返回 bitmap类型
+     */
+    private fun setImgSize(bm: Bitmap?, newWidth: Int, newHeight: Int): Bitmap {
+        // 获得图片的宽高.
+        val width = bm!!.width
+        val height = bm.height
+        // 计算缩放比例.
+        val scaleWidth = newWidth.toFloat() / width
+        val scaleHeight = newHeight.toFloat() / height
+        // 取得想要缩放的matrix参数.
+        val matrix = Matrix()
+        matrix.postScale(scaleWidth, scaleHeight)
+//        bm.config = Bitmap.Config.RGB_565
+        // 得到新的图片.
+        return Bitmap.createBitmap(bm, 0, 0, width, height, matrix, true)
+    }
+} // Class GraphyWallItem

+ 23 - 0
adm-cad/src/main/java/com/ys/bdtp/cad/types/Column.kt

@@ -0,0 +1,23 @@
+package com.ys.bdtp.cad.types
+
+import android.graphics.PointF
+
+/**
+ * 柱子 Item 类
+ *
+ * @author  庞利祥(sybotan@126.com)
+ */
+class Column {
+    /** 名称  */
+    var name: String? = null
+    /** 轮廓线  */
+    var outLine: ArrayList<ArrayList<PointF>>? = null
+    /** 房间边界  */
+    var roomBoundary: Boolean? = null
+    /** 位置  */
+//    var location: Place? = null
+    /** 模型id(外键)    */
+    var modelId: String? = null
+    /** 对应Revit模型id */
+    var sourceId: String? = null
+} // Class Column

+ 34 - 0
adm-cad/src/main/java/com/ys/bdtp/cad/types/Door.kt

@@ -0,0 +1,34 @@
+package com.ys.bdtp.cad.types
+
+import android.graphics.PointF
+
+/**
+ * 门 Item 类
+ *
+ * @author  庞利祥(sybotan@126.com)
+ */
+class Door {
+    /** 面朝方向  */
+//    var faceDirection: PointF? = null
+    /** 把手方向  */
+//    var handDirection: PointF? = null
+    /** 位置  */
+//    var location: Place? = null
+    /** 模型id(外键)    */
+    var modelId: String? = null
+    /** 名称  */
+    var name: String? = null
+    /** 轮廓线  */
+    var outLine: ArrayList<ArrayList<PointF>>? = null
+    /** 拥有者的RevitId */
+    var owner: String? = null
+    /** 对应Revit模型id */
+    var sourceId: String? = null
+    /** 厚度  */
+    var thick: Double? = null
+    /** 所属墙 */
+    var wallId: String? = null
+    /** 宽度  */
+    var width: String? = null
+
+} // Class Door

+ 21 - 0
adm-cad/src/main/java/com/ys/bdtp/cad/types/Elements.kt

@@ -0,0 +1,21 @@
+package com.ys.bdtp.cad.types
+
+class Elements {
+    /** 柱子 */
+    var columns: ArrayList<Column>? = null
+
+    /** 门 */
+    var doors: ArrayList<Door>? = null
+
+    /** 空间 */
+    var spaces: ArrayList<Space>? = null
+
+    /** 虚拟墙 */
+    var virtualWalls: ArrayList<VirtualWall>? = null
+
+    /** 墙 */
+    var walls: ArrayList<Wall>? = null
+
+    /** 窗户 */
+    var windows: ArrayList<Window>? = null
+} // Class Elements

+ 13 - 0
adm-cad/src/main/java/com/ys/bdtp/cad/types/Entity.kt

@@ -0,0 +1,13 @@
+package com.ys.bdtp.cad.types
+
+import com.ys.bdtp.cad.types.Elements
+
+/**
+ * 实体对象
+ *
+ * @author  庞利祥(sybotan@126.com)
+ */
+class Entity {
+    /** 元素 */
+    var elements: Elements? = null
+} // Class Entity

+ 13 - 0
adm-cad/src/main/java/com/ys/bdtp/cad/types/FloorData.kt

@@ -0,0 +1,13 @@
+package com.ys.bdtp.cad.types
+
+/**
+ * json数据类
+ *
+ * @author  庞利祥(sybotan@126.com)
+ */
+class FloorData {
+    val result = ""
+    var message = ""
+    /** 实体列表 */
+    var entityList = ArrayList<Entity>()
+} // Class FloorData

+ 25 - 0
adm-cad/src/main/java/com/ys/bdtp/cad/types/Grid.kt

@@ -0,0 +1,25 @@
+package com.ys.bdtp.cad.types
+
+import android.graphics.PointF
+
+/**
+ * Created by lihao.
+ * Date: 8/12/21
+ * 轴网
+ */
+class Grid {
+    /** 层id */
+    var levelId: String? = null
+    /** 位置  */
+    var location: Place? = null
+    /** 模型id(外键)    */
+    var modelId: String? = null
+    /** 名称  */
+    var name: String? = null
+    /** 轮廓线  */
+    var outLine: ArrayList<ArrayList<PointF>>? = null
+    /** 对应Revit模型id */
+    var sourceId: String? = null
+    /** 厚度  */
+    var width: String? = null
+} // Calss Wall

+ 17 - 0
adm-cad/src/main/java/com/ys/bdtp/cad/types/Marker.kt

@@ -0,0 +1,17 @@
+package com.ys.bdtp.cad.types
+
+/**
+ * 标记 item 类
+ *
+ * @author  庞利祥(sybotan@126.com)
+ */
+class Marker {
+    /** 标记的id  */
+    var id: String? = null
+    /** 标记的名称  */
+    var name: String? = null
+    /** X坐标 */
+    var x: Double? = null
+    /** Y坐标 */
+    var y: Double? = null
+} // Class Marker

+ 22 - 0
adm-cad/src/main/java/com/ys/bdtp/cad/types/Photos.kt

@@ -0,0 +1,22 @@
+package com.ys.bdtp.cad.types
+
+import android.graphics.Bitmap
+import java.io.Serializable
+
+/**
+ * created by lihao on 2018/11/19
+ */
+class Photos : Serializable {
+    var id: String? = null
+    var type: String? = null
+    var name: String? = null
+    var key: String? = null
+    var creator_id: String? = null
+    var creator_name: String? = null
+    var create_time: String? = null
+    var bitmap: Bitmap? = null
+    var itemType //0-图片 1-添加按钮 2-bitmap
+            = 0
+    var path //本地bitmap路径
+            : String? = null
+}

+ 17 - 0
adm-cad/src/main/java/com/ys/bdtp/cad/types/PipeLine.kt

@@ -0,0 +1,17 @@
+package com.ys.bdtp.cad.types
+
+import android.graphics.PointF
+import android.os.Parcelable
+import java.io.Serializable
+
+/**
+ * Created by lihao.
+ * Date: 2021/6/7
+ */
+class PipeLine : Serializable {
+    /** 定位点 */
+    var points: ArrayList<PointF> = ArrayList()
+
+    /** 类型 */
+    var type: String? = null
+}

+ 15 - 0
adm-cad/src/main/java/com/ys/bdtp/cad/types/Place.kt

@@ -0,0 +1,15 @@
+package com.ys.bdtp.cad.types
+
+import android.graphics.PointF
+
+/**
+ * 定位类
+ *
+ * @author  庞利祥(sybotan@126.com)
+ */
+class Place {
+    /** 定位点 */
+    var points: ArrayList<PointF>? = null
+    /** 类型 */
+    var type: String? = null
+} // Class Place

+ 40 - 0
adm-cad/src/main/java/com/ys/bdtp/cad/types/Point.kt

@@ -0,0 +1,40 @@
+package com.ys.bdtp.cad.types
+
+import android.graphics.PointF
+import java.util.ArrayList
+
+/**
+ * Created by lihao.
+ * Date: 2021/6/4
+ */
+class Point {
+
+
+    //问题id
+    var id: String? = null
+
+    /** X坐标  */
+    var mX = 0f
+
+    /** Y坐标  */
+    var mY = 0f
+    var points = ArrayList<PointF>()
+    var z: String? = null
+
+    var scalePoint = 1.0f
+    var remark: String? = null
+    var name: String? = null
+    var type: String? = null
+    var position: String? = null
+
+    var spaceId: String? = null
+    var content: String? = null
+    var floorId: String? = null
+    var deviceId: String? = null
+    var digitalDeliveryID: String? = null
+    var photos: ArrayList<Photos> = ArrayList()
+
+    //1-蓝 2-绿 3-红 4-huang 6-关系已完成
+    var equipState: Int? = 0
+    var equipType: Int? = 0
+}

+ 13 - 0
adm-cad/src/main/java/com/ys/bdtp/cad/types/PointZ.kt

@@ -0,0 +1,13 @@
+package com.ys.bdtp.cad.types
+
+import com.google.gson.annotations.SerializedName
+
+/**
+ * Created by lihao.
+ * Date: 2021/6/10
+ */
+data class PointZ(
+    @SerializedName("X") var x: Float = 0f,
+    @SerializedName("Y") var y: Float = 0f,
+    @SerializedName("Z") var z: Float = 0f
+)

+ 43 - 0
adm-cad/src/main/java/com/ys/bdtp/cad/types/Pointz2.java

@@ -0,0 +1,43 @@
+package com.ys.bdtp.cad.types;
+
+/**
+ * Created by lihao.
+ * Date: 2021/6/10
+ */
+public class Pointz2 {
+    public float x;
+    public float X;
+    public float y;
+    public float Y;
+    public float z;
+    public float Z;
+
+    public Pointz2() {
+    }
+
+    public float x() {
+        if (x == 0f) return X;
+        else return x;
+    }
+
+    public float y() {
+        if (y == 0f) return Y;
+        else return y;
+    }
+
+    public float z() {
+        if (z == 0f) return Z;
+        else return z;
+    }
+
+    public Pointz2(float x, float y) {
+        this.x = x;
+        this.y = y;
+    }
+
+    public Pointz2(float x, float y, float z) {
+        this.x = x;
+        this.y = y;
+        this.z = z;
+    }
+}

+ 23 - 0
adm-cad/src/main/java/com/ys/bdtp/cad/types/Space.kt

@@ -0,0 +1,23 @@
+package com.ys.bdtp.cad.types
+
+/**
+ * 空间 item 类
+ *
+ * @author  庞利祥(sybotan@126.com)
+ */
+class Space {
+    /** 轮廓线段    */
+    var boundarySegments: ArrayList<String>? = null
+    /** 位置  */
+//    var location: Place? = null
+    /** 模型id(外键)    */
+    var modelId: String? = null
+    /** 名称  */
+    var name: String? = null
+    /** 轮廓线  */
+    var outLine: ArrayList<ArrayList<PointZ>>? = null
+    /** 对应Revit模型id */
+    var sourceId: String? = null
+    /** 补充信息    */
+    var tag: String? = null
+} // Class Space

+ 72 - 0
adm-cad/src/main/java/com/ys/bdtp/cad/types/TunableSpace.kt

@@ -0,0 +1,72 @@
+package com.ys.bdtp.cad.types
+
+import android.os.Parcel
+import android.os.Parcelable
+
+/**
+ * 可调节空间空间 item 类
+ *
+ */
+class TunableSpace() :Parcelable {
+    /** 轮廓线  */
+    var outLine: ArrayList<ArrayList<ArrayList<PointZ>>> = ArrayList()
+    var name: String? = null
+    var floorName: String? = null
+    var floorId: String? = null
+    var objectEntity: String? = null
+    var isShow: Boolean = false
+
+    /**
+     *  {
+    "name": "有结构核查任务",
+    "code": "01"
+    },
+    {
+    "name": "有结构问题",
+    "code": "02"
+    },
+    {
+    "name": "结构核查完毕",
+    "code": "03"
+    },
+    {
+    "name": "有现场勘测任务",
+    "code": "04"
+    },
+    {
+    "name": "已完成勘测任务",
+    "code": "05"
+    }
+     */
+    var jobStatus: String = ""
+    var id: String? = null
+    var localName: String? = null
+
+    constructor(parcel: Parcel) : this() {
+        name = parcel.readString()
+        jobStatus = parcel.readString() ?: ""
+        id = parcel.readString()
+        localName = parcel.readString()
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(name)
+        parcel.writeString(jobStatus)
+        parcel.writeString(id)
+        parcel.writeString(localName)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<TunableSpace> {
+        override fun createFromParcel(parcel: Parcel): TunableSpace {
+            return TunableSpace(parcel)
+        }
+
+        override fun newArray(size: Int): Array<TunableSpace?> {
+            return arrayOfNulls(size)
+        }
+    }
+}

+ 21 - 0
adm-cad/src/main/java/com/ys/bdtp/cad/types/VirtualWall.kt

@@ -0,0 +1,21 @@
+package com.ys.bdtp.cad.types
+
+import android.graphics.PointF
+
+/**
+ * 虚拟墙 item 类
+ *
+ * @author  庞利祥(sybotan@126.com)
+ */
+class VirtualWall {
+    /** 位置  */
+//    var location: Place? = null
+    /** 模型id(外键)    */
+    var modelId: String? = null
+    /** 名称  */
+    var name: String? = null
+    /** 轮廓线  */
+    var outLine: ArrayList<ArrayList<PointF>>? = null
+    /** 对应Revit模型id */
+    var sourceId: String? = null
+} // Class VirtualWall

+ 25 - 0
adm-cad/src/main/java/com/ys/bdtp/cad/types/Wall.kt

@@ -0,0 +1,25 @@
+package com.ys.bdtp.cad.types
+
+import android.graphics.PointF
+
+/**
+ * 墙 item 类
+ *
+ * @author  庞利祥(sybotan@126.com)
+ */
+class Wall {
+    /** 层id */
+    var levelId: String? = null
+    /** 位置  */
+//    var location: Place? = null
+    /** 模型id(外键)    */
+    var modelId: String? = null
+    /** 名称  */
+    var name: String? = null
+    /** 轮廓线  */
+    var outLine: ArrayList<ArrayList<PointF>>? = null
+    /** 对应Revit模型id */
+    var sourceId: String? = null
+    /** 厚度  */
+    var width: String? = null
+} // Calss Wall

+ 29 - 0
adm-cad/src/main/java/com/ys/bdtp/cad/types/Window.kt

@@ -0,0 +1,29 @@
+package com.ys.bdtp.cad.types
+
+import android.graphics.PointF
+
+/**
+ * 窗户 Item 类
+ *
+ * @author  庞利祥(sybotan@126.com)
+ */
+class Window {
+    /** 位置  */
+//    var location: PointF? = null
+    /** 模型id(外键)    */
+    var modelId: String? = null
+    /** 名称  */
+    var name: String? = null
+    /** 轮廓线  */
+    var outLine: ArrayList<ArrayList<PointF>>? = null
+    /** 拥有者的RevitId */
+    var owner: String? = null
+    /** 对应Revit模型id */
+    var sourceId: String? = null
+    /** 厚度  */
+    var thick: Double? = null
+    /** 所属墙 */
+    var wallId: String? = null
+    /** 宽度  */
+    var width: String ? = null
+} // Class Casement

BIN
adm-cad/src/main/res/drawable/centertack_img.png


BIN
adm-cad/src/main/res/drawable/equip6.png


BIN
adm-cad/src/main/res/drawable/equip_blue.png


BIN
adm-cad/src/main/res/drawable/equip_green.png


BIN
adm-cad/src/main/res/drawable/equip_notdone.png


BIN
adm-cad/src/main/res/drawable/equip_purple.png


BIN
adm-cad/src/main/res/drawable/equip_red.png


BIN
adm-cad/src/main/res/drawable/img.png


BIN
adm-cad/src/main/res/drawable/pipecadcolor.png


BIN
adm-cad/src/main/res/drawable/pipecadsmall.png


BIN
adm-cad/src/main/res/drawable/qrcode.png


BIN
adm-cad/src/main/res/drawable/yellow_equip.png


+ 3 - 0
adm-cad/src/main/res/values/strings.xml

@@ -0,0 +1,3 @@
+<resources>
+    <string name="app_name">adm-cad</string>
+</resources>

+ 17 - 0
adm-cad/src/test/java/com/ys/bdtp/cad/ExampleUnitTest.kt

@@ -0,0 +1,17 @@
+package com.ys.bdtp.cad
+
+import org.junit.Test
+
+import org.junit.Assert.*
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * See [testing documentation](http://d.android.com/tools/testing).
+ */
+class ExampleUnitTest {
+    @Test
+    fun addition_isCorrect() {
+        assertEquals(4, 2 + 2)
+    }
+}

+ 1 - 1
adm-graph/build.gradle.kts

@@ -39,7 +39,7 @@ dependencies {
     implementation("com.google.android.material:material:1.4.0")
     implementation("org.greenrobot:eventbus:3.3.1")
     //implementation("org.jetbrains.anko:anko-commons:0.10.8")
-    //implementation("cn.sagacloud:saga-kotlin-base:1.4.105")
+    implementation("cn.sagacloud:saga-kotlin-base:1.4.105")
 
     testImplementation("junit:junit:4.13.2")
     androidTestImplementation("androidx.test.ext:junit:1.1.3")

+ 5 - 0
settings.gradle.kts

@@ -15,9 +15,14 @@ dependencyResolutionManagement {
     repositories {
         google()
         mavenCentral()
+        maven {
+            isAllowInsecureProtocol = true
+            setUrl("""http://dev.dp.sagacloud.cn:8082/repository/maven-public/""")
+        }
     }
 }
 rootProject.name = "Adm"
 include(":app")
 include(":adm-graph")
 include(":adm-base")
+include(":adm-cad")