|
|
@ -911,18 +911,23 @@ ${newstr}class-id=0 |
|
|
|
|
|
|
|
|
|
|
|
console.log(this.hostData); |
|
|
|
console.log(this.hostData); |
|
|
|
//如果之前保存过文件
|
|
|
|
//如果之前保存过文件
|
|
|
|
if (this.hostData.configFiles && this.hostData.configFiles.length !== 0) { |
|
|
|
let config_armFile = this.hostData.configFiles.find( |
|
|
|
let config_arm = this.hostData.configFiles.find( |
|
|
|
|
|
|
|
(item) => item.name == 'config_arm.yaml' |
|
|
|
(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' |
|
|
|
(item) => item.name == 'config_x86.yaml' |
|
|
|
).content; |
|
|
|
); |
|
|
|
let producer = this.hostData.configFiles.find( |
|
|
|
let producerFile = this.hostData.configFiles.find( |
|
|
|
(item) => item.name == 'producer.yaml' |
|
|
|
(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; |
|
|
|
).content; |
|
|
|
// console.log(111, config_arm);
|
|
|
|
|
|
|
|
// console.log(222, config_x86);
|
|
|
|
|
|
|
|
//修改config_arm.yaml文件
|
|
|
|
//修改config_arm.yaml文件
|
|
|
|
//更改connet_oil
|
|
|
|
//更改connet_oil
|
|
|
|
let config_armObj = yaml.load(config_arm); |
|
|
|
let config_armObj = yaml.load(config_arm); |
|
|
@ -946,35 +951,6 @@ ${newstr}class-id=0 |
|
|
|
}); |
|
|
|
}); |
|
|
|
config_armObj.connet_grounder.roi[0][key2] = [arr2]; |
|
|
|
config_armObj.connet_grounder.roi[0][key2] = [arr2]; |
|
|
|
config2 = yaml.dump(config_armObj, { lineWidth: -1 }); |
|
|
|
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 { |
|
|
|
} else { |
|
|
|
//使用模板
|
|
|
|
//使用模板
|
|
|
|
config2 = `# The all in one config file.
|
|
|
|
config2 = `# The all in one config file.
|
|
|
@ -1124,6 +1100,41 @@ ${newstr}class-id=0 |
|
|
|
secondary_model_window: 50 |
|
|
|
secondary_model_window: 50 |
|
|
|
secondary_model_path: '/opt/app/xgboost' |
|
|
|
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.
|
|
|
|
config3 = `# The all in one config file.
|
|
|
|
|
|
|
|
|
|
|
|
debug: false #when the debug is on, osd. |
|
|
|
debug: false #when the debug is on, osd. |
|
|
|