Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

major changes to data creation and connection #229

Merged
merged 30 commits into from
Jan 9, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
c1b725a
reworking Connection
julorenz Dec 23, 2021
941765d
linting
julorenz Dec 23, 2021
d0f51dc
colocating test ressources
julorenz Dec 25, 2021
1a0179f
linting
julorenz Dec 29, 2021
3f2e7a9
fixing tests ModularPlantManager
julorenz Dec 29, 2021
1554a03
updating files
julorenz Jan 2, 2022
93b4f9e
fix testing fix
julorenz Jan 4, 2022
19225b9
fixing issues and doku
julorenz Jan 4, 2022
e260a8e
refactoring feedbackMonitoringDA
julorenz Jan 4, 2022
85b768e
refactoring interlockDA
julorenz Jan 4, 2022
9946748
refactoring limitMonitoringDA
julorenz Jan 4, 2022
907d0be
refactoring OpModeDA
julorenz Jan 4, 2022
2331052
refactoring OSLevelDA
julorenz Jan 4, 2022
c26ef74
refactoring ResetDA
julorenz Jan 4, 2022
f5fea74
refactoring ScaleSettingsDA
julorenz Jan 4, 2022
d417bf2
refactoring ServiceOpModeDA
julorenz Jan 4, 2022
8e6c6d8
refactoring ServiceSourceModeDA
julorenz Jan 4, 2022
4743d87
refactoring SourceModeDA
julorenz Jan 4, 2022
862b6ce
refactoring UnitSettingsDA
julorenz Jan 4, 2022
f342730
refactoring valueLimitationDA
julorenz Jan 4, 2022
01ddd90
adding Handshake sequence
julorenz Jan 4, 2022
76c90f4
fixing rename of unitController
julorenz Jan 4, 2022
7dc1325
final adjustment to baseFunctions
julorenz Jan 4, 2022
edfe230
refactoring pimad parts
julorenz Jan 4, 2022
00f834d
updating files and tests
julorenz Jan 8, 2022
6fb21a7
linting
julorenz Jan 8, 2022
60fe06b
updating index.ts
julorenz Jan 8, 2022
e4511df
updating packages regarding ts version and linting
julorenz Jan 8, 2022
c07d854
updating api
julorenz Jan 9, 2022
b70dff1
Merge branch 'coreUpdate' into update/opcuaConnection
julorenz Jan 9, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
linting
  • Loading branch information
julorenz committed Dec 23, 2021
commit 941765dac8bfba1942f173ba411d40788f325742
2 changes: 1 addition & 1 deletion src/modularPlantManager/ModularPlantManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* SOFTWARE.
*/

