BusinessConstant.ets 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. import HashMap from '@ohos.util.HashMap';
  2. export default class BusinessConstant {
  3. static readonly mqttSubscribeTopic: string = 'station100/data/devices';
  4. static readonly mqttSubscribeTopic2: string = 'station11/data/devices';
  5. static readonly mqttPublishTopic: string = 'station100/cmd/devices';
  6. static readonly mqttUrl: string = 'tcp://192.168.1.3';
  7. // 每个clientId不重复
  8. static readonly mqttClientId: string = 'station100' + Date.now().toString(36);
  9. static readonly mqttUserName: string = '';
  10. static readonly mqttPassword: string = '';
  11. static readonly attrMap: Map<string, string> = new Map([
  12. ['LedRed', 'SSD'],
  13. ['LedOrange', 'SSD'],
  14. ['LedGreen', 'SSD'],
  15. ['Buzzer', 'SSD'],
  16. ['ExhaustFan', 'HYPYJ'],
  17. ['SolderingCurrTemp', 'WKDLT'],
  18. ['SolderingSetTemp', 'WKDLT'],
  19. ['RingWearStatus', 'FJDJC'],
  20. ['Temperature', 'WSDCGQ'],
  21. ['Humidity', 'WSDCGQ'],
  22. ['Charging1Set', 'PLC'],
  23. ['Charging2Set', 'PLC'],
  24. ['LED1Control', 'PLC'],
  25. ['LED2Control', 'PLC'],
  26. ['LED3Control', 'PLC'],
  27. ['Assemble_500W_Control', 'PLC'],
  28. ['Debugging_500W_Control', 'PLC'],
  29. ['Stokinout_500W_Control', 'PLC'],
  30. ['Inspection_500W_Control', 'PLC'],
  31. ['Packing_500W_Control', 'PLC'],
  32. ['Assemble_1000W_Control', 'PLC'],
  33. ['Debugging_1000W_Control', 'PLC'],
  34. ['Stokinout_1000W_Control', 'PLC'],
  35. ['Inspection_1000W_Control', 'PLC'],
  36. ['Packing_1000W_Control', 'PLC'],
  37. ['Rgv1CurrStatus', 'RGV1'],
  38. ['Rgv1CurrBatlevel', 'RGV1']
  39. ]);
  40. static readonly stationLightMap: Map<string, string[]> = new Map([
  41. ['装调工位1', ['Assemble_500W_Control', 'Assemble_1000W_Control']],
  42. ['装调工位2', ['Debugging_500W_Control', 'Debugging_1000W_Control']],
  43. ['出入库工位', ['Stokinout_500W_Control', 'Stokinout_1000W_Control']],
  44. ['检验工位', ['Inspection_500W_Control', 'Inspection_1000W_Control']],
  45. ['包装工位', ['Packing_500W_Control', 'Packing_1000W_Control']],
  46. ['仓储充电位1', ['Charging1Set']],
  47. ['仓储充电位2', ['Charging2Set']],
  48. ])
  49. }
  50. export enum DeviceType {
  51. ThreeColourLight = 'SSD',
  52. WeldFumeExtractor = 'HYPYJ',
  53. ElectricSolderingIron = 'WKDLT',
  54. ElectricScrewdriver = 'DDLSD',
  55. AntiWristStrap = 'FJDJC',
  56. CardReader = 'DKQ',
  57. Lighting = 'ZM',
  58. TempHumiditySensor = 'WSDCGQ',
  59. PlcControl = 'PLC',
  60. RGV1 = 'RGV1',
  61. }