Fixing Module nam
This commit is contained in:
parent
a129043a8d
commit
1577a583d8
@ -2,46 +2,46 @@
|
||||
* @author Martin Karkowski
|
||||
* @email m.karkowski@zema.de
|
||||
* @create date 2020-11-06 16:53:43
|
||||
* @modify date 2020-11-07 01:06:36
|
||||
* @modify date 2020-12-30 18:37:18
|
||||
* @desc [description]
|
||||
*/
|
||||
|
||||
import { HelloWorldModuleWithDecorators } from './helloworldWithDecorators.module';
|
||||
import { IPackageDescription } from "../../../lib/types/nope/nopePackage.interface"
|
||||
import { IPackageDescription } from "../../../lib/types/nope/nopePackage.interface";
|
||||
import { HelloWorldModuleWithDecorators } from "./helloworldWithDecorators.module";
|
||||
|
||||
const TYPES = {
|
||||
'helloworld': Symbol.for('helloworld')
|
||||
}
|
||||
helloworld: Symbol.for("helloworld")
|
||||
};
|
||||
|
||||
export const DESCRIPTION: IPackageDescription<typeof TYPES> = {
|
||||
activationHandlers: [],
|
||||
autostart: {},
|
||||
defaultInstances: [
|
||||
{
|
||||
selector: 'helloworld',
|
||||
options: {
|
||||
identifier: "instance01",
|
||||
type: "helloworld",
|
||||
params: []
|
||||
}
|
||||
}
|
||||
],
|
||||
nameOfPackage: 'helloworldpackage',
|
||||
providedClasses: [
|
||||
{
|
||||
description: {
|
||||
name: 'helloworld',
|
||||
selector: TYPES.helloworld,
|
||||
type: HelloWorldModuleWithDecorators
|
||||
},
|
||||
settings: {
|
||||
allowInstanceGeneration: true,
|
||||
}
|
||||
}
|
||||
],
|
||||
providedFunctions: [],
|
||||
requiredPackages: [],
|
||||
types: TYPES
|
||||
}
|
||||
activationHandlers: [],
|
||||
autostart: {},
|
||||
defaultInstances: [
|
||||
{
|
||||
selector: "helloworld",
|
||||
options: {
|
||||
identifier: "instance01",
|
||||
type: "helloworld",
|
||||
params: []
|
||||
}
|
||||
}
|
||||
],
|
||||
nameOfPackage: "helloworldpackage",
|
||||
providedClasses: [
|
||||
{
|
||||
description: {
|
||||
name: "helloworld",
|
||||
selector: TYPES.helloworld,
|
||||
type: HelloWorldModuleWithDecorators
|
||||
},
|
||||
settings: {
|
||||
allowInstanceGeneration: true
|
||||
}
|
||||
}
|
||||
],
|
||||
providedFunctions: [],
|
||||
requiredPackages: [],
|
||||
types: TYPES
|
||||
};
|
||||
|
||||
export default DESCRIPTION;
|
@ -14,7 +14,7 @@ export class HelloWorldModuleWithDecorators
|
||||
implements IHelloWorlModule {
|
||||
@exportProperty({
|
||||
mode: ["publish"],
|
||||
topic: "string",
|
||||
topic: "testProp",
|
||||
schema: {}
|
||||
})
|
||||
public testProp = new NopeObservable<string>();
|
||||
@ -22,7 +22,9 @@ export class HelloWorldModuleWithDecorators
|
||||
@exportProperty({
|
||||
mode: ["publish"],
|
||||
topic: "currentTime",
|
||||
schema: {}
|
||||
schema: {
|
||||
type: "string"
|
||||
}
|
||||
})
|
||||
public currentTime = new NopeObservable<string>();
|
||||
|
||||
@ -70,7 +72,7 @@ export class HelloWorldModuleWithDecorators
|
||||
}
|
||||
})
|
||||
async updateTestProp() {
|
||||
this.testProp.setContent("Internally Updated");
|
||||
this.testProp.setContent("Internally Updated using updateTestProp()");
|
||||
}
|
||||
|
||||
/**
|
||||
@ -111,6 +113,8 @@ export class HelloWorldModuleWithDecorators
|
||||
);
|
||||
}
|
||||
|
||||
protected _interval: any;
|
||||
|
||||
async init() {
|
||||
this.author = {
|
||||
forename: "Martin",
|
||||
@ -126,13 +130,12 @@ export class HelloWorldModuleWithDecorators
|
||||
await super.init();
|
||||
|
||||
// Every 1000 ms publish an update of the current time.
|
||||
setInterval(() => {
|
||||
this._interval = setInterval(() => {
|
||||
_this.currentTime.setContent(new Date().toISOString());
|
||||
}, 1000);
|
||||
|
||||
const _this = this;
|
||||
|
||||
this.testProp = new NopeObservable();
|
||||
this.testProp.setContent("INITAL_VALUE");
|
||||
|
||||
this.testProp.subscribe((value, sender) => {
|
||||
console.log(
|
||||
@ -146,7 +149,8 @@ export class HelloWorldModuleWithDecorators
|
||||
}
|
||||
|
||||
async dispose() {
|
||||
await super.dispose();
|
||||
clearInterval(this._interval);
|
||||
console.log("Deleting Module");
|
||||
await super.dispose();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user