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
refactoring ResetDA
  • Loading branch information
julorenz committed Jan 4, 2022
commit c26ef74bcdc555c89fc3b41fe00cf1b92f586c9f
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ DataAssemblyController "0..1" o-- Interlock
DataAssemblyController "0..1" o-- LimitMonitoring
DataAssemblyController "0..1" o-- OpMode
DataAssemblyController "0..1" o-- OSLevel
DataAssemblyController "0..1" o-- ResetDA
DataAssemblyController "0..1" o-- Reset
DataAssemblyController "0..1" o-- ScaleSettingDA
DataAssemblyController "0..1" o-- ServiceSourceModeDA
DataAssemblyController "0..1" o-- SourceModeDA
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export * from './interlock/Interlock';
export * from './limitMonitoring/LimitMonitoring';
export * from './opMode/OpMode';
export * from './osLevel/OSLevel';
export * from './resetDA/Reset';
export * from './reset/Reset';
export * from './scaleSettingsDA/ScaleSettings';
export * from './sourceModeDA/SourceModeController';
export * from './unitDA/UnitSettings';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,31 +26,31 @@
import * as chai from 'chai';
import * as chaiAsPromised from 'chai-as-promised';
import {MockupServer} from '../../../../_utils';
import {ResetDAMockup} from './ResetDA.mockup';
import {ResetMockup} from './Reset.mockup';
import {OpcUaConnection} from '../../../connection';


chai.use(chaiAsPromised);
const expect = chai.expect;

