Commit 09291f32 authored by p x's avatar p x
Browse files

集成一部分51

parent dcb7c2a6
......@@ -514,7 +514,7 @@ class MainVm @Inject constructor(
}
/**
* 网车辆状态数据
* 网车辆状态
* */
fun subVehicleStatus(): LiveData<VehicleStats> {
try {
......@@ -654,8 +654,8 @@ class MainVm @Inject constructor(
override fun onMsg(str: String) {
viewModelScope.launch {
FileIoUtils.writeToFile(str, "traff_light.txt")
// var bean = gson.fromJson(str, TrafficPerBean::class.java)
// trafficPerBean.postValue(bean)
var bean = gson.fromJson(str, TrafficLightBean::class.java)
trafficLightBean.postValue(bean)
}
}
}
......
......@@ -26,7 +26,7 @@ class PreDelayWSClient : WebSocketClient {
}
override fun onMessage(message: String?) {
println(TAG + " : " + message)
// println(TAG + " : " + message)
if (message.isNullOrEmpty())
return
onDataCb?.onMsg(message)
......
......@@ -24,11 +24,11 @@ class TrafficLightWSClient : WebSocketClient {
override fun onOpen(handshakedata: ServerHandshake?) {
// send("Hello, it is me. Mario :)")
System.out.println(TAG + " new connection opened")
// System.out.println(TAG + " new connection opened")
}
override fun onMessage(message: String?) {
println(TAG + " : " + message)
// println(TAG + " : " + message)
if (message.isNullOrEmpty())
return
onDataCb?.onMsg(message)
......
......@@ -24,11 +24,11 @@ class TrafficPreWSClient : WebSocketClient {
override fun onOpen(handshakedata: ServerHandshake?) {
// send("Hello, it is me. Mario :)")
System.out.println(TAG + " new connection opened")
// System.out.println(TAG + " new connection opened")
}
override fun onMessage(message: String?) {
println(TAG + " : " + message)
// println(TAG + " : " + message)
if (message.isNullOrEmpty())
return
onDataCb?.onMsg(message)
......
......@@ -26,7 +26,7 @@ class V2xWSClient : WebSocketClient {
}
override fun onMessage(message: String?) {
println(TAG + " : " + message)
// println(TAG + " : " + message)
if (message.isNullOrEmpty())
return
onDataCb?.onMsg(message)
......
......@@ -29,7 +29,7 @@ class VecLocWSClient : WebSocketClient {
}
override fun onMessage(message: String?) {
System.out.println(TAG + " : " + message);
// System.out.println(TAG + " : " + message)
if (message.isNullOrEmpty())
return
onDataCb?.onMsg(message)
......
......@@ -8,6 +8,7 @@ import java.nio.ByteBuffer
/*****网联车辆状态
* 只有发生变化的数据才推送
* 只用管(在线和离线状态即可)
* **/
class VehStatuWSClient : WebSocketClient {
......
......@@ -55,7 +55,7 @@
android:id="@+id/bt_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="网车辆状态" />
android:text="网车辆状态" />
<Button
android:id="@+id/bt_target"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment