diff --git a/app/src/main/java/com/casic/br/operationsite/extensions/Direction.kt b/app/src/main/java/com/casic/br/operationsite/extensions/Direction.kt
index d0b247b..e71ef57 100644
--- a/app/src/main/java/com/casic/br/operationsite/extensions/Direction.kt
+++ b/app/src/main/java/com/casic/br/operationsite/extensions/Direction.kt
@@ -41,4 +41,18 @@
fun createOpenLightCommand(): ByteArray {
return byteArrayOf(0xAA.toByte(), 0x01, 0x00, 0x91.toByte(), 0x01, 0x00, 0x93.toByte())
+}
+
+/**
+ * 打开声光报警
+ * */
+fun createOpenNoiseAndLightWarningCommand(): ByteArray {
+ return byteArrayOf(0xFF.toByte())
+}
+
+/**
+ * 关闭声光报警
+ * */
+fun createStopNoiseAndLightWarningCommand(): ByteArray {
+ return byteArrayOf(0x00.toByte())
}
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/br/operationsite/extensions/Direction.kt b/app/src/main/java/com/casic/br/operationsite/extensions/Direction.kt
index d0b247b..e71ef57 100644
--- a/app/src/main/java/com/casic/br/operationsite/extensions/Direction.kt
+++ b/app/src/main/java/com/casic/br/operationsite/extensions/Direction.kt
@@ -41,4 +41,18 @@
fun createOpenLightCommand(): ByteArray {
return byteArrayOf(0xAA.toByte(), 0x01, 0x00, 0x91.toByte(), 0x01, 0x00, 0x93.toByte())
+}
+
+/**
+ * 打开声光报警
+ * */
+fun createOpenNoiseAndLightWarningCommand(): ByteArray {
+ return byteArrayOf(0xFF.toByte())
+}
+
+/**
+ * 关闭声光报警
+ * */
+fun createStopNoiseAndLightWarningCommand(): ByteArray {
+ return byteArrayOf(0x00.toByte())
}
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/br/operationsite/utils/LocaleConstant.kt b/app/src/main/java/com/casic/br/operationsite/utils/LocaleConstant.kt
index c76f73b..d3327b5 100644
--- a/app/src/main/java/com/casic/br/operationsite/utils/LocaleConstant.kt
+++ b/app/src/main/java/com/casic/br/operationsite/utils/LocaleConstant.kt
@@ -32,6 +32,6 @@
const val HK_NET_USERNAME = "admin"
const val HK_NET_PASSWORD = "1234qwer"
const val WIFI_PASSWORD = "zhsz20311hw"
- const val UDP_HOST = "192.168.31.233"
+ const val UDP_HOST = "192.168.10.133"
const val UDP_PORT = 9000
}
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/br/operationsite/extensions/Direction.kt b/app/src/main/java/com/casic/br/operationsite/extensions/Direction.kt
index d0b247b..e71ef57 100644
--- a/app/src/main/java/com/casic/br/operationsite/extensions/Direction.kt
+++ b/app/src/main/java/com/casic/br/operationsite/extensions/Direction.kt
@@ -41,4 +41,18 @@
fun createOpenLightCommand(): ByteArray {
return byteArrayOf(0xAA.toByte(), 0x01, 0x00, 0x91.toByte(), 0x01, 0x00, 0x93.toByte())
+}
+
+/**
+ * 打开声光报警
+ * */
+fun createOpenNoiseAndLightWarningCommand(): ByteArray {
+ return byteArrayOf(0xFF.toByte())
+}
+
+/**
+ * 关闭声光报警
+ * */
+fun createStopNoiseAndLightWarningCommand(): ByteArray {
+ return byteArrayOf(0x00.toByte())
}
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/br/operationsite/utils/LocaleConstant.kt b/app/src/main/java/com/casic/br/operationsite/utils/LocaleConstant.kt
index c76f73b..d3327b5 100644
--- a/app/src/main/java/com/casic/br/operationsite/utils/LocaleConstant.kt
+++ b/app/src/main/java/com/casic/br/operationsite/utils/LocaleConstant.kt
@@ -32,6 +32,6 @@
const val HK_NET_USERNAME = "admin"
const val HK_NET_PASSWORD = "1234qwer"
const val WIFI_PASSWORD = "zhsz20311hw"
- const val UDP_HOST = "192.168.31.233"
+ const val UDP_HOST = "192.168.10.133"
const val UDP_PORT = 9000
}
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/br/operationsite/view/MethaneActivity.kt b/app/src/main/java/com/casic/br/operationsite/view/MethaneActivity.kt
index c0919d9..b8bb28a 100644
--- a/app/src/main/java/com/casic/br/operationsite/view/MethaneActivity.kt
+++ b/app/src/main/java/com/casic/br/operationsite/view/MethaneActivity.kt
@@ -119,6 +119,16 @@
}).build().show()
}
+ warningSwitch.setOnCheckedChangeListener { _, isChecked ->
+ if (isChecked) {
+ //开
+ udpClient.send(createOpenNoiseAndLightWarningCommand())
+ } else {
+ //关
+ udpClient.send(createStopNoiseAndLightWarningCommand())
+ }
+ }
+
configButton.setOnClickListener {
if (thresholdView.text.isNullOrBlank()) {
"阈值不能设置为空".show(this)
diff --git a/app/src/main/java/com/casic/br/operationsite/extensions/Direction.kt b/app/src/main/java/com/casic/br/operationsite/extensions/Direction.kt
index d0b247b..e71ef57 100644
--- a/app/src/main/java/com/casic/br/operationsite/extensions/Direction.kt
+++ b/app/src/main/java/com/casic/br/operationsite/extensions/Direction.kt
@@ -41,4 +41,18 @@
fun createOpenLightCommand(): ByteArray {
return byteArrayOf(0xAA.toByte(), 0x01, 0x00, 0x91.toByte(), 0x01, 0x00, 0x93.toByte())
+}
+
+/**
+ * 打开声光报警
+ * */
+fun createOpenNoiseAndLightWarningCommand(): ByteArray {
+ return byteArrayOf(0xFF.toByte())
+}
+
+/**
+ * 关闭声光报警
+ * */
+fun createStopNoiseAndLightWarningCommand(): ByteArray {
+ return byteArrayOf(0x00.toByte())
}
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/br/operationsite/utils/LocaleConstant.kt b/app/src/main/java/com/casic/br/operationsite/utils/LocaleConstant.kt
index c76f73b..d3327b5 100644
--- a/app/src/main/java/com/casic/br/operationsite/utils/LocaleConstant.kt
+++ b/app/src/main/java/com/casic/br/operationsite/utils/LocaleConstant.kt
@@ -32,6 +32,6 @@
const val HK_NET_USERNAME = "admin"
const val HK_NET_PASSWORD = "1234qwer"
const val WIFI_PASSWORD = "zhsz20311hw"
- const val UDP_HOST = "192.168.31.233"
+ const val UDP_HOST = "192.168.10.133"
const val UDP_PORT = 9000
}
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/br/operationsite/view/MethaneActivity.kt b/app/src/main/java/com/casic/br/operationsite/view/MethaneActivity.kt
index c0919d9..b8bb28a 100644
--- a/app/src/main/java/com/casic/br/operationsite/view/MethaneActivity.kt
+++ b/app/src/main/java/com/casic/br/operationsite/view/MethaneActivity.kt
@@ -119,6 +119,16 @@
}).build().show()
}
+ warningSwitch.setOnCheckedChangeListener { _, isChecked ->
+ if (isChecked) {
+ //开
+ udpClient.send(createOpenNoiseAndLightWarningCommand())
+ } else {
+ //关
+ udpClient.send(createStopNoiseAndLightWarningCommand())
+ }
+ }
+
configButton.setOnClickListener {
if (thresholdView.text.isNullOrBlank()) {
"阈值不能设置为空".show(this)
diff --git a/app/src/main/res/drawable/select_switch_background.xml b/app/src/main/res/drawable/select_switch_background.xml
new file mode 100644
index 0000000..30f4f28
--- /dev/null
+++ b/app/src/main/res/drawable/select_switch_background.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/br/operationsite/extensions/Direction.kt b/app/src/main/java/com/casic/br/operationsite/extensions/Direction.kt
index d0b247b..e71ef57 100644
--- a/app/src/main/java/com/casic/br/operationsite/extensions/Direction.kt
+++ b/app/src/main/java/com/casic/br/operationsite/extensions/Direction.kt
@@ -41,4 +41,18 @@
fun createOpenLightCommand(): ByteArray {
return byteArrayOf(0xAA.toByte(), 0x01, 0x00, 0x91.toByte(), 0x01, 0x00, 0x93.toByte())
+}
+
+/**
+ * 打开声光报警
+ * */
+fun createOpenNoiseAndLightWarningCommand(): ByteArray {
+ return byteArrayOf(0xFF.toByte())
+}
+
+/**
+ * 关闭声光报警
+ * */
+fun createStopNoiseAndLightWarningCommand(): ByteArray {
+ return byteArrayOf(0x00.toByte())
}
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/br/operationsite/utils/LocaleConstant.kt b/app/src/main/java/com/casic/br/operationsite/utils/LocaleConstant.kt
index c76f73b..d3327b5 100644
--- a/app/src/main/java/com/casic/br/operationsite/utils/LocaleConstant.kt
+++ b/app/src/main/java/com/casic/br/operationsite/utils/LocaleConstant.kt
@@ -32,6 +32,6 @@
const val HK_NET_USERNAME = "admin"
const val HK_NET_PASSWORD = "1234qwer"
const val WIFI_PASSWORD = "zhsz20311hw"
- const val UDP_HOST = "192.168.31.233"
+ const val UDP_HOST = "192.168.10.133"
const val UDP_PORT = 9000
}
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/br/operationsite/view/MethaneActivity.kt b/app/src/main/java/com/casic/br/operationsite/view/MethaneActivity.kt
index c0919d9..b8bb28a 100644
--- a/app/src/main/java/com/casic/br/operationsite/view/MethaneActivity.kt
+++ b/app/src/main/java/com/casic/br/operationsite/view/MethaneActivity.kt
@@ -119,6 +119,16 @@
}).build().show()
}
+ warningSwitch.setOnCheckedChangeListener { _, isChecked ->
+ if (isChecked) {
+ //开
+ udpClient.send(createOpenNoiseAndLightWarningCommand())
+ } else {
+ //关
+ udpClient.send(createStopNoiseAndLightWarningCommand())
+ }
+ }
+
configButton.setOnClickListener {
if (thresholdView.text.isNullOrBlank()) {
"阈值不能设置为空".show(this)
diff --git a/app/src/main/res/drawable/select_switch_background.xml b/app/src/main/res/drawable/select_switch_background.xml
new file mode 100644
index 0000000..30f4f28
--- /dev/null
+++ b/app/src/main/res/drawable/select_switch_background.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/select_switch_circle.xml b/app/src/main/res/drawable/select_switch_circle.xml
new file mode 100644
index 0000000..4e06301
--- /dev/null
+++ b/app/src/main/res/drawable/select_switch_circle.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/br/operationsite/extensions/Direction.kt b/app/src/main/java/com/casic/br/operationsite/extensions/Direction.kt
index d0b247b..e71ef57 100644
--- a/app/src/main/java/com/casic/br/operationsite/extensions/Direction.kt
+++ b/app/src/main/java/com/casic/br/operationsite/extensions/Direction.kt
@@ -41,4 +41,18 @@
fun createOpenLightCommand(): ByteArray {
return byteArrayOf(0xAA.toByte(), 0x01, 0x00, 0x91.toByte(), 0x01, 0x00, 0x93.toByte())
+}
+
+/**
+ * 打开声光报警
+ * */
+fun createOpenNoiseAndLightWarningCommand(): ByteArray {
+ return byteArrayOf(0xFF.toByte())
+}
+
+/**
+ * 关闭声光报警
+ * */
+fun createStopNoiseAndLightWarningCommand(): ByteArray {
+ return byteArrayOf(0x00.toByte())
}
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/br/operationsite/utils/LocaleConstant.kt b/app/src/main/java/com/casic/br/operationsite/utils/LocaleConstant.kt
index c76f73b..d3327b5 100644
--- a/app/src/main/java/com/casic/br/operationsite/utils/LocaleConstant.kt
+++ b/app/src/main/java/com/casic/br/operationsite/utils/LocaleConstant.kt
@@ -32,6 +32,6 @@
const val HK_NET_USERNAME = "admin"
const val HK_NET_PASSWORD = "1234qwer"
const val WIFI_PASSWORD = "zhsz20311hw"
- const val UDP_HOST = "192.168.31.233"
+ const val UDP_HOST = "192.168.10.133"
const val UDP_PORT = 9000
}
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/br/operationsite/view/MethaneActivity.kt b/app/src/main/java/com/casic/br/operationsite/view/MethaneActivity.kt
index c0919d9..b8bb28a 100644
--- a/app/src/main/java/com/casic/br/operationsite/view/MethaneActivity.kt
+++ b/app/src/main/java/com/casic/br/operationsite/view/MethaneActivity.kt
@@ -119,6 +119,16 @@
}).build().show()
}
+ warningSwitch.setOnCheckedChangeListener { _, isChecked ->
+ if (isChecked) {
+ //开
+ udpClient.send(createOpenNoiseAndLightWarningCommand())
+ } else {
+ //关
+ udpClient.send(createStopNoiseAndLightWarningCommand())
+ }
+ }
+
configButton.setOnClickListener {
if (thresholdView.text.isNullOrBlank()) {
"阈值不能设置为空".show(this)
diff --git a/app/src/main/res/drawable/select_switch_background.xml b/app/src/main/res/drawable/select_switch_background.xml
new file mode 100644
index 0000000..30f4f28
--- /dev/null
+++ b/app/src/main/res/drawable/select_switch_background.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/select_switch_circle.xml b/app/src/main/res/drawable/select_switch_circle.xml
new file mode 100644
index 0000000..4e06301
--- /dev/null
+++ b/app/src/main/res/drawable/select_switch_circle.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/switch_background_off.xml b/app/src/main/res/drawable/switch_background_off.xml
new file mode 100644
index 0000000..7a7205e
--- /dev/null
+++ b/app/src/main/res/drawable/switch_background_off.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/br/operationsite/extensions/Direction.kt b/app/src/main/java/com/casic/br/operationsite/extensions/Direction.kt
index d0b247b..e71ef57 100644
--- a/app/src/main/java/com/casic/br/operationsite/extensions/Direction.kt
+++ b/app/src/main/java/com/casic/br/operationsite/extensions/Direction.kt
@@ -41,4 +41,18 @@
fun createOpenLightCommand(): ByteArray {
return byteArrayOf(0xAA.toByte(), 0x01, 0x00, 0x91.toByte(), 0x01, 0x00, 0x93.toByte())
+}
+
+/**
+ * 打开声光报警
+ * */
+fun createOpenNoiseAndLightWarningCommand(): ByteArray {
+ return byteArrayOf(0xFF.toByte())
+}
+
+/**
+ * 关闭声光报警
+ * */
+fun createStopNoiseAndLightWarningCommand(): ByteArray {
+ return byteArrayOf(0x00.toByte())
}
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/br/operationsite/utils/LocaleConstant.kt b/app/src/main/java/com/casic/br/operationsite/utils/LocaleConstant.kt
index c76f73b..d3327b5 100644
--- a/app/src/main/java/com/casic/br/operationsite/utils/LocaleConstant.kt
+++ b/app/src/main/java/com/casic/br/operationsite/utils/LocaleConstant.kt
@@ -32,6 +32,6 @@
const val HK_NET_USERNAME = "admin"
const val HK_NET_PASSWORD = "1234qwer"
const val WIFI_PASSWORD = "zhsz20311hw"
- const val UDP_HOST = "192.168.31.233"
+ const val UDP_HOST = "192.168.10.133"
const val UDP_PORT = 9000
}
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/br/operationsite/view/MethaneActivity.kt b/app/src/main/java/com/casic/br/operationsite/view/MethaneActivity.kt
index c0919d9..b8bb28a 100644
--- a/app/src/main/java/com/casic/br/operationsite/view/MethaneActivity.kt
+++ b/app/src/main/java/com/casic/br/operationsite/view/MethaneActivity.kt
@@ -119,6 +119,16 @@
}).build().show()
}
+ warningSwitch.setOnCheckedChangeListener { _, isChecked ->
+ if (isChecked) {
+ //开
+ udpClient.send(createOpenNoiseAndLightWarningCommand())
+ } else {
+ //关
+ udpClient.send(createStopNoiseAndLightWarningCommand())
+ }
+ }
+
configButton.setOnClickListener {
if (thresholdView.text.isNullOrBlank()) {
"阈值不能设置为空".show(this)
diff --git a/app/src/main/res/drawable/select_switch_background.xml b/app/src/main/res/drawable/select_switch_background.xml
new file mode 100644
index 0000000..30f4f28
--- /dev/null
+++ b/app/src/main/res/drawable/select_switch_background.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/select_switch_circle.xml b/app/src/main/res/drawable/select_switch_circle.xml
new file mode 100644
index 0000000..4e06301
--- /dev/null
+++ b/app/src/main/res/drawable/select_switch_circle.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/switch_background_off.xml b/app/src/main/res/drawable/switch_background_off.xml
new file mode 100644
index 0000000..7a7205e
--- /dev/null
+++ b/app/src/main/res/drawable/switch_background_off.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/switch_background_on.xml b/app/src/main/res/drawable/switch_background_on.xml
new file mode 100644
index 0000000..91213fc
--- /dev/null
+++ b/app/src/main/res/drawable/switch_background_on.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/br/operationsite/extensions/Direction.kt b/app/src/main/java/com/casic/br/operationsite/extensions/Direction.kt
index d0b247b..e71ef57 100644
--- a/app/src/main/java/com/casic/br/operationsite/extensions/Direction.kt
+++ b/app/src/main/java/com/casic/br/operationsite/extensions/Direction.kt
@@ -41,4 +41,18 @@
fun createOpenLightCommand(): ByteArray {
return byteArrayOf(0xAA.toByte(), 0x01, 0x00, 0x91.toByte(), 0x01, 0x00, 0x93.toByte())
+}
+
+/**
+ * 打开声光报警
+ * */
+fun createOpenNoiseAndLightWarningCommand(): ByteArray {
+ return byteArrayOf(0xFF.toByte())
+}
+
+/**
+ * 关闭声光报警
+ * */
+fun createStopNoiseAndLightWarningCommand(): ByteArray {
+ return byteArrayOf(0x00.toByte())
}
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/br/operationsite/utils/LocaleConstant.kt b/app/src/main/java/com/casic/br/operationsite/utils/LocaleConstant.kt
index c76f73b..d3327b5 100644
--- a/app/src/main/java/com/casic/br/operationsite/utils/LocaleConstant.kt
+++ b/app/src/main/java/com/casic/br/operationsite/utils/LocaleConstant.kt
@@ -32,6 +32,6 @@
const val HK_NET_USERNAME = "admin"
const val HK_NET_PASSWORD = "1234qwer"
const val WIFI_PASSWORD = "zhsz20311hw"
- const val UDP_HOST = "192.168.31.233"
+ const val UDP_HOST = "192.168.10.133"
const val UDP_PORT = 9000
}
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/br/operationsite/view/MethaneActivity.kt b/app/src/main/java/com/casic/br/operationsite/view/MethaneActivity.kt
index c0919d9..b8bb28a 100644
--- a/app/src/main/java/com/casic/br/operationsite/view/MethaneActivity.kt
+++ b/app/src/main/java/com/casic/br/operationsite/view/MethaneActivity.kt
@@ -119,6 +119,16 @@
}).build().show()
}
+ warningSwitch.setOnCheckedChangeListener { _, isChecked ->
+ if (isChecked) {
+ //开
+ udpClient.send(createOpenNoiseAndLightWarningCommand())
+ } else {
+ //关
+ udpClient.send(createStopNoiseAndLightWarningCommand())
+ }
+ }
+
configButton.setOnClickListener {
if (thresholdView.text.isNullOrBlank()) {
"阈值不能设置为空".show(this)
diff --git a/app/src/main/res/drawable/select_switch_background.xml b/app/src/main/res/drawable/select_switch_background.xml
new file mode 100644
index 0000000..30f4f28
--- /dev/null
+++ b/app/src/main/res/drawable/select_switch_background.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/select_switch_circle.xml b/app/src/main/res/drawable/select_switch_circle.xml
new file mode 100644
index 0000000..4e06301
--- /dev/null
+++ b/app/src/main/res/drawable/select_switch_circle.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/switch_background_off.xml b/app/src/main/res/drawable/switch_background_off.xml
new file mode 100644
index 0000000..7a7205e
--- /dev/null
+++ b/app/src/main/res/drawable/switch_background_off.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/switch_background_on.xml b/app/src/main/res/drawable/switch_background_on.xml
new file mode 100644
index 0000000..91213fc
--- /dev/null
+++ b/app/src/main/res/drawable/switch_background_on.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/switch_circle_off.xml b/app/src/main/res/drawable/switch_circle_off.xml
new file mode 100644
index 0000000..e9a7924
--- /dev/null
+++ b/app/src/main/res/drawable/switch_circle_off.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/br/operationsite/extensions/Direction.kt b/app/src/main/java/com/casic/br/operationsite/extensions/Direction.kt
index d0b247b..e71ef57 100644
--- a/app/src/main/java/com/casic/br/operationsite/extensions/Direction.kt
+++ b/app/src/main/java/com/casic/br/operationsite/extensions/Direction.kt
@@ -41,4 +41,18 @@
fun createOpenLightCommand(): ByteArray {
return byteArrayOf(0xAA.toByte(), 0x01, 0x00, 0x91.toByte(), 0x01, 0x00, 0x93.toByte())
+}
+
+/**
+ * 打开声光报警
+ * */
+fun createOpenNoiseAndLightWarningCommand(): ByteArray {
+ return byteArrayOf(0xFF.toByte())
+}
+
+/**
+ * 关闭声光报警
+ * */
+fun createStopNoiseAndLightWarningCommand(): ByteArray {
+ return byteArrayOf(0x00.toByte())
}
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/br/operationsite/utils/LocaleConstant.kt b/app/src/main/java/com/casic/br/operationsite/utils/LocaleConstant.kt
index c76f73b..d3327b5 100644
--- a/app/src/main/java/com/casic/br/operationsite/utils/LocaleConstant.kt
+++ b/app/src/main/java/com/casic/br/operationsite/utils/LocaleConstant.kt
@@ -32,6 +32,6 @@
const val HK_NET_USERNAME = "admin"
const val HK_NET_PASSWORD = "1234qwer"
const val WIFI_PASSWORD = "zhsz20311hw"
- const val UDP_HOST = "192.168.31.233"
+ const val UDP_HOST = "192.168.10.133"
const val UDP_PORT = 9000
}
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/br/operationsite/view/MethaneActivity.kt b/app/src/main/java/com/casic/br/operationsite/view/MethaneActivity.kt
index c0919d9..b8bb28a 100644
--- a/app/src/main/java/com/casic/br/operationsite/view/MethaneActivity.kt
+++ b/app/src/main/java/com/casic/br/operationsite/view/MethaneActivity.kt
@@ -119,6 +119,16 @@
}).build().show()
}
+ warningSwitch.setOnCheckedChangeListener { _, isChecked ->
+ if (isChecked) {
+ //开
+ udpClient.send(createOpenNoiseAndLightWarningCommand())
+ } else {
+ //关
+ udpClient.send(createStopNoiseAndLightWarningCommand())
+ }
+ }
+
configButton.setOnClickListener {
if (thresholdView.text.isNullOrBlank()) {
"阈值不能设置为空".show(this)
diff --git a/app/src/main/res/drawable/select_switch_background.xml b/app/src/main/res/drawable/select_switch_background.xml
new file mode 100644
index 0000000..30f4f28
--- /dev/null
+++ b/app/src/main/res/drawable/select_switch_background.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/select_switch_circle.xml b/app/src/main/res/drawable/select_switch_circle.xml
new file mode 100644
index 0000000..4e06301
--- /dev/null
+++ b/app/src/main/res/drawable/select_switch_circle.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/switch_background_off.xml b/app/src/main/res/drawable/switch_background_off.xml
new file mode 100644
index 0000000..7a7205e
--- /dev/null
+++ b/app/src/main/res/drawable/switch_background_off.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/switch_background_on.xml b/app/src/main/res/drawable/switch_background_on.xml
new file mode 100644
index 0000000..91213fc
--- /dev/null
+++ b/app/src/main/res/drawable/switch_background_on.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/switch_circle_off.xml b/app/src/main/res/drawable/switch_circle_off.xml
new file mode 100644
index 0000000..e9a7924
--- /dev/null
+++ b/app/src/main/res/drawable/switch_circle_off.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/switch_circle_on.xml b/app/src/main/res/drawable/switch_circle_on.xml
new file mode 100644
index 0000000..0b4f0d5
--- /dev/null
+++ b/app/src/main/res/drawable/switch_circle_on.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/br/operationsite/extensions/Direction.kt b/app/src/main/java/com/casic/br/operationsite/extensions/Direction.kt
index d0b247b..e71ef57 100644
--- a/app/src/main/java/com/casic/br/operationsite/extensions/Direction.kt
+++ b/app/src/main/java/com/casic/br/operationsite/extensions/Direction.kt
@@ -41,4 +41,18 @@
fun createOpenLightCommand(): ByteArray {
return byteArrayOf(0xAA.toByte(), 0x01, 0x00, 0x91.toByte(), 0x01, 0x00, 0x93.toByte())
+}
+
+/**
+ * 打开声光报警
+ * */
+fun createOpenNoiseAndLightWarningCommand(): ByteArray {
+ return byteArrayOf(0xFF.toByte())
+}
+
+/**
+ * 关闭声光报警
+ * */
+fun createStopNoiseAndLightWarningCommand(): ByteArray {
+ return byteArrayOf(0x00.toByte())
}
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/br/operationsite/utils/LocaleConstant.kt b/app/src/main/java/com/casic/br/operationsite/utils/LocaleConstant.kt
index c76f73b..d3327b5 100644
--- a/app/src/main/java/com/casic/br/operationsite/utils/LocaleConstant.kt
+++ b/app/src/main/java/com/casic/br/operationsite/utils/LocaleConstant.kt
@@ -32,6 +32,6 @@
const val HK_NET_USERNAME = "admin"
const val HK_NET_PASSWORD = "1234qwer"
const val WIFI_PASSWORD = "zhsz20311hw"
- const val UDP_HOST = "192.168.31.233"
+ const val UDP_HOST = "192.168.10.133"
const val UDP_PORT = 9000
}
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/br/operationsite/view/MethaneActivity.kt b/app/src/main/java/com/casic/br/operationsite/view/MethaneActivity.kt
index c0919d9..b8bb28a 100644
--- a/app/src/main/java/com/casic/br/operationsite/view/MethaneActivity.kt
+++ b/app/src/main/java/com/casic/br/operationsite/view/MethaneActivity.kt
@@ -119,6 +119,16 @@
}).build().show()
}
+ warningSwitch.setOnCheckedChangeListener { _, isChecked ->
+ if (isChecked) {
+ //开
+ udpClient.send(createOpenNoiseAndLightWarningCommand())
+ } else {
+ //关
+ udpClient.send(createStopNoiseAndLightWarningCommand())
+ }
+ }
+
configButton.setOnClickListener {
if (thresholdView.text.isNullOrBlank()) {
"阈值不能设置为空".show(this)
diff --git a/app/src/main/res/drawable/select_switch_background.xml b/app/src/main/res/drawable/select_switch_background.xml
new file mode 100644
index 0000000..30f4f28
--- /dev/null
+++ b/app/src/main/res/drawable/select_switch_background.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/select_switch_circle.xml b/app/src/main/res/drawable/select_switch_circle.xml
new file mode 100644
index 0000000..4e06301
--- /dev/null
+++ b/app/src/main/res/drawable/select_switch_circle.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/switch_background_off.xml b/app/src/main/res/drawable/switch_background_off.xml
new file mode 100644
index 0000000..7a7205e
--- /dev/null
+++ b/app/src/main/res/drawable/switch_background_off.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/switch_background_on.xml b/app/src/main/res/drawable/switch_background_on.xml
new file mode 100644
index 0000000..91213fc
--- /dev/null
+++ b/app/src/main/res/drawable/switch_background_on.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/switch_circle_off.xml b/app/src/main/res/drawable/switch_circle_off.xml
new file mode 100644
index 0000000..e9a7924
--- /dev/null
+++ b/app/src/main/res/drawable/switch_circle_off.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/switch_circle_on.xml b/app/src/main/res/drawable/switch_circle_on.xml
new file mode 100644
index 0000000..0b4f0d5
--- /dev/null
+++ b/app/src/main/res/drawable/switch_circle_on.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_hikvision.xml b/app/src/main/res/layout/activity_hikvision.xml
index e350a9e..c53c6fe 100644
--- a/app/src/main/res/layout/activity_hikvision.xml
+++ b/app/src/main/res/layout/activity_hikvision.xml
@@ -100,7 +100,7 @@
android:layout_height="@dimen/titleViewHeight"
android:gravity="center_vertical"
android:paddingHorizontal="@dimen/dp_7"
- android:text="云台控制"
+ android:text="摄像头控制"
android:textColor="@color/mainTextColor"
android:textSize="@dimen/sp_16" />
diff --git a/app/src/main/java/com/casic/br/operationsite/extensions/Direction.kt b/app/src/main/java/com/casic/br/operationsite/extensions/Direction.kt
index d0b247b..e71ef57 100644
--- a/app/src/main/java/com/casic/br/operationsite/extensions/Direction.kt
+++ b/app/src/main/java/com/casic/br/operationsite/extensions/Direction.kt
@@ -41,4 +41,18 @@
fun createOpenLightCommand(): ByteArray {
return byteArrayOf(0xAA.toByte(), 0x01, 0x00, 0x91.toByte(), 0x01, 0x00, 0x93.toByte())
+}
+
+/**
+ * 打开声光报警
+ * */
+fun createOpenNoiseAndLightWarningCommand(): ByteArray {
+ return byteArrayOf(0xFF.toByte())
+}
+
+/**
+ * 关闭声光报警
+ * */
+fun createStopNoiseAndLightWarningCommand(): ByteArray {
+ return byteArrayOf(0x00.toByte())
}
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/br/operationsite/utils/LocaleConstant.kt b/app/src/main/java/com/casic/br/operationsite/utils/LocaleConstant.kt
index c76f73b..d3327b5 100644
--- a/app/src/main/java/com/casic/br/operationsite/utils/LocaleConstant.kt
+++ b/app/src/main/java/com/casic/br/operationsite/utils/LocaleConstant.kt
@@ -32,6 +32,6 @@
const val HK_NET_USERNAME = "admin"
const val HK_NET_PASSWORD = "1234qwer"
const val WIFI_PASSWORD = "zhsz20311hw"
- const val UDP_HOST = "192.168.31.233"
+ const val UDP_HOST = "192.168.10.133"
const val UDP_PORT = 9000
}
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/br/operationsite/view/MethaneActivity.kt b/app/src/main/java/com/casic/br/operationsite/view/MethaneActivity.kt
index c0919d9..b8bb28a 100644
--- a/app/src/main/java/com/casic/br/operationsite/view/MethaneActivity.kt
+++ b/app/src/main/java/com/casic/br/operationsite/view/MethaneActivity.kt
@@ -119,6 +119,16 @@
}).build().show()
}
+ warningSwitch.setOnCheckedChangeListener { _, isChecked ->
+ if (isChecked) {
+ //开
+ udpClient.send(createOpenNoiseAndLightWarningCommand())
+ } else {
+ //关
+ udpClient.send(createStopNoiseAndLightWarningCommand())
+ }
+ }
+
configButton.setOnClickListener {
if (thresholdView.text.isNullOrBlank()) {
"阈值不能设置为空".show(this)
diff --git a/app/src/main/res/drawable/select_switch_background.xml b/app/src/main/res/drawable/select_switch_background.xml
new file mode 100644
index 0000000..30f4f28
--- /dev/null
+++ b/app/src/main/res/drawable/select_switch_background.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/select_switch_circle.xml b/app/src/main/res/drawable/select_switch_circle.xml
new file mode 100644
index 0000000..4e06301
--- /dev/null
+++ b/app/src/main/res/drawable/select_switch_circle.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/switch_background_off.xml b/app/src/main/res/drawable/switch_background_off.xml
new file mode 100644
index 0000000..7a7205e
--- /dev/null
+++ b/app/src/main/res/drawable/switch_background_off.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/switch_background_on.xml b/app/src/main/res/drawable/switch_background_on.xml
new file mode 100644
index 0000000..91213fc
--- /dev/null
+++ b/app/src/main/res/drawable/switch_background_on.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/switch_circle_off.xml b/app/src/main/res/drawable/switch_circle_off.xml
new file mode 100644
index 0000000..e9a7924
--- /dev/null
+++ b/app/src/main/res/drawable/switch_circle_off.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/switch_circle_on.xml b/app/src/main/res/drawable/switch_circle_on.xml
new file mode 100644
index 0000000..0b4f0d5
--- /dev/null
+++ b/app/src/main/res/drawable/switch_circle_on.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_hikvision.xml b/app/src/main/res/layout/activity_hikvision.xml
index e350a9e..c53c6fe 100644
--- a/app/src/main/res/layout/activity_hikvision.xml
+++ b/app/src/main/res/layout/activity_hikvision.xml
@@ -100,7 +100,7 @@
android:layout_height="@dimen/titleViewHeight"
android:gravity="center_vertical"
android:paddingHorizontal="@dimen/dp_7"
- android:text="云台控制"
+ android:text="摄像头控制"
android:textColor="@color/mainTextColor"
android:textSize="@dimen/sp_16" />
diff --git a/app/src/main/res/layout/activity_methane.xml b/app/src/main/res/layout/activity_methane.xml
index ee17a35..9d1ad57 100644
--- a/app/src/main/res/layout/activity_methane.xml
+++ b/app/src/main/res/layout/activity_methane.xml
@@ -1,6 +1,7 @@
-
+
+
+
+
+
+
+
diff --git a/app/src/main/java/com/casic/br/operationsite/extensions/Direction.kt b/app/src/main/java/com/casic/br/operationsite/extensions/Direction.kt
index d0b247b..e71ef57 100644
--- a/app/src/main/java/com/casic/br/operationsite/extensions/Direction.kt
+++ b/app/src/main/java/com/casic/br/operationsite/extensions/Direction.kt
@@ -41,4 +41,18 @@
fun createOpenLightCommand(): ByteArray {
return byteArrayOf(0xAA.toByte(), 0x01, 0x00, 0x91.toByte(), 0x01, 0x00, 0x93.toByte())
+}
+
+/**
+ * 打开声光报警
+ * */
+fun createOpenNoiseAndLightWarningCommand(): ByteArray {
+ return byteArrayOf(0xFF.toByte())
+}
+
+/**
+ * 关闭声光报警
+ * */
+fun createStopNoiseAndLightWarningCommand(): ByteArray {
+ return byteArrayOf(0x00.toByte())
}
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/br/operationsite/utils/LocaleConstant.kt b/app/src/main/java/com/casic/br/operationsite/utils/LocaleConstant.kt
index c76f73b..d3327b5 100644
--- a/app/src/main/java/com/casic/br/operationsite/utils/LocaleConstant.kt
+++ b/app/src/main/java/com/casic/br/operationsite/utils/LocaleConstant.kt
@@ -32,6 +32,6 @@
const val HK_NET_USERNAME = "admin"
const val HK_NET_PASSWORD = "1234qwer"
const val WIFI_PASSWORD = "zhsz20311hw"
- const val UDP_HOST = "192.168.31.233"
+ const val UDP_HOST = "192.168.10.133"
const val UDP_PORT = 9000
}
\ No newline at end of file
diff --git a/app/src/main/java/com/casic/br/operationsite/view/MethaneActivity.kt b/app/src/main/java/com/casic/br/operationsite/view/MethaneActivity.kt
index c0919d9..b8bb28a 100644
--- a/app/src/main/java/com/casic/br/operationsite/view/MethaneActivity.kt
+++ b/app/src/main/java/com/casic/br/operationsite/view/MethaneActivity.kt
@@ -119,6 +119,16 @@
}).build().show()
}
+ warningSwitch.setOnCheckedChangeListener { _, isChecked ->
+ if (isChecked) {
+ //开
+ udpClient.send(createOpenNoiseAndLightWarningCommand())
+ } else {
+ //关
+ udpClient.send(createStopNoiseAndLightWarningCommand())
+ }
+ }
+
configButton.setOnClickListener {
if (thresholdView.text.isNullOrBlank()) {
"阈值不能设置为空".show(this)
diff --git a/app/src/main/res/drawable/select_switch_background.xml b/app/src/main/res/drawable/select_switch_background.xml
new file mode 100644
index 0000000..30f4f28
--- /dev/null
+++ b/app/src/main/res/drawable/select_switch_background.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/select_switch_circle.xml b/app/src/main/res/drawable/select_switch_circle.xml
new file mode 100644
index 0000000..4e06301
--- /dev/null
+++ b/app/src/main/res/drawable/select_switch_circle.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/switch_background_off.xml b/app/src/main/res/drawable/switch_background_off.xml
new file mode 100644
index 0000000..7a7205e
--- /dev/null
+++ b/app/src/main/res/drawable/switch_background_off.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/switch_background_on.xml b/app/src/main/res/drawable/switch_background_on.xml
new file mode 100644
index 0000000..91213fc
--- /dev/null
+++ b/app/src/main/res/drawable/switch_background_on.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/switch_circle_off.xml b/app/src/main/res/drawable/switch_circle_off.xml
new file mode 100644
index 0000000..e9a7924
--- /dev/null
+++ b/app/src/main/res/drawable/switch_circle_off.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/switch_circle_on.xml b/app/src/main/res/drawable/switch_circle_on.xml
new file mode 100644
index 0000000..0b4f0d5
--- /dev/null
+++ b/app/src/main/res/drawable/switch_circle_on.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_hikvision.xml b/app/src/main/res/layout/activity_hikvision.xml
index e350a9e..c53c6fe 100644
--- a/app/src/main/res/layout/activity_hikvision.xml
+++ b/app/src/main/res/layout/activity_hikvision.xml
@@ -100,7 +100,7 @@
android:layout_height="@dimen/titleViewHeight"
android:gravity="center_vertical"
android:paddingHorizontal="@dimen/dp_7"
- android:text="云台控制"
+ android:text="摄像头控制"
android:textColor="@color/mainTextColor"
android:textSize="@dimen/sp_16" />
diff --git a/app/src/main/res/layout/activity_methane.xml b/app/src/main/res/layout/activity_methane.xml
index ee17a35..9d1ad57 100644
--- a/app/src/main/res/layout/activity_methane.xml
+++ b/app/src/main/res/layout/activity_methane.xml
@@ -1,6 +1,7 @@
-
+
+
+
+
+
+
+
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
index 338552f..8ac8aa7 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -121,6 +121,14 @@
- @dimen/sp_12
+
+