Browse Source

[完善]bug

非煤矿业企业安全风险监测预警系统
邵佳豪 2 years ago
parent
commit
8e38baac6d
  1. 85
      src/app/system-management/host-config/host-config.component.ts

85
src/app/system-management/host-config/host-config.component.ts

@ -911,18 +911,23 @@ ${newstr}class-id=0
console.log(this.hostData);
//如果之前保存过文件
if (this.hostData.configFiles && this.hostData.configFiles.length !== 0) {
let config_arm = this.hostData.configFiles.find(
let config_armFile = this.hostData.configFiles.find(
(item) => item.name == 'config_arm.yaml'
).content;
let config_x86 = this.hostData.configFiles.find(
);
let config_x86File = this.hostData.configFiles.find(
(item) => item.name == 'config_x86.yaml'
).content;
let producer = this.hostData.configFiles.find(
);
let producerFile = this.hostData.configFiles.find(
(item) => item.name == 'producer.yaml'
);
if (
this.hostData.configFiles &&
this.hostData.configFiles.length !== 0 &&
config_armFile
) {
let config_arm = this.hostData.configFiles.find(
(item) => item.name == 'config_arm.yaml'
).content;
// console.log(111, config_arm);
// console.log(222, config_x86);
//修改config_arm.yaml文件
//更改connet_oil
let config_armObj = yaml.load(config_arm);
@ -946,35 +951,6 @@ ${newstr}class-id=0
});
config_armObj.connet_grounder.roi[0][key2] = [arr2];
config2 = yaml.dump(config_armObj, { lineWidth: -1 });
//修改config_x86.yaml文件
//更改connet_oil
let config_x86Obj = yaml.load(config_x86);
console.log('config_x86.yaml', config_x86Obj);
for (const key in config_x86Obj.connet_oil.roi[0]) {
delete config_x86Obj.connet_oil.roi[0][key];
}
let key3 = `oil_tube-${oilDischargeOrder}`;
let arr3 = [];
xieyouguan.split(',').forEach((item) => {
arr3.push(Number(item));
});
config_x86Obj.connet_oil.roi[0][key3] = [arr3];
// 更改connet_grounder
for (const key in config_x86Obj.connet_grounder.roi[0]) {
delete config_x86Obj.connet_grounder.roi[0][key];
}
let key4 = `grounder-${oilDischargeOrder}`;
let arr4 = [];
jingdian.split(',').forEach((item) => {
arr4.push(Number(item));
});
config_x86Obj.connet_grounder.roi[0][key4] = [arr4];
config3 = yaml.dump(config_x86Obj, { lineWidth: -1 });
// let producerObj = yaml.load(producer);
// config4 = yaml.dump(producerObj, { lineWidth: -1 });
config4 = producer;
console.log();
} else {
//使用模板
config2 = `# The all in one config file.
@ -1124,6 +1100,41 @@ ${newstr}class-id=0
secondary_model_window: 50
secondary_model_path: '/opt/app/xgboost'
`;
}
if (
this.hostData.configFiles &&
this.hostData.configFiles.length !== 0 &&
config_x86File
) {
let config_x86 = this.hostData.configFiles.find(
(item) => item.name == 'config_x86.yaml'
).content;
//修改config_x86.yaml文件
//更改connet_oil
let config_x86Obj = yaml.load(config_x86);
console.log('config_x86.yaml', config_x86Obj);
for (const key in config_x86Obj.connet_oil.roi[0]) {
delete config_x86Obj.connet_oil.roi[0][key];
}
let key3 = `oil_tube-${oilDischargeOrder}`;
let arr3 = [];
xieyouguan.split(',').forEach((item) => {
arr3.push(Number(item));
});
config_x86Obj.connet_oil.roi[0][key3] = [arr3];
// 更改connet_grounder
for (const key in config_x86Obj.connet_grounder.roi[0]) {
delete config_x86Obj.connet_grounder.roi[0][key];
}
let key4 = `grounder-${oilDischargeOrder}`;
let arr4 = [];
jingdian.split(',').forEach((item) => {
arr4.push(Number(item));
});
config_x86Obj.connet_grounder.roi[0][key4] = [arr4];
config3 = yaml.dump(config_x86Obj, { lineWidth: -1 });
} else {
config3 = `# The all in one config file.
debug: false #when the debug is on, osd.

Loading…
Cancel
Save