大空间消毒机
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.

115 lines
2.2 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
  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, passwd) => {
  17. return {
  18. command: 'chpasswd',
  19. messageId: 'chpasswd',
  20. userId,
  21. passwd,
  22. }
  23. }
  24. // 关机
  25. export const shutdownJSON = {
  26. command: 'shutdown',
  27. messageId: 'shutdown',
  28. delayms: 60 * 5,
  29. }
  30. // 开始消毒
  31. export const startDisinfectionJSON = (loglevel, roomVolume) => {
  32. return {
  33. command: 'startDisinfection',
  34. messageId: 'startDisinfection',
  35. loglevel,
  36. roomVolume,
  37. }
  38. }
  39. // 停止消毒
  40. export const stopDisinfectionJSON = {
  41. command: 'stopDisinfection',
  42. messageId: 'stopDisinfection',
  43. }
  44. // 获取当前设备的状态信息
  45. export const getStateJSON = {
  46. command: 'getState',
  47. messageId: 'getState',
  48. }
  49. export const getAllUserJSON = {
  50. command: 'getAllUser',
  51. messageId: 'getAllUser',
  52. }
  53. export const getAllSettingJSON = {
  54. command: 'getAllSetting',
  55. messageId: 'getAllSetting',
  56. }
  57. export const getAllRecords = disinfection_id => {
  58. return {
  59. command: 'getAllRecords',
  60. messageId: 'getAllRecords',
  61. disinfection_id,
  62. }
  63. }
  64. export const setSettingValJSON = (settingName, settingVal) => {
  65. return {
  66. command: 'setSettingVal',
  67. messageId: 'setSettingVal',
  68. settingName,
  69. settingVal,
  70. }
  71. }
  72. // RealtimeSensorDataReport
  73. // 实时传感器信息上报
  74. // 控制加液体泵转动 1 控制喷液体泵转动 2
  75. export const liquidpumpctrlJSON = (num, speed) => {
  76. return {
  77. command: 'exceCanCmd',
  78. cancmd: `pumpctrl_c1004 ${num} 300 ${speed}`, // 1 泵编号 300 是加速度, 1000是转速
  79. }
  80. }
  81. // 空压机
  82. export const someAirSwitchJSON = (num, flag) => {
  83. return {
  84. command: 'exceCanCmd',
  85. cancmd: `writeio ${num} ${flag}`,
  86. }
  87. }
  88. export const startReplenishingFluidsJSON = {
  89. command: 'startReplenishingFluids',
  90. messageId: 'startReplenishingFluids',
  91. }
  92. export const stopReplenishingFluidsJSON = {
  93. command: 'stopReplenishingFluids',
  94. messageId: 'stopReplenishingFluids',
  95. }
  96. export const startDrainingJSON = {
  97. command: 'startDraining',
  98. messageId: 'startDraining',
  99. }