Browse Source

[完善]完善配置文件

develop
邵佳豪 3 years ago
parent
commit
c463ea3a21
  1. 60
      src/app/system-management/condition-monitoring/condition-monitoring.component.html
  2. 2
      src/app/system-management/host-config/host-config.component.html
  3. 59
      src/app/system-management/host-config/host-config.component.ts

60
src/app/system-management/condition-monitoring/condition-monitoring.component.html

@ -32,10 +32,10 @@
[nzType]="'sync'"></i>重置</button> [nzType]="'sync'"></i>重置</button>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<button nz-button nzType="primary" type="button" [disabled]="setOfCheckedId.size === 0" <!-- <button nz-button nzType="primary" type="button" [disabled]="setOfCheckedId.size === 0"
[nzLoading]="loading == 'UpdateStates'" (click)="sendRequest('UpdateStates')"> [nzLoading]="loading == 'UpdateStates'" (click)="sendRequest('UpdateStates')">
更新识别程序服务状态 更新识别程序服务状态
</button> </button> -->
<button nz-button nzType="primary" type="button" [disabled]="setOfCheckedId.size === 0" <button nz-button nzType="primary" type="button" [disabled]="setOfCheckedId.size === 0"
[nzLoading]="loading == 'UpdateApps'" (click)="sendRequest('UpdateApps')"> [nzLoading]="loading == 'UpdateApps'" (click)="sendRequest('UpdateApps')">
更新识别程序 更新识别程序
@ -48,6 +48,10 @@
[nzLoading]="loading == 'primary'" (click)="sendRequest('UpdateModels')"> [nzLoading]="loading == 'primary'" (click)="sendRequest('UpdateModels')">
更新模型 更新模型
</button> </button>
<button nz-button nzType="primary" type="button" [disabled]="setOfCheckedId.size === 0"
[nzLoading]="loading == 'primary'" (click)="sendRequest('UpdateMonitors')">
更新监控程序
</button>
</form> </form>
</div> </div>
@ -59,10 +63,16 @@
<th>ip地址</th> <th>ip地址</th>
<th>所属油站</th> <th>所属油站</th>
<th>设备状态</th> <th>设备状态</th>
<th>识别程序服务状态</th> <!-- <th>识别程序服务状态</th> -->
<th>识别程序状态</th> <th>识别程序更新状态</th>
<th>镜像状态</th> <th>识别程序更新状态开始时间</th>
<!-- <th>模型状态</th> --> <th>识别程序更新状态结束时间</th>
<th>镜像更新状态</th>
<th>镜像更新状态开始时间</th>
<th>镜像更新状态结束时间</th>
<th>监控程序更新状态</th>
<th>监控程序更新状态开始时间</th>
<th>监控程序更新状态结束时间</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -72,27 +82,51 @@
<td>{{ data.hostIPAddress }}</td> <td>{{ data.hostIPAddress }}</td>
<td>{{ data.gasStationName }}</td> <td>{{ data.gasStationName }}</td>
<td>{{ data.hubConnectionState == 'Disconnected' ? '未连接' : '已连接' }}</td> <td>{{ data.hubConnectionState == 'Disconnected' ? '未连接' : '已连接' }}</td>
<td> <!-- <td>
<span *ngIf="data.linuxServiceState == 'Dead'">未启动</span> <span *ngIf="data.linuxServiceState == 'Dead'">未启动</span>
<span *ngIf="data.linuxServiceState == 'Waiting'">启动中</span> <span *ngIf="data.linuxServiceState == 'Waiting'">启动中</span>
<span *ngIf="data.linuxServiceState == 'Running'">运行中</span> <span *ngIf="data.linuxServiceState == 'Running'">运行中</span>
<span *ngIf="data.linuxServiceState == 'Failed'">失败</span> <span *ngIf="data.linuxServiceState == 'Failed'">失败</span>
</td> </td> -->
<td> <td>
<span *ngIf="data.appUpdatingState == 'Never'">未更新</span> <span *ngIf="data.appUpdatingState == 'Never'">未更新</span>
<span *ngIf="data.appUpdatingState == 'Updating'">更新中</span> <span *ngIf="data.appUpdatingState == 'Updating'">更新中</span>
<span *ngIf="data.appUpdatingState == 'Updated'">已更新</span> <span *ngIf="data.appUpdatingState == 'Updated'">已更新</span>
</td> </td>
<td>
<span>{{data.appUpdatingStartedTime ? (data.appUpdatingStartedTime | date:"yyyy-MM-dd HH:mm:ss") :
'/'}}</span>
</td>
<td>
<span>{{data.appUpdatingFinishedTime ? (data.appUpdatingFinishedTime | date:"yyyy-MM-dd HH:mm:ss") :
'/'}}</span>
</td>
<td> <td>
<span *ngIf="data.imageUpdatingState == 'Never'">未更新</span> <span *ngIf="data.imageUpdatingState == 'Never'">未更新</span>
<span *ngIf="data.imageUpdatingState == 'Updating'">更新中</span> <span *ngIf="data.imageUpdatingState == 'Updating'">更新中</span>
<span *ngIf="data.imageUpdatingState == 'Updated'">已更新</span> <span *ngIf="data.imageUpdatingState == 'Updated'">已更新</span>
</td> </td>
<!-- <td> <td>
<span *ngIf="data.appUpdatingState == 'Never'">未更新</span> <span>{{data.imageUpdatingStartedTime ? (data.imageUpdatingStartedTime | date:"yyyy-MM-dd HH:mm:ss") :
<span *ngIf="data.appUpdatingState == 'Updating'">更新中</span> '/'}}</span>
<span *ngIf="data.appUpdatingState == 'Updated'">已更新</span> </td>
</td> --> <td>
<span>{{data.imageUpdatingFinishedTime ? (data.imageUpdatingFinishedTime | date:"yyyy-MM-dd HH:mm:ss") :
'/'}}</span>
</td>
<td>
<span *ngIf="data.monitorUpdatingState == 'Never'">未更新</span>
<span *ngIf="data.monitorUpdatingState == 'Updating'">更新中</span>
<span *ngIf="data.monitorUpdatingState == 'Updated'">已更新</span>
</td>
<td>
<span>{{data.monitorUpdatingStartedTime ? (data.monitorUpdatingStartedTime | date:"yyyy-MM-dd HH:mm:ss") :
'/'}}</span>
</td>
<td>
<span>{{data.monitorUpdatingFinishedTime ? (data.monitorUpdatingFinishedTime | date:"yyyy-MM-dd HH:mm:ss") :
'/'}}</span>
</td>
</tr> </tr>
</tbody> </tbody>
</nz-table> </nz-table>

