Commit c0af16dd authored by p x's avatar p x
Browse files

first

parent 0b4d4d4e
Pipeline #3217 failed with stages
in 0 seconds
package com.sd.cavphmi.base
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import com.sd.cavphmi.net.NetLoadStatus
open class MyBaseViewModel : ViewModel() {
var totalPage = 1
var pages = 1
var limit = 20
var loadStatu = MutableLiveData<NetLoadStatus>()
var owner: LifecycleOwner? = null
}
package com.sd.cavphmi.base
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import com.sd.cavphmi.net.NetLoadStatus
open class OtherBaseViewModel : ViewModel() {
var totalPage = 1
var pages = 1
var limit = 20
var loadStatu = MutableLiveData<NetLoadStatus>()
}
package com.sd.cavphmi.bean
/**
* Avp 状态信息
* {"haulingNo":"PARK-202511263","vin":"LU123456789011111","spaceId":"1594179823000223754","space":{"id":1594179823000223754,"createdAt":1693016363,"updatedAt":1764137952156,"name":"B002","code":"1567","state":"OCCUPY","spaceType":"PARK","surface":"[[116.502672641583686,39.808717348607381],[116.502656697557583,39.808737040046204],[116.502719621229957,39.808767724154123],[116.502735514232526,39.808748008315952],[116.502672641583686,39.808717348607381]]","entranceLongitude":116.50274476891985,"entranceLatitude":39.808767558388645,"centerLongitude":120.7066859236955,"centerLatitude":31.324335727750118,"elevation":null,"occupyTime":"2025-11-26T06:19:12.139Z","occupySource":"LOCK","placeId":1,"line":null},"haulingStageState":"TRANSPORT_PROGRESS","businessType":"Park","vehicleContext":{"vin":"LU123456789011111","vehicleBusinessType":null,"online":true,"vehicleBasic":{"id":27,"deviceId":"0102072022380026","vehicleLength":null,"vehicleWidth":null,"maxSpeed":null,"minTurnRadius":null},"vehicleDynamic":{"speed":0.006823937919616057,"accSpeed":9.98458292271517,"longitude":116.502475,"latitude":39.809097,"elevation":23.00799999999981,"heading":148.6669921875,"drivingMode":"MANUAL","gearType":"PARK","power":null,"doorStatus":"1111111","light":null,"wiper":null},"perceptionContext":null},"drivenDecision":{"startPoint":{"id":"8b437b15-eb41-45d5-a1e4-d086dd5e62fd","longitude":116.502475,"latitude":39.809097,"altitude":23.00799999999981,"heading":148.6669921875,"targetSpeed":0.0,"acceleration":0.0,"timestamp":0.0,"curvature":0.0,"curvatureRate":0.0,"area":null,"longitudinalAcce":null,"longitudinalDis":null,"longitudinalSpeed":null,"transverseAcce":null,"transverseDis":null,"transverseSpeed":null,"verticalAcce":null},"endPoint":{"id":"1567","longitude":116.50274476891985,"latitude":39.808767558388645,"altitude":0.0,"heading":0.0,"targetSpeed":0.0,"acceleration":0.0,"timestamp":0.0,"curvature":0.0,"curvatureRate":0.0,"area":null,"longitudinalAcce":null,"longitudinalDis":null,"longitudinalSpeed":null,"transverseAcce":null,"transverseDis":null,"transverseSpeed":null,"verticalAcce":null},"trajectory":{"arrived":false,"startPoint":{"id":null,"longitude":0.0,"latitude":0.0,"altitude":0.0,"heading":0.0,"targetSpeed":0.0,"acceleration":0.0,"timestamp":0.0,"curvature":0.0,"curvatureRate":0.0,"area":null,"longitudinalAcce":null,"longitudinalDis":null,"longitudinalSpeed":null,"transverseAcce":null,"transverseDis":null,"transverseSpeed":null,"verticalAcce":null},"endPoint":{"id":null,"longitude":116.50274476891985,"latitude":39.808767558388645,"altitude":0.0,"heading":0.0,"targetSpeed":0.0,"acceleration":0.0,"timestamp":0.0,"curvature":0.0,"curvatureRate":0.0,"area":null,"longitudinalAcce":null,"longitudinalDis":null,"longitudinalSpeed":null,"transverseAcce":null,"transverseDis":null,"transverseSpeed":null,"verticalAcce":null},"points":[{"id":null,"longitude":116.50248899270137,"latitude":39.80910810251742,"altitude":0.0,"heading":0.0,"targetSpeed":0.0,"acceleration":0.0,"timestamp":0.0,"curvature":0.0,"curvatureRate":0.0,"area":null,"longitudinalAcce":null,"longitudinalDis":null,"longitudinalSpeed":null,"transverseAcce":null,"transverseDis":null,"transverseSpeed":null,"verticalAcce":null},{"id":null,"longitude":116.50250735122155,"latitude":39.80908496494593,"altitude":0.0,"heading":0.0,"targetSpeed":0.0,"acceleration":0.0,"timestamp":0.0,"curvature":0.0,"curvatureRate":0.0,"area":null,"longitudinalAcce":null,"longitudinalDis":null,"longitudinalSpeed":null,"transverseAcce":null,"transverseDis":null,"transverseSpeed":null,"verticalAcce":null},{"id":null,"longitude":116.50275529593338,"latitude":39.808776006506584,"altitude":0.0,"heading":0.0,"targetSpeed":0.0,"acceleration":0.0,"timestamp":0.0,"curvature":0.0,"curvatureRate":0.0,"area":null,"longitudinalAcce":null,"longitudinalDis":null,"longitudinalSpeed":null,"transverseAcce":null,"transverseDis":null,"transverseSpeed":null,"verticalAcce":null}],"pathLine":"1471_0.0000_-1,1457_0.0000_-1,1432_0.0000_-1,1348_0.0000_1,1450_0.0000_-1,1456_0.0000_-1,1487_0.0000_-1,1457_0.0000_1","pathArray":null,"length":56.522754903940324,"time":40},"routing":null,"progress":null},"exceptionCode":null,"exceptionMessage":null}
*
*/
data class AvpStatuBean(
val businessType: String,
val drivenDecision: DrivenDecision,
// val exceptionCode: Any,
// val exceptionMessage: Any,
val haulingNo: String,
val haulingStageState: String,
val space: Space,
val spaceId: String,
val vehicleContext: VehicleContext,
val vin: String
)
data class DrivenDecision(
val endPoint: EndPoint,//终点
// val progress: Any,
// val routing: Any,
val startPoint: StartPoint,//起点
val trajectory: Trajectory //// 全局路径
)
//车位信息
data class Space(
val centerLatitude: Double,
val centerLongitude: Double,
val code: String,
// val createdAt: Long,
// val elevation: Any,
val entranceLatitude: Double,
val entranceLongitude: Double,
val id: Long,
// val line: Any,
val name: String,
// val occupySource: String,
// val occupyTime: String,
val placeId: Int,
val spaceType: String,
val state: String,
val surface: String,
val updatedAt: Long
)
data class VehicleContext(
val online: Boolean,
// val perceptionContext: Any,
val vehicleBasic: VehicleBasic,
val vehicleBusinessType: String,
val vehicleDynamic: VehicleDynamic,
val vin: String
)
data class EndPoint(
val acceleration: Double,
val altitude: Double,
val area: Any,
val curvature: Double,
val curvatureRate: Double,
val heading: Double,
val id: String,
val latitude: Double,
val longitude: Double,
val longitudinalAcce: Any,
val longitudinalDis: Any,
val longitudinalSpeed: Any,
val targetSpeed: Double,
val timestamp: Double,
val transverseAcce: Any,
val transverseDis: Any,
val transverseSpeed: Any,
val verticalAcce: Any
)
data class StartPoint(
val acceleration: Double,
val altitude: Double,
val area: Any,
val curvature: Double,
val curvatureRate: Double,
val heading: Double,
val id: String,
val latitude: Double,
val longitude: Double,
val longitudinalAcce: Any,
val longitudinalDis: Any,
val longitudinalSpeed: Any,
val targetSpeed: Double,
val timestamp: Double,
val transverseAcce: Any,
val transverseDis: Any,
val transverseSpeed: Any,
val verticalAcce: Any
)
// 全局路径
data class Trajectory(
val arrived: Boolean,
val endPoint: EndPointX,
val length: Double,
val pathArray: Any,
val pathLine: String,
val points: List<Point>,// 全局路径 02坐标系
val startPoint: StartPointX,
val time: Int
)
data class EndPointX(
val acceleration: Double,
val altitude: Double,
val area: Any,
val curvature: Double,
val curvatureRate: Double,
val heading: Double,
val id: Any,
val latitude: Double,
val longitude: Double,
val longitudinalAcce: Any,
val longitudinalDis: Any,
val longitudinalSpeed: Any,
val targetSpeed: Double,
val timestamp: Double,
val transverseAcce: Any,
val transverseDis: Any,
val transverseSpeed: Any,
val verticalAcce: Any
)
data class Point(
val acceleration: Double,
val altitude: Double,
val area: Any,
val curvature: Double,
val curvatureRate: Double,
val heading: Double,
val id: Any,
val latitude: Double,
val longitude: Double,
val longitudinalAcce: Any,
val longitudinalDis: Any,
val longitudinalSpeed: Any,
val targetSpeed: Double,
val timestamp: Double,
val transverseAcce: Any,
val transverseDis: Any,
val transverseSpeed: Any,
val verticalAcce: Any
)
data class StartPointX(
val acceleration: Double,
val altitude: Double,
val area: Any,
val curvature: Double,
val curvatureRate: Double,
val heading: Double,
val id: Any,
val latitude: Double,
val longitude: Double,
val longitudinalAcce: Any,
val longitudinalDis: Any,
val longitudinalSpeed: Any,
val targetSpeed: Double,
val timestamp: Double,
val transverseAcce: Any,
val transverseDis: Any,
val transverseSpeed: Any,
val verticalAcce: Any
)
data class VehicleBasic(
val deviceId: String,
val id: Int,
val maxSpeed: Any,
val minTurnRadius: Any,
val vehicleLength: Any,
val vehicleWidth: Any
)
data class VehicleDynamic(
val accSpeed: Double,
val doorStatus: String,
val drivingMode: String,
val elevation: Double,
val gearType: String,
val heading: Double,
val latitude: Double,
val light: Any,
val longitude: Double,
val power: Any,
val speed: Double,
val wiper: Any
)
\ No newline at end of file
package com.sd.cavphmi.bean
/**可绑定车辆
* */
//{"code":1,"msg":"操作成功","result":[{"id":1,"vin":"LU123456789011111","plateNumber":"皖BDJ1106","vehicleBusinessType":"INNER","lastLongitude":null,"lastLatitude":null,"vehicleCode":"XSZN2-SV-0025","placeId":1}],"success":true}
data class BindCarBean(
val code: Int,
val msg: String,
val result: List<BindResult>,
val success: Boolean
)
data class BindResult(
val id: Int,
val lastLatitude: Any,
val lastLongitude: Any,
val placeId: Int,
val plateNumber: String,
val vehicleBusinessType: String,
val vehicleCode: String,
val vin: String
)
\ No newline at end of file
package com.sd.cavphmi.bean
//合并车辆位姿和AVP状态
class CarAndStatu private constructor(){
companion object {
private var instance: CarAndStatu? = null
fun getInstance(): CarAndStatu {
if (instance == null) {
instance = CarAndStatu()
}
return instance!!
}
}
var carVehicle: CarVehicle? = null
var avpStatuBean: AvpStatuBean? = null
}
\ No newline at end of file
package com.sd.cavphmi.bean
import androidx.annotation.IntDef
import androidx.databinding.ObservableField
// 使用@IntDef注解这些常量
@IntDef(GearStatus.P, GearStatus.R, GearStatus.N, GearStatus.D)
@Retention(AnnotationRetention.SOURCE)
annotation class GearStatus {
companion object {
// 定义状态常量
const val P = 33
const val R = 32
const val N = 34
const val D = 31
}
}
/**
* 车辆仪表
* */
class CarPanelBean {
companion object {
val instance: CarPanelBean by lazy { CarPanelBean() }
}
/***CAN 总线数据中的行驶速度,单位:0.01m/s,0xFFFF 表 示缺省***/
var speed = ObservableField(0)
/***档位**/
var tapPos = ObservableField<Int>(7)
// var gear = ObservableField<Int>()
//剩余电量
var remainSoc = ObservableField<Int>(0)
//转向灯 1=left 2=right
var lights = 0
var driveMode = ObservableField("")
//航向角0.。360
var heading = ObservableField<Int>(0)
}
\ No newline at end of file
package com.sd.cavphmi.bean
/***网联车辆位姿
* {
* "data": {
* "businessStatus": "DRIVING",
* "spaceName": "B075",
* "vehiclePos": [
* 116.50268,
* 39.808735,
* 59.688720703125
* ],
* "routing": [
*
* ],
* "progress": null
* }
* }
* **/
//data class CarVehicle(
// val data: VehData
//)
class CarVehicle {
val businessStatus: String = ""
// val progress: Any = ""
// val routing: List<Any>? = null
val spaceName: String = ""
//vehiclePos 里面分别是 经度、纬度、航向角
var vehiclePos: List<Double>? = null
}
\ No newline at end of file
package com.sd.cavphmi.bean
/***登录成功返回
* {
* "code": 1,
* "msg": "操作成功",
* "result": {
* "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiJjNzNkNzA4M2I1YjU0OWI0OTBiZWZlMGEyMmVlM2I3OSIsImNyZWF0ZVRpbWUiOjE3NjMxMDg5MzUyMzQsInVzZXJUeXBlIjoxLCJzb3VyY2UiOjAsInB3ZEV4cGlyZWQiOmZhbHNlLCJ1c2VybmFtZSI6ImhtaSJ9.0GJtC7YaduYUHpknLTpvRd4f4876uygPWKgioMvwRtM",
* "username": "HMI",
* "loginTime": 1763108935236,
* "expire": 1440,
* "returnUri": null,
* "pwdExpiredFlag": false
* },
* "success": true
* }
* **/
data class LoginSuccBean(
val code: Int,
val msg: String,
val result: LoginResult,
val success: Boolean
)
data class LoginResult(
val expire: Int,
val loginTime: Long,
val pwdExpiredFlag: Boolean,
val returnUri: Any,
val token: String,
val username: String
)
\ No newline at end of file
package com.sd.cavphmi.bean
/**开始泊车,获取路径规划
* {"vehiclePlate":"吉AC242"}
* {"data":{"line":[[125.14359435375829,43.83877834786253],[125.14342925781992,43.83870671502458]],"linkingLine":"118_0.00_-1","spaceCode":"1D-004","taskId":"1937759817639038977","vehicleId":"1700381241280815105","vehicleInfoId":"1694264612474306561","vehiclePlate":"吉AC242"}}
* **/
data class ParkLinePlan(
val line: List<List<Double>>,
val linkingLine: String,
val spaceCode: String,
val taskId: String,
val vehicleId: String,
val vehicleInfoId: String,
val vehiclePlate: String
)
\ No newline at end of file
package com.sd.cavphmi.bean
/**
* websocket解析目标感知物的接受数据
*
**/
class PerceptionBean : ArrayList<PerceptionBeanItem>()
data class PerceptionBeanItem(
val accessTime: Long,
val deviceId: String,
val participants: List<Participant>,
val receiveTime: Long,
val reportTime: Long,
// val statistic: Statistic
)
data class Participant(
val color: Int,
val gear: Int,
val heading: Double,
val latitude: Double,
val longitude: Double,
val ptcId: String,
val ptcType: String,//
val speed: Double
)
data class Statistic(
val ambulance: Int,
val bike: Int,
val bus: Int,
val car: Int,
val coach: Int,
val concrete_mixer: Int,
val conical_barrel: Int,
val electric_bicycle: Int,
val engine_emergency: Int,
val fire_truck: Int,
val heavy_truck: Int,
val large_truck: Int,
val micro_truck: Int,
val midibus: Int,
val minibus: Int,
val motorcycle: Int,
val mpv: Int,
val pedestrian: Int,
val pickup: Int,
val police_car: Int,
val small_truck: Int,
val spillage: Int,
val suv: Int,
val tank_truck: Int,
val tricycle: Int,
val truck: Int,
val unknown: Int
)
\ No newline at end of file
package com.sd.cavphmi.bean
/***
* 向websocket 订阅数据
* **/
class ReqBean {
val msgType = 2
var data = ""
}
\ No newline at end of file
package com.sd.cavphmi.bean
//class SpaceDataLocBean : ArrayList<SpaceDataLocBeanItem>()
/***本地停车场***/
data class SpaceDataLocBeanItem(
val center: List<Double>,
val controlPoint: List<Double>,
val coordinates: List<List<Double>>,
val heading: Int,
val spaceCode: String,
val type: String
)
\ No newline at end of file
package com.sd.cavphmi.bean
/**
* 车位占用情况
* {"code":1,"msg":"操作成功","result":[{"id":307,"code":"B007","locationName":"B007","distance":null,"longitude":null,"latitude":null,"surface":"[[116.49722581116599,39.73156217155182],[116.497239837239803,39.731542530956666],[116.497186225555666,39.731520254990194],[116.497172199475997,39.73153989558011],[116.49722581116599,39.73156217155182]]","state":"FREE","placeId":3}]}
*/
data class SpaceInfoBean(
val code: Int,
val msg: String,
val result: List<Result>
)
data class Result(
val code: String,
val distance: Any,
val id: Int,
val latitude: Any,
val locationName: String,
val longitude: Any,
val placeId: Int,
val state: String,
val surface: String
)
\ No newline at end of file
package com.sd.cavphmi.bean
class SpaceNoBean {
}
\ No newline at end of file
package com.sd.cavphmi.bean
/**V2x 预警开始
* {"id":"39846582477537280","objects":[{"id":"267","name":"Vehicle","longitude":117.3461065,"latitude":38.9985969,"elevation":500.0},{"id":"1600009","name":"Participants","longitude":117.3463289,"latitude":38.9986373,"elevation":500.0}],"type":1,"typeName":"前向碰撞预警","level":1,"startTime":1755582898300,"reportTime":1755582898300}
* ***/
class V2xStartBean {
var id: String = ""
var level: Int = 1
var objects: List<VObject>? = null
var reportTime: Long = 0L
var startTime: Long = 0L
var type: Int = -1
var typeName: String = ""
}
//第一个是自己的车 第二个是预警车
data class VObject(
var elevation: Double,
var id: String,
var latitude: Double,
var longitude: Double,
var name: String
)
\ No newline at end of file
package com.sd.cavphmi.bean
import com.sd.cavphmi.R
object VToXImgBean {
var imgs = mapOf(
"1" to R.drawable.abnormal,
"2" to R.drawable.admission,
"3" to R.drawable.advance,
"4" to R.drawable.change_lanes,
"5" to R.drawable.intersection,
"6" to R.drawable.weak,
)
}
\ No newline at end of file
package com.sd.cavphmi.bean
/**车辆详情**/
data class VehDetailBean(
val code: Int,
val msg: String,
val result: VResult,
val success: Boolean
)
data class VResult(
val offlineCount: Int,
val onlineCount: Int,
val vehicleInfos: List<VehicleInfo>
)
data class VehicleInfo(
val online: Boolean,
val plateNumber: String,
val vehicleCode: String,
val vehicleId: Long,
val vehicleImgUrl: Any,
val vehicleOwnerName: Any,
val vehicleOwnerPhone: Any,
val vehicleVideoUrl: String//车内视频
)
\ No newline at end of file
package com.sd.cavphmi.bean
/**
*
* 联网车辆状态数据 (只有发生变化的数据才推送)
* {"vehicleStatistics":{"total":0,"minibus":0,"bus":0,"sweeper":0,"selling":3,"taxi":0,"brt":0,"patrol":0},"vehicleStatusList":[{"id":"263","type":"selling","status":0,"driveMode":1},{"id":"265","type":"selling","status":0,"driveMode":1},{"id":"267","type":"selling","status":0,"driveMode":1}]}
* **/
data class VehicleStats(
val vehicleStatistics: VehicleStatistics,
val vehicleStatusList: List<VehicleStatus>
)
data class VehicleStatistics(
val brt: Int,
val bus: Int,
val minibus: Int, //小巴车在线数量
val patrol: Int,
val selling: Int,
val sweeper: Int,
val taxi: Int,
val total: Int//总的在线数量
)
// 状态变化的车辆,对象型数组
data class VehicleStatus(
val driveMode: Int,
val id: String,
val status: Int, // 必填,int 类型,车辆状态编码:0-离线、1-在线
val type: String // 选填,字符串类型,车辆类型
)
\ No newline at end of file
package com.sd.cavphmi.bean
import com.sd.cavphmi.R
/**构造预警的文字和图标**/
class WarningBean {
// var type = -1
var img = R.drawable.chao_su
//提示文字
var tipStr = ""
companion object {
val instance: WarningBean by lazy { WarningBean() }
}
}
package com.sd.cavphmi.bean
object WebSetBean {
var subDic = mapOf(
"/topic/vehicle" to "/avp/api/VL961/vehicle/1694264612474306561",//车辆位姿数据
"/topic/dataMerge" to "/avp/api/VL961/dataMerge",//感知目标物
"/topic/signal" to "/avp/api/VL961/signal",
"/topic/v2xStart" to "/avp/api/VL961/v2xStart",//v2x预警开始
"/topic/v2xEnd" to "/avp/api/VL961/v2xEnd",//v2x预警结束
"/topic/vehicleStatus" to "/avp/api/VL961/vehicleStatus",//联网车辆数据
"/topic/timeDelay" to "/avp/api/VL961/timeDelay",
"/topic/points" to "/avp/api/VL961/points",//停车位变更
"/topic/linePlaning" to "/avp/api/VL961/linePlaning",//全局路径发生切换
"/topic/partLine" to "/avp/api/VL961/partLine",// // 局部路径
"/topic/rsiEvent" to "/avp/api/VL961/rsiEvent",// rsi事件
"/topic/parkingLockStatusChange" to "/topic/parkingLockStatusChange",// 地锁
)
//socket 回调
var dic = mapOf(
"/topic/vehicle" to 5231,
"/topic/dataMerge" to 5232,
"topic/signa" to 5233,
"/topic/v2xStart" to 5234,
"/topic/v2xEnd" to 5235,
"/topic/vehicleStatus" to 5236,
"/topic/timeDelay" to 5237,
"/topic/point" to 1,
"/topic/linePlaning" to 52310,
"/topic/rsiEvent" to 52311,
"/topic/partLine" to 52312,
)
// 5231: { action: setting.webSocket.dic["/topic/vehicle"] },
// 5232: { action: setting.webSocket.dic["/topic/dataMerge"] },
// 5233: { action: setting.webSocket.dic["/topic/signal"] },
// 5234: { action: setting.webSocket.dic["/topic/v2xStart"] },
// 5235: { action: setting.webSocket.dic["/topic/v2xEnd"] },
// 5236: { action: setting.webSocket.dic["/topic/vehicleStatus"] },
// 5237: { action: setting.webSocket.dic["/topic/timeDelay"] },
// 1: { action: setting.webSocket.dic["/topic/points"] },
}
\ No newline at end of file
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