陈鹏飞 3 years ago
parent
commit
3e2c0ed5c9
  1. 72
      src/app/system-management/condition-monitoring/condition-monitoring.component.html
  2. 6
      src/app/system-management/condition-monitoring/condition-monitoring.component.ts
  3. 16
      src/app/system-management/condition-monitoring/model/model.component.html
  4. 2
      src/app/system-management/host-config/host-config.component.html
  5. 59
      src/app/system-management/host-config/host-config.component.ts

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

@ -19,6 +19,16 @@
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<nz-form-item>
<!-- <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="state">设备状态</nz-form-label> -->
<nz-form-control>
<nz-select formControlName="state" nzPlaceHolder="请选择设备状态">
<nz-option [nzValue]="0" nzLabel="未连接"></nz-option>
<nz-option [nzValue]="1" nzLabel="已连接"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item class="btn"> <nz-form-item class="btn">
<nz-form-control> <nz-form-control>
@ -32,10 +42,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 +58,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 +73,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 +92,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>
@ -100,6 +144,6 @@
<nz-pagination [nzHideOnSinglePage]="false" [nzPageIndex]="1" [nzTotal]="num" [nzPageSize]="10" <nz-pagination [nzHideOnSinglePage]="false" [nzPageIndex]="1" [nzTotal]="num" [nzPageSize]="10"
[nzShowTotal]="totalTemplate" nzShowQuickJumper (nzPageIndexChange)="pageChange($event)"> [nzShowTotal]="totalTemplate" nzShowQuickJumper (nzPageIndexChange)="pageChange($event)">
</nz-pagination> </nz-pagination>
<ng-template #totalTemplate let-total> 16条/页,共{{num}}条 </ng-template> <ng-template #totalTemplate let-total> 10条/页,共{{num}}条 </ng-template>
</div> </div>
</div> </div>

6
src/app/system-management/condition-monitoring/condition-monitoring.component.ts

@ -16,7 +16,8 @@ export class ConditionMonitoringComponent implements OnInit {
validateForm!: FormGroup; validateForm!: FormGroup;
ngOnInit(): void { ngOnInit(): void {
this.validateForm = this.fb.group({ this.validateForm = this.fb.group({
organization: [null] organization: [null],
state: [null]
}); });
this.getAllOrganization() this.getAllOrganization()
@ -76,7 +77,8 @@ export class ConditionMonitoringComponent implements OnInit {
ContainsChildren: true, ContainsChildren: true,
OrganizationId: this.defaultOrId, OrganizationId: this.defaultOrId,
PageNumber: this.PageNumber, PageNumber: this.PageNumber,
PageSize: 10 PageSize: 10,
HubConnectionState:this.validateForm.value.state
} }
this.isLoading = true this.isLoading = true
this.http.get('/api/EdgeDevices/Statuses', { params: params }).subscribe( this.http.get('/api/EdgeDevices/Statuses', { params: params }).subscribe(

16
src/app/system-management/condition-monitoring/model/model.component.html

@ -3,14 +3,14 @@
<nz-form-item> <nz-form-item>
<nz-form-control> <nz-form-control>
<nz-select nzMode="multiple" formControlName="type" nzPlaceHolder="请选择类型"> <nz-select nzMode="multiple" formControlName="type" nzPlaceHolder="请选择类型">
<nz-option [nzValue]="'Peoplenet'" nzLabel="Peoplenet"></nz-option> <nz-option [nzValue]="'peoplenet'" nzLabel="peoplenet"></nz-option>
<nz-option [nzValue]="'Trafficcam'" nzLabel="Trafficcam"></nz-option> <nz-option [nzValue]="'trafficcam'" nzLabel="trafficcam"></nz-option>
<nz-option [nzValue]="'Actionnet'" nzLabel="Actionnet"></nz-option> <nz-option [nzValue]="'actionnet'" nzLabel="actionnet"></nz-option>
<nz-option [nzValue]="'Idnet'" nzLabel="Idnet"></nz-option> <nz-option [nzValue]="'idnet'" nzLabel="idnet"></nz-option>
<nz-option [nzValue]="'Oilnet'" nzLabel="Oilnet"></nz-option> <nz-option [nzValue]="'oilnet'" nzLabel="oilnet"></nz-option>
<nz-option [nzValue]="'Smoking_calling_net'" nzLabel="Smoking_calling_net"></nz-option> <nz-option [nzValue]="'smoking_calling_net'" nzLabel="smoking_calling_net"></nz-option>
<nz-option [nzValue]="'Connet'" nzLabel="Connet"></nz-option> <nz-option [nzValue]="'connet'" nzLabel="connet"></nz-option>
<nz-option [nzValue]="'Fire_smoke_net'" nzLabel="Fire_smoke_net"></nz-option> <nz-option [nzValue]="'fire_smoke_net'" nzLabel="fire_smoke_net"></nz-option>
</nz-select> </nz-select>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>

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

@ -49,7 +49,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
@ -75,7 +75,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)
}); });
@ -231,16 +231,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)
@ -352,10 +352,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 += `
@ -393,22 +393,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,
@ -515,7 +512,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