Fixing Module nam

This commit is contained in:
Martin Karkowski 2020-12-30 19:57:03 +01:00
parent a129043a8d
commit 1577a583d8
2 changed files with 46 additions and 42 deletions

View File

@ -2,23 +2,23 @@
* @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',
selector: "helloworld",
options: {
identifier: "instance01",
type: "helloworld",
@ -26,22 +26,22 @@ export const DESCRIPTION: IPackageDescription<typeof TYPES> = {
}
}
],
nameOfPackage: 'helloworldpackage',
nameOfPackage: "helloworldpackage",
providedClasses: [
{
description: {
name: 'helloworld',
name: "helloworld",
selector: TYPES.helloworld,
type: HelloWorldModuleWithDecorators
},
settings: {
allowInstanceGeneration: true,
allowInstanceGeneration: true
}
}
],
providedFunctions: [],
requiredPackages: [],
types: TYPES
}
};
export default DESCRIPTION;

View File

@ -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();
}
}