大空间消毒机
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

243 lines
4.8 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. // 登陆
  2. export const loginJSON = (userid, passwd) => {
  3. return {
  4. command: 'login',
  5. messageId: 'login',
  6. userid,
  7. passwd,
  8. }
  9. }
  10. // 退出登陆
  11. export const logoutJSON = {
  12. command: 'unlogin',
  13. messageId: 'unlogin',
  14. }
  15. // 改密码
  16. export const chpasswdJSON = (userId, newpasswd, passwd) => {
  17. return {
  18. command: 'chpasswd',
  19. messageId: 'chpasswd',
  20. userId,
  21. newpasswd,
  22. passwd,
  23. }
  24. }
  25. // 关机
  26. export const shutdownJSON = {
  27. command: 'shutdown',
  28. messageId: 'shutdown',
  29. delayms: 1000 * 5,
  30. }
  31. // 开始消毒
  32. export const startDisinfectionJSON = (loglevel, roomVolume) => {
  33. return {
  34. command: 'startDisinfection',
  35. messageId: 'startDisinfection',
  36. loglevel,
  37. roomVolume,
  38. }
  39. }
  40. export const continueDisinfectionJSON = {
  41. command: 'continueDisinfection',
  42. messageId: 'continueDisinfection',
  43. }
  44. // 停止消毒
  45. export const stopDisinfectionJSON = {
  46. command: 'stopDisinfection',
  47. messageId: 'stopDisinfection',
  48. }
  49. export const pauseDisinfectionJSON = {
  50. command: 'pauseDisinfection',
  51. messageId: 'pauseDisinfection',
  52. }
  53. // 获取当前设备的状态信息
  54. export const getStateJSON = {
  55. command: 'getState',
  56. messageId: 'getState',
  57. }
  58. export const getAllUserJSON = {
  59. command: 'getAllUser',
  60. messageId: 'getAllUser',
  61. }
  62. export const getAllSettingJSON = {
  63. command: 'getAllSetting',
  64. messageId: 'getAllSetting',
  65. }
  66. export const getAllRecordsJSON = disinfection_id => {
  67. return {
  68. command: 'getAllRecords',
  69. messageId: 'getAllRecords',
  70. disinfection_id,
  71. }
  72. }
  73. export const setSettingValJSON = (settingName, settingVal) => {
  74. return {
  75. command: 'setSettingVal',
  76. messageId: 'setSettingVal',
  77. settingName,
  78. settingVal,
  79. }
  80. }
  81. // RealtimeSensorDataReport
  82. // 实时传感器信息上报
  83. // 控制加液体泵转动 1 控制喷液体泵转动 2
  84. export const liquidpumpctrlJSON = (num, speed) => {
  85. return {
  86. command: 'exceCanCmd',
  87. cancmd: `pumpctrl_c1004 ${num} 300 ${speed}`, // 1 泵编号 300 是加速度, 1000是转速
  88. }
  89. }
  90. // 空压机
  91. export const someAirSwitchJSON = (num, flag) => {
  92. return {
  93. command: 'exceCanCmd',
  94. cancmd: `writeio ${num} ${flag}`,
  95. }
  96. }
  97. export const startReplenishingFluidsJSON = stopAt => {
  98. return {
  99. command: 'startReplenishingFluids',
  100. messageId: 'startReplenishingFluids',
  101. stopAt,
  102. }
  103. }
  104. export const stopReplenishingFluidsJSON = {
  105. command: 'stopReplenishingFluids',
  106. messageId: 'stopReplenishingFluids',
  107. }
  108. export const startDrainingJSON = {
  109. command: 'startDraining',
  110. messageId: 'startDraining',
  111. }
  112. export const stopDrainingJSON = {
  113. command: 'stopDraining',
  114. messageId: 'stopDraining',
  115. }
  116. export const addLiquidCtrlJSON = (num, speed, power) => {
  117. return {
  118. command: 'exceCanCmd',
  119. cancmd: `pumpctrl_c1004 ${num} 300 ${speed} 1 ${power}`,
  120. }
  121. }
  122. export const test_replenishingFluidsPumpCtrJSON = (ctrl, speed) => {
  123. return {
  124. command: 'test_replenishingFluidsPumpCtrl',
  125. messageId: 'test_replenishingFluidsPumpCtrl',
  126. ctrl,
  127. speed,
  128. }
  129. }
  130. export const sprayLiquidPump_open_for_testJSON = (ctrl, speed) => {
  131. return {
  132. command: 'test_sprayLiquidPumpCtrl',
  133. messageId: 'test_sprayLiquidPumpCtrl',
  134. ctrl,
  135. speed,
  136. }
  137. }
  138. export const updateDateJSON = (year, month, day) => {
  139. return {
  140. command: 'updateDate',
  141. messageId: 'updateDate',
  142. year,
  143. month,
  144. day,
  145. }
  146. }
  147. export const updateTimeJSON = (hour, min, second) => {
  148. return {
  149. command: 'updateTime',
  150. messageId: 'updateTime',
  151. hour,
  152. min,
  153. second,
  154. }
  155. }
  156. export const changeDisinfectionParameterJSON = data => {
  157. return {
  158. command: 'changeDisinfectionParameter',
  159. messageId: 'changeDisinfectionParameter',
  160. ...data,
  161. }
  162. }
  163. export const addUserJson = (uid, passwd) => {
  164. return {
  165. command: 'addUser',
  166. messageId: 'addUser',
  167. uid,
  168. passwd,
  169. permission_level: 3,
  170. }
  171. }
  172. export const delUserJSON = id => {
  173. return {
  174. command: 'delUser',
  175. messageId: 'delUser',
  176. id,
  177. }
  178. }
  179. export const updateUserPermissionLevelJSON = id => {
  180. return {
  181. command: 'updateUserPermissionLevel',
  182. messageId: 'updateUserPermissionLevel',
  183. id,
  184. permission_level: 0,
  185. }
  186. }
  187. export const exportUserBehaviorRecordJSON = {
  188. command: 'exportUserBehaviorRecord',
  189. messageId: 'exportUserBehaviorRecord',
  190. }
  191. export const exportDisinfectionRecordJSON = {
  192. command: 'exportDisinfectionRecord',
  193. messageId: 'exportDisinfectionRecord',
  194. }
  195. export const cleanDisinfectionRecordJSON = {
  196. command: 'cleanDisinfectionRecord',
  197. messageId: 'cleanDisinfectionRecord',
  198. }
  199. export const cleanUserBehaviorRecordJSON = {
  200. command: 'cleanUserBehaviorRecord',
  201. messageId: 'cleanUserBehaviorRecord',
  202. }
  203. export const getUserBehaviorRecordDescJSON = (page, page_size) => {
  204. return {
  205. command: 'getUserBehaviorRecordDescJson',
  206. page,
  207. page_size,
  208. messageId: 'getUserBehaviorRecordDescJson',
  209. }
  210. }