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: any; browsePath: {}; }
getMapping
getMapping()
Returns : any
getOverriddenSubscriptionsByPath
getOverriddenSubscriptionsByPath(browsePath: string[])
Parameters :
Name Type Optional
browsePath string[] 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
trackById
trackById(_index: number, el: any)
Parameters :
Name Type Optional
_index number No
el any 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>
<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>

results matching ""

    No results matching ""