2
src/app/system-management/host-config/host-config.component.html

@ -44,7 +44,7 @@
</tbody> </tbody>
</nz-table> </nz-table>
<div class="footer"> <div class="footer">
<button [disabled]="isSourceYaml === true" nz-button nzType="primary" (click)="sourceYaml()">下发source.yaml配置</button> <button nz-button nzType="primary" (click)="sourceYaml()">下发source.yaml配置</button>
</div> </div>
<div class="footer"> <div class="footer">
<button [disabled]="isSourceYaml === false" nz-button nzType="primary" (click)="connect()">下发算法配置</button> <button [disabled]="isSourceYaml === false" nz-button nzType="primary" (click)="connect()">下发算法配置</button>

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

@ -48,7 +48,7 @@ export class HostConfigComponent implements OnInit {
// return item // return item
// } // }
// }) // })
if (data.configFiles) { if (data.configFiles && data.configFiles.length != 0) {
this.isSourceYaml = true this.isSourceYaml = true
} else { } else {
this.isSourceYaml = false this.isSourceYaml = false
@ -74,7 +74,7 @@ export class HostConfigComponent implements OnInit {
EdgeDeviceId: this.hostId EdgeDeviceId: this.hostId
} }
this.isLoading = true this.isLoading = true
this.http.get('/api/Cameras',{ params: params }).subscribe((data: any) => { this.http.get('/api/Cameras', { params: params }).subscribe((data: any) => {
data.items.forEach(element => { data.items.forEach(element => {
element.dimensionedPointsObj = JSON.parse(element.dimensionedPoints) element.dimensionedPointsObj = JSON.parse(element.dimensionedPoints)
}); });
@ -213,16 +213,16 @@ export class HostConfigComponent implements OnInit {
connect() { connect() {
let isAllLabel = this.listOfData.find((item: any) => { // let isAllLabel = this.listOfData.find((item: any) => {
if (item.type != 1 && !item.dimensionedPoints) { // if (item.type != 1 && !item.dimensionedPoints) {
console.log('存在摄像头未标注的情况') // console.log('存在摄像头未标注的情况')
return item // return item
} // }
}) // })
if (isAllLabel) { // if (isAllLabel) {
this.message.create('error', '存在摄像头未标注的情况'); // this.message.create('error', '存在摄像头未标注的情况');
return // return
} // }
let ids = [] let ids = []
this.listOfData.forEach((item: any) => { this.listOfData.forEach((item: any) => {
ids.push(item.id) ids.push(item.id)
@ -334,10 +334,10 @@ logging_interval : 600
if (item.type == 0) { if (item.type == 0) {
let str = '' let str = ''
item.dimensionedPointsObj.polygon.forEach(element => { item.dimensionedPointsObj ? item.dimensionedPointsObj.polygon.forEach(element => {
str += element.x + ',' str += element.x + ','
str += element.y + ',' str += element.y + ','
}); }) : 0;
str = str.substring(0, str.lastIndexOf(',')) str = str.substring(0, str.lastIndexOf(','))
console.log('进出口多边形', str) console.log('进出口多边形', str)
config1 += ` config1 += `
@ -375,22 +375,19 @@ mode=strict
` `
} }
}) })
if (xieyouqu.length != 1) {
this.message.create('warning', '有且只能有一个卸油区!'); let xieyouguan = ''
return let jingdian = ''
} else { xieyouqu.length != 0 ? xieyouqu[0].dimensionedPointsObj.rectangle.forEach(element => {
let xieyouguan = '' if (element.oilUnloadingArea) {
let jingdian = '' xieyouguan = element.x + ',' + element.y + ',' + element.width + ',' + element.height
xieyouqu[0].dimensionedPointsObj.rectangle.forEach(element => { } else {
if (element.oilUnloadingArea) { jingdian = element.x + ',' + element.y + ',' + element.width + ',' + element.height
xieyouguan = element.x + ',' + element.y + ',' + element.width + ',' + element.height }
} else { }) : '';
jingdian = element.x + ',' + element.y + ',' + element.width + ',' + element.height console.log('泄油管区域', xieyouguan)
} console.log('静电接地', jingdian)
}); config2 = `# The all in one config file.
console.log('泄油管区域', xieyouguan)
console.log('静电接地', jingdian)
config2 = `# The all in one config file.
# RTSP sources # RTSP sources
# type # type
# 0 ViolateArea.ENTRANCE, # 0 ViolateArea.ENTRANCE,
@ -497,7 +494,7 @@ rule_threshold:
threshold_connecting: 0.667 #rolling mean confidence threshold_connecting: 0.667 #rolling mean confidence
threshold_identity: 0.1 #only to filter out people net error threshold_identity: 0.1 #only to filter out people net error
` `
}
sessionStorage.setItem('config1', config1) sessionStorage.setItem('config1', config1)
sessionStorage.setItem('config2', config2) sessionStorage.setItem('config2', config2)
sessionStorage.setItem('config3', config3) sessionStorage.setItem('config3', config3)

Loading…
Cancel
Save