// config.js const dtConfig = { serverAddress: 'http://124.220.32.217:41100/api/database/command', // serverAddress: 'http://192.168.1.133:41100/api/database/command', mqttIp: '124.220.32.217', // mqttIp: '192.168.1.182', mqttPort: '8083', topBoxTitle: '智能三轴机床数字孪生系统', mqttTopic: 'SCADAMain/demo_device_mqtt_tfjj', // 默认值,登录后会被覆盖 timeout: 15000, // 设备运行履刷新时间配置(毫秒) equipmentRuntimeHistoryRefreshInterval: 60000, // 伺服负载曲线刷新时间配置(毫秒) ServoLoadCurveRefreshInterval: 5000, // OEE刷新时间配置(毫秒) OEEAnalysisRefreshInterval: 5000, //质量管理轮播时间配置(毫秒) QualityManagementRefreshInterval: 6000, // 报警刷新时间配置(毫秒) WarningRefreshInterval: 5000, // SPC计算请求数据配置 spcRequestConfig: { // 请求基本信息 success: true, code: 0, msg: '质量分析SPC系统', req_code: 'REQ_LIST_001', req_from: 'management_client', req_cmd: 'Cmd_Spc', // 请求参数 req_param: { n: 5, // 样本容量 k: 12, // 样本组数 usl: 39, // 规格上限 lsl: 38, // 规格下限 // 原始测量数据(示例数据,实际使用时可以从API获取) x: [ 38.35487637345995, 38.248328521419786, 38.32045322103805, 38.32045322103805, 38.25488531225552, 38.366350757648426, 38.269638091664106, 38.27291648709354, 38.295865255153785, 38.26144210309895, 38.28603006883064, 38.310618034671236, 38.38602113059877, 38.20079178809075, 37.810662750206156, 38.304061243769745, 38.34176279155959, 38.37290754862404, 38.33520600062112, 38.2925868597108, 38.3319276051548, 38.476177007528335, 38.62698320503382, 38.38274273510215, 36.461603281997846, 38.21882296275427, 38.35487637345995, 38.26799889395011, 38.312257232397826, 38.32864920969044, 38.297504452876005, 38.264720498523566, 38.241771730591765, 38.24505012600482, 38.2811124756756, 38.38274273510215, 38.36143316442186, 38.28930846426975, 38.348319582505866, 38.404052305865335, 38.307339639219514, 38.32209241876756, 38.3532371757207, 38.3319276051548, 38.33848439608938, 38.310618034671236, 38.349958780243654, 38.69091192048382, 38.2925868597108, 38.304061243769745, 38.32537081422803, 38.34176279155959, 38.36962915313525, 38.36962915313525, 38.26635969623659, 38.19259579962647, ], /* x: [ 1.55, 1.58, 1.61, 1.6, 1.6, 1.58, 1.63, 1.63, 1.62, 1.63, 1.62, 1.63, 1.62, 1.59, 1.58, 1.58, 1.6, 1.61, 1.62, 1.63, 1.58, 1.64, 1.63, 1.62, 1.62, 1.62, 1.62, 1.63, 1.61, 1.57, 1.64, 1.62, 1.61, 1.6, 1.58, 1.57, 1.59, 1.61, 1.62, 1.63, 1.58, 1.61, 1.6, 1.62, 1.63, 1.6, 1.61, 1.64, 1.64, 1.63, 1.58, 1.6, 1.62, 1.63, 1.65, 1.62, 1.58, 1.59, 1.57, 1.58, 1.57, 1.57, 1.58, 1.59, 1.64, 1.61, 1.64, 1.62, 1.6, 1.59, 1.65, 1.62, 1.62, 1.6, 1.58, 1.57, 1.59, 1.57, 1.59, 1.62, 1.56, 1.57, 1.57, 1.61, 1.62, 1.56, 1.58, 1.59, 1.6, 1.62, 1.58, 1.6, 1.6, 1.62, 1.63, 1.58, 1.59, 1.6, 1.63, 1.62, 1.58, 1.59, 1.62, 1.63, 1.64, 1.58, 1.59, 1.62, 1.63, 1.61, 1.58, 1.59, 1.6, 1.61, 1.63, 1.57, 1.59, 1.61, 1.61, 1.62, 1.58, 1.58, 1.6, 1.61, 1.63, 1.62, 1.58, 1.58, 1.58, 1.57, 1.63, 1.59, 1.57, 1.58, 1.57, 1.58, 1.62, 1.61, 1.63, 1.61, 1.58, 1.57, 1.59, 1.6, 1.62, 1.62, 1.6, 1.6, 1.57, 1.57, ], */ }, }, } // 更新 MQTT Topic 的方法 const updateMqttTopic = (newTopic) => { dtConfig.mqttTopic = newTopic // 同时更新到 localStorage 以便其他页面使用 localStorage.setItem('mqttTopic', newTopic) console.log('MQTT Topic 已更新:', newTopic) } // 确保在全局对象上设置配置 if (typeof window !== 'undefined') { window.dt_Config = dtConfig window.updateMqttTopic = updateMqttTopic // console.log('全局配置已设置:', dtConfig) }