|
@@ -545,6 +545,83 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
|
|
|
scene.setOnSingleTopUp(object : FloorScene.OnSingleTopUp {
|
|
|
@SuppressLint("SetJavaScriptEnabled")
|
|
|
override fun onSingUp(x: Float, y: Float) {
|
|
|
+
|
|
|
+ //查看模式下,判断问题点选中逻辑
|
|
|
+ if ("normal".equals(scene.type)) {
|
|
|
+ realDistance = distance * scene.defaultPointScale / graphyView.scale
|
|
|
+ var hasChoose = false
|
|
|
+ for (point in scene.pointItemList) {
|
|
|
+ val sqrt = Math.sqrt(
|
|
|
+ Math.pow(
|
|
|
+ Math.abs(x - point.data.mX).toDouble(),
|
|
|
+ 2.0
|
|
|
+ ) + Math.pow(Math.abs(y - point.data.mY).toDouble(), 2.0)
|
|
|
+ ).toInt()
|
|
|
+ if (sqrt < realDistance) {
|
|
|
+ hasChoose = true
|
|
|
+ showDotDetail(point)
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!hasChoose) {
|
|
|
+ problemLl.visibility = View.GONE
|
|
|
+ } else {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ var hasChooseEquip = false
|
|
|
+ for (point in scene.equipList) {
|
|
|
+ val sqrt = Math.sqrt(
|
|
|
+ Math.pow(
|
|
|
+ Math.abs(x - point.data.mX).toDouble(),
|
|
|
+ 2.0
|
|
|
+ ) + Math.pow(Math.abs(y - point.data.mY).toDouble(), 2.0)
|
|
|
+ ).toInt()
|
|
|
+ if (sqrt < realDistance) {
|
|
|
+ hasChooseEquip = true
|
|
|
+ equipDetail.alpha = 1f
|
|
|
+ equipDelete.alpha = 1f
|
|
|
+ equipDetail.isEnabled = true
|
|
|
+ equipDelete.isEnabled = true
|
|
|
+ point.data.equipState = 4
|
|
|
+ equipDetail.setOnClickListener {
|
|
|
+ val intent =
|
|
|
+ Intent(this@GraphyActivity, EquipDetailActivity::class.java)
|
|
|
+ val bundle = Bundle()
|
|
|
+ val positon = Position()
|
|
|
+ positon.x = point.data.mX.toString()
|
|
|
+ positon.y = point.data.mY.toString()
|
|
|
+ val z = Z()
|
|
|
+ val position = gson.fromJson(point.data.position, Z::class.java)
|
|
|
+ z.offset = position.offset
|
|
|
+ z.region = position.region
|
|
|
+ positon.z = z
|
|
|
+ bundle.putString("spaceId", scene.choseSpace!!.data.id)
|
|
|
+ bundle.putSerializable("position", positon)
|
|
|
+ bundle.putString("buildingId", buildingId)
|
|
|
+ bundle.putString("floorId", floorId)
|
|
|
+ bundle.putString("deviceId", point.data.deviceId)
|
|
|
+ bundle.putString("projectId", projectId)
|
|
|
+ intent.putExtra("equip", bundle)
|
|
|
+ startActivityForResult(intent, REQUEST_CODE_EQUIP)
|
|
|
+ }
|
|
|
+ equipDelete.setOnClickListener {
|
|
|
+ graphyVM.insProblemEquip(scene.choseSpace!!, point.data.deviceId!!)
|
|
|
+ }
|
|
|
+
|
|
|
+ } else {
|
|
|
+ point.data.equipState = point.data.equipType
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!hasChooseEquip) {
|
|
|
+ equipDetail.alpha = 0.5f
|
|
|
+ equipDelete.alpha = 0.5f
|
|
|
+ equipDetail.isEnabled = false
|
|
|
+ equipDelete.isEnabled = false
|
|
|
+ } else {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//如果只是查看模式,可以选中空间,进行空间内业务操作
|
|
|
if ("normal".equals(scene.type)) {
|
|
|
var hasChose = false
|
|
@@ -875,76 +952,6 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
|
|
|
scene.qrcodeItemList.clear()
|
|
|
}
|
|
|
|
|
|
- //查看模式下,判断问题点选中逻辑
|
|
|
- if ("normal".equals(scene.type)) {
|
|
|
- realDistance = distance * scene.defaultPointScale / graphyView.scale
|
|
|
- var hasChoose = false
|
|
|
- for (point in scene.pointItemList) {
|
|
|
- val sqrt = Math.sqrt(
|
|
|
- Math.pow(
|
|
|
- Math.abs(x - point.data.mX).toDouble(),
|
|
|
- 2.0
|
|
|
- ) + Math.pow(Math.abs(y - point.data.mY).toDouble(), 2.0)
|
|
|
- ).toInt()
|
|
|
- if (sqrt < realDistance) {
|
|
|
- hasChoose = true
|
|
|
- showDotDetail(point)
|
|
|
- break
|
|
|
- }
|
|
|
- }
|
|
|
- if (!hasChoose) {
|
|
|
- problemLl.visibility = View.GONE
|
|
|
- }
|
|
|
- var hasChooseEquip = false
|
|
|
- for (point in scene.equipList) {
|
|
|
- val sqrt = Math.sqrt(
|
|
|
- Math.pow(
|
|
|
- Math.abs(x - point.data.mX).toDouble(),
|
|
|
- 2.0
|
|
|
- ) + Math.pow(Math.abs(y - point.data.mY).toDouble(), 2.0)
|
|
|
- ).toInt()
|
|
|
- if (sqrt < realDistance) {
|
|
|
- hasChooseEquip = true
|
|
|
- equipDetail.alpha = 1f
|
|
|
- equipDelete.alpha = 1f
|
|
|
- equipDetail.isEnabled = true
|
|
|
- equipDelete.isEnabled = true
|
|
|
- equipDetail.setOnClickListener {
|
|
|
- val intent =
|
|
|
- Intent(this@GraphyActivity, EquipDetailActivity::class.java)
|
|
|
- val bundle = Bundle()
|
|
|
- val positon = Position()
|
|
|
- positon.x = point.data.mX.toString()
|
|
|
- positon.y = point.data.mY.toString()
|
|
|
- val z = Z()
|
|
|
- val position = gson.fromJson(point.data.position, Z::class.java)
|
|
|
- z.offset = position.offset
|
|
|
- z.region = position.region
|
|
|
- positon.z = z
|
|
|
- bundle.putString("spaceId", scene.choseSpace!!.data.id)
|
|
|
- bundle.putSerializable("position", positon)
|
|
|
- bundle.putString("buildingId", buildingId)
|
|
|
- bundle.putString("floorId", floorId)
|
|
|
- bundle.putString("deviceId", point.data.deviceId)
|
|
|
- bundle.putString("projectId", projectId)
|
|
|
- intent.putExtra("equip", bundle)
|
|
|
- startActivityForResult(intent, REQUEST_CODE_EQUIP)
|
|
|
- }
|
|
|
- equipDelete.setOnClickListener {
|
|
|
- graphyVM.insProblemEquip(scene.choseSpace!!, point.data.deviceId!!)
|
|
|
- }
|
|
|
- break
|
|
|
- }
|
|
|
- }
|
|
|
- if (!hasChooseEquip) {
|
|
|
- equipDetail.alpha = 0.5f
|
|
|
- equipDelete.alpha = 0.5f
|
|
|
- equipDetail.isEnabled = false
|
|
|
- equipDelete.isEnabled = false
|
|
|
- }
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
//绑定二位码业务
|
|
|
if ("qrcode".equals(scene.type)) {
|
|
|
qrcodeLl.visibility = View.VISIBLE
|
|
@@ -1599,6 +1606,7 @@ class GraphyActivity : BaseActivity(), ICaptureStatusListener, ICameraChangedCal
|
|
|
point.remark = child.remark
|
|
|
point.type = model.type
|
|
|
point.equipState = child.type
|
|
|
+ point.equipType = child.type
|
|
|
point.position = child.position
|
|
|
point.deviceId = child.deviceId
|
|
|
|