protocol-opcua/opcua-device-protocol-detail.component.ts
OnInit
selector | opcua-device-protocol-detail |
templateUrl | ./opcua-device-protocol-detail.html |
Properties |
Methods |
constructor(changeDetectorRef: ChangeDetectorRef, opcuaService: OpcuaService, alertService: AlertService, router: Router)
|
|||||||||||||||
Parameters :
|
actionHandler | ||||
actionHandler(actionObject)
|
||||
Parameters :
Returns :
void
|
addVariable |
addVariable()
|
Returns :
void
|
canSave | ||||
canSave(deviceTypeForm)
|
||||
Parameters :
Returns :
boolean
|
extractOverridSubscriptionType | ||||
extractOverridSubscriptionType(_mapping)
|
||||
Parameters :
Returns :
{}
|
getEmptyMappingObject |
getEmptyMappingObject()
|
Returns :
{ id: any; browsePath: {}; }
|
getMapping |
getMapping()
|
Returns :
any
|
getOverriddenSubscriptionsByPath | ||||||
getOverriddenSubscriptionsByPath(browsePath: string[])
|
||||||
Parameters :
Returns :
any
|
getStructuredResource | ||||
getStructuredResource(resource)
|
||||
Parameters :
Returns :
any
|
ngAfterContentChecked |
ngAfterContentChecked()
|
Returns :
void
|
Async ngOnInit |
ngOnInit()
|
Returns :
any
|
prepareRequestJson | ||||
prepareRequestJson(_model)
|
||||
Parameters :
Returns :
{}
|
removeVariable | ||||
removeVariable(mappingObject)
|
||||
Parameters :
Returns :
void
|
Async save |
save()
|
Returns :
any
|
trackById |
trackById(_index: number, el: any)
|
Returns :
number
|
updateVariable | ||||
updateVariable(mappingObject)
|
||||
Parameters :
Returns :
void
|
updateViableMapping | ||||
updateViableMapping(model)
|
||||
Parameters :
Returns :
any
|
getParentAttr |
Default value : () => {...}
|
initialModel |
Type : OpcuaDeviceType
|
Default value : {
id: '',
fieldbusType: 'opcuaV2',
description: '',
unit: '',
fieldbusVersion: 4,
name: '',
referencedServerId: '',
referencedRootNodeId: '',
subscriptionType: {
type: 'None'
},
mappings: [],
overriddenSubscriptions: [],
applyConstraints: {
browsePathMatchesRegex: '',
matchesNodeIds: [],
serverObjectHasFragment: '',
matchesServerIds: []
},
enabled: ''
}
|
instanceList |
Type : QueryList<OpcuaDeviceProtocolMapping>
|
Decorators :
@ViewChildren(OpcuaDeviceProtocolMapping)
|
isLoaded |
Default value : true
|
model |
Type : any
|
selectedNode |
Type : any
|
server |
Type : any
|
<c8y-title *ngIf="!isLoaded">{{ model.name }}</c8y-title>
<c8y-breadcrumb>
<c8y-breadcrumb-item
[icon]="'c8y-device-protocols'"
[label]="'Device types' | translate"
></c8y-breadcrumb-item>
<c8y-breadcrumb-item
[icon]="'c8y-device-protocols'"
[label]="'Device protocols' | translate"
[path]="'deviceprotocols'"
></c8y-breadcrumb-item>
<c8y-breadcrumb-item [icon]="'c8y-device-protocols'" [label]="model?.name"></c8y-breadcrumb-item>
</c8y-breadcrumb>
<div class="row">
<div class="col-lg-12 col-lg-max">
<form #deviceTypeForm="ngForm" name="detailForm" *ngIf="!isLoaded" class="card card--fullpage">
<opcua-device-protocol-description [model]="model"></opcua-device-protocol-description>
<div class="inner-scroll">
<div class="d-contents">
<div class="card-header separator-top-bottom bg-component sticky-top">
<div class="h4" translate>Variables</div>
</div>
<div class="p-l-16 p-r-16">
<div class="c8y-list__group" *ngIf="model.mappings.length > 0" ngModelGroup="variable">
<opcua-device-protocol-mapping
*ngFor="let resource of getMapping(); index as i; trackBy: trackById"
[index]="i"
[referencedServerId]="model.referencedServerId"
[referencedRootNodeId]="model.referencedRootNodeId"
[resource]="getStructuredResource(resource)"
[getParentAttr]="getParentAttr"
(onAction)="actionHandler($event)"
></opcua-device-protocol-mapping>
</div>
</div>
<div class="p-l-16 p-r-16 p-t-16">
<c8y-ui-empty-state
*ngIf="model.mappings.length === 0"
[icon]="'sliders'"
[title]="'No variables to display.' | translate"
[subtitle]="'Click below to add your first variable.' | translate"
></c8y-ui-empty-state>
<div class="card-footer">
<button
type="button"
title="{{ 'Add variable' | translate }}"
class="btn btn-default addVariableBtn"
(click)="addVariable()"
>
<i c8yIcon="plus-circle"></i>
{{ 'Add variable' | translate }}
</button>
</div>
</div>
</div>
<div class="d-contents">
<div class="card-header separator-top-bottom bg-component sticky-top">
<div class="h4" translate>Data reporting</div>
</div>
<div class="p-l-16 p-r-16 p-t-16" ngModelGroup="subscription">
<opcua-device-protocol-data-reporting
[groupName]="'subscription'"
[model]="model"
></opcua-device-protocol-data-reporting>
</div>
</div>
<div class="d-contents">
<div class="card-header separator-top-bottom sticky-top">
<div class="h4" translate>Auto apply constraints</div>
</div>
<div class="p-l-16 p-r-16 p-t-16 overflow-visible" ngModelGroup="autoApply">
<opcua-auto-apply [model]="model"></opcua-auto-apply>
</div>
</div>
<div class="card-footer sticky-bottom separator" style="z-index: 101">
<button
title="{{ 'Save' | translate }}"
id="deviceTypeSave"
class="btn btn-primary"
(click)="save()"
[disabled]="canSave(deviceTypeForm)"
type="button"
>
{{ 'Save' | translate }}
</button>
</div>
</div>
</form>
</div>
</div>