├── .travis.yml
├── Image.qrc
├── Image
├── Project
│ ├── import.png
│ ├── importBlue.png
│ ├── save.png
│ ├── saveBlue.png
│ ├── saveas.png
│ └── saveasBlue.png
├── Table
│ ├── append-mulit-row.png
│ ├── append-mulit-rowB.png
│ ├── append-row.png
│ ├── append-rowB.png
│ ├── clear.png
│ ├── clearB.png
│ ├── delete-row.png
│ ├── delete-rowB.png
│ ├── insert-below.png
│ ├── insert-belowB.png
│ ├── redo.png
│ ├── redoB.png
│ ├── undo.png
│ └── undoB.png
├── Template
│ ├── electrombile.png
│ ├── electrombileG.png
│ ├── fuelCar.png
│ ├── fuelCarG.png
│ ├── hybrid.png
│ ├── hybridG.png
│ ├── simpleTemplateIcon.png
│ └── simpleTemplateIconG.png
├── Tools
│ ├── arrowDownBlue.png
│ ├── arrowDownGray.png
│ ├── arrowUpBlue.png
│ ├── arrowUpGray.png
│ ├── checkG.png
│ ├── checkR.png
│ ├── importG.png
│ ├── importO.png
│ ├── promptG.png
│ ├── promptR.png
│ ├── searchIconB.png
│ └── searchIconG.png
└── demo1.png
├── Json.qrc
├── Json
├── electricCar.json
├── fuelCar.json
├── mixingCar.json
└── sample.json
├── LICENSE
├── Qml.qrc
├── Qml
├── Component
│ ├── FColorButton.qml
│ ├── FHoverButton.qml
│ ├── FJsonListModel.qml
│ ├── FPopDialog.qml
│ ├── FSpinBox.qml
│ ├── FSpinButton.qml
│ ├── FTextButton.qml
│ ├── FToolTip.qml
│ └── JsonPath.js
├── FTable.qml
└── Main.qml
├── README.md
├── Src
├── FileIO.cpp
├── FileIO.hpp
├── FileInfo.cpp
├── FileInfo.hpp
├── Logger
│ ├── Logger.cpp
│ ├── Logger.h
│ └── LoggerTemplate.h
├── Main.cpp
├── OperationRecorder.cpp
├── OperationRecorder.hpp
├── TableStatus.cpp
└── TableStatus.hpp
├── TableEdit.pro
├── appveyor.yml
└── scripts
├── macos
├── build.sh
├── deploy.sh
└── install.sh
└── ubuntu
├── build.sh
├── deploy.sh
└── install.sh
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: cpp
2 | sudo: required
3 | compiler: gcc
4 | group: deprecated-2019Q1
5 | matrix:
6 | include:
7 | - os: linux
8 | dist: xenial
9 | env:
10 | releaseName=TableEdit_ubuntu_xenial_x64.AppImage
11 | cache:
12 | bundler: true
13 | apt: true
14 | directories:
15 | - /opt/qt512/
16 | - ./linuxdeployqt.AppImage
17 | - os: osx
18 | osx_image: xcode10.2
19 | env:
20 | releaseName=TableEdit_macos10-14_xcode10-2.dmg
21 | cache:
22 | bundler: true
23 | directories:
24 | - /usr/local/opt/qt
25 | before_install:
26 | - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then chmod a+x ./scripts/macos/install.sh; ./scripts/macos/install.sh; fi
27 | - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then chmod a+x ./scripts/ubuntu/install.sh; ./scripts/ubuntu/install.sh; fi
28 | script:
29 | - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then chmod a+x ./scripts/macos/build.sh; ./scripts/macos/build.sh; fi
30 | - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then chmod a+x ./scripts/ubuntu/build.sh; ./scripts/ubuntu/build.sh; fi
31 | before_deploy:
32 | - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then chmod a+x ./scripts/macos/deploy.sh; ./scripts/macos/deploy.sh; fi
33 | - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then chmod a+x ./scripts/ubuntu/deploy.sh; ./scripts/ubuntu/deploy.sh; fi
34 | deploy: # 部署
35 | provider: releases # 部署到 GitHub Release,除此之外,Travis CI 还支持发布到 fir.im、AWS、Google App Engine 等
36 | api_key: $GITHUB_OAUTH_TOKEN # 填写 GitHub 的 token (Settings -> Personal access tokens -> Generate new token)
37 | file: bin/${releaseName} # 部署文件路径
38 | skip_cleanup: true # 设置为 true 以跳过清理,不然 apk 文件就会被清理
39 | on: # 发布时机
40 | tags: true # tags 设置为 true 表示只有在有 tag 的情况下才部署
41 | notifications:
42 | email: false
43 |
44 |
--------------------------------------------------------------------------------
/Image.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 | Image/Project/import.png
4 | Image/Project/importBlue.png
5 | Image/Project/save.png
6 | Image/Project/saveas.png
7 | Image/Project/saveasBlue.png
8 | Image/Project/saveBlue.png
9 | Image/Table/append-mulit-row.png
10 | Image/Table/append-mulit-rowB.png
11 | Image/Table/append-row.png
12 | Image/Table/append-rowB.png
13 | Image/Table/clear.png
14 | Image/Table/clearB.png
15 | Image/Table/delete-row.png
16 | Image/Table/delete-rowB.png
17 | Image/Table/insert-below.png
18 | Image/Table/insert-belowB.png
19 | Image/Table/redo.png
20 | Image/Table/redoB.png
21 | Image/Table/undo.png
22 | Image/Table/undoB.png
23 | Image/Template/electrombile.png
24 | Image/Template/electrombileG.png
25 | Image/Template/fuelCar.png
26 | Image/Template/fuelCarG.png
27 | Image/Template/hybrid.png
28 | Image/Template/hybridG.png
29 | Image/Template/simpleTemplateIcon.png
30 | Image/Template/simpleTemplateIconG.png
31 | Image/Tools/arrowDownBlue.png
32 | Image/Tools/arrowDownGray.png
33 | Image/Tools/arrowUpBlue.png
34 | Image/Tools/arrowUpGray.png
35 | Image/Tools/checkG.png
36 | Image/Tools/checkR.png
37 | Image/Tools/importG.png
38 | Image/Tools/importO.png
39 | Image/Tools/promptG.png
40 | Image/Tools/promptR.png
41 | Image/Tools/searchIconB.png
42 | Image/Tools/searchIconG.png
43 |
44 |
45 |
--------------------------------------------------------------------------------
/Image/Project/import.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaredtao/TableEdit/4043485dfa13bccacac9e7992a5778f6a0de74e4/Image/Project/import.png
--------------------------------------------------------------------------------
/Image/Project/importBlue.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaredtao/TableEdit/4043485dfa13bccacac9e7992a5778f6a0de74e4/Image/Project/importBlue.png
--------------------------------------------------------------------------------
/Image/Project/save.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaredtao/TableEdit/4043485dfa13bccacac9e7992a5778f6a0de74e4/Image/Project/save.png
--------------------------------------------------------------------------------
/Image/Project/saveBlue.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaredtao/TableEdit/4043485dfa13bccacac9e7992a5778f6a0de74e4/Image/Project/saveBlue.png
--------------------------------------------------------------------------------
/Image/Project/saveas.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaredtao/TableEdit/4043485dfa13bccacac9e7992a5778f6a0de74e4/Image/Project/saveas.png
--------------------------------------------------------------------------------
/Image/Project/saveasBlue.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaredtao/TableEdit/4043485dfa13bccacac9e7992a5778f6a0de74e4/Image/Project/saveasBlue.png
--------------------------------------------------------------------------------
/Image/Table/append-mulit-row.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaredtao/TableEdit/4043485dfa13bccacac9e7992a5778f6a0de74e4/Image/Table/append-mulit-row.png
--------------------------------------------------------------------------------
/Image/Table/append-mulit-rowB.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaredtao/TableEdit/4043485dfa13bccacac9e7992a5778f6a0de74e4/Image/Table/append-mulit-rowB.png
--------------------------------------------------------------------------------
/Image/Table/append-row.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaredtao/TableEdit/4043485dfa13bccacac9e7992a5778f6a0de74e4/Image/Table/append-row.png
--------------------------------------------------------------------------------
/Image/Table/append-rowB.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaredtao/TableEdit/4043485dfa13bccacac9e7992a5778f6a0de74e4/Image/Table/append-rowB.png
--------------------------------------------------------------------------------
/Image/Table/clear.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaredtao/TableEdit/4043485dfa13bccacac9e7992a5778f6a0de74e4/Image/Table/clear.png
--------------------------------------------------------------------------------
/Image/Table/clearB.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaredtao/TableEdit/4043485dfa13bccacac9e7992a5778f6a0de74e4/Image/Table/clearB.png
--------------------------------------------------------------------------------
/Image/Table/delete-row.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaredtao/TableEdit/4043485dfa13bccacac9e7992a5778f6a0de74e4/Image/Table/delete-row.png
--------------------------------------------------------------------------------
/Image/Table/delete-rowB.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaredtao/TableEdit/4043485dfa13bccacac9e7992a5778f6a0de74e4/Image/Table/delete-rowB.png
--------------------------------------------------------------------------------
/Image/Table/insert-below.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaredtao/TableEdit/4043485dfa13bccacac9e7992a5778f6a0de74e4/Image/Table/insert-below.png
--------------------------------------------------------------------------------
/Image/Table/insert-belowB.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaredtao/TableEdit/4043485dfa13bccacac9e7992a5778f6a0de74e4/Image/Table/insert-belowB.png
--------------------------------------------------------------------------------
/Image/Table/redo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaredtao/TableEdit/4043485dfa13bccacac9e7992a5778f6a0de74e4/Image/Table/redo.png
--------------------------------------------------------------------------------
/Image/Table/redoB.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaredtao/TableEdit/4043485dfa13bccacac9e7992a5778f6a0de74e4/Image/Table/redoB.png
--------------------------------------------------------------------------------
/Image/Table/undo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaredtao/TableEdit/4043485dfa13bccacac9e7992a5778f6a0de74e4/Image/Table/undo.png
--------------------------------------------------------------------------------
/Image/Table/undoB.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaredtao/TableEdit/4043485dfa13bccacac9e7992a5778f6a0de74e4/Image/Table/undoB.png
--------------------------------------------------------------------------------
/Image/Template/electrombile.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaredtao/TableEdit/4043485dfa13bccacac9e7992a5778f6a0de74e4/Image/Template/electrombile.png
--------------------------------------------------------------------------------
/Image/Template/electrombileG.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaredtao/TableEdit/4043485dfa13bccacac9e7992a5778f6a0de74e4/Image/Template/electrombileG.png
--------------------------------------------------------------------------------
/Image/Template/fuelCar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaredtao/TableEdit/4043485dfa13bccacac9e7992a5778f6a0de74e4/Image/Template/fuelCar.png
--------------------------------------------------------------------------------
/Image/Template/fuelCarG.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaredtao/TableEdit/4043485dfa13bccacac9e7992a5778f6a0de74e4/Image/Template/fuelCarG.png
--------------------------------------------------------------------------------
/Image/Template/hybrid.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaredtao/TableEdit/4043485dfa13bccacac9e7992a5778f6a0de74e4/Image/Template/hybrid.png
--------------------------------------------------------------------------------
/Image/Template/hybridG.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaredtao/TableEdit/4043485dfa13bccacac9e7992a5778f6a0de74e4/Image/Template/hybridG.png
--------------------------------------------------------------------------------
/Image/Template/simpleTemplateIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaredtao/TableEdit/4043485dfa13bccacac9e7992a5778f6a0de74e4/Image/Template/simpleTemplateIcon.png
--------------------------------------------------------------------------------
/Image/Template/simpleTemplateIconG.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaredtao/TableEdit/4043485dfa13bccacac9e7992a5778f6a0de74e4/Image/Template/simpleTemplateIconG.png
--------------------------------------------------------------------------------
/Image/Tools/arrowDownBlue.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaredtao/TableEdit/4043485dfa13bccacac9e7992a5778f6a0de74e4/Image/Tools/arrowDownBlue.png
--------------------------------------------------------------------------------
/Image/Tools/arrowDownGray.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaredtao/TableEdit/4043485dfa13bccacac9e7992a5778f6a0de74e4/Image/Tools/arrowDownGray.png
--------------------------------------------------------------------------------
/Image/Tools/arrowUpBlue.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaredtao/TableEdit/4043485dfa13bccacac9e7992a5778f6a0de74e4/Image/Tools/arrowUpBlue.png
--------------------------------------------------------------------------------
/Image/Tools/arrowUpGray.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaredtao/TableEdit/4043485dfa13bccacac9e7992a5778f6a0de74e4/Image/Tools/arrowUpGray.png
--------------------------------------------------------------------------------
/Image/Tools/checkG.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaredtao/TableEdit/4043485dfa13bccacac9e7992a5778f6a0de74e4/Image/Tools/checkG.png
--------------------------------------------------------------------------------
/Image/Tools/checkR.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaredtao/TableEdit/4043485dfa13bccacac9e7992a5778f6a0de74e4/Image/Tools/checkR.png
--------------------------------------------------------------------------------
/Image/Tools/importG.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaredtao/TableEdit/4043485dfa13bccacac9e7992a5778f6a0de74e4/Image/Tools/importG.png
--------------------------------------------------------------------------------
/Image/Tools/importO.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaredtao/TableEdit/4043485dfa13bccacac9e7992a5778f6a0de74e4/Image/Tools/importO.png
--------------------------------------------------------------------------------
/Image/Tools/promptG.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaredtao/TableEdit/4043485dfa13bccacac9e7992a5778f6a0de74e4/Image/Tools/promptG.png
--------------------------------------------------------------------------------
/Image/Tools/promptR.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaredtao/TableEdit/4043485dfa13bccacac9e7992a5778f6a0de74e4/Image/Tools/promptR.png
--------------------------------------------------------------------------------
/Image/Tools/searchIconB.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaredtao/TableEdit/4043485dfa13bccacac9e7992a5778f6a0de74e4/Image/Tools/searchIconB.png
--------------------------------------------------------------------------------
/Image/Tools/searchIconG.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaredtao/TableEdit/4043485dfa13bccacac9e7992a5778f6a0de74e4/Image/Tools/searchIconG.png
--------------------------------------------------------------------------------
/Image/demo1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaredtao/TableEdit/4043485dfa13bccacac9e7992a5778f6a0de74e4/Image/demo1.png
--------------------------------------------------------------------------------
/Json.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 | Json/electricCar.json
4 | Json/fuelCar.json
5 | Json/mixingCar.json
6 | Json/sample.json
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Json/electricCar.json:
--------------------------------------------------------------------------------
1 | {
2 | "commands": [
3 | {
4 | "name": "applicationState" ,"bits": 8, "min": 0,
5 | "description": "0: 显示未初始化,例如开机视频播放,1: 开机动画进行中,2: 关机动画进行中,3: 自检中, \
6 | 4: 休眠界面显示中,5: 休眠界面显示动画进行中,6: 休眠界面消失动画进行中,7: 正常状态画面显示中"
7 | },
8 | {
9 | "bits": 1,
10 | "coefficient": 1,
11 | "description": " 0:不请求,开机后,当MCU接收到此命令后,开始向CORE发送信号 1:请求",
12 | "invalid": "0x0",
13 | "max": 1,
14 | "min": 0,
15 | "name": "commandReq",
16 | "offset": 0
17 | },
18 | {
19 | "bits": 1,
20 | "coefficient": 1,
21 | "description": "0:不关屏 1:ARM请求MCU关闭屏幕 ",
22 | "invalid": "0x0",
23 | "max": 1,
24 | "min": 0,
25 | "name": "closeLCDReq",
26 | "offset": 0
27 | },
28 | {
29 | "bits": 1,
30 | "coefficient": 1,
31 | "description": "小计里程清零 0:不清零 1:清零 ",
32 | "invalid": "0x0",
33 | "max": 1,
34 | "min": 0,
35 | "name": "tripClean",
36 | "offset": 0
37 | },
38 | {
39 | "bits": 1,
40 | "coefficient": 1,
41 | "description": "平均车速清零 0:不清零 1:清零 ",
42 | "invalid": "0x0",
43 | "max": 1,
44 | "min": 0,
45 | "name": "avgSpeedClean",
46 | "offset": 0
47 | },
48 | {
49 | "bits": 1,
50 | "coefficient": 0,
51 | "description": "暂留",
52 | "invalid": "0x0",
53 | "max": 0,
54 | "min": 0,
55 | "offset": 0
56 | },
57 | {
58 | "bits": 1,
59 | "coefficient": 0,
60 | "description": "暂留",
61 | "invalid": "0x0",
62 | "max": 0,
63 | "min": 0,
64 | "offset": 0
65 | },
66 | {
67 | "bits": 1,
68 | "coefficient": 1,
69 | "description": "0:不蜂鸣,用于量产核心板程序烧写成功 1:蜂鸣4s ",
70 | "invalid": "0x0",
71 | "max": 1,
72 | "min": 0,
73 | "name": "coreSysBurned",
74 | "offset": 0
75 | },
76 | {
77 | "bits": 1,
78 | "coefficient": 1,
79 | "description": "0:进入正常模式 1:进入工程模式",
80 | "invalid": "0x0",
81 | "max": 1,
82 | "min": 0,
83 | "name": "setPrjMode",
84 | "offset": 0
85 | },
86 | {
87 | "bits": 8,
88 | "coefficient": 0,
89 | "description": "暂留",
90 | "invalid": "0x0",
91 | "max": 0,
92 | "min": 0,
93 | "offset": 0
94 | },
95 | {
96 | "bits": 8,
97 | "coefficient": 0,
98 | "description": "暂留",
99 | "invalid": "0x0",
100 | "max": 0,
101 | "min": 0,
102 | "offset": 0
103 | },
104 | {
105 | "bits": 8,
106 | "coefficient": 0,
107 | "description": "暂留",
108 | "invalid": "0x0",
109 | "max": 0,
110 | "min": 0,
111 | "offset": 0
112 | },
113 | {
114 | "bits": 32,
115 | "coefficient": 1,
116 | "description": "存储自1970年1月1日0时0分0秒到现在的秒数:修改 0:不修改",
117 | "invalid": "0x0",
118 | "max": -1,
119 | "min": -1,
120 | "name": "setseconds",
121 | "offset": 0
122 | },
123 | {
124 | "bits": 4,
125 | "coefficient": 1,
126 | "description": "0:中文 1:英文",
127 | "invalid": "0xf",
128 | "max": 1,
129 | "min": 0,
130 | "name": "languageSet",
131 | "offset": 0
132 | },
133 | {
134 | "bits": 4,
135 | "coefficient": 1,
136 | "description": "0:亮度1级 1:亮度2级 2:亮度3级 3:亮度4级 ",
137 | "invalid": "0xf",
138 | "max": 3,
139 | "min": 0,
140 | "name": "setBacklightLevel",
141 | "offset": 0
142 | },
143 | {
144 | "bits": 8,
145 | "coefficient": 1,
146 | "description": "0:主题1 1:主题2 2:主题3 3:主题4",
147 | "invalid": "0xff",
148 | "max": 3,
149 | "min": 0,
150 | "name": "themeSet",
151 | "offset": 0
152 | },
153 | {
154 | "bits": 1,
155 | "coefficient": 1,
156 | "description": "0:未做保养 1:已做保养",
157 | "invalid": "0x0",
158 | "max": 1,
159 | "min": 0,
160 | "name": "maintenanceClean",
161 | "offset": 0
162 | },
163 | {
164 | "bits": 1,
165 | "coefficient": 1,
166 | "description": "0:开机动画未结束 1:开机动画结束",
167 | "invalid": "0x0",
168 | "max": 1,
169 | "min": 0,
170 | "name": "animaFinished",
171 | "offset": 0
172 | },
173 | {
174 | "bits": 1,
175 | "coefficient": 1,
176 | "description": "0:不进行USB升级1:进行USB升级",
177 | "invalid": "0x0",
178 | "max": 1,
179 | "min": 0,
180 | "name": "usbUpdate",
181 | "offset": 0
182 | },
183 | {
184 | "bits": 1,
185 | "coefficient": 1,
186 | "description": "0:未检测通过 1:通过检测",
187 | "invalid": "0x0",
188 | "max": 1,
189 | "min": 0,
190 | "name": "usbDiskCheck",
191 | "offset": 0
192 | },
193 | {
194 | "bits": 4,
195 | "coefficient": 0,
196 | "description": "暂留",
197 | "invalid": "0x0",
198 | "max": 0,
199 | "min": 0,
200 | "offset": 0
201 | },
202 | {
203 | "bits": 8,
204 | "coefficient": 1,
205 | "description": "HMI 临时版本",
206 | "invalid": "0xff",
207 | "max": 100,
208 | "min": 0,
209 | "name": "qtVersionMin",
210 | "offset": 0
211 | },
212 | {
213 | "bits": 5,
214 | "coefficient": 1,
215 | "description": "HMI交付版本,每次交付样机加一",
216 | "invalid": "0x1f",
217 | "max": 30,
218 | "min": 0,
219 | "name": "qtVersionMid",
220 | "offset": 0
221 | },
222 | {
223 | "bits": 3,
224 | "coefficient": 1,
225 | "description": "HMI主版本 SOP版本号,量产加一",
226 | "invalid": "0x7",
227 | "max": 6,
228 | "min": 0,
229 | "name": "qtVersionMax",
230 | "offset": 0
231 | }
232 | ],
233 | "heartBeatInterval": 2000,
234 | "signals": [
235 | {
236 | "bits": 8,
237 | "coefficient": 1,
238 | "description": "MCU临时版本\n",
239 | "invalid": "0xff",
240 | "max": 100,
241 | "min": 0,
242 | "name": "mcuVersionMin",
243 | "offset": 0
244 | },
245 | {
246 | "bits": 5,
247 | "coefficient": 1,
248 | "description": "MCU中版本号 交付版本,每次交付样机加一",
249 | "invalid": "0x1f",
250 | "max": 30,
251 | "min": 0,
252 | "name": "mcuVersionMid",
253 | "offset": 0
254 | },
255 | {
256 | "bits": 3,
257 | "coefficient": 1,
258 | "description": "MCU主版本号 SOP版本号,量产加一",
259 | "invalid": "0x7",
260 | "max": 6,
261 | "min": 0,
262 | "name": "mcuVersionMax",
263 | "offset": 0
264 | },
265 | {
266 | "bits": 16,
267 | "coefficient": 1,
268 | "description": "暂留 转速 \n红色区域:5800-8000",
269 | "invalid": "0x0",
270 | "max": 8000,
271 | "min": 0,
272 | "name": "rpm",
273 | "offset": 0
274 | },
275 | {
276 | "bits": 8,
277 | "coefficient": 1,
278 | "description": "车速,0-240",
279 | "max": 240,
280 | "name": "speed",
281 | "offset": 0
282 | },
283 | {
284 | "bits": 32,
285 | "coefficient": 1,
286 | "description": "时间 存储自1970年1月1日0时0分0秒到现在的秒数",
287 | "invalid": "0x0",
288 | "max": 4294967295,
289 | "min": 0,
290 | "name": "dateTime",
291 | "offset": 0
292 | },
293 | {
294 | "bits": 8,
295 | "coefficient": 1,
296 | "description": "车速 单位:km/h",
297 | "invalid": "0xff",
298 | "max": 140,
299 | "min": 0,
300 | "name": "carSpeed",
301 | "offset": 0
302 | },
303 | {
304 | "bits": 1,
305 | "coefficient": 1,
306 | "description": "确认按键 0: default\n1: press down ",
307 | "invalid": "0x0",
308 | "max": 1,
309 | "min": 0,
310 | "name": "enterKey",
311 | "offset": 0
312 | },
313 | {
314 | "bits": 1,
315 | "coefficient": 1,
316 | "description": "返回按键 0: default\n1: press down ",
317 | "invalid": "0x0",
318 | "max": 1,
319 | "min": 0,
320 | "name": "backKey",
321 | "offset": 0
322 | },
323 | {
324 | "bits": 1,
325 | "coefficient": 1,
326 | "description": "向上按键 0: default\n1: press down ",
327 | "invalid": "0x0",
328 | "max": 1,
329 | "min": 0,
330 | "name": "prevKey",
331 | "offset": 0
332 | },
333 | {
334 | "bits": 1,
335 | "coefficient": 1,
336 | "description": "向下按键 0: default\n1: press down ",
337 | "invalid": "0x0",
338 | "max": 1,
339 | "min": 0,
340 | "name": "nextKey",
341 | "offset": 0
342 | },
343 | {
344 | "bits": 1,
345 | "coefficient": 1,
346 | "description": "0:disEnabled 1:enabled",
347 | "max": 1,
348 | "min": 0,
349 | "name": "projectModeEnabled",
350 | "offset": 0
351 | },
352 | {
353 | "bits": 2,
354 | "coefficient": 0,
355 | "description": "暂留",
356 | "invalid": "0x0",
357 | "max": 0,
358 | "min": 0,
359 | "offset": 0
360 | },
361 | {
362 | "bits": 1,
363 | "coefficient": 1,
364 | "description": "0: IGN OFF\n1: IGN ON",
365 | "invalid": "0x0",
366 | "max": 1,
367 | "min": 0,
368 | "name": "igOn",
369 | "offset": 0
370 | },
371 | {
372 | "bits": 4,
373 | "coefficient": 1,
374 | "description": "档位 0: P档 \n1-8: M1-M8档\n9: P档 闪烁\n10: R档 \n11: N档\n12: D档\n13: S档(保留)\n14: 显示'F' 表示档位错误",
375 | "invalid": "0x0",
376 | "max": 14,
377 | "min": 0,
378 | "name": "gear",
379 | "offset": 0
380 | },
381 | {
382 | "bits": 2,
383 | "coefficient": 1,
384 | "description": "ECO模式 0:不显示 1:ECO模式 2:暂留 3:暂留",
385 | "invalid": "0x0",
386 | "max": 1,
387 | "min": 0,
388 | "name": "EcoMode",
389 | "offset": 0
390 | },
391 | {
392 | "bits": 2,
393 | "coefficient": 1,
394 | "description": "钥匙位置 OFF = 0,ACC = 1,ON = 2,START = 3",
395 | "invalid": "0x0",
396 | "max": 3,
397 | "min": 0,
398 | "name": "keyStatus",
399 | "offset": 0
400 | },
401 | {
402 | "bits": 1,
403 | "coefficient": 1,
404 | "description": "左前门状态 0x00:close\n0x01:open",
405 | "invalid": "0x0",
406 | "max": 1,
407 | "min": 0,
408 | "name": "lfDoor",
409 | "offset": 0
410 | },
411 | {
412 | "bits": 1,
413 | "coefficient": 1,
414 | "description": "右前门状态 0x00:close\n0x01:open",
415 | "invalid": "0x0",
416 | "max": 1,
417 | "min": 0,
418 | "name": "rfDoor",
419 | "offset": 0
420 | },
421 | {
422 | "bits": 1,
423 | "coefficient": 1,
424 | "description": "左后门状态 暂留\n0x00:close\n0x01:open",
425 | "invalid": "0x0",
426 | "max": 1,
427 | "min": 0,
428 | "name": "lrDoor",
429 | "offset": 0
430 | },
431 | {
432 | "bits": 1,
433 | "coefficient": 1,
434 | "description": "右后门状态 暂留\n0x00:close\n0x01:open",
435 | "invalid": "0x0",
436 | "max": 1,
437 | "min": 0,
438 | "name": "rrDoor",
439 | "offset": 0
440 | },
441 | {
442 | "bits": 1,
443 | "coefficient": 1,
444 | "description": "引擎盖状态 暂留\n0x00:close\n0x01:open",
445 | "invalid": "0x0",
446 | "max": 1,
447 | "min": 0,
448 | "name": "hoodDoor",
449 | "offset": 0
450 | },
451 | {
452 | "bits": 1,
453 | "coefficient": 1,
454 | "description": "行李箱状态 0x00:close\n0x01:open",
455 | "invalid": "0x0",
456 | "max": 1,
457 | "min": 0,
458 | "name": "trunkDoor",
459 | "offset": 0
460 | },
461 | {
462 | "bits": 2,
463 | "coefficient": 0,
464 | "description": "暂留",
465 | "invalid": "0x0",
466 | "max": 0,
467 | "min": 0,
468 | "offset": 0
469 | },
470 | {
471 | "bits": 24,
472 | "coefficient": 1,
473 | "description": "总里程 单位:Km",
474 | "invalid": "0x0",
475 | "max": 999999,
476 | "min": 0,
477 | "name": "odo",
478 | "offset": 0
479 | },
480 | {
481 | "bits": 8,
482 | "coefficient": 1,
483 | "description": "平均车速 单位:km/h",
484 | "invalid": "0xff",
485 | "max": 140,
486 | "min": 0,
487 | "name": "avgCarSpeed",
488 | "offset": 0
489 | },
490 | {
491 | "bits": 8,
492 | "coefficient": 0,
493 | "description": "暂留",
494 | "invalid": "0x0",
495 | "max": 0,
496 | "min": 0,
497 | "offset": 0
498 | },
499 | {
500 | "bits": 16,
501 | "coefficient": 1,
502 | "description": "续航里程 单位 Km",
503 | "invalid": "0x0",
504 | "max": 999,
505 | "min": 0,
506 | "name": "remainMileage",
507 | "offset": 0
508 | },
509 | {
510 | "bits": 24,
511 | "coefficient": 0.1,
512 | "description": "小计里程 单位 Km",
513 | "invalid": "0x0",
514 | "max": 9999,
515 | "min": 0,
516 | "name": "trip1",
517 | "offset": 0
518 | },
519 | {
520 | "bits": 8,
521 | "coefficient": 0,
522 | "description": "暂留",
523 | "invalid": "0x0",
524 | "max": 255,
525 | "min": 0,
526 | "name": "fuel",
527 | "offset": 0
528 | },
529 | {
530 | "bits": 24,
531 | "coefficient": 0,
532 | "description": "暂留",
533 | "invalid": "0x0",
534 | "max": 16777215,
535 | "min": 0,
536 | "name": "trip2",
537 | "offset": 0
538 | },
539 | {
540 | "bits": 8,
541 | "coefficient": 1,
542 | "description": "0%-100%",
543 | "invalid": "0x0",
544 | "max": 100,
545 | "min": 0,
546 | "name": "socPercent",
547 | "offset": 0
548 | },
549 | {
550 | "bits": 16,
551 | "coefficient": 1,
552 | "description": "保养里程 单位:Km",
553 | "invalid": "0x0",
554 | "max": 5000,
555 | "min": 0,
556 | "name": "maintenanceMileage",
557 | "offset": 0
558 | },
559 | {
560 | "bits": 16,
561 | "coefficient": 0.5,
562 | "description": "车外温度\n单位:℃",
563 | "invalid": "0x0",
564 | "max": 65535,
565 | "min": -55,
566 | "name": "outCarTemp",
567 | "offset": 0
568 | },
569 | {
570 | "bits": 16,
571 | "coefficient": 0,
572 | "description": "暂留 ",
573 | "invalid": "0x0",
574 | "max": 65535,
575 | "min": 0,
576 | "name": "avgFuel",
577 | "offset": 0
578 | },
579 | {
580 | "bits": 16,
581 | "coefficient": 0,
582 | "description": "暂留",
583 | "invalid": "0x0",
584 | "max": 65535,
585 | "min": 0,
586 | "name": "instantFuel",
587 | "offset": 0
588 | },
589 | {
590 | "bits": 16,
591 | "coefficient": 0.1,
592 | "description": "电流 单位:A",
593 | "invalid": "0x0",
594 | "max": 1000,
595 | "min": -1000,
596 | "name": "powerBatCurrent",
597 | "offset": 0
598 | },
599 | {
600 | "bits": 16,
601 | "coefficient": 0.1,
602 | "description": "电压 单位:V",
603 | "invalid": "0x0",
604 | "max": 500,
605 | "min": 0,
606 | "name": "powerBatVolt",
607 | "offset": 0
608 | },
609 | {
610 | "bits": 8,
611 | "coefficient": 1,
612 | "description": "硬件临时版本",
613 | "invalid": "0xff",
614 | "max": 100,
615 | "min": 0,
616 | "name": "hwVersionMin",
617 | "offset": 0
618 | },
619 | {
620 | "bits": 5,
621 | "coefficient": 1,
622 | "description": "硬件中版本号 交付版本,每次交付样机加一",
623 | "invalid": "0x1f",
624 | "max": 30,
625 | "min": 0,
626 | "name": "hwVersionMid",
627 | "offset": 0
628 | },
629 | {
630 | "bits": 3,
631 | "coefficient": 1,
632 | "description": "硬件主版本号 SOP版本号,量产加一",
633 | "invalid": "0x7",
634 | "max": 6,
635 | "min": 0,
636 | "name": "hwVersionMax",
637 | "offset": 0
638 | },
639 | {
640 | "bits": 1,
641 | "coefficient": 1,
642 | "description": "前雾灯 0:off 1:on ",
643 | "invalid": "0x0",
644 | "max": 1,
645 | "min": 0,
646 | "name": "frontFogStatus",
647 | "offset": 0
648 | },
649 | {
650 | "bits": 1,
651 | "coefficient": 1,
652 | "description": "后雾灯 0:off 1:on",
653 | "invalid": "0x0",
654 | "max": 1,
655 | "min": 0,
656 | "name": "rearFogStatus",
657 | "offset": 0
658 | },
659 | {
660 | "bits": 1,
661 | "coefficient": 1,
662 | "description": "左转灯 0:off 1:on",
663 | "invalid": "0x0",
664 | "max": 1,
665 | "min": 0,
666 | "name": "turnLeftStatus",
667 | "offset": 0
668 | },
669 | {
670 | "bits": 1,
671 | "coefficient": 1,
672 | "description": "右转灯 0:off 1:on",
673 | "invalid": "0x0",
674 | "max": 1,
675 | "min": 0,
676 | "name": "turnRightStatus",
677 | "offset": 0
678 | },
679 | {
680 | "bits": 1,
681 | "coefficient": 1,
682 | "description": "高光灯 0:off 1:on",
683 | "invalid": "0x0",
684 | "max": 1,
685 | "min": 0,
686 | "name": "highBeamStatus",
687 | "offset": 0
688 | },
689 | {
690 | "bits": 1,
691 | "coefficient": 1,
692 | "description": "Ready灯 0:off 1:on",
693 | "invalid": "0x0",
694 | "max": 1,
695 | "min": 0,
696 | "name": "readyStatus",
697 | "offset": 0
698 | },
699 | {
700 | "bits": 1,
701 | "coefficient": 1,
702 | "description": "主安全带 0: off 1:on",
703 | "invalid": "0x0",
704 | "max": 1,
705 | "min": 0,
706 | "name": "mainBeltSts",
707 | "offset": 0
708 | },
709 | {
710 | "bits": 1,
711 | "coefficient": 1,
712 | "description": "辅安全带 0: off 1:on",
713 | "invalid": "0x0",
714 | "max": 1,
715 | "min": 0,
716 | "name": "secondBeltSts",
717 | "offset": 0
718 | },
719 | {
720 | "bits": 1,
721 | "coefficient": 1,
722 | "description": "EPS故障 0:off 1:on",
723 | "invalid": "0x0",
724 | "max": 1,
725 | "min": 0,
726 | "name": "EPSFault",
727 | "offset": 0
728 | },
729 | {
730 | "bits": 1,
731 | "coefficient": 1,
732 | "description": "EBD故障 0:off 1:on",
733 | "invalid": "0x0",
734 | "max": 1,
735 | "min": 0,
736 | "name": "EBDFault",
737 | "offset": 0
738 | },
739 | {
740 | "bits": 1,
741 | "coefficient": 1,
742 | "description": "ABS故障 0:off 1:on ",
743 | "invalid": "0x0",
744 | "max": 1,
745 | "min": 0,
746 | "name": "ABSFault",
747 | "offset": 0
748 | },
749 | {
750 | "bits": 1,
751 | "coefficient": 1,
752 | "description": "日间行车灯 0:off 1:on ",
753 | "invalid": "0x0",
754 | "max": 1,
755 | "min": 0,
756 | "name": "dayDriveStatus",
757 | "offset": 0
758 | },
759 | {
760 | "bits": 1,
761 | "coefficient": 1,
762 | "description": "位置灯 0:off 1:on ",
763 | "invalid": "0x0",
764 | "max": 1,
765 | "min": 0,
766 | "name": "positionLight",
767 | "offset": 0
768 | },
769 | {
770 | "bits": 1,
771 | "coefficient": 1,
772 | "description": "近光灯 0:off 1:on ",
773 | "invalid": "0x0",
774 | "max": 1,
775 | "min": 0,
776 | "name": "nearReachStatus",
777 | "offset": 0
778 | },
779 | {
780 | "bits": 1,
781 | "coefficient": 1,
782 | "description": "电机系统故障 0:off 1:on ",
783 | "invalid": "0x0",
784 | "max": 1,
785 | "min": 0,
786 | "name": "MotorSysErr",
787 | "offset": 0
788 | },
789 | {
790 | "bits": 1,
791 | "coefficient": 1,
792 | "description": "整车保养提示 0:off 1:on ",
793 | "invalid": "0x0",
794 | "max": 1,
795 | "min": 0,
796 | "name": "vehicleMaintain",
797 | "offset": 0
798 | },
799 | {
800 | "bits": 1,
801 | "coefficient": 1,
802 | "description": "安全气囊故障 0:off 1:on ",
803 | "invalid": "0x0",
804 | "max": 1,
805 | "min": 0,
806 | "name": "airBagErrStatus",
807 | "offset": 0
808 | },
809 | {
810 | "bits": 1,
811 | "coefficient": 1,
812 | "description": "电机温度高指示 0:off 1:on ",
813 | "invalid": "0x0",
814 | "max": 1,
815 | "min": 0,
816 | "name": "motorTempHigh",
817 | "offset": 0
818 | },
819 | {
820 | "bits": 1,
821 | "coefficient": 1,
822 | "description": "绝缘电阻低 0:off 1:on",
823 | "invalid": "0x0",
824 | "max": 1,
825 | "min": 0,
826 | "name": "InsResLowAlarm",
827 | "offset": 0
828 | },
829 | {
830 | "bits": 1,
831 | "coefficient": 1,
832 | "description": "充电线连接指示 0:off 1:on",
833 | "invalid": "0x0",
834 | "max": 1,
835 | "min": 0,
836 | "name": "chargeWireCNN",
837 | "offset": 0
838 | },
839 | {
840 | "bits": 4,
841 | "coefficient": 0,
842 | "max": 0,
843 | "min": 0,
844 | "offset": 0
845 | },
846 | {
847 | "bits": 1,
848 | "coefficient": 1,
849 | "description": "电池包加热状态 0:off 1:on ",
850 | "invalid": "0x0",
851 | "max": 1,
852 | "min": 0,
853 | "name": "BattHeatingSts ",
854 | "offset": 0
855 | },
856 | {
857 | "bits": 1,
858 | "coefficient": 1,
859 | "description": "电池电量低指示 0:off 1:on ",
860 | "invalid": "0x0",
861 | "max": 1,
862 | "min": 0,
863 | "name": "pwrBattLow",
864 | "offset": 0
865 | },
866 | {
867 | "bits": 2,
868 | "coefficient": 1,
869 | "description": "电池充电状态 0:灭\n1:正在充电,黄色指示灯\n2:充电完成,绿色指示灯",
870 | "invalid": "0x0",
871 | "max": 2,
872 | "min": 0,
873 | "name": "pwrBattChargeSts",
874 | "offset": 0
875 | },
876 | {
877 | "bits": 4,
878 | "coefficient": 1,
879 | "description": "PEPS文字指示 0x0: 无提示\n0x1: 转向锁解闭锁失败\n0x2: 智能钥匙系统故障\n0x3: 未检测到钥匙\n0x4: 钥匙电池电量低\n0x5: 请把钥匙靠近启动按钮\n0x6: 请切换到P/N档\n0x7:请踩制动并按启动按钮启动车辆\n0x8:长按启动按钮5s启动车辆",
880 | "invalid": "0x0",
881 | "max": 8,
882 | "min": 0,
883 | "name": "PEPSSts",
884 | "offset": 0
885 | },
886 | {
887 | "bits": 4,
888 | "coefficient": 1,
889 | "description": "亮度等级 0:亮度1级 \n1:亮度2级 \n2:亮度3级 \n3:亮度4级 ",
890 | "invalid": "0x0",
891 | "max": 3,
892 | "min": 0,
893 | "name": "backlightGrade",
894 | "offset": 0
895 | },
896 | {
897 | "bits": 4,
898 | "coefficient": 1,
899 | "description": "语言 0:中文\n1:英文",
900 | "invalid": "0x0",
901 | "max": 1,
902 | "min": 0,
903 | "name": "language",
904 | "offset": 0
905 | },
906 | {
907 | "bits": 8,
908 | "coefficient": 1,
909 | "description": "电机温度 单位:℃",
910 | "invalid": "0x0",
911 | "max": 254,
912 | "min": 0,
913 | "name": "motorTemp",
914 | "offset": 0
915 | },
916 | {
917 | "bits": 16,
918 | "coefficient": 1,
919 | "description": "左前胎压 胎压单位Kpa,其他为无效值",
920 | "invalid": "0x0",
921 | "max": 4094,
922 | "min": 0,
923 | "name": "lfTirePressure",
924 | "offset": 0
925 | },
926 | {
927 | "bits": 16,
928 | "coefficient": 1,
929 | "description": "右前胎压 胎压单位Kpa,其他为无效值",
930 | "invalid": "0x0",
931 | "max": 4094,
932 | "min": 0,
933 | "name": "rfTirePressure",
934 | "offset": 0
935 | },
936 | {
937 | "bits": 16,
938 | "coefficient": 1,
939 | "description": "左后胎压 胎压单位Kpa,其他为无效值",
940 | "invalid": "0x0",
941 | "max": 4094,
942 | "min": 0,
943 | "name": "lrTirePressure",
944 | "offset": 0
945 | },
946 | {
947 | "bits": 16,
948 | "coefficient": 1,
949 | "description": "右后胎压 胎压单位Kpa,其他为无效值",
950 | "invalid": "0x0",
951 | "max": 4094,
952 | "min": 0,
953 | "name": "rrTirePressure",
954 | "offset": 0
955 | },
956 | {
957 | "bits": 16,
958 | "coefficient": 1,
959 | "description": "左前胎温 胎温单位℃ ,其他为无效值",
960 | "invalid": "0x0",
961 | "max": 260,
962 | "min": -40,
963 | "name": "lfTireTemp",
964 | "offset": 0
965 | },
966 | {
967 | "bits": 16,
968 | "coefficient": 1,
969 | "description": "右前胎温 胎温单位℃ ,其他为无效值",
970 | "invalid": "0x0",
971 | "max": 260,
972 | "min": -40,
973 | "name": "rfTireTemp",
974 | "offset": 0
975 | },
976 | {
977 | "bits": 16,
978 | "coefficient": 1,
979 | "description": "左后胎温单位℃ ,其他为无效值",
980 | "invalid": "0x0",
981 | "max": 260,
982 | "min": -40,
983 | "name": "lrTireTemp",
984 | "offset": 0
985 | },
986 | {
987 | "bits": 16,
988 | "coefficient": 1,
989 | "description": "右后胎温单位℃ ,其他为无效值",
990 | "invalid": "0x0",
991 | "max": 260,
992 | "min": -40,
993 | "name": "rrTireTemp",
994 | "offset": 0
995 | },
996 | {
997 | "bits": 2,
998 | "coefficient": 1,
999 | "description": "左前轮胎报警 0x0: No warning. \n0x1: over pressure warning. \n0x2: under pressure warning. \n0x3: Reserved. ",
1000 | "invalid": "0x0",
1001 | "max": 3,
1002 | "min": 0,
1003 | "name": "lfTirePressureWarn",
1004 | "offset": 0
1005 | },
1006 | {
1007 | "bits": 2,
1008 | "coefficient": 1,
1009 | "description": "右前轮胎报警 0x0: No warning. \n0x1: over pressure warning. \n0x2: under pressure warning. \n0x3: Reserved. ",
1010 | "invalid": "0x0",
1011 | "max": 3,
1012 | "min": 0,
1013 | "name": "rfTirePressureWarn",
1014 | "offset": 0
1015 | },
1016 | {
1017 | "bits": 2,
1018 | "coefficient": 1,
1019 | "description": "左后轮胎报警 0x0: No warning. \n0x1: over pressure warning. \n0x2: under pressure warning. \n0x3: Reserved. ",
1020 | "invalid": "0x0",
1021 | "max": 3,
1022 | "min": 0,
1023 | "name": "lrTirePressureWarn",
1024 | "offset": 0
1025 | },
1026 | {
1027 | "bits": 2,
1028 | "coefficient": 1,
1029 | "description": "右后轮胎报警 0x0: No warning. \n0x1: over pressure warning. \n0x2: under pressure warning. \n0x3: Reserved. ",
1030 | "invalid": "0x0",
1031 | "max": 3,
1032 | "min": 0,
1033 | "name": "rrTirePressureWarn",
1034 | "offset": 0
1035 | },
1036 | {
1037 | "bits": 2,
1038 | "coefficient": 1,
1039 | "description": "左前轮胎温度报警 0x0: No warning. \n0x1: over Temperature warning. \n0x2: under Temperature warning. \n0x3: Reserved. ",
1040 | "invalid": "0x0",
1041 | "max": 3,
1042 | "min": 0,
1043 | "name": "lfTireTempWarn",
1044 | "offset": 0
1045 | },
1046 | {
1047 | "bits": 2,
1048 | "coefficient": 1,
1049 | "description": "右前轮胎温度报警 0x0: No warning. \n0x1: over Temperature warning. \n0x2: under Temperature warning. \n0x3: Reserved. ",
1050 | "invalid": "0x0",
1051 | "max": 3,
1052 | "min": 0,
1053 | "name": "rfTireTempWarn",
1054 | "offset": 0
1055 | },
1056 | {
1057 | "bits": 2,
1058 | "coefficient": 1,
1059 | "description": "左后轮胎温度报警 0x0: No warning. \n0x1: over Temperature warning. \n0x2: under Temperature warning. \n0x3: Reserved. ",
1060 | "invalid": "0x0",
1061 | "max": 3,
1062 | "min": 0,
1063 | "name": "lrTireTempWarn",
1064 | "offset": 0
1065 | },
1066 | {
1067 | "bits": 2,
1068 | "coefficient": 1,
1069 | "description": "右后轮胎温度报警 0x0: No warning. \n0x1: over Temperature warning. \n0x2: under Temperature warning. \n0x3: Reserved. ",
1070 | "invalid": "0x0",
1071 | "max": 3,
1072 | "min": 0,
1073 | "name": "rrTireTempWarn",
1074 | "offset": 0
1075 | },
1076 | {
1077 | "bits": 8,
1078 | "coefficient": 1,
1079 | "description": "主题 0:主题1\n1:主题2\n2:主题3\n4:主题4",
1080 | "invalid": "0x0",
1081 | "max": 4,
1082 | "min": 0,
1083 | "name": "theme",
1084 | "offset": 0
1085 | },
1086 | {
1087 | "bits": 4,
1088 | "coefficient": 1,
1089 | "description": "模式设置 0x0:普通模式\n0x1:演示模式\n0x2:工程模式\n0x3:生产模式\n",
1090 | "invalid": "0x0",
1091 | "max": 3,
1092 | "min": 0,
1093 | "name": "projectMode",
1094 | "offset": 0
1095 | },
1096 | {
1097 | "bits": 2,
1098 | "coefficient": 1,
1099 | "description": "定速巡航指示 0x0:巡航关闭\n0x1:巡航激活 闪烁\n0x2:巡航工作 常亮",
1100 | "invalid": "0x0",
1101 | "max": 2,
1102 | "min": 0,
1103 | "name": "ccsControlState",
1104 | "offset": 0
1105 | },
1106 | {
1107 | "bits": 1,
1108 | "coefficient": 1,
1109 | "description": "龟速灯指示 0:off\n1:on",
1110 | "invalid": "0x0",
1111 | "max": 1,
1112 | "min": 0,
1113 | "name": "tortoiseSts",
1114 | "offset": 0
1115 | },
1116 | {
1117 | "bits": 1,
1118 | "coefficient": 1,
1119 | "description": "PEPS指示灯状态 0:off 1:on",
1120 | "invalid": "0x0",
1121 | "max": 1,
1122 | "min": 0,
1123 | "name": "PEPSlampSts",
1124 | "offset": 0
1125 | },
1126 | {
1127 | "bits": 1,
1128 | "coefficient": 1,
1129 | "description": "轮胎界面配置 0:界面不能显示胎压界面\n1:界面可以显示胎压界面",
1130 | "invalid": "0x0",
1131 | "max": 1,
1132 | "min": 0,
1133 | "name": "CFGtyreUIshow",
1134 | "offset": 0
1135 | },
1136 | {
1137 | "bits": 7,
1138 | "coefficient": 0,
1139 | "description": "暂留",
1140 | "invalid": "0x0",
1141 | "max": 0,
1142 | "min": 0,
1143 | "offset": 0
1144 | },
1145 | {
1146 | "bits": 2,
1147 | "coefficient": 1,
1148 | "description": "整车系统故障 0:不报警\n1:2级报警 灯常亮\n2:1级报警 灯闪烁\n3:3级报警 灯常亮+蜂鸣",
1149 | "invalid": "0x0",
1150 | "max": 3,
1151 | "min": 0,
1152 | "name": "VehicleFaultLvl",
1153 | "offset": 0
1154 | },
1155 | {
1156 | "bits": 2,
1157 | "coefficient": 1,
1158 | "description": "动力电池故障 0:不报警\n1:2级报警 灯常亮\n2:1级报警 灯闪烁\n3:3级报警 灯常亮+蜂鸣",
1159 | "invalid": "0x0",
1160 | "max": 3,
1161 | "min": 0,
1162 | "name": "pwrBattFaultLvl",
1163 | "offset": 0
1164 | },
1165 | {
1166 | "bits": 2,
1167 | "coefficient": 1,
1168 | "description": "EPB故障 0: 不报警\n1: 灯常亮 \n2: 灯闪烁\n3: 保留",
1169 | "invalid": "0x0",
1170 | "max": 3,
1171 | "min": 0,
1172 | "name": "epbParkErrStatus",
1173 | "offset": 0
1174 | },
1175 | {
1176 | "bits": 2,
1177 | "coefficient": 1,
1178 | "description": "EPB指示 0: off\n1: EPB常亮\n2:EPB闪烁\n3:保留",
1179 | "invalid": "0x0",
1180 | "max": 3,
1181 | "min": 0,
1182 | "name": "epbParkStatus",
1183 | "offset": 0
1184 | },
1185 | {
1186 | "bits": 8,
1187 | "coefficient": 1,
1188 | "description": "定速巡航车速 单位:Km/h",
1189 | "invalid": "0x0",
1190 | "max": 140,
1191 | "min": 0,
1192 | "name": "CruiseSpdSet ",
1193 | "offset": 0
1194 | },
1195 | {
1196 | "bits": 16,
1197 | "coefficient": 1,
1198 | "description": "剩余冲电时间 单位:min",
1199 | "invalid": "0x0",
1200 | "max": 65534,
1201 | "min": 0,
1202 | "name": "RemnChgTime ",
1203 | "offset": 0
1204 | },
1205 | {
1206 | "bits": 2,
1207 | "coefficient": 1,
1208 | "description": "0:不自检\n1:开始自检\n2:正在自检\n3:自检完成",
1209 | "invalid": "0x0",
1210 | "max": 3,
1211 | "min": 0,
1212 | "name": "selfCheckSts",
1213 | "offset": 0
1214 | },
1215 | {
1216 | "bits": 1,
1217 | "coefficient": 1,
1218 | "description": "轮胎故障指示灯 0:off 1:on",
1219 | "invalid": "0x0",
1220 | "max": 1,
1221 | "min": 0,
1222 | "name": "TPMSsysWarning",
1223 | "offset": 0
1224 | },
1225 | {
1226 | "bits": 5,
1227 | "coefficient": 1,
1228 | "description": "暂留",
1229 | "invalid": "0x0",
1230 | "max": 0,
1231 | "min": 0,
1232 | "offset": 0
1233 | },
1234 | {
1235 | "bits": 2,
1236 | "coefficient": 1,
1237 | "description": "左前轮胎快速漏气 0:不报警 1:快速漏气 2:慢速漏气 3:保留",
1238 | "invalid": "0x0",
1239 | "max": 3,
1240 | "min": 0,
1241 | "name": "lfTireLeakSts",
1242 | "offset": 0
1243 | },
1244 | {
1245 | "bits": 2,
1246 | "coefficient": 1,
1247 | "description": "右前轮胎快速漏气 0:不报警 1:快速漏气 2:慢速漏气 3:保留",
1248 | "invalid": "0x0",
1249 | "max": 3,
1250 | "min": 0,
1251 | "name": "rfTireLeakSts",
1252 | "offset": 0
1253 | },
1254 | {
1255 | "bits": 2,
1256 | "coefficient": 1,
1257 | "description": "左后轮胎快速漏气 0:不报警 1:快速漏气 2:慢速漏气 3:保留",
1258 | "invalid": "0x0",
1259 | "max": 3,
1260 | "min": 0,
1261 | "name": "lrTireLeakSts",
1262 | "offset": 0
1263 | },
1264 | {
1265 | "bits": 2,
1266 | "coefficient": 1,
1267 | "description": "右后轮胎快速漏气 0:不报警 1:快速漏气 2:慢速漏气 3:保留",
1268 | "invalid": "0x0",
1269 | "max": 3,
1270 | "min": 0,
1271 | "name": "rrTireLeakSts",
1272 | "offset": 0
1273 | }
1274 | ],
1275 | "specialSignals": [
1276 | ],
1277 | "version": "0.0.1"
1278 | }
1279 |
--------------------------------------------------------------------------------
/Json/fuelCar.json:
--------------------------------------------------------------------------------
1 | {
2 | "commands": [
3 | {
4 | "name": "applicationState" ,"bits": 8, "min": 0,
5 | "description": "0: 显示未初始化,例如开机视频播放,1: 开机动画进行中,2: 关机动画进行中,3: 自检中, \
6 | 4: 休眠界面显示中,5: 休眠界面显示动画进行中,6: 休眠界面消失动画进行中,7: 正常状态画面显示中"
7 | },
8 | {
9 | "bits": 1,
10 | "description": "打开请求",
11 | "max": 1,
12 | "min": 0,
13 | "name": "openRequest"
14 | },
15 | {
16 | "bits": 1,
17 | "description": "关闭请求",
18 | "max": 1,
19 | "min": 0,
20 | "name": "closeRequest"
21 | },
22 | {
23 | "bits": 1,
24 | "description": "清小计里程",
25 | "max": 1,
26 | "min": 0,
27 | "name": "subtotalReset"
28 | },
29 | {
30 | "bits": 1,
31 | "description": "清平均车速",
32 | "max": 1,
33 | "min": 0,
34 | "name": "speedAverageReset"
35 | },
36 | {
37 | "bits": 1,
38 | "description": "清平均油耗",
39 | "max": 1,
40 | "min": 0,
41 | "name": "fuelAverageReset"
42 | },
43 | {
44 | "bits": 1,
45 | "max": 0,
46 | "min": 0
47 | },
48 | {
49 | "bits": 1,
50 | "description": "烧录结束",
51 | "max": 1,
52 | "min": 0,
53 | "name": "burnFinish"
54 | },
55 | {
56 | "bits": 17,
57 | "max": 0,
58 | "min": 0
59 | },
60 | {
61 | "bits": 8,
62 | "description": "Fusion状态",
63 | "max": 7,
64 | "min": 0,
65 | "name": "coreStatus"
66 | },
67 | {
68 | "bits": 32,
69 | "description": "时间设置",
70 | "max": 4294967295,
71 | "min": 0,
72 | "name": "utc"
73 | },
74 | {
75 | "bits": 1,
76 | "description": "清保养里程",
77 | "max": 1,
78 | "min": 0,
79 | "name": "maintainReset"
80 | },
81 | {
82 | "bits": 1,
83 | "description": "开机画面结束",
84 | "max": 1,
85 | "min": 0,
86 | "name": "openingFinish"
87 | },
88 | {
89 | "bits": 1,
90 | "description": "USB升级",
91 | "max": 1,
92 | "min": 0,
93 | "name": "usbUpgrade"
94 | },
95 | {
96 | "bits": 1,
97 | "description": "USB反馈",
98 | "max": 1,
99 | "min": 0,
100 | "name": "usbFeedback"
101 | },
102 | {
103 | "bits": 2,
104 | "description": "语言设置",
105 | "max": 2,
106 | "min": 0,
107 | "name": "language"
108 | },
109 | {
110 | "bits": 2,
111 | "description": "时间模式设置",
112 | "max": 2,
113 | "min": 0,
114 | "name": "timeMode"
115 | },
116 | {
117 | "bits": 3,
118 | "max": 0,
119 | "min": 0
120 | },
121 | {
122 | "bits": 2,
123 | "description": "导航设置",
124 | "max": 2,
125 | "min": 0,
126 | "name": "dvdConfig"
127 | },
128 | {
129 | "bits": 3,
130 | "description": "主题设置",
131 | "max": 6,
132 | "min": 0,
133 | "name": "themeConfig"
134 | }
135 | ],
136 | "heartBeatInterval": 3000,
137 | "signals": [
138 | {
139 | "bits": 8,
140 | "coefficient": 1,
141 | "description": "MCU临时版本",
142 | "invalid": "0xff",
143 | "max": 100,
144 | "min": 0,
145 | "name": "mcuVersionMin",
146 | "offset": 0
147 | },
148 | {
149 | "bits": 5,
150 | "coefficient": 1,
151 | "description": "MCU中版本号 交付版本,每次交付样机加一",
152 | "invalid": "0x1f",
153 | "max": 30,
154 | "min": 0,
155 | "name": "mcuVersionMid",
156 | "offset": 0
157 | },
158 | {
159 | "bits": 3,
160 | "coefficient": 1,
161 | "description": "MCU主版本号 SOP版本号,量产加一",
162 | "invalid": "0x7",
163 | "max": 6,
164 | "min": 0,
165 | "name": "mcuVersionMax",
166 | "offset": 0
167 | },
168 | {
169 | "bits": 16,
170 | "coefficient": 1,
171 | "description": "转速",
172 | "invalid": "0xffff",
173 | "max": 8000,
174 | "min": 0,
175 | "name": "rpm",
176 | "offset": 0
177 | },
178 | {
179 | "bits": 32,
180 | "coefficient": 1,
181 | "description": "时间",
182 | "invalid": "0x0",
183 | "max": 4294967295,
184 | "min": 0,
185 | "name": "dateTime",
186 | "offset": 0
187 | },
188 | {
189 | "bits": 8,
190 | "coefficient": 1,
191 | "description": "瞬时速度",
192 | "invalid": "0xff",
193 | "max": 220,
194 | "min": 0,
195 | "name": "speed",
196 | "offset": 0
197 | },
198 | {
199 | "bits": 8,
200 | "coefficient": 1,
201 | "description": "水温",
202 | "invalid": "0xff",
203 | "max": 254,
204 | "min": 0,
205 | "name": "waterTemperature",
206 | "offset": 0
207 | },
208 | {
209 | "bits": 1,
210 | "coefficient": 1,
211 | "description": "确认按键 0: default\\n1: press down",
212 | "max": 1,
213 | "min": 0,
214 | "name": "enterKey",
215 | "offset": 0
216 | },
217 | {
218 | "bits": 1,
219 | "coefficient": 1,
220 | "description": "返回按键 0: default\\n1: press down",
221 | "max": 1,
222 | "min": 0,
223 | "name": "backKey",
224 | "offset": 0
225 | },
226 | {
227 | "bits": 1,
228 | "coefficient": 1,
229 | "description": "向上按键 0: default\\n1: press down",
230 | "max": 1,
231 | "min": 0,
232 | "name": "prevKey",
233 | "offset": 0
234 | },
235 | {
236 | "bits": 1,
237 | "coefficient": 1,
238 | "description": "向下按键 0: default\\n1: press down",
239 | "max": 1,
240 | "min": 0,
241 | "name": "nextKey",
242 | "offset": 0
243 | },
244 | {
245 | "bits": 1,
246 | "coefficient": 1,
247 | "description": "0: disenabled 1:enabled",
248 | "max": 1,
249 | "min": 0,
250 | "name": "projectModeEnabled",
251 | "offset": 0
252 | },
253 | {
254 | "bits": 2,
255 | "coefficient": 0,
256 | "max": 0,
257 | "min": 0,
258 | "offset": 0
259 | },
260 | {
261 | "bits": 1,
262 | "coefficient": 1,
263 | "description": "点火",
264 | "invalid": "0x0",
265 | "max": 1,
266 | "min": 0,
267 | "name": "igOn",
268 | "offset": 0
269 | },
270 | {
271 | "bits": 4,
272 | "coefficient": 1,
273 | "description": "档位",
274 | "invalid": "0xf",
275 | "max": 14,
276 | "min": 0,
277 | "name": "gear",
278 | "offset": 0
279 | },
280 | {
281 | "bits": 2,
282 | "coefficient": 1,
283 | "description": "档位模式",
284 | "invalid": "0x0",
285 | "max": 3,
286 | "min": 0,
287 | "name": "gearMode",
288 | "offset": 0
289 | },
290 | {
291 | "bits": 2,
292 | "coefficient": 1,
293 | "description": "钥匙状态",
294 | "invalid": "0x0",
295 | "max": 3,
296 | "min": 0,
297 | "name": "key",
298 | "offset": 0
299 | },
300 | {
301 | "bits": 1,
302 | "coefficient": 1,
303 | "description": "前左门状态,0x00:close\n0x01:open",
304 | "max": 1,
305 | "min": 0,
306 | "name": "lfDoor",
307 | "offset": 0
308 | },
309 | {
310 | "bits": 1,
311 | "coefficient": 1,
312 | "description": "前右门状态,0x00:close\n0x01:open",
313 | "max": 1,
314 | "min": 0,
315 | "name": "rfDoor",
316 | "offset": 0
317 | },
318 | {
319 | "bits": 1,
320 | "coefficient": 1,
321 | "description": "后左门状态,0x00:close\n0x01:open",
322 | "max": 1,
323 | "min": 0,
324 | "name": "lrDoor",
325 | "offset": 0
326 | },
327 | {
328 | "bits": 1,
329 | "coefficient": 1,
330 | "description": "后右门状态,0x00:close\n0x01:open",
331 | "max": 1,
332 | "min": 0,
333 | "name": "rrDoor",
334 | "offset": 0
335 | },
336 | {
337 | "bits": 1,
338 | "coefficient": 1,
339 | "description": "引擎盖状态,0x00:close\n0x01:open",
340 | "max": 1,
341 | "min": 0,
342 | "name": "hoodDoor",
343 | "offset": 0
344 | },
345 | {
346 | "bits": 1,
347 | "coefficient": 1,
348 | "description": "行李箱状态,0x00:close\n0x01:open",
349 | "max": 1,
350 | "min": 0,
351 | "name": "trunkDoor",
352 | "offset": 0
353 | },
354 | {
355 | "bits": 2,
356 | "coefficient": 0,
357 | "max": 0,
358 | "min": 0,
359 | "offset": 0
360 | },
361 | {
362 | "bits": 24,
363 | "coefficient": 1,
364 | "description": "总里程",
365 | "invalid": "0xffffff",
366 | "max": 999999,
367 | "min": 0,
368 | "name": "distanceTotal",
369 | "offset": 0
370 | },
371 | {
372 | "bits": 8,
373 | "coefficient": 1,
374 | "description": "平均速度",
375 | "invalid": "0xff",
376 | "max": 220,
377 | "min": 0,
378 | "name": "speedAverage",
379 | "offset": 0
380 | },
381 | {
382 | "bits": 8,
383 | "coefficient": 0,
384 | "min": 0,
385 | "offset": 0
386 | },
387 | {
388 | "bits": 16,
389 | "coefficient": 1,
390 | "description": "续航里程",
391 | "invalid": "0xffff",
392 | "max": 700,
393 | "min": 0,
394 | "name": "mileage",
395 | "offset": 0
396 | },
397 | {
398 | "bits": 24,
399 | "coefficient": 1,
400 | "description": "小计里程1",
401 | "invalid": "0xffffff",
402 | "max": 9999,
403 | "min": 0,
404 | "name": "distanceSubtotal1",
405 | "offset": 0
406 | },
407 | {
408 | "bits": 8,
409 | "coefficient": 1,
410 | "description": "油量",
411 | "invalid": "0xff",
412 | "max": 100,
413 | "min": 0,
414 | "name": "fuelQuantity",
415 | "offset": 0
416 | },
417 | {
418 | "bits": 24,
419 | "coefficient": 1,
420 | "description": "小计里程2",
421 | "invalid": "0xffffff",
422 | "max": 9999,
423 | "min": 0,
424 | "name": "distanceSubtotal2",
425 | "offset": 0
426 | },
427 | {
428 | "bits": 16,
429 | "coefficient": 1,
430 | "description": "保养里程",
431 | "invalid": "0xffff",
432 | "max": 5000,
433 | "min": 0,
434 | "name": "distanceMaintain",
435 | "offset": 0
436 | },
437 | {
438 | "bits": 16,
439 | "coefficient": 0.5,
440 | "description": "车外温度",
441 | "invalid": "0xffff",
442 | "max": 2045,
443 | "min": 0,
444 | "name": "temperatureOutside",
445 | "offset": -40
446 | },
447 | {
448 | "bits": 16,
449 | "coefficient": 0.1,
450 | "description": "平均油耗",
451 | "invalid": "0xffff",
452 | "max": 200,
453 | "min": 0,
454 | "name": "fuelAverage",
455 | "offset": 0
456 | },
457 | {
458 | "bits": 16,
459 | "coefficient": 0.1,
460 | "description": "瞬时油耗",
461 | "invalid": "0xffff",
462 | "max": 200,
463 | "min": 0,
464 | "name": "fuelInstant",
465 | "offset": 0
466 | },
467 | {
468 | "bits": 3,
469 | "coefficient": 1,
470 | "description": "雷达报警前左",
471 | "invalid": "0x7",
472 | "max": 5,
473 | "min": 0,
474 | "name": "radarWarningLF",
475 | "offset": 0
476 | },
477 | {
478 | "bits": 3,
479 | "coefficient": 1,
480 | "description": "雷达报警前左中",
481 | "invalid": "0x7",
482 | "max": 5,
483 | "min": 0,
484 | "name": "radarWarningLFC",
485 | "offset": 0
486 | },
487 | {
488 | "bits": 2,
489 | "coefficient": 0,
490 | "max": 0,
491 | "min": 0,
492 | "offset": 0
493 | },
494 | {
495 | "bits": 3,
496 | "coefficient": 1,
497 | "description": "雷达报警前右中",
498 | "invalid": "0x7",
499 | "max": 5,
500 | "min": 0,
501 | "name": "radarWarningRFC",
502 | "offset": 0
503 | },
504 | {
505 | "bits": 3,
506 | "coefficient": 1,
507 | "description": "雷达报警前右",
508 | "invalid": "0x7",
509 | "max": 5,
510 | "min": 0,
511 | "name": "radarWarningRF",
512 | "offset": 0
513 | },
514 | {
515 | "bits": 2,
516 | "coefficient": 1,
517 | "description": "自适应巡航实际距离",
518 | "invalid": "0x0",
519 | "max": 3,
520 | "min": 0,
521 | "name": "accDistanceActual",
522 | "offset": 0
523 | },
524 | {
525 | "bits": 3,
526 | "coefficient": 1,
527 | "description": "雷达报警后左",
528 | "invalid": "0x7",
529 | "max": 5,
530 | "min": 0,
531 | "name": "radarWarningLR",
532 | "offset": 0
533 | },
534 | {
535 | "bits": 3,
536 | "coefficient": 1,
537 | "description": "雷达报警后左中",
538 | "invalid": "0x7",
539 | "max": 5,
540 | "min": 0,
541 | "name": "radarWarningLRC",
542 | "offset": 0
543 | },
544 | {
545 | "bits": 2,
546 | "coefficient": 1,
547 | "description": "自适应巡航PCW",
548 | "invalid": "0x0",
549 | "max": 3,
550 | "min": 0,
551 | "name": "accPcw",
552 | "offset": 0
553 | },
554 | {
555 | "bits": 3,
556 | "coefficient": 1,
557 | "description": "雷达报警后右中\t",
558 | "invalid": "0x7",
559 | "max": 5,
560 | "min": 0,
561 | "name": "radarWarningRRC",
562 | "offset": 0
563 | },
564 | {
565 | "bits": 3,
566 | "coefficient": 1,
567 | "description": "雷达报警后右",
568 | "invalid": "0x7",
569 | "max": 5,
570 | "min": 0,
571 | "name": "radarWarningRR",
572 | "offset": 0
573 | },
574 | {
575 | "bits": 2,
576 | "coefficient": 1,
577 | "description": "雷达报警状态",
578 | "invalid": "0x0",
579 | "max": 3,
580 | "min": 0,
581 | "name": "radarStatus",
582 | "offset": 0
583 | },
584 | {
585 | "bits": 1,
586 | "coefficient": 1,
587 | "description": "前雾灯",
588 | "invalid": "0x0",
589 | "max": 1,
590 | "min": 0,
591 | "name": "fogFront",
592 | "offset": 0
593 | },
594 | {
595 | "bits": 1,
596 | "coefficient": 1,
597 | "description": "后雾灯",
598 | "invalid": "0x0",
599 | "max": 1,
600 | "min": 0,
601 | "name": "fogRear",
602 | "offset": 0
603 | },
604 | {
605 | "bits": 1,
606 | "coefficient": 1,
607 | "description": "左转向灯",
608 | "invalid": "0x0",
609 | "max": 1,
610 | "min": 0,
611 | "name": "turningLeft",
612 | "offset": 0
613 | },
614 | {
615 | "bits": 1,
616 | "coefficient": 1,
617 | "description": "右转向灯",
618 | "invalid": "0x0",
619 | "max": 1,
620 | "min": 0,
621 | "name": "turningRight",
622 | "offset": 0
623 | },
624 | {
625 | "bits": 1,
626 | "coefficient": 1,
627 | "description": "大光灯",
628 | "invalid": "0x0",
629 | "max": 1,
630 | "min": 0,
631 | "name": "beamHigh",
632 | "offset": 0
633 | },
634 | {
635 | "bits": 1,
636 | "coefficient": 1,
637 | "description": "小光灯",
638 | "invalid": "0x0",
639 | "max": 1,
640 | "min": 0,
641 | "name": "beamLow",
642 | "offset": 0
643 | },
644 | {
645 | "bits": 1,
646 | "coefficient": 1,
647 | "description": "电子制动力分配",
648 | "invalid": "0x0",
649 | "max": 1,
650 | "min": 0,
651 | "name": "ebd",
652 | "offset": 0
653 | },
654 | {
655 | "bits": 1,
656 | "coefficient": 1,
657 | "description": "紧急刹车灯",
658 | "invalid": "0x0",
659 | "max": 1,
660 | "min": 0,
661 | "name": "ep",
662 | "offset": 0
663 | },
664 | {
665 | "bits": 1,
666 | "coefficient": 1,
667 | "description": "气囊故障",
668 | "invalid": "0x0",
669 | "max": 1,
670 | "min": 0,
671 | "name": "airbagFault",
672 | "offset": 0
673 | },
674 | {
675 | "bits": 1,
676 | "coefficient": 1,
677 | "description": "电子驻车制动系统故障",
678 | "invalid": "0x0",
679 | "max": 1,
680 | "min": 0,
681 | "name": "epbFault",
682 | "offset": 0
683 | },
684 | {
685 | "bits": 1,
686 | "coefficient": 1,
687 | "description": "日间行车灯",
688 | "invalid": "0x0",
689 | "max": 1,
690 | "min": 0,
691 | "name": "drl",
692 | "offset": 0
693 | },
694 | {
695 | "bits": 1,
696 | "coefficient": 1,
697 | "invalid": "0x0",
698 | "max": 1,
699 | "min": 0,
700 | "offset": 0
701 | },
702 | {
703 | "bits": 1,
704 | "coefficient": 1,
705 | "description": "防锁死刹车装置",
706 | "invalid": "0x0",
707 | "max": 1,
708 | "min": 0,
709 | "name": "abs",
710 | "offset": 0
711 | },
712 | {
713 | "bits": 1,
714 | "coefficient": 1,
715 | "description": "发动机电子稳定装置",
716 | "invalid": "0x0",
717 | "max": 1,
718 | "min": 0,
719 | "name": "epc",
720 | "offset": 0
721 | },
722 | {
723 | "bits": 1,
724 | "coefficient": 1,
725 | "description": "电动助力转向系统",
726 | "invalid": "0x0",
727 | "max": 1,
728 | "min": 0,
729 | "name": "eps",
730 | "offset": 0
731 | },
732 | {
733 | "bits": 1,
734 | "coefficient": 1,
735 | "description": "发动排放机故障",
736 | "invalid": "0x0",
737 | "max": 1,
738 | "min": 0,
739 | "name": "mil",
740 | "offset": 0
741 | },
742 | {
743 | "bits": 1,
744 | "coefficient": 1,
745 | "description": "车身电子稳定系统关闭",
746 | "invalid": "0x0",
747 | "max": 1,
748 | "min": 0,
749 | "name": "espOff",
750 | "offset": 0
751 | },
752 | {
753 | "bits": 1,
754 | "coefficient": 1,
755 | "description": "保养信号灯",
756 | "invalid": "0x0",
757 | "max": 1,
758 | "min": 0,
759 | "name": "maintain",
760 | "offset": 0
761 | },
762 | {
763 | "bits": 1,
764 | "coefficient": 1,
765 | "description": "刹车油压力低",
766 | "invalid": "0x0",
767 | "max": 1,
768 | "min": 0,
769 | "name": "brakeOilLow",
770 | "offset": 0
771 | },
772 | {
773 | "bits": 1,
774 | "coefficient": 1,
775 | "description": "四驱",
776 | "invalid": "0x0",
777 | "max": 1,
778 | "min": 0,
779 | "name": "w4",
780 | "offset": 0
781 | },
782 | {
783 | "bits": 2,
784 | "coefficient": 1,
785 | "description": "发动机启停",
786 | "invalid": "0x0",
787 | "max": 3,
788 | "min": 0,
789 | "name": "startStop",
790 | "offset": 0
791 | },
792 | {
793 | "bits": 1,
794 | "coefficient": 1,
795 | "description": "胎压系统故障",
796 | "invalid": "0x0",
797 | "max": 1,
798 | "min": 0,
799 | "name": "tirePressureSystem",
800 | "offset": 0
801 | },
802 | {
803 | "bits": 1,
804 | "coefficient": 1,
805 | "description": "胎压配置",
806 | "invalid": "0x0",
807 | "max": 1,
808 | "min": 0,
809 | "name": "tireConfig",
810 | "offset": 0
811 | },
812 | {
813 | "bits": 2,
814 | "coefficient": 1,
815 | "description": "机油压力低",
816 | "invalid": "0x0",
817 | "max": 3,
818 | "min": 0,
819 | "name": "engineOilLow",
820 | "offset": 0
821 | },
822 | {
823 | "bits": 2,
824 | "coefficient": 1,
825 | "description": "车身电子稳定系统",
826 | "invalid": "0x0",
827 | "max": 3,
828 | "min": 0,
829 | "name": "esp",
830 | "offset": 0
831 | },
832 | {
833 | "bits": 2,
834 | "coefficient": 1,
835 | "description": "电子驻车制动系统",
836 | "invalid": "0x0",
837 | "max": 3,
838 | "min": 0,
839 | "name": "epb",
840 | "offset": 0
841 | },
842 | {
843 | "bits": 2,
844 | "coefficient": 1,
845 | "description": "位置灯",
846 | "invalid": "0x0",
847 | "max": 3,
848 | "min": 0,
849 | "name": "position",
850 | "offset": 0
851 | },
852 | {
853 | "bits": 2,
854 | "coefficient": 1,
855 | "description": "传动控制系统故障",
856 | "invalid": "0x0",
857 | "max": 3,
858 | "min": 0,
859 | "name": "tcuFault",
860 | "offset": 0
861 | },
862 | {
863 | "bits": 2,
864 | "coefficient": 1,
865 | "description": "水温故障",
866 | "invalid": "0x0",
867 | "max": 3,
868 | "min": 0,
869 | "name": "coolantTemperatureWarning",
870 | "offset": 0
871 | },
872 | {
873 | "bits": 2,
874 | "coefficient": 1,
875 | "description": "陡坡缓降",
876 | "invalid": "0x0",
877 | "max": 3,
878 | "min": 0,
879 | "name": "hdc",
880 | "offset": 0
881 | },
882 | {
883 | "bits": 1,
884 | "coefficient": 1,
885 | "description": "发动机防盗系统",
886 | "invalid": "0x0",
887 | "max": 1,
888 | "min": 0,
889 | "name": "immo",
890 | "offset": 0
891 | },
892 | {
893 | "bits": 1,
894 | "coefficient": 1,
895 | "description": "驾驶员安全带",
896 | "invalid": "0x0",
897 | "max": 1,
898 | "min": 0,
899 | "name": "beltDriver",
900 | "offset": 0
901 | },
902 | {
903 | "bits": 1,
904 | "coefficient": 1,
905 | "description": "副驾驶员安全带",
906 | "invalid": "0x0",
907 | "max": 1,
908 | "min": 0,
909 | "name": "beltPessenger",
910 | "offset": 0
911 | },
912 | {
913 | "bits": 1,
914 | "coefficient": 1,
915 | "description": "车道保持辅助系统故障",
916 | "invalid": "0x0",
917 | "max": 1,
918 | "min": 0,
919 | "name": "alsFault",
920 | "offset": 0
921 | },
922 | {
923 | "bits": 1,
924 | "coefficient": 1,
925 | "description": "雷达启动",
926 | "invalid": "0x0",
927 | "max": 1,
928 | "min": 0,
929 | "name": "radarActive",
930 | "offset": 0
931 | },
932 | {
933 | "bits": 1,
934 | "coefficient": 1,
935 | "description": "电子驻车系统",
936 | "invalid": "0x0",
937 | "max": 1,
938 | "min": 0,
939 | "name": "avh",
940 | "offset": 0
941 | },
942 | {
943 | "bits": 1,
944 | "coefficient": 1,
945 | "description": "室外温度单位",
946 | "invalid": "0x0",
947 | "max": 1,
948 | "min": 0,
949 | "name": "temperatureOutsideUnit",
950 | "offset": 0
951 | },
952 | {
953 | "bits": 1,
954 | "coefficient": 1,
955 | "description": "开启超速报警",
956 | "invalid": "0x0",
957 | "max": 1,
958 | "min": 0,
959 | "name": "overSpeedActive",
960 | "offset": 0
961 | },
962 | {
963 | "bits": 2,
964 | "coefficient": 1,
965 | "description": "换挡模式",
966 | "invalid": "0x0",
967 | "max": 3,
968 | "min": 0,
969 | "name": "gearSwitchMode",
970 | "offset": 0
971 | },
972 | {
973 | "bits": 8,
974 | "coefficient": 1,
975 | "description": "主题 0:主题1\\n1:主题2\\n2:主题3\\n4:主题4",
976 | "max": 4,
977 | "min": 0,
978 | "name": "theme",
979 | "offset": 0
980 | },
981 | {
982 | "bits": 8,
983 | "coefficient": 1,
984 | "description": "语言 0:中文\\n1:英文",
985 | "max": 1,
986 | "min": 0,
987 | "name": "language",
988 | "offset": 0
989 | },
990 | {
991 | "bits": 8,
992 | "coefficient": 1,
993 | "description": "硬件临时版本",
994 | "invalid": "0xff",
995 | "max": 100,
996 | "min": 0,
997 | "name": "hwVersionMin",
998 | "offset": 0
999 | },
1000 | {
1001 | "bits": 5,
1002 | "coefficient": 1,
1003 | "description": "硬件中版本号 交付版本,每次交付样机加一",
1004 | "invalid": "0x1f",
1005 | "max": 30,
1006 | "min": 0,
1007 | "name": "hwVersionMid",
1008 | "offset": 0
1009 | },
1010 | {
1011 | "bits": 3,
1012 | "coefficient": 1,
1013 | "description": "硬件主版本号 SOP版本号,量产加一",
1014 | "invalid": "0x7",
1015 | "max": 6,
1016 | "min": 0,
1017 | "name": "hwVersionMax",
1018 | "offset": 0
1019 | }
1020 | ],
1021 | "specialSignals": [
1022 | {
1023 | "name": "tirePressureLF",
1024 | "type": 1
1025 | },
1026 | {
1027 | "name": "tirePressureRF",
1028 | "type": 2
1029 | },
1030 | {
1031 | "name": "tirePressureLR",
1032 | "type": 3
1033 | },
1034 | {
1035 | "name": "tirePressureRR",
1036 | "type": 4
1037 | },
1038 | {
1039 | "name": "tirePressureWarningLF",
1040 | "type": 5
1041 | },
1042 | {
1043 | "name": "tirePressureWarningRF",
1044 | "type": 6
1045 | },
1046 | {
1047 | "name": "fuelLow",
1048 | "type": 7
1049 | },
1050 | {
1051 | "name": "outsideTemperatureStatus",
1052 | "type": 8
1053 | },
1054 | {
1055 | "name": "tirePressureWarningLR",
1056 | "type": 9
1057 | },
1058 | {
1059 | "name": "tirePressureWarningRR",
1060 | "type": 10
1061 | },
1062 | {
1063 | "name": "memset",
1064 | "type": 11
1065 | },
1066 | {
1067 | "name": "tireTemperatureLF",
1068 | "type": 12
1069 | },
1070 | {
1071 | "name": "tireTemperatureRF",
1072 | "type": 13
1073 | },
1074 | {
1075 | "name": "tireTemperatureLR",
1076 | "type": 14
1077 | },
1078 | {
1079 | "name": "tireTemperatureRR",
1080 | "type": 15
1081 | },
1082 | {
1083 | "name": "tireTemperatureWarningLF",
1084 | "type": 16
1085 | },
1086 | {
1087 | "name": "tireTemperatureWarningRF",
1088 | "type": 17
1089 | },
1090 | {
1091 | "name": "tireTemperatureWarningLR",
1092 | "type": 18
1093 | },
1094 | {
1095 | "name": "tireTemperatureWarningRR",
1096 | "type": 19
1097 | },
1098 | {
1099 | "name": "tireSystemWarning",
1100 | "type": 20
1101 | },
1102 | {
1103 | "name": "lcdDisplay",
1104 | "type": 21
1105 | },
1106 | {
1107 | "name": "drivingMode",
1108 | "type": 22
1109 | },
1110 | {
1111 | "name": "accText",
1112 | "type": 23
1113 | },
1114 | {
1115 | "name": "accAeb",
1116 | "type": 24
1117 | },
1118 | {
1119 | "name": "fatigue",
1120 | "type": 25
1121 | },
1122 | {
1123 | "name": "dvdActive",
1124 | "type": 26
1125 | },
1126 | {
1127 | "name": "laneDeparture",
1128 | "type": 27
1129 | },
1130 | {
1131 | "name": "cruiseControlStatus",
1132 | "type": 28
1133 | },
1134 | {
1135 | "name": "cruiseControlSpeed",
1136 | "type": 29
1137 | },
1138 | {
1139 | "name": "pepsStatus",
1140 | "type": 30
1141 | },
1142 | {
1143 | "name": "gearSwitchTarget",
1144 | "type": 31
1145 | },
1146 | {
1147 | "name": "usbUpgrade",
1148 | "type": 32
1149 | },
1150 | {
1151 | "name": "backlight",
1152 | "type": 33
1153 | },
1154 | {
1155 | "name": "dvdConfig",
1156 | "type": 34
1157 | },
1158 | {
1159 | "name": "theme",
1160 | "type": 35
1161 | },
1162 | {
1163 | "name": "language",
1164 | "type": 36
1165 | },
1166 | {
1167 | "name": "speedLimit",
1168 | "type": 37
1169 | },
1170 | {
1171 | "name": "hardwareVersion",
1172 | "type": 38
1173 | },
1174 | {
1175 | "name": "dvdClockToward",
1176 | "type": 39
1177 | },
1178 | {
1179 | "name": "dvdClockGuide",
1180 | "type": 40
1181 | },
1182 | {
1183 | "name": "dvdTurnDistance",
1184 | "type": 41
1185 | },
1186 | {
1187 | "name": "dvdDestinationDistance",
1188 | "type": 42
1189 | },
1190 | {
1191 | "name": "dvdGuideType",
1192 | "type": 43
1193 | },
1194 | {
1195 | "name": "dvdTurnType",
1196 | "type": 44
1197 | },
1198 | {
1199 | "name": "dvdMode",
1200 | "type": 45
1201 | },
1202 | {
1203 | "name": "usbTest",
1204 | "type": 46
1205 | },
1206 | {
1207 | "name": "timeMode",
1208 | "type": 47
1209 | },
1210 | {
1211 | "name": "accConfig",
1212 | "type": 48
1213 | },
1214 | {
1215 | "name": "accTakeOverRequest",
1216 | "type": 49
1217 | },
1218 | {
1219 | "name": "accFrontStatus",
1220 | "type": 50
1221 | },
1222 | {
1223 | "name": "accSignalStatus",
1224 | "type": 51
1225 | },
1226 | {
1227 | "name": "accFrontDistanceActual",
1228 | "type": 52
1229 | },
1230 | {
1231 | "name": "accTargetSpeed",
1232 | "type": 53
1233 | }
1234 | ],
1235 | "version": "0.0.1"
1236 | }
1237 |
--------------------------------------------------------------------------------
/Json/mixingCar.json:
--------------------------------------------------------------------------------
1 | {
2 | "commands": [
3 | {
4 | "name": "applicationState" ,"bits": 8, "min": 0,
5 | "description": "0: 显示未初始化,例如开机视频播放,1: 开机动画进行中,2: 关机动画进行中,3: 自检中, \
6 | 4: 休眠界面显示中,5: 休眠界面显示动画进行中,6: 休眠界面消失动画进行中,7: 正常状态画面显示中"
7 | },
8 | {
9 | "bits": 1,
10 | "coefficient": 1,
11 | "description": "命令请求,1:请求 0:不请求,开机后,当MCU接收到此命令后,开始向CORE发送信号",
12 | "max": 1,
13 | "min": 0,
14 | "name": "commandReq",
15 | "offset": 0
16 | },
17 | {
18 | "bits": 1,
19 | "coefficient": 1,
20 | "description": "关屏请求,1:关屏 0:不关屏",
21 | "max": 1,
22 | "min": 0,
23 | "name": "closeReq",
24 | "offset": 0
25 | },
26 | {
27 | "bits": 1,
28 | "coefficient": 1,
29 | "description": "小计里程清零,1:清零 0:不清零",
30 | "max": 1,
31 | "min": 0,
32 | "name": "tripClean",
33 | "offset": 0
34 | },
35 | {
36 | "bits": 1,
37 | "coefficient": 1,
38 | "description": "平均车速清零,1:清零 0:不清零",
39 | "max": 1,
40 | "min": 0,
41 | "name": "avgSpeedClean",
42 | "offset": 0
43 | },
44 | {
45 | "bits": 1,
46 | "coefficient": 1,
47 | "description": "平均油耗清零,1:清零 0:不清零",
48 | "max": 1,
49 | "min": 0,
50 | "name": "avgFuelClean",
51 | "offset": 0
52 | },
53 | {
54 | "bits": 3,
55 | "min": 0
56 | },
57 | {
58 | "bits": 8,
59 | "coefficient": 1,
60 | "description": "报警界面声音同步,用于报警界面与声音同步,每个数值表示不同的报警界面,待定",
61 | "max": 255,
62 | "min": 0,
63 | "name": "alarmInterface",
64 | "offset": 0
65 | },
66 | {
67 | "bits": 8,
68 | "min": 0,
69 | "name": "interfaceSoundSync"
70 | },
71 | {
72 | "bits": 2,
73 | "coefficient": 1,
74 | "description": "CORE系统烧写完成,USB转OTG烧写核心板系统完毕信号\n00: 无操作\n01: 完成\n10: 失败\n11: 保留",
75 | "max": 1,
76 | "min": 0,
77 | "name": "coreSysBurned",
78 | "offset": 0
79 | },
80 | {
81 | "bits": 6,
82 | "min": 0
83 | },
84 | {
85 | "bits": 32,
86 | "coefficient": 1,
87 | "description": "日期时间设置,存储自1970年1月1日0时0分0秒到现在的秒数:修改 0:不修改",
88 | "min": 0,
89 | "name": "secondsSet",
90 | "offset": 0
91 | },
92 | {
93 | "bits": 24,
94 | "min": 0
95 | },
96 | {
97 | "bits": 4,
98 | "coefficient": 1,
99 | "description": "当前主题,0x0000:主题1(默认主题,不设置)\n0x0001~0x1111:主题2至15",
100 | "max": 15,
101 | "min": 0,
102 | "name": "setCurrentTheme",
103 | "offset": 0
104 | },
105 | {
106 | "bits": 4,
107 | "coefficient": 1,
108 | "description": "工程模式,0x0000:普通模式(默认模式,不设置)\n0x0001:演示模式\n0x0010:工程模式\n0x0011:生产模式\n0x0100~0x1111:备用模式\n",
109 | "max": 15,
110 | "min": 0,
111 | "name": "setProjectMode",
112 | "offset": 0
113 | },
114 | {
115 | "bits": 4,
116 | "coefficient": 1,
117 | "description": "当前界面编号,0:常显界面\n1:导航界面\n2:夜视界面\n3:行车记录仪界面\n4-15: 保留",
118 | "max": 15,
119 | "min": 0,
120 | "name": "currentInterfaceNum"
121 | },
122 | {
123 | "bits": 4,
124 | "coefficient": 1,
125 | "description": "限速报警设置,0:OFF 1:40km/h 2:50km/h......13:160km/h",
126 | "max": 15,
127 | "min": 0
128 | },
129 | {
130 | "bits": 1,
131 | "coefficient": 1,
132 | "description": "开机动画完成标志,0:开机动画未完成\n1:开机动画完成",
133 | "max": 1,
134 | "min": 0,
135 | "name": "startAnimationEnd"
136 | },
137 | {
138 | "bits": 7,
139 | "min": 0
140 | },
141 | {
142 | "bits": 16,
143 | "min": 0
144 | },
145 | {
146 | "bits": 32,
147 | "min": 0,
148 | "name": "toMCUHeartbeat"
149 | }
150 | ],
151 | "heartBeatInterval": 3000,
152 | "signals": [
153 | {
154 | "bits": 16,
155 | "coefficient": 1,
156 | "description": "转数",
157 | "max": 7000,
158 | "min": 0,
159 | "name": "rpm",
160 | "offset": 0
161 | },
162 | {
163 | "bits": 8,
164 | "coefficient": 1,
165 | "description": "车速,0-240",
166 | "max": 240,
167 | "min": 0,
168 | "name": "speed",
169 | "offset": 0
170 | },
171 | {
172 | "bits": 8,
173 | "coefficient": 1,
174 | "description": "水温表",
175 | "max": 130,
176 | "min": 50,
177 | "name": "waterTemp",
178 | "offset": 0
179 | },
180 | {
181 | "bits": 32,
182 | "coefficient": 1,
183 | "description": "时间 存储自1970年1月1日0时0分0秒到现在的秒数",
184 | "invalid": "0x0",
185 | "max": 4294967295,
186 | "min": 0,
187 | "name": "dateTime",
188 | "offset": 0
189 | },
190 | {
191 | "bits": 1,
192 | "coefficient": 1,
193 | "description": " 按键1,0: 未按下\n1: 按下",
194 | "max": 1,
195 | "min": 0,
196 | "name": "enterKey",
197 | "offset": 0
198 | },
199 | {
200 | "bits": 1,
201 | "coefficient": 1,
202 | "description": "按键2,0: 未按下\n1: 按下",
203 | "max": 1,
204 | "min": 0,
205 | "name": "backKey",
206 | "offset": 0
207 | },
208 | {
209 | "bits": 1,
210 | "coefficient": 1,
211 | "description": "按键3",
212 | "max": 1,
213 | "min": 0,
214 | "name": "nextKey",
215 | "offset": 0
216 | },
217 | {
218 | "bits": 1,
219 | "coefficient": 1,
220 | "description": " 按键4",
221 | "max": 1,
222 | "min": 0,
223 | "name": "prevKey",
224 | "offset": 0
225 | },
226 | {
227 | "bits": 1,
228 | "coefficient": 1,
229 | "description": "0:disEnabled 1:enabled",
230 | "max": 1,
231 | "min": 0,
232 | "name": "projectModeEnabled",
233 | "offset": 0
234 | },
235 | {
236 | "bits": 2,
237 | "min": 0
238 | },
239 | {
240 | "bits": 1,
241 | "coefficient": 1,
242 | "description": "点火状态,0:OFF\n1:ON",
243 | "max": 1,
244 | "min": 0,
245 | "name": "igOn",
246 | "offset": 0
247 | },
248 | {
249 | "bits": 4,
250 | "coefficient": 1,
251 | "description": "档位信息,0x00 不显示\n0x01 手动1档\n0x02 手动2档\n0x03 手动3档\n0x04 手动4档\n0x05 手动5档\n0x06 手动6档\n0x07 手动7档\n0x08 自动P档\n0x09 自动D档\n0x0A 自动N档\n0x0B 自动R档\n0x0C-0x0E 保留\n0x0F:故障",
252 | "max": 8,
253 | "min": 0,
254 | "name": "gear",
255 | "offset": 0
256 | },
257 | {
258 | "bits": 2,
259 | "min": 0
260 | },
261 | {
262 | "bits": 2,
263 | "coefficient": 1,
264 | "description": "钥匙状态,OFF =0,ACC = 1,ON = 2,START = 3",
265 | "max": 3,
266 | "min": 0,
267 | "name": "keyStatus",
268 | "offset": 0
269 | },
270 | {
271 | "bits": 1,
272 | "coefficient": 1,
273 | "description": "前左门状态,0x00:close\n0x01:open",
274 | "max": 1,
275 | "min": 0,
276 | "name": "lfDoor",
277 | "offset": 0
278 | },
279 | {
280 | "bits": 1,
281 | "coefficient": 1,
282 | "description": "前右门状态,0x00:close\n0x01:open",
283 | "max": 1,
284 | "min": 0,
285 | "name": "rfDoor",
286 | "offset": 0
287 | },
288 | {
289 | "bits": 1,
290 | "coefficient": 1,
291 | "description": "后左门状态,0x00:close\n0x01:open",
292 | "max": 1,
293 | "min": 0,
294 | "name": "lrDoor",
295 | "offset": 0
296 | },
297 | {
298 | "bits": 1,
299 | "coefficient": 1,
300 | "description": "后右门状态,0x00:close\n0x01:open",
301 | "max": 1,
302 | "min": 0,
303 | "name": "rrDoor",
304 | "offset": 0
305 | },
306 | {
307 | "bits": 1,
308 | "coefficient": 1,
309 | "description": "引擎盖状态,0x00:close\n0x01:open",
310 | "max": 1,
311 | "min": 0,
312 | "name": "hoodDoor",
313 | "offset": 0
314 | },
315 | {
316 | "bits": 1,
317 | "coefficient": 1,
318 | "description": "行李箱状态,0x00:close\n0x01:open",
319 | "max": 1,
320 | "min": 0,
321 | "name": "trunkDoor",
322 | "offset": 0
323 | },
324 | {
325 | "bits": 2,
326 | "min": 0
327 | },
328 | {
329 | "bits": 1,
330 | "description": "左转向灯,0x00:OFF\n0x01:ON",
331 | "min": 0,
332 | "name": "turnLeft"
333 | },
334 | {
335 | "bits": 1,
336 | "description": "右转向灯,0x00:OFF\n0x01:ON",
337 | "min": 0,
338 | "name": "turnRight"
339 | },
340 | {
341 | "bits": 1,
342 | "description": "前雾灯,0x00:OFF\n0x01:ON",
343 | "min": 0,
344 | "name": "frontFogLight"
345 | },
346 | {
347 | "bits": 1,
348 | "description": "后雾灯,0x00:OFF\n0x01:ON",
349 | "min": 0,
350 | "name": "rearFogLight"
351 | },
352 | {
353 | "bits": 1,
354 | "description": "主驾驶安全带未系报警灯,0x00:OFF\n0x01:ON",
355 | "min": 0,
356 | "name": "seatBeltMas"
357 | },
358 | {
359 | "bits": 1,
360 | "description": "副驾驶安全带未系报警灯,0x00:OFF\n0x01:ON",
361 | "min": 0,
362 | "name": "seatBeltCop"
363 | },
364 | {
365 | "bits": 1,
366 | "description": "远光灯,0x00:OFF\n0x01:ON",
367 | "min": 0,
368 | "name": "highBeam"
369 | },
370 | {
371 | "bits": 1,
372 | "description": "近光灯,0x00:OFF\n0x01:ON",
373 | "min": 0,
374 | "name": "lowBeam"
375 | },
376 | {
377 | "bits": 8,
378 | "min": 0
379 | },
380 | {
381 | "bits": 24,
382 | "coefficient": 1,
383 | "description": "总里程,最大有效值是999999,非法值0xFFFFFF",
384 | "max": 999999,
385 | "min": 0,
386 | "name": "odo",
387 | "offset": 0
388 | },
389 | {
390 | "bits": 8,
391 | "coefficient": 1,
392 | "description": "平均车速,0-240km/h",
393 | "max": 240,
394 | "min": 0,
395 | "name": "avgSpeed",
396 | "offset": 0
397 | },
398 | {
399 | "bits": 4,
400 | "coefficient": 1,
401 | "description": "当前主题,0x0000:主题1\n0x0001~0x1111:主题2至15",
402 | "max": 15,
403 | "min": 0,
404 | "name": "theme",
405 | "offset": 0
406 | },
407 | {
408 | "bits": 4,
409 | "coefficient": 1,
410 | "description": "工程模式,0x0000:普通模式\n0x0001:演示模式\n0x0002:工程模式\n0x0003:生产模式\n0x0004~0x1111:备用模式\n",
411 | "max": 15,
412 | "min": 0,
413 | "name": "projectMode",
414 | "offset": 0
415 | },
416 | {
417 | "bits": 16,
418 | "coefficient": 1,
419 | "description": "续航里程,0-999km",
420 | "max": 999,
421 | "min": 0,
422 | "name": "remainMileage",
423 | "offset": 0
424 | },
425 | {
426 | "bits": 16,
427 | "coefficient": 1,
428 | "max": 50000,
429 | "min": 0,
430 | "name": "maintenanceMileage",
431 | "offset": 0
432 | },
433 | {
434 | "bits": 16,
435 | "coefficient": 0.1,
436 | "description": "车外温度,0xFFFF非法温度,显示为\"--.-\"\n0xFFFE不显示",
437 | "max": 160,
438 | "min": -40,
439 | "name": "outTemp",
440 | "offset": -40
441 | },
442 | {
443 | "bits": 24,
444 | "coefficient": 0.1,
445 | "description": "小计里程1,最大有效值为999.9,非法值0xFFFF",
446 | "max": 999.9,
447 | "min": 0,
448 | "name": "trip1",
449 | "offset": 0
450 | },
451 | {
452 | "bits": 8,
453 | "coefficient": 1,
454 | "description": "燃油量,0%-100%",
455 | "max": 100,
456 | "min": 0,
457 | "name": "fuel",
458 | "offset": 0
459 | },
460 | {
461 | "bits": 16,
462 | "coefficient": 0.1,
463 | "description": "平均油耗,0xFFFF,表示无效值。\n0.0-30.0L/100km,单位L/100km.\n最高位为0时,代表L/H.\n最高位为1时,代表L/100km\n",
464 | "max": 30,
465 | "min": 0,
466 | "name": "avgFuel",
467 | "offset": 0
468 | },
469 | {
470 | "bits": 16,
471 | "coefficient": 0.1,
472 | "description": "瞬时油耗,0.0-45.0L/100km,\n最高位为0时,代表L/H.\n最高位为1时,代表L/100km\n",
473 | "max": 45,
474 | "min": 0,
475 | "name": "instantFuel",
476 | "offset": 0
477 | },
478 | {
479 | "bits": 24,
480 | "coefficient": 0.1,
481 | "description": "小计里程2,最大有效值为999.9,非法值0xFFFF",
482 | "max": 999.9,
483 | "min": 0,
484 | "name": "trip2",
485 | "offset": 0
486 | },
487 | {
488 | "bits": 8,
489 | "coefficient": 1,
490 | "description": "电量SOC,0%-100%(燃油表此项默认无效值)",
491 | "max": 100,
492 | "min": 0,
493 | "name": "soc",
494 | "offset": 0
495 | },
496 | {
497 | "bits": 16,
498 | "coefficient": 0.1,
499 | "description": "动力电池电流,燃油表为无效值",
500 | "max": 500,
501 | "min": 0,
502 | "name": "batteryCurrent",
503 | "offset": -500
504 | },
505 | {
506 | "bits": 16,
507 | "coefficient": 0.1,
508 | "description": "动力电池电压,燃油表为无效值",
509 | "max": 600,
510 | "min": 0,
511 | "name": "batteryVoltage",
512 | "offset": 0
513 | },
514 | {
515 | "bits": 16,
516 | "coefficient": 0.1,
517 | "description": "平均电能消耗,兼容电动车与混动车",
518 | "max": 2000,
519 | "min": 0,
520 | "name": "avgPowerConsum",
521 | "offset": 0
522 | },
523 | {
524 | "bits": 8,
525 | "coefficient": 1,
526 | "description": "MCU临时版本",
527 | "invalid": "0xff",
528 | "max": 100,
529 | "min": 0,
530 | "name": "mcuVersionMin",
531 | "offset": 0
532 | },
533 | {
534 | "bits": 5,
535 | "coefficient": 1,
536 | "description": "MCU中版本号 交付版本,每次交付样机加一",
537 | "invalid": "0x1f",
538 | "max": 30,
539 | "min": 0,
540 | "name": "mcuVersionMid",
541 | "offset": 0
542 | },
543 | {
544 | "bits": 3,
545 | "coefficient": 1,
546 | "description": "MCU主版本号 SOP版本号,量产加一",
547 | "invalid": "0x7",
548 | "max": 6,
549 | "min": 0,
550 | "name": "mcuVersionMax",
551 | "offset": 0
552 | },
553 | {
554 | "bits": 8,
555 | "coefficient": 1,
556 | "description": "硬件临时版本",
557 | "invalid": "0xff",
558 | "max": 100,
559 | "min": 0,
560 | "name": "hwVersionMin",
561 | "offset": 0
562 | },
563 | {
564 | "bits": 5,
565 | "coefficient": 1,
566 | "description": "硬件中版本号 交付版本,每次交付样机加一",
567 | "invalid": "0x1f",
568 | "max": 30,
569 | "min": 0,
570 | "name": "hwVersionMid",
571 | "offset": 0
572 | },
573 | {
574 | "bits": 3,
575 | "coefficient": 1,
576 | "description": "硬件主版本号 SOP版本号,量产加一",
577 | "invalid": "0x7",
578 | "max": 6,
579 | "min": 0,
580 | "name": "hwVersionMax",
581 | "offset": 0
582 | },
583 | {
584 | "bits": 16,
585 | "min": 0,
586 | "name": "language"
587 | },
588 | {
589 | "bits": 8,
590 | "coefficient": 1,
591 | "description": "前左胎压,胎压值 = value * 比例系数 + 偏移量",
592 | "max": 255,
593 | "min": 0,
594 | "name": "lfTire",
595 | "offset": 0
596 | },
597 | {
598 | "bits": 8,
599 | "coefficient": 1,
600 | "description": "前右胎压,胎压值 = value * 比例系数 + 偏移量 ",
601 | "max": 255,
602 | "min": 0,
603 | "name": "rfTire",
604 | "offset": 0
605 | },
606 | {
607 | "bits": 8,
608 | "coefficient": 1,
609 | "description": "后左胎压,胎压值 = value * 比例系数 + 偏移量 ",
610 | "max": 255,
611 | "min": 0,
612 | "name": "lbTire",
613 | "offset": 0
614 | },
615 | {
616 | "bits": 8,
617 | "coefficient": 1,
618 | "description": "后右胎压,胎压值 = value * 比例系数 + 偏移量 ",
619 | "max": 255,
620 | "min": 0,
621 | "name": "rbTire",
622 | "offset": 0
623 | },
624 | {
625 | "bits": 3,
626 | "coefficient": 1,
627 | "description": "前左胎压报警信息, $0 : No warning. \n$1 : High pressure warning. (同时显示的胎压数值变红) \n$2 : Low pressure warning. (同时显示的胎压数值变红) \n$3 : Quik leakage. \n$4 : Lost Sensor \n$5 : Sensor battery low \n$6 : High Temper(同时显示的胎温数值变红) \n$7 : Reserved",
628 | "min": 0,
629 | "name": "lfTireWar",
630 | "offset": 0
631 | },
632 | {
633 | "bits": 3,
634 | "coefficient": 1,
635 | "description": "前右胎压报警信息",
636 | "min": 0,
637 | "name": "rfTireWar",
638 | "offset": 0
639 | },
640 | {
641 | "bits": 1,
642 | "coefficient": 1,
643 | "description": "胎压模式,0:直接测量模式\n1:间接测量模式",
644 | "min": 0,
645 | "name": "tireMode",
646 | "offset": 0
647 | },
648 | {
649 | "bits": 1,
650 | "coefficient": 1,
651 | "description": "信号灯同步,0:无同步 1:同步",
652 | "min": 0,
653 | "name": "lightSync",
654 | "offset": 0
655 | },
656 | {
657 | "bits": 3,
658 | "coefficient": 1,
659 | "description": "后左胎压报警信息,$0 : No warning. \n$1 : High pressure warning. (同时显示的胎压数值变红) \n$2 : Low pressure warning. (同时显示的胎压数值变红)\n$3 : Quik leakage. \n$4 : Lost Sensor \n$5 : Sensor battery low \n$6 : High Temper (同时显示的胎温数值变红)\n$7 : Reserved",
660 | "min": 0,
661 | "name": "lbTireWar",
662 | "offset": 0
663 | },
664 | {
665 | "bits": 3,
666 | "coefficient": 1,
667 | "description": "后右胎压报警信息",
668 | "min": 0,
669 | "name": "rbTireWar",
670 | "offset": 0
671 | },
672 | {
673 | "bits": 2,
674 | "min": 0
675 | },
676 | {
677 | "bits": 8,
678 | "coefficient": 1,
679 | "description": "前左胎压温度,Unit:℃",
680 | "min": 0,
681 | "name": "lfTemp",
682 | "offset": -50
683 | },
684 | {
685 | "bits": 8,
686 | "coefficient": 1,
687 | "description": " 前右胎压温度,Unit:℃",
688 | "min": 0,
689 | "name": "rfTemp",
690 | "offset": -50
691 | },
692 | {
693 | "bits": 8,
694 | "coefficient": 1,
695 | "description": "后左胎压温度,Unit:℃",
696 | "min": 0,
697 | "name": "lbTemp",
698 | "offset": -50
699 | },
700 | {
701 | "bits": 8,
702 | "coefficient": 1,
703 | "description": "后右胎压温度,Unit:℃",
704 | "min": 0,
705 | "name": "rbTemp",
706 | "offset": -50
707 | },
708 | {
709 | "bits": 1,
710 | "coefficient": 1,
711 | "description": "前左胎压温度报警,$0 : No temperature warning.$1 : Temperature warning",
712 | "min": 0,
713 | "name": "lfTempWar",
714 | "offset": 0
715 | },
716 | {
717 | "bits": 1,
718 | "coefficient": 1,
719 | "description": "前右胎压温度报警,$0 : No temperature warning.$1 : Temperature warning",
720 | "min": 0,
721 | "name": "rfTempWar",
722 | "offset": 0
723 | },
724 | {
725 | "bits": 1,
726 | "coefficient": 1,
727 | "description": "后左胎压温度报警,$0 : No temperature warning.$1 : Temperature warning",
728 | "min": 0,
729 | "name": "lbTempWar",
730 | "offset": 0
731 | },
732 | {
733 | "bits": 1,
734 | "coefficient": 1,
735 | "description": "后右胎压温度报警,$0 : No temperature warning.$1 : Temperature warning",
736 | "min": 0,
737 | "name": "rbTempWar",
738 | "offset": 0
739 | },
740 | {
741 | "bits": 1,
742 | "coefficient": 1,
743 | "description": "系统错误报警,$0 : No any error.$1 : System error.",
744 | "min": 0,
745 | "name": "sysWar",
746 | "offset": 0
747 | },
748 | {
749 | "bits": 3,
750 | "coefficient": 1,
751 | "description": "间接模式状态,$1: 故障模式\n$2: 漏气\n$3: 重置\n$4: 正常",
752 | "min": 0,
753 | "name": "indirectMode",
754 | "offset": 0
755 | },
756 | {
757 | "bits": 3,
758 | "coefficient": 1,
759 | "description": "前左雷达距离,0x00: 不显示\n0x01: 1格闪烁\n0x02: 2格显示,最外一格闪烁\n0x03: 3格显示,最外一格闪烁\n0x04:4格显示,最外一格闪烁",
760 | "min": 0,
761 | "name": "lfRadar",
762 | "offset": 0
763 | },
764 | {
765 | "bits": 3,
766 | "coefficient": 1,
767 | "description": "前左中雷达距离,0x00: 不显示\n0x01: 1格闪烁\n0x02: 2格显示,最外一格闪烁\n0x03: 3格显示,最外一格闪烁\n0x04:4格显示,最外一格闪烁",
768 | "min": 0,
769 | "name": "lfMRadar",
770 | "offset": 0
771 | },
772 | {
773 | "bits": 2,
774 | "coefficient": 1,
775 | "description": "倒车雷达系统状态,0x00:不显示雷达\n0x01:自检\n0x02:雷达激活\n0x03:无效",
776 | "min": 0,
777 | "name": "radarSysState",
778 | "offset": 0
779 | },
780 | {
781 | "bits": 3,
782 | "coefficient": 1,
783 | "description": "前右中雷达距离,0x00: 不显示\n0x01: 1格闪烁\n0x02: 2格显示,最外一格闪烁\n0x03: 3格显示,最外一格闪烁\n0x04:4格显示,最外一格闪烁",
784 | "min": 0,
785 | "name": "rfMRadar",
786 | "offset": 0
787 | },
788 | {
789 | "bits": 3,
790 | "coefficient": 1,
791 | "description": "前右雷达距离,0x00: 不显示\n0x01: 1格闪烁\n0x02: 2格显示,最外一格闪烁\n0x03: 3格显示,最外一格闪烁\n0x04:4格显示,最外一格闪烁",
792 | "min": 0,
793 | "name": "rfRadar",
794 | "offset": 0
795 | },
796 | {
797 | "bits": 2,
798 | "min": 0
799 | },
800 | {
801 | "bits": 3,
802 | "coefficient": 1,
803 | "description": "后左雷达距离,0x00: 不显示\n0x01: 1格闪烁\n0x02: 2格显示,最外一格闪烁\n0x03: 3格显示,最外一格闪烁\n0x04:4格显示,最外一格闪烁",
804 | "min": 0,
805 | "name": "lbRadar",
806 | "offset": 0
807 | },
808 | {
809 | "bits": 3,
810 | "coefficient": 1,
811 | "description": "后左中雷达距离,0x00: 不显示\n0x01: 1格闪烁\n0x02: 2格显示,最外一格闪烁\n0x03: 3格显示,最外一格闪烁\n0x04:4格显示,最外一格闪烁",
812 | "min": 0,
813 | "name": "lbMRadar",
814 | "offset": 0
815 | },
816 | {
817 | "bits": 2,
818 | "min": 0
819 | },
820 | {
821 | "bits": 3,
822 | "coefficient": 1,
823 | "description": "后右中雷达距离,0x00: 不显示\n0x01: 1格闪烁\n0x02: 2格显示,最外一格闪烁\n0x03: 3格显示,最外一格闪烁\n0x04:4格显示,最外一格闪烁",
824 | "min": 0,
825 | "name": "rbMRadar",
826 | "offset": 0
827 | },
828 | {
829 | "bits": 3,
830 | "coefficient": 1,
831 | "description": "后右雷达距离,0x00: 不显示\n0x01: 1格闪烁\n0x02: 2格显示,最外一格闪烁\n0x03: 3格显示,最外一格闪烁\n0x04:4格显示,最外一格闪烁",
832 | "min": 0,
833 | "name": "rbRadar",
834 | "offset": 0
835 | },
836 | {
837 | "bits": 2,
838 | "min": 0
839 | },
840 | {
841 | "bits": 1,
842 | "coefficient": 1,
843 | "description": "小灯,0:off 1:on ",
844 | "min": 0,
845 | "name": "smallLights",
846 | "offset": 0
847 | },
848 | {
849 | "bits": 1,
850 | "coefficient": 1,
851 | "description": "EPB故障,0:off 1:on ",
852 | "min": 0,
853 | "name": "epbFailure",
854 | "offset": 0
855 | },
856 | {
857 | "bits": 1,
858 | "coefficient": 1,
859 | "description": "制动报警灯,0:off 1:on ",
860 | "min": 0,
861 | "name": "handBrakeWarningLights",
862 | "offset": 0
863 | },
864 | {
865 | "bits": 1,
866 | "coefficient": 1,
867 | "description": "遥控钥匙在外指示,0:off 1:on ",
868 | "min": 0,
869 | "name": "kyeOut",
870 | "offset": 0
871 | },
872 | {
873 | "bits": 1,
874 | "coefficient": 1,
875 | "description": "EPS故障,0:off 1:on",
876 | "min": 0,
877 | "name": "epsFailure",
878 | "offset": 0
879 | },
880 | {
881 | "bits": 1,
882 | "coefficient": 1,
883 | "description": "ABS故障,0:off 1:on",
884 | "min": 0,
885 | "name": "absFailure",
886 | "offset": 0
887 | },
888 | {
889 | "bits": 1,
890 | "coefficient": 1,
891 | "description": "功率降低指示,0:off 1:on (列表有定义,无图标)",
892 | "min": 0,
893 | "name": "powerReductionIndication",
894 | "offset": 0
895 | },
896 | {
897 | "bits": 1,
898 | "coefficient": 1,
899 | "description": "整车系统故障,0:off 1:on",
900 | "min": 0,
901 | "name": "systemFailure",
902 | "offset": 0
903 | },
904 | {
905 | "bits": 1,
906 | "coefficient": 1,
907 | "description": "ESP 故障,0:off 1:on",
908 | "min": 0,
909 | "name": "espFailure",
910 | "offset": 0
911 | },
912 | {
913 | "bits": 1,
914 | "coefficient": 1,
915 | "description": "ESP OFF,0:off 1:on",
916 | "min": 0,
917 | "name": "espOff",
918 | "offset": 0
919 | },
920 | {
921 | "bits": 1,
922 | "coefficient": 1,
923 | "description": "ESP ON,0:off 1:on",
924 | "min": 0,
925 | "name": "esp"
926 | },
927 | {
928 | "bits": 1,
929 | "coefficient": 1,
930 | "description": "安全气囊故障,0:off 1:on ",
931 | "min": 0,
932 | "name": "airbagFailure",
933 | "offset": 0
934 | },
935 | {
936 | "bits": 1,
937 | "coefficient": 1,
938 | "description": "ACC巡航开关指示,0:off 1:on",
939 | "min": 0,
940 | "name": "accSwitch",
941 | "offset": 0
942 | },
943 | {
944 | "bits": 2,
945 | "coefficient": 0,
946 | "min": 0
947 | },
948 | {
949 | "bits": 1,
950 | "coefficient": 1,
951 | "description": "电子转向柱锁解锁失败指示,0:off 1:on",
952 | "min": 0,
953 | "name": "esclFailure"
954 | },
955 | {
956 | "bits": 1,
957 | "coefficient": 1,
958 | "description": "12V电池充电报警,0:off 1:on",
959 | "min": 0,
960 | "name": "batteryChargingWarning",
961 | "offset": 0
962 | },
963 | {
964 | "bits": 1,
965 | "description": "12V蓄电池馈电报警,0:off 1:on (有定义无图标)",
966 | "min": 0,
967 | "name": "batteryFeedWarning"
968 | },
969 | {
970 | "bits": 1,
971 | "coefficient": 1,
972 | "description": "动力电池充电状态,0:0ff 1:on",
973 | "min": 0,
974 | "name": "batteryChargeStatus",
975 | "offset": 0
976 | },
977 | {
978 | "bits": 1,
979 | "coefficient": 1,
980 | "description": "充电线连接,0:0ff 1:on",
981 | "min": 0,
982 | "name": "chargLineConnection",
983 | "offset": 0
984 | },
985 | {
986 | "bits": 1,
987 | "coefficient": 1,
988 | "description": "动力电池馈电,0:0ff 1:on",
989 | "min": 0,
990 | "name": "batteryFeed",
991 | "offset": 0
992 | },
993 | {
994 | "bits": 1,
995 | "coefficient": 1,
996 | "description": "动力电池故障,0:0ff 1:on",
997 | "min": 0,
998 | "name": "batteryFailure",
999 | "offset": 0
1000 | },
1001 | {
1002 | "bits": 1,
1003 | "coefficient": 1,
1004 | "description": "动力电池切断,0:0ff 1:on",
1005 | "min": 0,
1006 | "name": "powerBatteryCutOff",
1007 | "offset": 0
1008 | },
1009 | {
1010 | "bits": 1,
1011 | "coefficient": 1,
1012 | "description": "电池电量低报警,0:SOC颜色正常 1:SOC颜色变红 (MCU做蜂鸣报警)",
1013 | "min": 0,
1014 | "name": "socLow",
1015 | "offset": 0
1016 | },
1017 | {
1018 | "bits": 1,
1019 | "description": "电机及控制器过热,0:0ff 1:on",
1020 | "min": 0,
1021 | "name": "motorControllerOverheat"
1022 | },
1023 | {
1024 | "bits": 1,
1025 | "description": "电机驱动系统故障,0:0ff 1:on",
1026 | "min": 0,
1027 | "name": "motorDriveSystemFailure"
1028 | },
1029 | {
1030 | "bits": 1,
1031 | "description": "TCU故障指示,0:0ff 1:on",
1032 | "min": 0,
1033 | "name": "tcuFailure"
1034 | },
1035 | {
1036 | "bits": 1,
1037 | "description": "绝缘报警,0:0ff 1:on",
1038 | "min": 0,
1039 | "name": "insulationWarning"
1040 | },
1041 | {
1042 | "bits": 1,
1043 | "min": 0
1044 | },
1045 | {
1046 | "bits": 1,
1047 | "description": "钥匙电量低警告指示,0:0ff 1:on ",
1048 | "min": 0,
1049 | "name": "keyLowWarning"
1050 | },
1051 | {
1052 | "bits": 1,
1053 | "description": "制动液液位传感器,0:0ff 1:on",
1054 | "min": 0,
1055 | "name": "brakeFailure"
1056 | },
1057 | {
1058 | "bits": 1,
1059 | "coefficient": 1,
1060 | "description": "洗涤液液位传感器,0:0ff 1:on",
1061 | "min": 0,
1062 | "name": "detergentLiquidLlevel"
1063 | },
1064 | {
1065 | "bits": 3,
1066 | "description": "模式选择,0:SPORT模式\n1:ECO模式\n3-7:其他模式",
1067 | "min": 0,
1068 | "name": "modeSwitch"
1069 | },
1070 | {
1071 | "bits": 1,
1072 | "description": "回馈开关,0:0ff 1:on (有定义无图标)",
1073 | "min": 0,
1074 | "name": "feedSwitch"
1075 | },
1076 | {
1077 | "bits": 2,
1078 | "min": 0,
1079 | "name": "feedStrength"
1080 | },
1081 | {
1082 | "bits": 1,
1083 | "coefficient": 1,
1084 | "description": "运行准备就绪,0:off 1:on ",
1085 | "max": 1,
1086 | "min": 0,
1087 | "name": "ready",
1088 | "offset": 0
1089 | },
1090 | {
1091 | "bits": 1,
1092 | "min": 0
1093 | },
1094 | {
1095 | "bits": 2,
1096 | "description": "自检同步信号,0:不自检\n1:开始自检\n2:正在自检ing\n3:自检完成\n",
1097 | "min": 0,
1098 | "name": "selfCheckSynchronize"
1099 | },
1100 | {
1101 | "bits": 6,
1102 | "min": 0
1103 | },
1104 | {
1105 | "bits": 8,
1106 | "coefficient": 1,
1107 | "description": "文字报警,0:不显示报警字符串\n1:请踩刹车启动\n2:IMMO认证失败\n3:启动按钮有故障\n4:方向盘锁定系统上锁失败",
1108 | "max": 255,
1109 | "min": 0,
1110 | "name": "warningTexts",
1111 | "offset": 0
1112 | },
1113 | {
1114 | "bits": 8,
1115 | "coefficient": 1,
1116 | "description": "文字提示,0:不显示字符串\n1:记录仪无存储卡\n2:记录仪存储卡无效\n3:记录仪锁档文件满\n4:USB连接中…",
1117 | "max": 255,
1118 | "min": 0,
1119 | "name": "tipsTexts",
1120 | "offset": 0
1121 | }
1122 | ],
1123 | "specialSignals": [
1124 | ],
1125 | "version": "0.0.1"
1126 | }
1127 |
--------------------------------------------------------------------------------
/Json/sample.json:
--------------------------------------------------------------------------------
1 | {
2 | "commands": [
3 | {
4 | "name": "applicationState" ,"bits": 8, "min": 0,
5 | "description": "0: 显示未初始化,例如开机视频播放,1: 开机动画进行中,2: 关机动画进行中,3: 自检中, \
6 | 4: 休眠界面显示中,5: 休眠界面显示动画进行中,6: 休眠界面消失动画进行中,7: 正常状态画面显示中"
7 | }
8 | ],
9 | "heartBeatInterval": 3000,
10 | "signals": [
11 | {
12 | "bits": 8,
13 | "coefficient": 1,
14 | "description": "MCU临时版本",
15 | "invalid": "0xff",
16 | "max": 100,
17 | "min": 0,
18 | "name": "mcuVersionMin",
19 | "offset": 0
20 | },
21 | {
22 | "bits": 5,
23 | "coefficient": 1,
24 | "description": "MCU中版本号 交付版本,每次交付样机加一",
25 | "invalid": "0x1f",
26 | "max": 30,
27 | "min": 0,
28 | "name": "mcuVersionMid",
29 | "offset": 0
30 | },
31 | {
32 | "bits": 3,
33 | "coefficient": 1,
34 | "description": "MCU主版本号 SOP版本号,量产加一",
35 | "invalid": "0x7",
36 | "max": 6,
37 | "min": 0,
38 | "name": "mcuVersionMax",
39 | "offset": 0
40 | },
41 | {
42 | "bits": 16,
43 | "coefficient": 1,
44 | "description": "转速",
45 | "max": 8000,
46 | "min": 0,
47 | "name": "rpm",
48 | "offset": 0
49 | },
50 | {
51 | "bits": 8,
52 | "coefficient": 1,
53 | "description": "车速,0-240",
54 | "max": 240,
55 | "name": "speed",
56 | "offset": 0
57 | },
58 | {
59 | "bits": 1,
60 | "coefficient": 1,
61 | "description": "0: IGN OFF\\n1: IGN ON",
62 | "max": 1,
63 | "min": 0,
64 | "name": "igOn",
65 | "offset": 0
66 | },
67 | {
68 | "bits": 4,
69 | "coefficient": 1,
70 | "description": "语言 0:中文\\n1:英文",
71 | "max": 1,
72 | "min": 0,
73 | "name": "language",
74 | "offset": 0
75 | },
76 | {
77 | "bits": 1,
78 | "coefficient": 1,
79 | "description": "0: disenable 1:enable",
80 | "max": 1,
81 | "min": 0,
82 | "name": "projectModeEnabled",
83 | "offset": 0
84 | },
85 | {
86 | "bits": 2,
87 | "coefficient": 1,
88 | "max": 0,
89 | "min": 0,
90 | "offset": 0
91 | },
92 | {
93 | "bits": 32,
94 | "coefficient": 1,
95 | "description": "时间 存储自1970年1月1日0时0分0秒到现在的秒数",
96 | "invalid": "0x0",
97 | "max": 4294967295,
98 | "min": 0,
99 | "name": "dateTime",
100 | "offset": 0
101 | },
102 | {
103 | "bits": 8,
104 | "coefficient": 1,
105 | "description": "主题 0:主题1\\n1:主题2\\n2:主题3\\n4:主题4",
106 | "max": 4,
107 | "min": 0,
108 | "name": "theme",
109 | "offset": 0
110 | },
111 | {
112 | "bits": 1,
113 | "coefficient": 1,
114 | "description": "确认按键 0: default\\n1: press down",
115 | "max": 1,
116 | "min": 0,
117 | "name": "enterKey",
118 | "offset": 0
119 | },
120 | {
121 | "bits": 1,
122 | "coefficient": 1,
123 | "description": "返回按键 0: default\\n1: press down",
124 | "max": 1,
125 | "min": 0,
126 | "name": "backKey",
127 | "offset": 0
128 | },
129 | {
130 | "bits": 1,
131 | "coefficient": 1,
132 | "description": "向上按键 0: default\\n1: press down",
133 | "max": 1,
134 | "min": 0,
135 | "name": "prevKey",
136 | "offset": 0
137 | },
138 | {
139 | "bits": 1,
140 | "coefficient": 1,
141 | "description": "向下按键 0: default\\n1: press down",
142 | "max": 1,
143 | "min": 0,
144 | "name": "nextKey",
145 | "offset": 0
146 | },
147 | {
148 | "bits": 4,
149 | "coefficient": 1,
150 | "min": 0,
151 | "offset": 0
152 | },
153 | {
154 | "bits": 8,
155 | "coefficient": 1,
156 | "description": "硬件临时版本",
157 | "invalid": "0xff",
158 | "max": 100,
159 | "min": 0,
160 | "name": "hwVersionMin",
161 | "offset": 0
162 | },
163 | {
164 | "bits": 5,
165 | "coefficient": 1,
166 | "description": "硬件中版本号 交付版本,每次交付样机加一",
167 | "invalid": "0x1f",
168 | "max": 30,
169 | "min": 0,
170 | "name": "hwVersionMid",
171 | "offset": 0
172 | },
173 | {
174 | "bits": 3,
175 | "coefficient": 1,
176 | "description": "硬件主版本号 SOP版本号,量产加一",
177 | "invalid": "0x7",
178 | "max": 6,
179 | "min": 0,
180 | "name": "hwVersionMax",
181 | "offset": 0
182 | }
183 | ],
184 | "specialSignals": [
185 | ],
186 | "version": "0.0.1"
187 | }
188 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 贾文涛
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/Qml.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 | Qml/Main.qml
4 | Qml/Component/FHoverButton.qml
5 | Qml/Component/FJsonListModel.qml
6 | Qml/Component/FSpinBox.qml
7 | Qml/Component/FSpinButton.qml
8 | Qml/Component/FTextButton.qml
9 | Qml/Component/JsonPath.js
10 | Qml/Component/FToolTip.qml
11 | Qml/FTable.qml
12 | Qml/Component/FPopDialog.qml
13 | Qml/Component/FColorButton.qml
14 |
15 |
16 |
--------------------------------------------------------------------------------
/Qml/Component/FColorButton.qml:
--------------------------------------------------------------------------------
1 | import QtQuick 2.0
2 |
3 | Rectangle {
4 | id: root
5 | property alias text: centerText.text
6 | property alias containsMouse: area.containsMouse
7 | property alias hoverEnabled: area.hoverEnabled
8 | signal clicked()
9 |
10 | implicitHeight: 30
11 | implicitWidth: 80
12 | color: area.containsMouse ? (area.pressed ? Qt.lighter("#1dc0e3"): "#1dc0e3") : "#179dba"
13 | radius: 5
14 |
15 | Text {
16 | id: centerText
17 | anchors.centerIn: parent
18 | color: "#ffffff"
19 | }
20 | MouseArea {
21 | id: area
22 | anchors.fill: parent
23 | hoverEnabled: true
24 | onClicked: root.clicked()
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Qml/Component/FHoverButton.qml:
--------------------------------------------------------------------------------
1 | import QtQuick 2.7
2 | import QtQuick.Controls 2.1
3 |
4 | Item {
5 | id: root
6 | implicitWidth: 40
7 | implicitHeight: 30
8 |
9 | property alias backImageSource: backImage.source
10 | property alias frontImageSource: frontImage.source
11 | property alias tipText: toolTip.text
12 | property bool isAtAbove: false
13 | property alias containMouse: mouseArea.containsMouse
14 | property bool buttonEnabled: true
15 | signal clicked
16 | Image {
17 | id: backImage
18 | anchors.centerIn: parent
19 | }
20 | Image {
21 | id: frontImage
22 | anchors.centerIn: parent
23 | visible: mouseArea.containsMouse && root.buttonEnabled
24 | }
25 | MouseArea {
26 | id: mouseArea
27 | anchors.fill: parent
28 | hoverEnabled: true
29 | onClicked: {
30 | forceActiveFocus();
31 | root.clicked()
32 | }
33 | }
34 |
35 | FToolTip {
36 | id: toolTip
37 | tipVisible: mouseArea.containsMouse
38 | delay: 500
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/Qml/Component/FJsonListModel.qml:
--------------------------------------------------------------------------------
1 | import QtQuick 2.7
2 | import "JsonPath.js" as JsonPath
3 | import Tools 1.0
4 | Item {
5 | id: jsonListModel
6 |
7 | signal parseStart()
8 | signal parseEnd()
9 |
10 | property string error: ""
11 |
12 | //默认1000
13 | property int heartBeatInterval: 1000
14 | property string mcuVersion: ""
15 | property ListModel signalsModel: ListModel {
16 | id: signalsListModel; dynamicRoles: true
17 | }
18 | property ListModel specialSignalsModel: ListModel {
19 | id: specialSignalsListModel; dynamicRoles: true
20 | }
21 | property ListModel commandsModel: ListModel {
22 | id: commandsListModel; dynamicRoles: true
23 | }
24 | property string heartBeatIntervalQuery: ""
25 | property string mcuVersionQuery: ""
26 | property string signalsQuery: ""
27 | property string specialSignalsQuery: ""
28 | property string commandsQuery: ""
29 |
30 | readonly property var specialSignalsHeader: [
31 | "type", "name", "description"
32 | ]
33 |
34 | property string jsonStr: ""
35 |
36 | onHeartBeatIntervalQueryChanged: {
37 | var retArray = queryFromJsonToArray(heartBeatIntervalQuery);
38 | var val = parseInt(retArray);
39 | if (val) {
40 | heartBeatInterval = val;
41 | } else {
42 | heartBeatInterval = 1000;
43 | }
44 | }
45 | onMcuVersionQueryChanged: {
46 | var retArray = queryFromJsonToArray(mcuVersionQuery);
47 | if (retArray) {
48 | var str = retArray.toString();
49 | mcuVersion = str;
50 | }
51 | }
52 | onSignalsQueryChanged: {
53 | queryToModel(signalsListModel, signalsQuery, null);
54 | }
55 | onSpecialSignalsQueryChanged: {
56 | queryToModel(specialSignalsListModel, specialSignalsQuery, specialSignalsHeader);
57 | }
58 | onCommandsQueryChanged: {
59 | queryToModel(commandsListModel, commandsQuery, null);
60 | }
61 |
62 | //加载源文件
63 | function loadFromSource(source) {
64 | jsonListModel.parseStart();
65 | var ret = fileIO.readFile(source);
66 | if (ret === "") {
67 | error = fileIO.getErrorString();
68 | } else {
69 | error = "";
70 | jsonStr = ret;
71 | }
72 | updateDatas();
73 | jsonListModel.parseEnd();
74 | }
75 | //保存models数据到文件
76 | function saveModelsToFile(filePath, isIndented) {
77 | var str = getModelData(isIndented);
78 | //write to file
79 | if (!fileIO.writeFile(filePath, str)) {
80 | var err = fileIO.getErrorString();
81 | return err;
82 | } else {
83 | return "";
84 | }
85 | }
86 | function getModelData(isIndented) {
87 | var signalsArray = getObjectsToArray(signalsModel);
88 | var specialSingalsArray = getObjectsToArray(specialSignalsModel);
89 | var commandsArray = getObjectsToArray(commandsModel);
90 |
91 | var obj = Object.create(null);
92 | //filte default and maintain in commands
93 | for (var i = 0; i < commandsArray.length; ++i) {
94 | var commandObj = commandsArray[i];
95 | if (commandObj["maintain"] !== undefined) {
96 | var newObj = new Object;
97 | var filterName = "default";
98 | if (commandObj["maintain"] === "") {
99 | //delete maintain
100 | filterName = "maintain";
101 | }
102 | var keys = Object.keys(commandObj);
103 | for (var index in keys) {
104 | var key = keys[index];
105 | if (key !== filterName) {
106 | newObj[key] = commandObj[key];
107 | }
108 | }
109 | commandsArray[i] = newObj;
110 | }
111 | }
112 | obj.version = mcuVersion;
113 | obj.heartBeatInterval = (heartBeatInterval === 0 ? 1000 : heartBeatInterval);
114 | obj.signals = signalsArray;
115 | obj.specialSignals = specialSingalsArray;
116 | obj.commands = commandsArray;
117 | var str = "";
118 | if (isIndented) {
119 | str = JSON.stringify(obj, function (key, value) {
120 | if (value === undefined || value === null || value === "")
121 | return undefined;
122 | if (key === "order" || key === "objectName" || key === "logicMax")
123 | return undefined;
124 | if (key === "min" || key === "max" || key === "coefficient" || key === "default") {
125 | if (Number(value) != undefined)
126 | return Number(value);
127 | else
128 | return undefined;
129 | }
130 | return value;
131 | }, 4);
132 | } else {
133 | str = JSON.stringify(obj, function (key, value) {
134 | if (value === undefined || value === null || value === "")
135 | return undefined;
136 | if (key === "order" || key === "objectName" || key === "logicMax")
137 | return undefined;
138 | if (key === "min" || key === "max" || key === "coefficient" || key === "default") {
139 | if (Number(value) != undefined)
140 | return Number(value);
141 | else
142 | return undefined;
143 | }
144 | return value;
145 | });
146 | }
147 | return str;
148 | }
149 | //update
150 | function updateDatas() {
151 | var retArray = queryFromJsonToArray(heartBeatIntervalQuery);
152 | var val = parseInt(retArray);
153 | if (val) {
154 | heartBeatInterval = val;
155 | } else {
156 | heartBeatInterval = 1000;
157 | }
158 |
159 | retArray = queryFromJsonToArray(mcuVersionQuery)
160 | if (retArray) {
161 | var str = retArray.toString();
162 | mcuVersion = str;
163 | }
164 |
165 | queryToModel(signalsListModel, signalsQuery, null);
166 | queryToModel(specialSignalsListModel, specialSignalsQuery, specialSignalsHeader);
167 | queryToModel(commandsListModel, commandsQuery, null);
168 | }
169 | //使用JsonPath查询数据, 不影响model
170 | function queryFromJsonToArray(query) {
171 | if (jsonStr === "" || query === "")
172 | return [];
173 | var objectArray;
174 | try {
175 | objectArray = JSON.parse(jsonStr);
176 | } catch (err) {
177 | error = String(err)
178 | }
179 | objectArray = JsonPath.jsonPath(objectArray, query);
180 | return objectArray;
181 | }
182 |
183 | //从Json查询数据,并添加到model
184 | function queryToModel (model, query, fliter) {
185 | if (jsonStr === "" || query === "") {
186 | return;
187 | }
188 | var objectArray;
189 | try {
190 | objectArray = JSON.parse(jsonStr);
191 | } catch (err) {
192 | error = String(err)
193 | }
194 | model.clear();
195 | objectArray = JsonPath.jsonPath(objectArray, query);
196 | for (var key in objectArray) {
197 | var obj = objectArray[key];
198 |
199 | //invalid convert to Hex
200 | if (obj["invalid"]) {
201 | obj["invalid"] = stringToHex(obj["invalid"])
202 | }
203 | //fliter no need key and value
204 | if (fliter && fliter.length > 0) {
205 | var newObj = Object.create(null);
206 | var fliterKeys = Object.keys(obj);
207 | for (var i = 0; i < fliterKeys.length; ++i) {
208 | var fliterKey = fliterKeys[i];
209 | if (fliter.indexOf(fliterKey) >= 0) {
210 | newObj[fliterKey] = obj[fliterKey];
211 | }
212 | }
213 | model.append(newObj);
214 | } else {
215 | model.append(obj);
216 | }
217 | }
218 | }
219 | function stringToHex(str) {
220 | var ret = "";
221 | var list = String(str).split(',');
222 | for (var i = 0; i < list.length; ++i) {
223 | var s = list[i]
224 | if (i === 0) {
225 | ret += "0x" + parseInt(s).toString(16)
226 | } else {
227 | ret += ",0x" + parseInt(s).toString(16)
228 | }
229 | }
230 | return ret;
231 | }
232 | function getObjectsToArray(model) {
233 | var array = []
234 | for (var i = 0; i < model.count; ++i) {
235 | array.push(model.get(i))
236 | }
237 | return array
238 | }
239 | FileIO {
240 | id: fileIO
241 | }
242 | }
243 |
--------------------------------------------------------------------------------
/Qml/Component/FPopDialog.qml:
--------------------------------------------------------------------------------
1 | import QtQuick 2.7
2 | import QtQuick.Controls 2.0
3 | Popup {
4 | id: root
5 | x: (parent.width - width) / 2
6 | y: (parent.height - height) / 2
7 | implicitWidth: 300
8 | implicitHeight: 200
9 |
10 | modal: true
11 | focus: true
12 | closePolicy: Popup.CloseOnEscape
13 |
14 | property alias title: titleText.text
15 | property string text
16 | property alias okButtonText: okButton.text
17 | property alias cancleButtonText: cancleButton.text
18 | property bool cancleButtonVisible: true
19 | property var okClickFunc: function() {root.close()}
20 | property var cancleClickFunc: function() {root.close()}
21 | //将中间部分做成Component属性,外部可以自定义
22 | property Component contentComponent: Component {
23 | id: defaultComponent
24 | Text {
25 | id: contentText
26 | anchors.centerIn: parent
27 | text: root.text
28 | }
29 | }
30 |
31 | function reset() {
32 | okButton.text = "确定"
33 | cancleButton.text = "取消"
34 | cancleButtonVisible = false
35 | okClickFunc = function() {root.close()}
36 | cancleClickFunc = function() {root.close()}
37 | contentComponent = defaultComponent
38 | }
39 | contentItem: Item {
40 | id: contentItem
41 | Rectangle {
42 | id: titleRect
43 | height: 30
44 | width: parent.width
45 | radius: 2
46 | color: "#09556c"
47 | Text {
48 | id: titleText
49 | anchors.centerIn: parent
50 | }
51 | }
52 | Rectangle {
53 | height: 1
54 | width: parent.width
55 | y: titleRect.height + 5
56 | color: "black"
57 | }
58 | Loader {
59 | id: centerContent
60 | anchors.centerIn: parent
61 | sourceComponent: contentComponent
62 | }
63 |
64 | Row {
65 | anchors.horizontalCenter: parent.horizontalCenter
66 | anchors.bottom: parent.bottom
67 | anchors.bottomMargin: 5
68 | spacing: 10
69 | FColorButton {
70 | id: okButton
71 | text: "确定"
72 | onClicked: {
73 | root.okClickFunc()
74 | }
75 | }
76 | FColorButton {
77 | id: cancleButton
78 | text: "取消"
79 | visible: root.cancleButtonVisible
80 | onClicked: {
81 | root.cancleClickFunc()
82 | }
83 | }
84 | }
85 | }
86 | background: Rectangle {
87 | color: "#09556c"
88 | radius: 5
89 | }
90 | }
91 |
--------------------------------------------------------------------------------
/Qml/Component/FSpinBox.qml:
--------------------------------------------------------------------------------
1 | import QtQuick 2.7
2 | import QtQuick.Controls 2.1
3 |
4 | SpinBox {
5 | id: root
6 | property int decimals: 0
7 | property bool pressed: textinputPressed | down.pressed | up.pressed
8 |
9 | property bool textinputPressed: false
10 | signal editingFinished()
11 |
12 | property bool showNan: false
13 | property bool boxShow: false
14 |
15 | validator: DoubleValidator {
16 | bottom: Math.min(root.from, root.to)
17 | top: Math.max(root.from, root.to)
18 | }
19 |
20 | textFromValue: function(value, locale) {
21 | if (showNan && value === -1)
22 | return "";
23 | else
24 | return Number(value).toLocaleString(locale, 'f', root.decimals)
25 | }
26 |
27 | valueFromText: function(text, locale) {
28 | return Number.fromLocaleString(locale, text)
29 | }
30 | editable: true
31 | contentItem: TextInput {
32 | id: textInput
33 | z: 2
34 | text: root.textFromValue(root.value, root.locale)
35 | font: root.font
36 | color: boxShow ? "#ededed" : "#272727"
37 | selectionColor: "#4283aa"
38 | selectedTextColor: "#ffffff"
39 | horizontalAlignment: Qt.AlignHCenter
40 | verticalAlignment: Qt.AlignVCenter
41 | selectByMouse: true
42 | readOnly: !root.editable
43 | validator: root.validator
44 | echoMode: TextInput.Normal
45 | inputMethodHints: Qt.ImhFormattedNumbersOnly
46 |
47 | onEditingFinished: {
48 | root.editingFinished()
49 | }
50 | MouseArea {
51 | id: textinputArea
52 | anchors.fill: parent
53 | hoverEnabled: true
54 |
55 | propagateComposedEvents: true
56 | onContainsMouseChanged: {
57 | if (containsMouse) {
58 | cursorShape = Qt.IBeamCursor;
59 | } else {
60 | cursorShape = Qt.ArrowCursor;
61 | root.textinputPressed = false;
62 | }
63 | }
64 | onDoubleClicked: mouse.accepted = false;
65 | onPositionChanged: mouse.accepted = false;
66 | onPressAndHold: mouse.accepted = false;
67 | onClicked:mouse.accepted = false;
68 | onReleased: {
69 | root.textinputPressed = false;
70 | root.editingFinished()
71 | mouse.accepted = false;
72 | }
73 | onPressed: {
74 | root.textinputPressed = true;
75 | mouse.accepted = false;
76 | }
77 | }
78 | }
79 |
80 | up.indicator: Rectangle {
81 | x: root.mirrored ? 0 : parent.width - width - 1.5
82 | y: 1.5
83 | height: parent.height - 3
84 | implicitWidth: 30
85 | implicitHeight: 30
86 | color: "transparent"
87 | border.color: enabled ? "#8f5c50" : "#4d4e52"
88 | Text {
89 | text: "+"
90 | font.pixelSize: root.font.pixelSize * 2
91 | color: boxShow ? "#fffcfc" : "#00a7ff"
92 | anchors.fill: parent
93 | fontSizeMode: Text.Fit
94 | horizontalAlignment: Text.AlignHCenter
95 | verticalAlignment: Text.AlignVCenter
96 | }
97 | }
98 |
99 | down.indicator: Rectangle {
100 | x: root.mirrored ? parent.width - width : 1.5
101 | y: 1.5
102 | height: parent.height - 3
103 | implicitWidth: 30
104 | implicitHeight: 30
105 | color: "transparent"
106 | border.color: enabled ? "#8f5c50" : "#4d4e52"
107 | Text {
108 | text: "-"
109 | font.pixelSize: root.font.pixelSize * 2
110 | color: boxShow ? "#fffcfc" : "#00a7ff"
111 | anchors.fill: parent
112 | fontSizeMode: Text.Fit
113 | horizontalAlignment: Text.AlignHCenter
114 | verticalAlignment: Text.AlignVCenter
115 | }
116 | }
117 |
118 | background: Rectangle {
119 | implicitWidth: 120
120 | color: "transparent"//"#cecfd3"
121 | }
122 | up.onPressedChanged: {
123 | if (pressed) {
124 | syncer.restart()
125 | }
126 | }
127 | down.onPressedChanged: {
128 | if (pressed) {
129 | syncer.restart()
130 | }
131 | }
132 | Timer {
133 | id: syncer
134 | running: false
135 | repeat: false
136 | interval: 300
137 | onTriggered: {
138 | root.editingFinished()
139 | }
140 | }
141 | }
142 |
--------------------------------------------------------------------------------
/Qml/Component/FSpinButton.qml:
--------------------------------------------------------------------------------
1 | import QtQuick 2.0
2 | import QtQuick.Controls 2.1
3 | Rectangle {
4 | id: root
5 | implicitWidth: 120
6 | implicitHeight: 30
7 | property alias backImageSource: hoverButton.backImageSource
8 | property alias frontImageSource: hoverButton.frontImageSource
9 | property alias tipText: hoverButton.tipText
10 |
11 | signal trigger(int count);
12 | border.width: hoverButton.containMouse ? 1 : 0
13 | border.color: "#00A7FF"
14 | color: "transparent"
15 |
16 | SpinBox {
17 | anchors {
18 | top: parent.top
19 | bottom: parent.bottom
20 | topMargin: 3
21 | bottomMargin: 3
22 | left: parent.left
23 | leftMargin: 3
24 | right: hoverButton.left
25 | }
26 | id: control
27 | from: 1
28 | to: 1024
29 | value: 5
30 | editable: true
31 | contentItem: Rectangle{
32 | implicitWidth: 30
33 | height: control.height
34 | color: "transparent"
35 | TextInput {
36 | z: 2
37 | anchors.fill: parent
38 | text: control.textFromValue(control.value, control.locale)
39 | font: control.font
40 | color: "#313131"
41 | selectionColor: "#4283aa"
42 | selectedTextColor: "#ffffff"
43 | horizontalAlignment: Qt.AlignHCenter
44 | verticalAlignment: Qt.AlignVCenter
45 |
46 | readOnly: !control.editable
47 | validator: control.validator
48 | inputMethodHints: Qt.ImhFormattedNumbersOnly
49 | }
50 | }
51 |
52 | up.indicator: Rectangle {
53 | x: control.mirrored ? 0 : parent.width - width
54 | height: control.height
55 | implicitWidth: height
56 | color: "transparent"
57 | border.color: "#b8b9bc"
58 | border.width: 3
59 | radius: 5
60 | Text {
61 | text: "+"
62 | font.pixelSize: control.font.pixelSize * 2
63 | color: "#b8b9bc"
64 | anchors.fill: parent
65 | fontSizeMode: Text.Fit
66 | horizontalAlignment: Text.AlignHCenter
67 | verticalAlignment: Text.AlignVCenter
68 | }
69 | }
70 |
71 | down.indicator: Rectangle {
72 | x: control.mirrored ? parent.width - width : 0
73 | height: control.height
74 | implicitWidth: height
75 | color: "transparent"
76 | border.color: "#b8b9bc"
77 | border.width: 3
78 | radius: 5
79 | Text {
80 | text: "-"
81 | font.pixelSize: control.font.pixelSize * 2
82 | color: "#b8b9bc"
83 | anchors.fill: parent
84 | fontSizeMode: Text.Fit
85 | horizontalAlignment: Text.AlignHCenter
86 | verticalAlignment: Text.AlignVCenter
87 | }
88 | }
89 |
90 | background: Rectangle {
91 | color: "#f1f4f9"
92 | }
93 | }
94 | FHoverButton {
95 | id: hoverButton
96 | anchors {
97 | top: parent.top
98 | bottom: parent.bottom
99 | right: parent.right
100 | }
101 | onClicked: root.trigger(control.value)
102 | }
103 |
104 | }
105 |
--------------------------------------------------------------------------------
/Qml/Component/FTextButton.qml:
--------------------------------------------------------------------------------
1 | import QtQuick 2.0
2 | import QtQuick.Controls 2.1
3 |
4 | Rectangle {
5 | id: root
6 | implicitWidth: 240
7 | implicitHeight: 30
8 |
9 | property alias backImageSourceOne: tipButtonOne.backImageSource
10 | property alias frontImageSourceOne: tipButtonOne.frontImageSource
11 | property alias tipTextOne: tipButtonOne.tipText
12 | property alias isAtAboveOne: tipButtonOne.isAtAbove
13 |
14 | property alias backImageSourceTwo: tipButtonTwo.backImageSource
15 | property alias frontImageSourceTwo: tipButtonTwo.frontImageSource
16 | property alias tipTextTwo: tipButtonTwo.tipText
17 | property alias isAtAboveTwo: tipButtonTwo.isAtAbove
18 |
19 |
20 | property alias hitText: textField.placeholderText
21 | property var buttonOneClickFuc: function() {}
22 | property var buttonTwoClickFuc: function() {}
23 | property int current: 0
24 | property int count: 0
25 | signal trigger(string text);
26 |
27 | radius: 4
28 | color: "transparent"
29 | TextField {
30 | id: textField
31 | anchors.left: parent.left
32 | anchors.top: parent.top
33 | anchors.bottom: parent.bottom
34 | anchors.margins: 1
35 | verticalAlignment: Text.AlignVCenter
36 | selectByMouse: true
37 | onEditingFinished: {
38 | if (textField.text)
39 | root.trigger(textField.text)
40 | }
41 | background: Rectangle {
42 | implicitWidth: root.width
43 | implicitHeight: root.height
44 | radius: 4
45 | color: "transparent"
46 | border.color: (textinputArea.containsMouse || tipButtonOne.containMouse || tipButtonTwo.containMouse) ? "#0099cc" : "#b8b9ba"
47 | }
48 | MouseArea {
49 | id: textinputArea
50 | anchors.fill: parent
51 | hoverEnabled: true
52 |
53 | propagateComposedEvents: true
54 | onContainsMouseChanged: {
55 | if (containsMouse) {
56 | cursorShape = Qt.IBeamCursor;
57 | } else {
58 | cursorShape = Qt.ArrowCursor;
59 | }
60 | }
61 | onDoubleClicked: mouse.accepted = false;
62 | onPositionChanged: mouse.accepted = false;
63 | onPressAndHold: mouse.accepted = false;
64 | onClicked:mouse.accepted = false;
65 | onReleased: {
66 | mouse.accepted = false;
67 | }
68 | onPressed: {
69 | mouse.accepted = false;
70 | }
71 | }
72 | }
73 | Row {
74 | anchors {
75 | top: parent.top
76 | bottom: parent.bottom
77 | right: parent.right
78 | }
79 | Text {
80 | id: text
81 | text: current + " of " + count
82 | visible: textField.text
83 | anchors.verticalCenter: parent.verticalCenter
84 | }
85 | FHoverButton {
86 | id: tipButtonOne
87 | onClicked: buttonOneClickFuc()
88 | width: 30
89 | height: 30
90 | implicitWidth: 30
91 | implicitHeight: 30
92 | anchors.verticalCenter: parent.verticalCenter
93 | }
94 | FHoverButton {
95 | id: tipButtonTwo
96 | onClicked: buttonTwoClickFuc()
97 | width: 30
98 | height: 30
99 | implicitWidth: 30
100 | implicitHeight: 30
101 | anchors.verticalCenter: parent.verticalCenter
102 | }
103 | }
104 | }
105 |
--------------------------------------------------------------------------------
/Qml/Component/FToolTip.qml:
--------------------------------------------------------------------------------
1 | import QtQuick 2.0
2 | import QtQuick.Controls 2.0
3 | Item {
4 | id: root
5 | anchors.fill: parent
6 | property alias text: toolTip.text
7 | property alias tipVisible: toolTip.visible
8 | property alias delay: toolTip.delay
9 | property alias timeout: toolTip.timeout
10 |
11 | //矩形旋转45度,一半被toolTip遮住(重合),另一半三角形和ToolTip组成一个带箭头的ToolTip
12 | Rectangle {
13 | visible: toolTip.visible
14 | rotation: 45
15 | width: 10
16 | height: 10
17 | color: "black"
18 | //水平居中
19 | anchors.horizontalCenter: parent.horizontalCenter
20 | //垂直方向上,由ToolTip的y值,决定位置
21 | anchors.verticalCenter: toolTip.y > 0 ? parent.bottom : parent.top
22 | anchors.verticalCenterOffset: toolTip.y > 0 ? 5 : -5
23 | }
24 | ToolTip {
25 | id: toolTip
26 | contentItem: Text {
27 | text: toolTip.text
28 | color: "#F1F4F9"
29 | }
30 | background: Rectangle {
31 | id: background
32 | color: "black"
33 | radius: 8
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/Qml/Component/JsonPath.js:
--------------------------------------------------------------------------------
1 | /* JSONPath 0.8.5 - XPath for JSON
2 | *
3 | * Copyright (c) 2007 Stefan Goessner (goessner.net)
4 | * Licensed under the MIT (MIT-LICENSE.txt) licence.
5 | *
6 | */
7 | function jsonPath(obj, expr, arg) {
8 | var P = {
9 | resultType: arg && arg.resultType || "VALUE",
10 | result: [],
11 | normalize: function(expr) {
12 | var subx = [];
13 | return expr.replace(/[\['](\??\(.*?\))[\]']|\['(.*?)'\]/g, function($0,$1,$2){return "[#"+(subx.push($1||$2)-1)+"]";}) /* http://code.google.com/p/jsonpath/issues/detail?id=4 */
14 | .replace(/'?\.'?|\['?/g, ";")
15 | .replace(/;;;|;;/g, ";..;")
16 | .replace(/;$|'?\]|'$/g, "")
17 | .replace(/#([0-9]+)/g, function($0,$1){return subx[$1];});
18 | },
19 | asPath: function(path) {
20 | var x = path.split(";"), p = "$";
21 | for (var i=1,n=x.length; i
74 |
75 |
76 | ###### 请放心联系我,乐于提供咨询服务,也可洽谈有偿技术支持相关事宜。
77 |
78 | ***
79 | #### **打赏**
80 | 
81 |
82 | ###### 觉得分享的内容还不错, 就请作者喝杯奶茶吧~~
83 | ***
84 |
--------------------------------------------------------------------------------
/Src/FileIO.cpp:
--------------------------------------------------------------------------------
1 | #include "FileIO.hpp"
2 |
3 | FileIO::FileIO(QObject *parent) : QObject(parent) {}
4 |
5 | bool FileIO::writeFile(const QString &filePath, const QString &data) {
6 | QFile file(filePath);
7 | if (file.open(QFile::WriteOnly)) {
8 | //这里使用QJsonDocument转换一次,规避windows和Linux平台 不一致
9 | auto json = QJsonDocument::fromJson(data.toUtf8());
10 | auto data = json.toJson();
11 |
12 | file.write(data);
13 | file.close();
14 | mError.clear();
15 | return true;
16 | } else {
17 | mError = "FileName: " + file.fileName() + " Error: " + file.errorString();
18 | return false;
19 | }
20 | }
21 |
22 | QString FileIO::readFile(const QString &filePath) {
23 | QString ret;
24 | QFile file(filePath);
25 | if (file.open(QFile::ReadOnly)) {
26 | auto bytes = file.readAll();
27 | //如果Json中的字符串被手动编辑时,按下了回车键,qml中的JSON.parse会认不出来。所以这里用QJsonDocument格式化一下,再给出去。
28 | auto json = QJsonDocument::fromJson(bytes);
29 | ret = QString(json.toJson());
30 |
31 | file.close();
32 | mError.clear();
33 | } else {
34 | ret.clear();
35 | mError = "FileName: " + file.fileName() + " Error: " + file.errorString();
36 | }
37 | return ret;
38 | }
39 |
40 | const QString &FileIO::errorString() {
41 | return mError;
42 | }
43 |
--------------------------------------------------------------------------------
/Src/FileIO.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 | #include
6 | #include
7 | #include
8 |
9 | //为qml提供文件读写
10 | class FileIO : public QObject {
11 | Q_OBJECT
12 | public:
13 | explicit FileIO(QObject *parent = nullptr);
14 |
15 | //写文件,成功返回true,失败返回false,失败的错误信息可以通过errorString获取
16 | Q_INVOKABLE bool writeFile(const QString &filePath, const QString &data);
17 |
18 | //读文件,返回值为文件内容,失败返回空QString,失败的错误信息可以通过errorString获取,文件为空属于错误信息的一种
19 | Q_INVOKABLE QString readFile(const QString &filePath);
20 | //获取错误信息
21 | Q_INVOKABLE const QString &errorString();
22 | private:
23 | QString mError;
24 | };
25 |
--------------------------------------------------------------------------------
/Src/FileInfo.cpp:
--------------------------------------------------------------------------------
1 | #include "FileInfo.hpp"
2 |
3 | FileInfo::FileInfo(QObject *parent) : QObject(parent) {}
4 |
5 | QString FileInfo::baseName(const QString &filePath) {
6 | QFileInfo info(filePath);
7 | return info.baseName();
8 | }
9 |
10 | QString FileInfo::suffix(const QString &filePath) {
11 | QFileInfo info(filePath);
12 | return info.suffix();
13 | }
14 |
15 | QString FileInfo::absoluteDir(const QString &filePath) {
16 | QFileInfo info(filePath);
17 | return info.absoluteDir().absolutePath();
18 | }
19 |
20 | QUrl FileInfo::toUrl(const QString &filePath) {
21 | return QUrl::fromLocalFile(filePath);
22 | }
23 |
24 | QString FileInfo::toLocal(const QUrl &url) {
25 | return url.toLocalFile();
26 | }
27 |
--------------------------------------------------------------------------------
/Src/FileInfo.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 | #include
6 | #include
7 | #include
8 |
9 | //为qml提供文件路径处理、文件名处理相关的功能
10 | class FileInfo : public QObject {
11 | Q_OBJECT
12 | public:
13 | explicit FileInfo(QObject *parent = 0);
14 |
15 | //这些API的功能,请参考QFileInfo的文档。
16 | Q_INVOKABLE QString baseName(const QString &filePath);
17 | Q_INVOKABLE QString suffix(const QString &filePath);
18 | Q_INVOKABLE QString absoluteDir(const QString &filePath);
19 | //转成QUrl
20 | Q_INVOKABLE QUrl toUrl(const QString &filePath);
21 | //转成local
22 | Q_INVOKABLE QString toLocal(const QUrl &url);
23 | };
24 |
--------------------------------------------------------------------------------
/Src/Logger/Logger.cpp:
--------------------------------------------------------------------------------
1 | #include "Logger.h"
2 | #include "LoggerTemplate.h"
3 |
4 | #include
5 | #include
6 | #include
7 | #include
8 |
9 | #include
10 |
11 | #ifdef Q_OS_WIN
12 | #include
13 | #else
14 | #include
15 | #endif
16 |
17 | namespace Logger
18 | {
19 | static QString gLogDir;
20 | static int gLogMaxCount;
21 |
22 | static void outputMessage(QtMsgType type, const QMessageLogContext &context, const QString &msg);
23 |
24 | void initLog(const QString &logPath, int logMaxCount)
25 | {
26 | qInstallMessageHandler(outputMessage);
27 | gLogDir = QCoreApplication::applicationDirPath() + "/" + logPath;
28 | gLogMaxCount = logMaxCount;
29 | QDir dir(gLogDir);
30 | if (!dir.exists())
31 | {
32 | dir.mkpath(dir.absolutePath());
33 | }
34 | QStringList infoList = dir.entryList(QDir::Files, QDir::Name);
35 | while (infoList.size() > gLogMaxCount)
36 | {
37 | dir.remove(infoList.first());
38 | infoList.removeFirst();
39 | }
40 | }
41 | static void outputMessage(QtMsgType type, const QMessageLogContext &context, const QString &msg)
42 | {
43 | static const QString messageTemp= QString("%2
\r\n");
44 | static const char typeList[] = {'d', 'w', 'c', 'f', 'i'};
45 | static QMutex mutex;
46 | static QFile file;
47 | static QTextStream textStream;
48 | Q_UNUSED(context);
49 | QDateTime dt = QDateTime::currentDateTime();
50 |
51 | //每小时一个文件
52 | QString fileNameDt = dt.toString("yyyy-MM-dd_hh");
53 |
54 | //每分钟一个文件
55 | //QString fileNameDt = dt.toString("yyyy-MM-dd_hh_mm");
56 |
57 | //每天一个文件
58 | //QString fileNameDt = dt.toString("yyyy-MM-dd_");
59 | QString contentDt = dt.toString("yyyy-MM-dd hh:mm:ss");
60 | QString message = QString("%1 %2").arg(contentDt).arg(msg);
61 | QString htmlMessage = messageTemp.arg(typeList[static_cast(type)]).arg(message);
62 | QString newfileName = QString("%1/%2_log.html").arg(gLogDir).arg(fileNameDt);
63 | mutex.lock();
64 | if (file.fileName() != newfileName)
65 | {
66 | if (file.isOpen())
67 | {
68 | file.close();
69 | }
70 | file.setFileName(newfileName);
71 | bool exist = file.exists();
72 | file.open(QIODevice::WriteOnly | QIODevice::Append);
73 | textStream.setDevice(&file);
74 | textStream.setCodec("UTF-8");
75 | if (!exist)
76 | {
77 | textStream << logTemplate << "\r\n";
78 | }
79 | }
80 | textStream << htmlMessage;
81 | file.flush();
82 | mutex.unlock();
83 | #ifdef Q_OS_WIN
84 | ::OutputDebugString(message.toStdWString().data());
85 | ::OutputDebugString(L"\r\n");
86 | #else
87 | fprintf(stderr, "%s\n", message.toStdString().data());
88 | #endif
89 | }
90 | } // namespace Logger
91 |
--------------------------------------------------------------------------------
/Src/Logger/Logger.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include
3 |
4 | namespace Logger
5 | {
6 |
7 | #define LOG_DEBUG qDebug() << __FILE__ << __FUNCTION__ << __LINE__
8 | #define LOG_INFO qInfo() << __FILE__ << __FUNCTION__ << __LINE__
9 | #define LOG_WARN qWarning() << __FILE__ << __FUNCTION__ << __LINE__
10 | #define LOG_CRIT qCritical() << __FILE__ << __FUNCTION__ << __LINE__
11 |
12 | void initLog(const QString& logPath = QStringLiteral("Log"), int logMaxCount = 1024);
13 |
14 | } // namespace Logger
15 |
--------------------------------------------------------------------------------
/Src/Logger/LoggerTemplate.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include
3 | #include
4 | namespace Logger
5 | {
6 | const static QString logTemplate = u8R"logTemplate(
7 |
8 |
9 |
10 |
11 |
12 | TaoLogger
13 |
14 |
86 |
87 |
88 |
89 |
90 |
117 |
125 | )logTemplate";
126 | }
127 |
--------------------------------------------------------------------------------
/Src/Main.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 | #include
5 |
6 | #include "Logger/Logger.h"
7 | #include "FileIO.hpp"
8 | #include "FileInfo.hpp"
9 | #include "TableStatus.hpp"
10 | #include "OperationRecorder.hpp"
11 |
12 | int main(int argc, char *argv[])
13 | {
14 | QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
15 | QGuiApplication app(argc, argv);
16 | app.setOrganizationName("jaredTao");
17 | app.setOrganizationDomain("https://jaredtao.github.io");
18 | Logger::initLog();
19 |
20 | qmlRegisterType("Tools", 1, 0, "FileIO");
21 | qmlRegisterType("Tools", 1, 0, "FileInfo");
22 | qmlRegisterType("Tools", 1, 0, "OperationRecorder");
23 |
24 | TableStatus tableStatus;
25 | QQuickView view;
26 | view.engine()->rootContext()->setContextProperty("TableStatus", &tableStatus);
27 | view.setSource(QUrl("qrc:/Qml/Main.qml"));
28 | view.show();
29 | return app.exec();
30 | }
31 |
--------------------------------------------------------------------------------
/Src/OperationRecorder.cpp:
--------------------------------------------------------------------------------
1 | #include "OperationRecorder.hpp"
2 |
3 | OperationRecorder::OperationRecorder(QObject *parent) : QObject(parent) {}
4 |
5 | void OperationRecorder::record(const QString &data) {
6 | mUndoQueue.push_back(data);
7 | //Note 新增记录时,要把redo队列清空,保证时间上的正确性
8 | mRedoQueue.clear();
9 | updateCount();
10 | }
11 |
12 | QString OperationRecorder::undo() {
13 | if (mUndoQueue.length() <= 0) {
14 | return QString();
15 | }
16 | auto ret = mUndoQueue.last();
17 | mRedoQueue.push_back(ret);
18 | mUndoQueue.pop_back();
19 | updateCount();
20 | return ret;
21 | }
22 |
23 | QString OperationRecorder::redo() {
24 | if (mRedoQueue.length() <= 0) {
25 | return QString();
26 | }
27 | auto ret = mRedoQueue.last();
28 | mUndoQueue.push_back(ret);
29 | mRedoQueue.pop_back();
30 | updateCount();
31 | return ret;
32 | }
33 |
34 | void OperationRecorder::clear() {
35 | mUndoQueue.clear();
36 | mRedoQueue.clear();
37 | updateCount();
38 | }
39 |
40 | int OperationRecorder::undoCount() const {
41 | return mUndoCount;
42 | }
43 |
44 | int OperationRecorder::redoCount() const {
45 | return mRedoCount;
46 | }
47 |
48 | void OperationRecorder::setUndoCount(int undoCount) {
49 | if (mUndoCount == undoCount) return;
50 |
51 | mUndoCount = undoCount;
52 | emit undoCountChanged(mUndoCount);
53 | }
54 |
55 | void OperationRecorder::setRedoCount(int redoCount) {
56 | if (mRedoCount == redoCount) return;
57 |
58 | mRedoCount = redoCount;
59 | emit redoCountChanged(mRedoCount);
60 | }
61 |
62 | void OperationRecorder::updateCount() {
63 | setRedoCount(mRedoQueue.length());
64 | setUndoCount(mUndoQueue.length());
65 | }
66 |
--------------------------------------------------------------------------------
/Src/OperationRecorder.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 | #include
6 |
7 | //为Qml提供一个数据结构,用来记录用户增,删,改,清空 操作
8 | //这里把数据当作一个QString,不关心内容是什么,只实现undo、redo的逻辑
9 | //数据QString的具体内容在qml中,是一个json格式的字符串
10 |
11 | class OperationRecorder : public QObject {
12 | Q_OBJECT
13 | Q_PROPERTY(int undoCount READ undoCount WRITE setUndoCount NOTIFY undoCountChanged)
14 | Q_PROPERTY(int redoCount READ redoCount WRITE setRedoCount NOTIFY redoCountChanged)
15 | public:
16 | explicit OperationRecorder(QObject *parent = nullptr);
17 |
18 | enum Type {
19 | Add = 0,
20 | Delete,
21 | Clear,
22 | Modify
23 | };
24 | Q_ENUMS(Type)
25 |
26 | //添加一份记录数据
27 | Q_INVOKABLE void record(const QString& data);
28 |
29 | //获取要撤销的数据,可能为空
30 | Q_INVOKABLE QString undo();
31 |
32 | //获取要恢复的数据,可能为空
33 | Q_INVOKABLE QString redo();
34 |
35 | //清空记录
36 | Q_INVOKABLE void clear();
37 |
38 | int undoCount() const;
39 | int redoCount() const;
40 |
41 | public slots:
42 | void setUndoCount(int undoCount);
43 |
44 | void setRedoCount(int redoCount);
45 |
46 | signals:
47 | void undoCountChanged(int undoCount);
48 |
49 | void redoCountChanged(int redoCount);
50 |
51 | private:
52 | //更新 count
53 | void updateCount();
54 |
55 | QVector mUndoQueue, mRedoQueue;
56 | int mUndoCount = 0;
57 | int mRedoCount = 0;
58 | };
59 |
--------------------------------------------------------------------------------
/Src/TableStatus.cpp:
--------------------------------------------------------------------------------
1 | #include "TableStatus.hpp"
2 |
3 | TableStatus::TableStatus(QObject *parent) : QObject(parent) {}
4 |
5 | void TableStatus::setHasSaved(bool hasSaved) {
6 | if (mHasSaved == hasSaved) return;
7 | mHasSaved = hasSaved;
8 | emit hasSavedChanged(hasSaved);
9 | }
10 |
11 | void TableStatus::setSaveWithIndented(bool saveWithIndented) {
12 | if (mSaveWithIndented == saveWithIndented) return;
13 |
14 | mSaveWithIndented = saveWithIndented;
15 | emit saveWithIndentedChanged(mSaveWithIndented);
16 | }
17 |
18 | void TableStatus::setSourceJsonFilePath(const QString &sourceJsonFilePath) {
19 | if (mSourceJsonFilePath == sourceJsonFilePath) return;
20 |
21 | mSourceJsonFilePath = sourceJsonFilePath;
22 | emit sourceJsonFilePathChanged(mSourceJsonFilePath);
23 | }
24 |
25 | void TableStatus::setSignalNames(const QStringList &signalNames) {
26 | if (mSignalNames == signalNames) return;
27 |
28 | mSignalNames = signalNames;
29 | emit signalNamesChanged(mSignalNames);
30 | }
31 |
32 | void TableStatus::setSpecialSignalNames(const QStringList &specialSignalNames) {
33 | if (mSpecialSignalNames == specialSignalNames) return;
34 |
35 | mSpecialSignalNames = specialSignalNames;
36 | emit specialSignalNamesChanged(mSpecialSignalNames);
37 | }
38 |
39 | void TableStatus::setCommandNames(const QStringList &commandNames) {
40 | if (mCommandNames == commandNames) return;
41 |
42 | mCommandNames = commandNames;
43 | emit commandNamesChanged(mCommandNames);
44 | }
45 |
46 | void TableStatus::setModelNames(const QStringList &modelNames) {
47 | if (mModelNames == modelNames) return;
48 |
49 | mModelNames = modelNames;
50 | emit modelNamesChanged(mModelNames);
51 | }
52 |
53 |
54 | bool TableStatus::hasSaved() const {
55 | return mHasSaved;
56 | }
57 |
58 | bool TableStatus::saveWithIndented() const {
59 | return mSaveWithIndented;
60 | }
61 |
62 | int TableStatus::getSignalBitByName(const QString &name) {
63 | return frameBits(SIGNALS_STR, name);
64 | }
65 |
66 | int TableStatus::getSpecialSignalBitByName(const QString &name) {
67 | return frameBits(SPECIAL_SIGNALS_STR, name);
68 | }
69 |
70 | int TableStatus::getCommandBitByName(const QString &name) {
71 | return frameBits(COMMANDS_STR, name);
72 | }
73 |
74 | void TableStatus::setmodelKey(const QString &autoCompleterKey) {
75 | mModelNames.clear();
76 | mMcuSignalNames.clear();
77 | mMcuSignalNames = mSignalNames + mSpecialSignalNames + mCommandNames;
78 | for(int i = 0; i < mMcuSignalNames.count(); ++i) {
79 | if(mMcuSignalNames.at(i).startsWith(autoCompleterKey)
80 | && mMcuSignalNames.at(i) != autoCompleterKey) {
81 | mModelNames << mMcuSignalNames.at(i);
82 | }
83 | }
84 | }
85 |
86 |
87 | void TableStatus::setMcuData(const QString &mcuData) {
88 | mMcuData = QJsonDocument::fromJson(mcuData.toUtf8());
89 | setSignalNames(frameNames(SIGNALS_STR));
90 | setSpecialSignalNames(frameNames(SPECIAL_SIGNALS_STR));
91 | setCommandNames(frameNames(COMMANDS_STR));
92 | }
93 |
94 | QString TableStatus::loadTemplateFile(const QString &filePath) {
95 |
96 | QFile sourceFile(filePath);
97 | if (!sourceFile.open(QFile::ReadOnly)) {
98 | return sourceFile.fileName() + sourceFile.errorString();
99 | }
100 | auto data = sourceFile.readAll();
101 | sourceFile.close();
102 |
103 | QFile targetFile(tempFilePath());
104 | if (targetFile.exists()) {
105 | targetFile.remove();
106 | } else {
107 | QString path = QCoreApplication::applicationDirPath() + "/PreviewWorkingDir/Config";
108 | QDir dir(path);
109 | if (!dir.exists()) {
110 | dir.mkpath(path);
111 | }
112 | }
113 | if (!targetFile.open(QFile::WriteOnly)) {
114 | return targetFile.fileName() + targetFile.errorString();
115 | }
116 | targetFile.write(data);
117 | targetFile.close();
118 |
119 | setSourceJsonFilePath("");
120 | setSourceJsonFilePath(tempFilePath());
121 | return QString("");
122 | }
123 |
124 | QString TableStatus::tempFilePath() const {
125 | return QCoreApplication::applicationDirPath() + "/Mcu.json";
126 | }
127 |
128 | const QStringList &TableStatus::signalNames() const {
129 | return mSignalNames;
130 | }
131 |
132 | const QStringList &TableStatus::specialSignalNames() const {
133 | return mSpecialSignalNames;
134 | }
135 |
136 | const QStringList &TableStatus::commandNames() const {
137 | return mCommandNames;
138 | }
139 |
140 | const QStringList &TableStatus:: modelNames() const {
141 | return mModelNames;
142 | }
143 |
144 | const QString &TableStatus::sourceJsonFilePath() const {
145 | return mSourceJsonFilePath;
146 | }
147 |
148 | QStringList TableStatus::frameNames(const QString &frame) {
149 | QStringList ret;
150 | auto rootObj = mMcuData.object();
151 | if (rootObj.contains(frame)) {
152 | auto frameArray = rootObj[frame].toArray();
153 | for (auto i = 0; i < frameArray.count(); ++i) {
154 | auto obj = frameArray[i].toObject();
155 | if (!obj.isEmpty() && obj.contains(NAME_STR)) {
156 | if (!obj[NAME_STR].toString().isEmpty())
157 | ret.append(obj[NAME_STR].toString());
158 | }
159 | }
160 | }
161 | return ret;
162 | }
163 |
164 | int TableStatus::frameBits(const QString &frame, const QString &name) {
165 | int ret = 0;
166 | auto rootObj = mMcuData.object();
167 | if (rootObj.contains(frame)) {
168 | auto frameArray = rootObj[frame].toArray();
169 | for (auto i = 0; i < frameArray.count(); i++) {
170 | auto obj = frameArray[i].toObject();
171 | if (!obj.isEmpty() && obj.contains(NAME_STR)) {
172 | if (obj[NAME_STR].toString() == name) {
173 | ret = obj[BITS_STR].toInt();
174 | break;
175 | }
176 | }
177 | }
178 | }
179 | return ret;
180 | }
181 |
182 |
--------------------------------------------------------------------------------
/Src/TableStatus.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 | //用到的一些字符串,写成全局只读变量
11 | const QString SIGNALS_STR = "signals";
12 | const QString SPECIAL_SIGNALS_STR = "specialSignals";
13 | const QString COMMANDS_STR = "commands";
14 | const QString NAME_STR = "name";
15 | const QString BITS_STR = "bits";
16 |
17 | //这个类用来记录表格的一些状态,以及把表格中的name数据做成属性提供出来给其他模块访问
18 | class TableStatus : public QObject {
19 | Q_OBJECT
20 | Q_PROPERTY(bool hasSaved READ hasSaved WRITE setHasSaved NOTIFY hasSavedChanged)
21 | Q_PROPERTY(bool saveWithIndented READ saveWithIndented WRITE setSaveWithIndented NOTIFY saveWithIndentedChanged)
22 | Q_PROPERTY(QString sourceJsonFilePath READ sourceJsonFilePath WRITE setSourceJsonFilePath NOTIFY sourceJsonFilePathChanged)
23 |
24 | //状态帧所有name
25 | Q_PROPERTY(QStringList signalNames READ signalNames WRITE setSignalNames NOTIFY signalNamesChanged)
26 | //上行专用帧所有name
27 | Q_PROPERTY(QStringList specialSignalNames READ specialSignalNames WRITE setSpecialSignalNames NOTIFY specialSignalNamesChanged)
28 | //下行帧所有name
29 | Q_PROPERTY(QStringList commandNames READ commandNames WRITE setCommandNames NOTIFY commandNamesChanged)
30 | //MCU所有数据name筛选
31 | Q_PROPERTY(QStringList modelNames READ modelNames WRITE setModelNames NOTIFY modelNamesChanged)
32 | //临时工程目录
33 | Q_PROPERTY(QString tempFilePath READ tempFilePath NOTIFY tempFilePathChanged)
34 | public:
35 | explicit TableStatus(QObject *parent = 0);
36 | bool hasSaved() const;
37 | bool saveWithIndented() const;
38 |
39 | const QString &sourceJsonFilePath() const;
40 |
41 | //获取状态帧 name 对应的 bits
42 | Q_INVOKABLE int getSignalBitByName(const QString &name);
43 | //获取上行专用帧 name 对应的 bits
44 | Q_INVOKABLE int getSpecialSignalBitByName(const QString &name);
45 | //获取下行帧 name 对应的 bits
46 | Q_INVOKABLE int getCommandBitByName(const QString &name);
47 | //获取自动补全控件key值
48 | Q_INVOKABLE void setmodelKey(const QString &autoCompleterKey);
49 |
50 | const QStringList &signalNames() const;
51 |
52 | const QStringList &specialSignalNames() const;
53 |
54 | const QStringList &commandNames() const;
55 |
56 | const QStringList &modelNames() const;
57 |
58 | QString tempFilePath() const;
59 |
60 | //qml把Mcu数据set到cpp
61 | Q_INVOKABLE void setMcuData(const QString &mcuData);
62 |
63 | Q_INVOKABLE QString loadTemplateFile(const QString &filePath);
64 |
65 | public slots:
66 | void setHasSaved(bool hasSaved);
67 |
68 | void setSaveWithIndented(bool saveWithIndented);
69 |
70 | void setSourceJsonFilePath(const QString &sourceJsonFilePath);
71 |
72 | void setSignalNames(const QStringList &signalNames);
73 |
74 | void setSpecialSignalNames(const QStringList &specialSignalNames);
75 |
76 | void setCommandNames(const QStringList &commandNames);
77 |
78 | void setModelNames(const QStringList &modelNames);
79 |
80 | signals:
81 | void hasSavedChanged(bool hasSaved);
82 |
83 | void saveWithIndentedChanged(bool saveWithIndented);
84 |
85 | void sourceJsonFilePathChanged(const QString &sourceJsonFilePath);
86 |
87 | void signalNamesChanged(const QStringList &signalNames);
88 |
89 | void specialSignalNamesChanged(const QStringList &specialSignalNames);
90 |
91 | void commandNamesChanged(const QStringList &commandNames);
92 |
93 | void modelNamesChanged(const QStringList &modelNames);
94 |
95 | void tempFilePathChanged();
96 | private:
97 | QStringList frameNames(const QString &frame);
98 | int frameBits(const QString &frame, const QString &name);
99 |
100 | bool mHasSaved = true;
101 | bool mSaveWithIndented = true;
102 | QString mSourceJsonFilePath;
103 | QJsonDocument mMcuData;
104 | QStringList mSignalNames;
105 | QStringList mSpecialSignalNames;
106 | QStringList mCommandNames;
107 | QStringList mMcuSignalNames;
108 | QStringList mModelNames;
109 | };
110 |
111 |
112 |
--------------------------------------------------------------------------------
/TableEdit.pro:
--------------------------------------------------------------------------------
1 | QT += qml quick
2 |
3 | CONFIG += c++11
4 |
5 | msvc{
6 | QMAKE_CFLAGS += -source-charset:utf-8
7 | QMAKE_CXXFLAGS += -source-charset:utf-8
8 | }
9 |
10 | HEADERS += \
11 | Src/FileIO.hpp \
12 | Src/FileInfo.hpp \
13 | Src/TableStatus.hpp \
14 | Src/OperationRecorder.hpp \
15 | Src/Logger/Logger.h \
16 | Src/Logger/LoggerTemplate.h
17 |
18 | SOURCES += Src/Main.cpp \
19 | Src/FileIO.cpp \
20 | Src/FileInfo.cpp \
21 | Src/TableStatus.cpp \
22 | Src/OperationRecorder.cpp \
23 | Src/Logger/Logger.cpp
24 |
25 | RESOURCES += Qml.qrc \
26 | Image.qrc \
27 | Json.qrc
28 |
29 | DESTDIR = bin
30 | CONFIG(debug, debug|release) {
31 | MOC_DIR = build/debug/moc
32 | RCC_DIR = build/debug/rcc
33 | UI_DIR = build/debug/ui
34 | OBJECTS_DIR = build/debug/obj
35 | } else {
36 | MOC_DIR = build/release/moc
37 | RCC_DIR = build/release/rcc
38 | UI_DIR = build/release/ui
39 | OBJECTS_DIR = build/release/obj
40 | }
41 |
42 |
43 |
44 | OTHER_FILES += README.md \
45 | appveyor.yml \
46 | .travis.yml
47 |
48 | macos {
49 | OTHER_FILES += \
50 | scripts/macos/install.sh \
51 | scripts/macos/build.sh \
52 | scripts/macos/deploy.sh
53 | }
54 |
55 | linux {
56 | OTHER_FILES += \
57 | scripts/ubuntu/install.sh \
58 | scripts/ubuntu/build.sh \
59 | scripts/ubuntu/deploy.sh
60 | }
61 |
62 | # Additional import path used to resolve QML modules in Qt Creator's code model
63 | QML_IMPORT_PATH =
64 |
65 | # Additional import path used to resolve QML modules just for Qt Quick Designer
66 | QML_DESIGNER_IMPORT_PATH =
67 |
68 |
--------------------------------------------------------------------------------
/appveyor.yml:
--------------------------------------------------------------------------------
1 | version: build{build}
2 |
3 | branches:
4 | except:
5 | - project/travis
6 |
7 | environment:
8 | matrix:
9 | - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
10 | releaseName: TableEdit_win64
11 |
12 | build_script:
13 | - call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
14 | - set QTDIR=C:\Qt\5.12\msvc2017_64
15 | - set PATH=%PATH%;%QTDIR%\bin;
16 | - qmake
17 | - nmake
18 | after_build:
19 | - if "%APPVEYOR_REPO_TAG%"=="true" windeployqt bin\TableEdit.exe --qmldir %QTDIR%\qml
20 | artifacts:
21 | - path: bin
22 | name: $(releaseName)
23 | deploy:
24 | provider: GitHub
25 | auth_token: $(GITHUB_OAUTH_TOKEN)
26 | description: 'TableEdit Release'
27 | draft: false
28 | prerelease: false
29 | on:
30 | APPVEYOR_REPO_TAG: true
31 |
--------------------------------------------------------------------------------
/scripts/macos/build.sh:
--------------------------------------------------------------------------------
1 | #! /bin/bash
2 | /usr/local/opt/qt/bin/qmake
3 | make -j$(nproc)
--------------------------------------------------------------------------------
/scripts/macos/deploy.sh:
--------------------------------------------------------------------------------
1 | #! /bin/bash
2 | /usr/local/opt/qt/bin/macdeployqt bin/TableEdit.app -qmldir=/usr/local/opt/qt/qml -verbose=1 -dmg
3 | mv bin/TableEdit.dmg bin/TableEdit_macos10-14_xcode10-2.dmg
--------------------------------------------------------------------------------
/scripts/macos/install.sh:
--------------------------------------------------------------------------------
1 | #! /bin/bash
2 | brew update
3 | brew install qt
4 |
--------------------------------------------------------------------------------
/scripts/ubuntu/build.sh:
--------------------------------------------------------------------------------
1 | #! /bin/bash
2 | source /opt/qt512/bin/qt512-env.sh
3 | qmake
4 | make -j$(nproc)
--------------------------------------------------------------------------------
/scripts/ubuntu/deploy.sh:
--------------------------------------------------------------------------------
1 | #! /bin/bash
2 | wget https://github.com/probonopd/linuxdeployqt/releases/download/6/linuxdeployqt-6-x86_64.AppImage
3 | mv linuxdeployqt-6-x86_64.AppImage linuxdeployqt.AppImage
4 | chmod a+x linuxdeployqt.AppImage
5 | ./linuxdeployqt.AppImage bin/TableEdit -qmake="/opt/qt512/bin/qmake" -qmldir="/opt/qt512/qml" -appimage
6 | move bin/TableEdit.AppImage bin/TableEdit_ubuntu_xenial_x64.AppImage
7 |
--------------------------------------------------------------------------------
/scripts/ubuntu/install.sh:
--------------------------------------------------------------------------------
1 | #! /bin/bash
2 | sudo add-apt-repository ppa:beineri/opt-qt-5.12.3-xenial -y
3 | sudo apt-get update -qq
4 | sudo apt-get install -y libglew-dev libglfw3-dev
5 | sudo apt-get install -y qt512-meta-minimal
6 |
7 |
--------------------------------------------------------------------------------