File

protocol-opcua/opcua-device-protocol-detail.component.ts

Implements

OnInit

Metadata

Index

Properties
Methods

Constructor

constructor(changeDetectorRef: ChangeDetectorRef, opcuaService: OpcuaService, alertService: AlertService, router: Router)
Parameters :
Name Type Optional
changeDetectorRef ChangeDetectorRef No
opcuaService OpcuaService No
alertService AlertService No
router Router No

Methods

actionHandler
actionHandler(actionObject)
Parameters :
Name Optional
actionObject No
Returns : void
addVariable
addVariable()
Returns : void
canSave
canSave(deviceTypeForm)
Parameters :
Name Optional
deviceTypeForm No
Returns : boolean
extractOverridSubscriptionType
extractOverridSubscriptionType(_mapping)
Parameters :
Name Optional
_mapping No
Returns : {}
getEmptyMappingObject
getEmptyMappingObject()
Returns : { id: string; browsePath: {}; }
getMapping
getMapping()
Returns : any
getOverriddenSubscriptionsByPath
getOverriddenSubscriptionsByPath(browsePath)
Parameters :
Name Optional
browsePath No
Returns : any
getStructuredResource
getStructuredResource(resource)
Parameters :
Name Optional
resource No
Returns : any
ngAfterContentChecked
ngAfterContentChecked()
Returns : void
Async ngOnInit
ngOnInit()
Returns : any
prepareRequestJson
prepareRequestJson(_model)
Parameters :
Name Optional
_model No
Returns : {}
removeVariable
removeVariable(mappingObject)
Parameters :
Name Optional
mappingObject No
Returns : void
Async save
save()
Returns : any
trackByIndex
trackByIndex(index: number)
Parameters :
Name Type Optional
index number No
Returns : number
updateVariable
updateVariable(mappingObject)
Parameters :
Name Optional
mappingObject No
Returns : void
updateViableMapping
updateViableMapping(model)
Parameters :
Name Optional
model No
Returns : any

Properties

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>
<div>
  <form #deviceTypeForm="ngForm" name="detailForm" *ngIf="!isLoaded">
    <opcua-device-protocol-description [model]="model"></opcua-device-protocol-description>
    <div class="card m-b-4">
      <div class="card-header separator">
        <h4 translate>Variables</h4>
      </div>
      <div class="list-group" *ngIf="model.mappings.length > 0" ngModelGroup="variable">
        <opcua-device-protocol-mapping
          *ngFor="let resource of getMapping(); trackBy: trackByIndex; let i = index"
          [index]="i"
          [referencedServerId]="model.referencedServerId"
          [referencedRootNodeId]="model.referencedRootNodeId"
          [resource]="getStructuredResource(resource)"
          [getParentAttr]="getParentAttr"
          (onAction)="actionHandler($event)"
        >
        </opcua-device-protocol-mapping>
      </div>
      <div class="card-block">
        <div class="c8y-empty-state text-left" *ngIf="model.mappings.length === 0">
          <h1 c8yIcon="sliders"></h1>
          <p translate>No variables to display. Click below to add.</p>
        </div>
        <button
          title="{{ 'Add variable' | translate }}"
          class="btn-add-block addVariableBtn"
          (click)="addVariable()"
        >
          <i c8yIcon="plus-circle"></i> {{ 'Add variable' | translate }}
        </button>
      </div>
    </div>
    <div class="card m-b-4">
      <div class="card-header separator">
        <h4 translate>Data reporting</h4>
      </div>
      <div class="card-block" ngModelGroup="subscription">
        <opcua-device-protocol-data-reporting
          [groupName]="'subscription'"
          [model]="model"
        ></opcua-device-protocol-data-reporting>
      </div>
    </div>
    <div class="card">
      <div class="card-header separator">
        <h4 translate>Auto apply constraints</h4>
      </div>
      <div class="card-block overflow-visible" ngModelGroup="autoApply">
        <opcua-auto-apply [model]="model"></opcua-auto-apply>
      </div>
    </div>

    <span>
      <div class="text-center page-footer m-t-16">
        <div class="btn-save-wrapper animated">
          <button
            title="{{ 'Save' | translate }}"
            id="deviceTypeSave"
            class="btn btn-primary"
            (click)="save()"
            [disabled]="canSave(deviceTypeForm)"
            translate
          >
            Save
          </button>
        </div>
      </div>
    </span>
  </form>
</div>

results matching ""

    No results matching ""