-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathApp.js
36 lines (31 loc) · 1.13 KB
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { AppController } from "./AppController.js";
import { AppSettingsModel } from "./AppSettingsModel.js";
import { DeviceModel } from "./net/DeviceModel.js"
import { NetworkMonitor } from "./net/NetworkMonitor.js";
import { DeviceMonitor } from "./net/DeviceMonitor.js";
import { Logger } from "./utils/Logger.js";
export class App {
static instance() {
return this._instance || (this._instance = new this());
}
static releaseInstance() {
this._instance = undefined;
}
constructor() {
const logger = new Logger();
const appSettingsModel = new AppSettingsModel(logger);
appSettingsModel.init();
const deviceMonitor = new DeviceMonitor(logger);
const networkMonitor = new NetworkMonitor(logger);
const deviceModel = new DeviceModel(logger, deviceMonitor, networkMonitor, appSettingsModel);
this._appController = new AppController(logger, appSettingsModel, deviceModel);
}
start() {
this._appController.init();
this._appController.show();
}
stop() {
this._appController.hide();
this._appController.deinit();
}
}