import {BackendNotification, PEAInterface, PEAModel, PEAOptions, POLServiceInterface, POLServiceOptions, RecipeOptions, ServerSettingsOptions, ServiceCommand, VariableChange,} from '@p2olab/polaris-interface';
import {BackendNotification, PEAInterface, PEAModel, PEAOptions, POLServiceInterface, POLServiceOptions, RecipeOptions, ServiceCommand, VariableChange,} from '@p2olab/polaris-interface';
import {Backbone, PEAPool, PEAPoolVendor,} from '@p2olab/pimad-core';
import {catManager, ServiceLogEntry} from '../logging';
import {ParameterChange, PEAController, Service} from './pea';
Expand Down
2 changes: 1 addition & 1 deletion src/modularPlantManager/_utils/mockupServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export class MockupServer {

const namespace: Namespace = addressSpace.getOwnNamespace();

this.namespace = addressSpace.registerNamespace('urn:P2OLab:NodeOPCUA-Server');;
this.namespace = addressSpace.registerNamespace('urn:P2OLab:NodeOPCUA-Server');
// declare a new object
const myMockup = namespace.addObject({
organizedBy: addressSpace.rootFolder.objects,
Expand Down
1 change: 0 additions & 1 deletion src/modularPlantManager/condition/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export * from './Condition';
export * from './ConditionFactory';

export * from './custom';
export * from './logical';
export * from './peaCondition';
2 changes: 1 addition & 1 deletion src/modularPlantManager/pea/PiMAdParser/PiMAdParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ export class PiMAdParser {
}

/**
* @param dataAssemblyModels {DataAssemblyModel[]}
* @return {DataAssemblyOptions[]}
* @private
* @param procedureModels
*/
private static createProcedureOptionsArray(procedureModels: ProcedureModel[]): ProcedureOptions[] {
const procedureOptionsArray: ProcedureOptions[] = [];
Expand Down
62 changes: 31 additions & 31 deletions src/modularPlantManager/pea/StateMachine/MtpStateMachine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,65 +287,65 @@ export class MtpStateMachine {

public readonly defaultOptions: UserDefinedServiceConfiguration = {
guards: {
startingEnabled: () => true,
restartingEnabled: () => true,
executeEnabled: () => true,
completingEnabled: () => true,
pausingEnabled: () => true,
holdingEnabled: () => false,
unholdingEnabled: () => true,
startingEnabled: (): boolean => true,
restartingEnabled: (): boolean => true,
executeEnabled: (): boolean => true,
completingEnabled: (): boolean => true,
pausingEnabled: (): boolean => true,
holdingEnabled: (): boolean => false,
unholdingEnabled: (): boolean => true,
},
actions: {
onIdle: () => { return; },
onStarting: () => this.goToNextState(),
onExecute: () => { return; },
onCompleting: () => this.goToNextState(),
onCompleted: () => { return; },
onResetting: () => this.goToNextState(),
onPausing: () => this.goToNextState(),
onPaused: () => { return; },
onResuming: () => this.goToNextState(),
onStopping: () => this.goToNextState(),
onStopped: () => { return; },
onAborting: () => this.goToNextState(),
onAborted: () => { return; },
onIdle: (): void => { return; },
onStarting: (): void => this.goToNextState(),
onExecute: (): void => { return; },
onCompleting: (): void => this.goToNextState(),
onCompleted: (): void => { return; },
onResetting: (): void => this.goToNextState(),
onPausing: (): void => this.goToNextState(),
onPaused: (): void => { return; },
onResuming: (): void => this.goToNextState(),
onStopping: (): void => this.goToNextState(),
onStopped: (): void => { return; },
onAborting: (): void => this.goToNextState(),
onAborted: (): void => { return; },
},
};

private staticOptions: StaticServiceConfiguration = {
guards: { startingEnabledStatic: () => true},
guards: { startingEnabledStatic: (): boolean => true},
actions: {
onStartingStatic: () => {this.updateProcedureCur();},
onResettingStatic: () => {return;}
onStartingStatic: (): void => {this.updateProcedureCur();},
onResettingStatic: (): void => {return;}
}
}

public reconfigure(updatedGuards: Partial<UserDefinedGuard>, updatedActions: Partial<UserDefinedActions>) {
public reconfigure(updatedGuards: Partial<UserDefinedGuard>, updatedActions: Partial<UserDefinedActions>): void {
const guards: UserDefinedGuard =
{ ...this.staticOptions.guards,...this.defaultOptions.guards, ...updatedGuards} as UserDefinedGuard;
const actions: UserDefinedActions =
{ ...this.staticOptions.actions,...this.defaultOptions.actions, ...updatedActions} as UserDefinedActions;
this.stateMachine = this.stateMachine.withConfig({guards, actions});
}

public setProcedureReq(procedureReq: number){
public setProcedureReq(procedureReq: number): void{
this.varProcedureReq = procedureReq;
}

private updateProcedureCur(){
private updateProcedureCur(): void{
this.varProcedureCur = this.getProcedureReq();
}
private resetProcedureCur(){
private resetProcedureCur(): void{
this.varProcedureCur = 0;
}

public getProcedureReq() {return this.varProcedureReq;}
public getProcedureCur() {return this.varProcedureCur;}
public getProcedureReq(): number {return this.varProcedureReq;}
public getProcedureCur(): number {return this.varProcedureCur;}


/* Start ServiceStateMachine
*/
public start() {
public start(): void {
this.stateMachineService = interpret(this.stateMachine);
this.stateMachineService.onTransition(() => console.log(`[STATEMACHINE] FSM (${this.name}): ${this.getState()}`))
.start();
Expand All @@ -372,7 +372,7 @@ export class MtpStateMachine {
else throw Error('StateMachine not initialized.');
}

public goToNextState() {
public goToNextState(): void {
if(this.stateMachineService) this.stateMachineService.send('SC');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
*/

import {OpcUaDataItem} from '../../../connection';
import {BaseDataAssemblyRuntime, DataAssemblyController} from '../../DataAssemblyController';
import {Constructor} from '../_helper';
import {BaseDataAssemblyRuntime} from '../../DataAssemblyController';

export interface FeedbackMonitoringRuntime extends BaseDataAssemblyRuntime {
MonEn: OpcUaDataItem<boolean>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
*/

import {OpcUaDataItem} from '../../../connection';
import {BaseDataAssemblyRuntime, DataAssemblyController} from '../../DataAssemblyController';
import {Constructor} from '../_helper';
import {BaseDataAssemblyRuntime} from '../../DataAssemblyController';

export type InterlockRuntime = BaseDataAssemblyRuntime & {
PermEn: OpcUaDataItem<boolean>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
*/

import {OpcUaDataItem} from '../../../connection';
import {Constructor} from '../_helper';
import {BaseDataAssemblyRuntime, DataAssemblyController} from '../../DataAssemblyController';
import {BaseDataAssemblyRuntime} from '../../DataAssemblyController';

export type LimitMonitoringRuntime = BaseDataAssemblyRuntime & {
VAHEn: OpcUaDataItem<boolean>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
*/

import {OpcUaDataItem} from '../../../connection';
import {Constructor} from '../_helper';
import {BaseDataAssemblyRuntime, DataAssemblyController} from '../../DataAssemblyController';
import {BaseDataAssemblyRuntime} from '../../DataAssemblyController';

export interface OSLevelRuntime extends BaseDataAssemblyRuntime {
OSLevel: OpcUaDataItem<number>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,8 @@
* SOFTWARE.
*/

import {ParameterInterface} from '@p2olab/polaris-interface';
import {OpcUaDataItem} from '../../../connection';
import {Constructor} from '../_helper';
import {BaseDataAssemblyRuntime, DataAssemblyController} from '../../DataAssemblyController';
import {AnaView} from '../../indicatorElement';
import {BaseDataAssemblyRuntime} from '../../DataAssemblyController';

export interface ScaleSettingsRuntime extends BaseDataAssemblyRuntime {
VSclMin: OpcUaDataItem<number>;
Expand All @@ -42,7 +39,7 @@ export class ScaleSettings {
this.initialize();
}

private initialize(){
private initialize(): void{
this.dAController.communication.VSclMax = this.dAController.createDataItem('VSclMax', 'read');
this.dAController.communication.VSclMin = this.dAController.createDataItem('VSclMin', 'read');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,8 @@

import {ServiceSourceMode} from '@p2olab/polaris-interface';
import {OpcUaDataItem} from '../../../connection';
import {BaseDataAssemblyRuntime, DataAssemblyController} from '../../DataAssemblyController';
import {Constructor} from '../_helper';
import {BaseDataAssemblyRuntime} from '../../DataAssemblyController';
import {catDataAssembly} from '../../../../../logging';
import {AnaServParamMockup} from '../../operationElement/servParam/anaServParam/AnaServParam.mockup';
import {AnaServParam} from '../../operationElement';

export interface ServiceSourceModeRuntime extends BaseDataAssemblyRuntime {
SrcChannel: OpcUaDataItem<boolean>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@
* SOFTWARE.
*/

import {ParameterInterface} from '@p2olab/polaris-interface';
import {OpcUaDataItem} from '../../../connection';
import {BaseDataAssemblyRuntime, DataAssemblyController} from '../../DataAssemblyController';
import {Constructor} from '../_helper';
import {BaseDataAssemblyRuntime} from '../../DataAssemblyController';

export type ValueLimitationRuntime = BaseDataAssemblyRuntime & {
VMin: OpcUaDataItem<number>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
*/

import {OpcUaDataItem} from '../../../connection';
import {BaseDataAssemblyRuntime, Constructor} from '../../index';
import {DataAssemblyController} from '../../DataAssemblyController';
import {BaseDataAssemblyRuntime} from '../../index';

export interface WQCRuntime extends BaseDataAssemblyRuntime {
WQC: OpcUaDataItem<number>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* tslint:disable:max-classes-per-file */
/*
* MIT License
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,10 @@

import {DataAssemblyOptions} from '@p2olab/polaris-interface';
import {OpcUaConnection} from '../../connection';
import {OSLevelRuntime, WQCRuntime} from '../_extensions';
import {OSLevelRuntime, WQC, WQCRuntime} from '../_extensions';
import {
BaseDataAssemblyRuntime, DataAssemblyController,
} from '../DataAssemblyController';
import {OSLevel} from '../_extensions/osLevelDA/OSLevel';
import {WQC} from '../_extensions/wqcDA/WQC';

export type DiagnosticElementRuntime = BaseDataAssemblyRuntime & WQCRuntime & OSLevelRuntime;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import * as chaiAsPromised from 'chai-as-promised';
import {DataAssemblyOptions} from '@p2olab/polaris-interface';
import * as baseDataAssemblyOptions from './HealthStateView.spec.json';
import {MockupServer} from '../../../../_utils';
import {Namespace, UAObject} from 'node-opcua';
import {HealthStateViewMockup} from './HealthStateView.mockup';


Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* tslint:disable:max-classes-per-file */
/*
* MIT License
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export * from './DiagnosticElement';
export * from './healthStateView/HealthStateView';

export * from './lockView';
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* tslint:disable:max-classes-per-file */
/*
* MIT License
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* tslint:disable:max-classes-per-file */
/*
* MIT License
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,14 @@
*/

import {AnaView, AnaViewRuntime} from './AnaView';
import {OpcUaConnection, OpcUaDataItem} from '../../../connection';
import {OpcUaConnection} from '../../../connection';
import {DataAssemblyOptions} from '@p2olab/polaris-interface';
import {LimitMonitoring, LimitMonitoringRuntime} from '../../_extensions/limitMonitoringDA/LimitMonitoring';
import {OSLevel, OSLevelRuntime} from '../../_extensions/osLevelDA/OSLevel';
import {
LimitMonitoring,
LimitMonitoringRuntime,
OSLevel,
OSLevelRuntime
} from '../../_extensions';

export type AnaMonRuntime = AnaViewRuntime & LimitMonitoringRuntime & OSLevelRuntime

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
* SOFTWARE.
*/

import {DataAssemblyOptions, ParameterInterface} from '@p2olab/polaris-interface';
import {DataAssemblyOptions} from '@p2olab/polaris-interface';
import {OpcUaConnection, OpcUaDataItem} from '../../../connection';
import {ScaleSettingsRuntime, UnitDataAssemblyRuntime} from '../../_extensions';
import {IndicatorElement, IndicatorElementRuntime} from '../IndicatorElement';
import {ScaleSettings} from '../../_extensions/scaleSettingsDA/ScaleSettings';
import {UnitSettings} from '../../_extensions/unitDA/UnitSettings';
import {ScaleSettings, UnitSettings} from '../../_extensions';

export type AnaViewRuntime = IndicatorElementRuntime & UnitDataAssemblyRuntime & ScaleSettingsRuntime & {
V: OpcUaDataItem<number>;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* tslint:disable:max-classes-per-file */
/*
* MIT License
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,11 @@
* SOFTWARE.
*/

import {DataAssemblyOptions, ParameterInterface} from '@p2olab/polaris-interface';
import {DataAssemblyOptions} from '@p2olab/polaris-interface';
import {OpcUaConnection} from '../../../connection';
import {AnaViewRuntime} from '../AnaView/AnaView';
import {IndicatorElement} from '../IndicatorElement';
import {UnitSettings} from '../../_extensions/unitDA/UnitSettings';
import {ScaleSettings} from '../../_extensions/scaleSettingsDA/ScaleSettings';
import {ScaleSettings, UnitSettings} from '../../_extensions';


export class DIntView extends IndicatorElement {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
*/

import {DataAssemblyOptions, ParameterInterface} from '@p2olab/polaris-interface';
import {OpcUaConnection, OpcUaDataItem} from '../../connection';
import {OpcUaConnection} from '../../connection';
import {WQCRuntime} from '../_extensions';
import {
BaseDataAssemblyRuntime, DataAssemblyController
} from '../DataAssemblyController';
import {WQC} from '../_extensions/wqcDA/WQC';
import {WQC} from '../_extensions';

export type IndicatorElementRuntime = BaseDataAssemblyRuntime & WQCRuntime

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export * from './IndicatorElement';

export * from './AnaView/AnaMon';
export * from './AnaView/AnaView';
export * from './BinView/BinMon';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,14 @@

import {
DataAssemblyOptions,
InputElementOptions,
ParameterInterface,
ParameterOptions
} from '@p2olab/polaris-interface';
import {DataItem, OpcUaConnection} from '../../connection';
import {PEAController} from '../../PEAController';
import {WQCRuntime} from '../_extensions';
import {WQC, WQCRuntime} from '../_extensions';
import {BaseDataAssemblyRuntime, DataAssemblyController} from '../DataAssemblyController';
import {catDataAssembly} from '../../../../logging';
import {WQC} from '../_extensions/wqcDA/WQC';
import {Parameter} from '../../../recipe';

export type InputElementRuntime = WQCRuntime & BaseDataAssemblyRuntime ;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@

import {DataAssemblyOptions, ParameterInterface, ParameterOptions} from '@p2olab/polaris-interface';
import {Parameter} from '../../../recipe';
import {DataItem, OpcUaConnection, OpcUaDataItem} from '../../connection';
import {DataItem, OpcUaConnection} from '../../connection';
import {OSLevelRuntime} from '../_extensions';
import {BaseDataAssemblyRuntime, DataAssemblyController} from '../DataAssemblyController';
import {PEAController} from '../../PEAController';
import {catDataAssembly} from '../../../../logging';
import {OSLevel} from '../_extensions/osLevelDA/OSLevel';
import {OSLevel} from '../_extensions';

export type OperationElementRuntime = BaseDataAssemblyRuntime & OSLevelRuntime

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export * from './man';
export * from './servParam';

export * from './OperationElement';
Loading