describe('ResetDAMockup', () => {
describe('ResetMockup', () => {
describe('static', () => {
let mockupServer: MockupServer;
beforeEach(async()=>{
mockupServer = new MockupServer();
await mockupServer.initialize();
});

it('should create ResetDAMockup', async () => {
const mockup= new ResetDAMockup(mockupServer.nameSpace,
it('should create ResetMockup', async () => {
const mockup= new ResetMockup(mockupServer.nameSpace,
mockupServer.rootObject, 'Variable');
expect(mockup).to.not.be.undefined;

});
it('getResetDAMockupReferenceJSON()', () => {
const mockup = new ResetDAMockup(mockupServer.nameSpace,
it('getResetMockupReferenceJSON()', () => {
const mockup = new ResetMockup(mockupServer.nameSpace,
mockupServer.rootObject, 'Variable');
const json = mockup.getResetDAInstanceMockupJSON() as any;
const json = mockup.getResetInstanceMockupJSON() as any;
expect(Object.keys(json).length).to.equal(2);
expect(json.ResetOp).to.not.be.undefined;
expect(json.ResetAut).to.not.be.undefined;
Expand All @@ -65,7 +65,7 @@ describe('ResetDAMockup', () => {
this.timeout(10000);
mockupServer = new MockupServer();
await mockupServer.initialize();
new ResetDAMockup(mockupServer.nameSpace, mockupServer.rootObject, 'Variable');
new ResetMockup(mockupServer.nameSpace, mockupServer.rootObject, 'Variable');
await mockupServer.start();
connection = new OpcUaConnection();
connection.initialize({endpoint: mockupServer.endpoint});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

import {DataType, Namespace, StatusCodes, UAObject, Variant} from 'node-opcua';

export function getResetDAMockupReferenceJSON(
export function getResetMockupReferenceJSON(
namespace: number,
objectBrowseName: string): object {

Expand All @@ -43,7 +43,7 @@ export function getResetDAMockupReferenceJSON(
});
}

export class ResetDAMockup {
export class ResetMockup {
protected resetOp = false;
protected resetAut = false;
protected mockupNode: UAObject;
Expand Down Expand Up @@ -84,8 +84,8 @@ export class ResetDAMockup {
});
}

public getResetDAInstanceMockupJSON(): object {
return getResetDAMockupReferenceJSON(
public getResetInstanceMockupJSON(): object {
return getResetMockupReferenceJSON(
this.mockupNode.namespaceIndex,
this.mockupNode.browseName.name as string);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ class Reset{
}

ResetRuntime <-- Reset
ResetDASpec --> Reset : <<uses>>
ResetDASpec --> ResetDAMockup : <<uses>>
ResetSpec --> Reset : <<uses>>
ResetSpec --> ResetMockup : <<uses>>
@enduml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {DataAssemblyController} from '../../DataAssemblyController';
import {MonBinVlv} from '../../activeElement';
import {Reset} from './Reset';
import {MockupServer} from '../../../../_utils';
import {ResetDAMockup} from './ResetDA.mockup';
import {ResetMockup} from './Reset.mockup';

chai.use(chaiAsPromised);
const expect = chai.expect;
Expand Down Expand Up @@ -62,7 +62,7 @@ describe('Reset', () => {
this.timeout(4000);
mockupServer = new MockupServer();
await mockupServer.initialize();
new ResetDAMockup(mockupServer.nameSpace, mockupServer.rootObject, 'Variable');
new ResetMockup(mockupServer.nameSpace, mockupServer.rootObject, 'Variable');
await mockupServer.start();
connection = new OpcUaConnection();
connection.initialize({endpoint: mockupServer.endpoint});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {WQCDAMockup} from '../../_extensions/wqcDA/WQCDA.mockup';
import {OSLevelMockup} from '../../_extensions/osLevel/OSLevel.mockup';
import {getOpModeMockupReferenceJSON, OpModeMockup} from '../../_extensions/opMode/OpMode.mockup';
import {getInterlockMockupReferenceJSON, InterlockMockup} from '../../_extensions/interlock/Interlock.mockup';
import {getResetDAMockupReferenceJSON, ResetDAMockup} from '../../_extensions/resetDA/ResetDA.mockup';
import {getResetMockupReferenceJSON, ResetMockup} from '../../_extensions/reset/Reset.mockup';
import {getActiveElementMockupReferenceJSON} from '../ActiveElement.mockup';


Expand All @@ -41,7 +41,7 @@ export function getDrvMockupReferenceJSON(
...getActiveElementMockupReferenceJSON(namespace,objectBrowseName),
...getOpModeMockupReferenceJSON(namespace,objectBrowseName),
...getInterlockMockupReferenceJSON(namespace,objectBrowseName),
...getResetDAMockupReferenceJSON(namespace,objectBrowseName),
...getResetMockupReferenceJSON(namespace,objectBrowseName),
SafePos: {
namespaceIndex: `${namespace}`,
nodeId: `${objectBrowseName}.SafePos`,
Expand Down Expand Up @@ -138,7 +138,7 @@ export class DrvMockup {
public osLevel: OSLevelMockup;
public operationMode: OpModeMockup;
public interlock: InterlockMockup;
public reset: ResetDAMockup;
public reset: ResetMockup;

public safePos = false;
public safePosAct = false;
Expand Down Expand Up @@ -175,7 +175,7 @@ export class DrvMockup {
this.wqc = new WQCDAMockup(namespace, this.mockupNode, this.name);
this.operationMode = new OpModeMockup(namespace,this.mockupNode,this.name);
this.interlock= new InterlockMockup(namespace,this.mockupNode,this.name);
this.reset= new ResetDAMockup(namespace,this.mockupNode,this.name);
this.reset= new ResetMockup(namespace,this.mockupNode,this.name);

namespace.addVariable({
componentOf: this.mockupNode,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {WQCDAMockup} from '../../_extensions/wqcDA/WQCDA.mockup';
import {OSLevelMockup} from '../../_extensions/osLevel/OSLevel.mockup';
import {getOpModeMockupReferenceJSON, OpModeMockup} from '../../_extensions/opMode/OpMode.mockup';
import {getInterlockMockupReferenceJSON, InterlockMockup} from '../../_extensions/interlock/Interlock.mockup';
import {getResetDAMockupReferenceJSON, ResetDAMockup} from '../../_extensions/resetDA/ResetDA.mockup';
import {getResetMockupReferenceJSON, ResetMockup} from '../../_extensions/reset/Reset.mockup';
import {getActiveElementMockupReferenceJSON} from '../ActiveElement.mockup';


Expand All @@ -40,7 +40,7 @@ export function getVlvMockupReferenceJSON(
...getActiveElementMockupReferenceJSON(namespace, objectBrowseName),
...getOpModeMockupReferenceJSON(namespace,objectBrowseName),
...getInterlockMockupReferenceJSON(namespace,objectBrowseName),
...getResetDAMockupReferenceJSON(namespace,objectBrowseName),
...getResetMockupReferenceJSON(namespace,objectBrowseName),
SafePos: {
namespaceIndex: `${namespace}`,
nodeId: `${objectBrowseName}.SafePos`,
Expand Down Expand Up @@ -107,7 +107,7 @@ export class VlvMockup {
public osLevel: OSLevelMockup;
public operationMode: OpModeMockup;
public interlock: InterlockMockup;
public reset: ResetDAMockup;
public reset: ResetMockup;

public safePos = false;
public safePosEn = false;
Expand Down Expand Up @@ -137,7 +137,7 @@ export class VlvMockup {
this.wqc = new WQCDAMockup(namespace, this.mockupNode, this.name);
this.operationMode = new OpModeMockup(namespace,this.mockupNode,this.name);
this.interlock= new InterlockMockup(namespace,this.mockupNode,this.name);
this.reset= new ResetDAMockup(namespace,this.mockupNode,this.name);
this.reset= new ResetMockup(namespace,this.mockupNode,this.name);

namespace.addVariable({
componentOf: this.mockupNode,
Expand Down