From af1cbd90a9e631ce1ba8393f054690ee08c3499a Mon Sep 17 00:00:00 2001 From: Matthew Broadway Date: Sun, 30 Aug 2020 12:34:33 +0100 Subject: [PATCH 01/12] added tuxedo_cc_wmi to installation instructions --- README.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 164812df..6e64ccd0 100644 --- a/README.md +++ b/README.md @@ -32,9 +32,13 @@ tuxedo-control-center sudo apt install -y git gcc g++ make nodejs ``` -2. Clone & install libraries + +2. Install `tuxedo-cc-wmi` (can be obtained from the respositories [here](https://www.tuxedocomputers.com/en/Infos/Help-and-Support/Instructions/Add-TUXEDO-Computers-software-package-sources.tuxedo#)). + This package provides a driver at `/dev/tuxedo_cc_wmi`. The control center can run without this but will not be functional. + +3. Clone & install libraries ``` - git clone https://github.com/tuxedocomputers/tuxedo-control-center.git` + git clone https://github.com/tuxedocomputers/tuxedo-control-center.git cd tuxedo-control-center @@ -42,7 +46,7 @@ tuxedo-control-center ``` **Note:** Do ***not*** continue with `npm audit fix`. Known to cause various issues. -3. Install service file that points to development build path (or use installed service from packaged version) +4. Install service file that points to development build path (or use installed service from packaged version) Manual instructions: 1. Copy `tccd.service` and `tccd-sleep.service` (from src/dist-data) to `/etc/systemd/system/` From a9960daca5642cb1f98ed80443f0e9eca9dccf7f Mon Sep 17 00:00:00 2001 From: Matthew Broadway Date: Sun, 30 Aug 2020 13:12:13 +0100 Subject: [PATCH 02/12] added start-service command --- README.md | 1 + package.json | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index 6e64ccd0..1dc78499 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,7 @@ tuxedo-control-center | build | Build all apps service/electron/angular | | start | Normal start of electron app after build | | start-watch | Start GUI with automatic reload on changes to angular directory | +| start-service | Start the tccd daemon | | test-common | Test common files (jasmine) | | gen-lang | Generate base for translation (`ng-app/assets/locale/lang.xlf`) | | pack-prod -- all \| deb \| rpm | Build and package for chosen target(s) | diff --git a/package.json b/package.json index e7f157df..f1611408 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "build-electron": "tsc -p ./src/e-app", "build-service": "tsc -p ./src/service-app && cp ./src/package.json ./dist/tuxedo-control-center/service-app/package.json && run-s bundle-service", "bundle-service": "pkg --target node10-linux-x64 --output ./dist/tuxedo-control-center/data/service/tccd ./dist/tuxedo-control-center/service-app/package.json", + "start-service": "sudo NODE_PATH=\"./dist/tuxedo-control-center/data/service:${NODE_PATH}\" node ./dist/tuxedo-control-center/service-app/service-app/main.js --start", "build-native": "node-gyp configure && node-gyp rebuild", "copy-files": "run-s copy-package-json copy-dist-files copy-native", "copy-native": "mkdir -p ./dist/tuxedo-control-center/service-app/native-lib && cp ./build/Release/TuxedoWMIAPI.node ./dist/tuxedo-control-center/data/service", From 67a1348fdea0916fa38d2dd0d3acd543ba7392f2 Mon Sep 17 00:00:00 2001 From: Matthew Broadway Date: Sun, 30 Aug 2020 17:40:16 +0100 Subject: [PATCH 03/12] added option to open dev tools with --debug --- .vscode/launch.json | 2 +- src/e-app/main.ts | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index d7955715..d841b4a1 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -10,7 +10,7 @@ "windows": { "runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron.cmd" }, - "runtimeArgs": ["./dist/tuxedo-control-center"], + "runtimeArgs": ["./dist/tuxedo-control-center", "--debug"], "program": "${workspaceRoot}/src/e-app/main.ts", "outFiles": [ "${workspaceRoot}/dist/tuxedo-control-center/e-app/e-app/main.js" diff --git a/src/e-app/main.ts b/src/e-app/main.ts index b1fdca36..ca33d4d3 100644 --- a/src/e-app/main.ts +++ b/src/e-app/main.ts @@ -20,6 +20,7 @@ let tccDBus: TccDBusController; const watchOption = process.argv.includes('--watch'); const trayOnlyOption = process.argv.includes('--tray'); const noTccdVersionCheck = process.argv.includes('--no-tccd-version-check'); +const debugModeOption = process.argv.includes('--debug'); // Ensure that only one instance of the application is running const applicationLock = app.requestSingleInstanceLock(); @@ -183,6 +184,10 @@ function createTccWindow() { } }); + if(debugModeOption) { + tccWindow.webContents.openDevTools() + } + const indexPath = path.join(__dirname, '..', '..', 'ng-app', 'index.html'); tccWindow.loadFile(indexPath); tccWindow.on('closed', () => { From 22dce6126f9f97f6fe8712e6c2a0394f0b5df615 Mon Sep 17 00:00:00 2001 From: Matthew Broadway Date: Sun, 30 Aug 2020 19:58:38 +0100 Subject: [PATCH 04/12] reading fan tables from a configuration file --- build-src/after_install.sh | 4 + src/common/classes/ConfigHandler.ts | 73 ++- src/dist-data/fantables | 514 ++++++++++++++++++ src/ng-app/app/config.service.ts | 4 +- .../classes/TuxedoControlCenterDaemon.ts | 10 +- 5 files changed, 595 insertions(+), 10 deletions(-) create mode 100644 src/dist-data/fantables diff --git a/build-src/after_install.sh b/build-src/after_install.sh index 5722d4cd..ac34ded4 100755 --- a/build-src/after_install.sh +++ b/build-src/after_install.sh @@ -12,6 +12,10 @@ cp ${DIST_DATA}/tuxedo-control-center-tray.desktop /etc/skel/.config/autostart/t cp ${DIST_DATA}/de.tuxedocomputers.tcc.policy /usr/share/polkit-1/actions/de.tuxedocomputers.tcc.policy || true cp ${DIST_DATA}/com.tuxedocomputers.tccd.conf /usr/share/dbus-1/system.d/com.tuxedocomputers.tccd.conf || true +# Copy settings +mkdir -p /etc/tcc +cp ${DIST_DATA}/fantables.json /etc/tcc/fantables || true + # Copy and enable services cp ${DIST_DATA}/tccd.service /etc/systemd/system/tccd.service || true cp ${DIST_DATA}/tccd-sleep.service /etc/systemd/system/tccd-sleep.service || true diff --git a/src/common/classes/ConfigHandler.ts b/src/common/classes/ConfigHandler.ts index b40a2788..d5d7d8da 100644 --- a/src/common/classes/ConfigHandler.ts +++ b/src/common/classes/ConfigHandler.ts @@ -29,6 +29,8 @@ export class ConfigHandler { public autosaveFileMod: number; public fantablesFileMod: number; + private fanTables: ITccFanProfile[]; + private loadedCustomProfiles: ITccProfile[]; private loadedSettings: ITccSettings; @@ -38,6 +40,8 @@ export class ConfigHandler { this.profileFileMod = 0o644; this.autosaveFileMod = 0o644; this.fantablesFileMod = 0o644; + + this.fanTables = this.readFanTables(); } get pathSettings() { return this._pathSettings; } @@ -73,12 +77,67 @@ export class ConfigHandler { this.writeConfig(autosave, filePath, { mode: this.autosaveFileMod }); } + private createFanProfile(name: string, rows): ITccFanProfile { + return { + name: name, + tableCPU: rows.map(row => ({"temp": row[0], "speed": row[1]})), + tableGPU: rows.map(row => ({"temp": row[0], "speed": row[2]})) + } + } + readFanTables(filePath: string = this.pathFanTables): ITccFanProfile[] { - return this.readConfig(filePath); + const lines = fs.readFileSync(filePath, 'utf-8').split('\n'); + let currentProfile = null; + let currentRows = []; + let profiles = []; + const blankLineRegex = /^\s*(#.*)?$/ + const sectionLineRegex = /^\s*\[([^\]]+)\]\s*(#.*)?$/ + const rowLineRegex = /^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(#.*)?/ + let match + for(var line of lines) { + if(blankLineRegex.test(line)) { + continue; + } else if((match = rowLineRegex.exec(line)) !== null) { + if(currentProfile === null) { + throw Error(`syntax error reading fan profiles from "${filePath}"`); + } + currentRows.push([parseInt(match[1]), parseInt(match[2]), parseInt(match[3])]); + } else if((match = sectionLineRegex.exec(line)) !== null) { + if(currentProfile !== null) { + profiles.push(this.createFanProfile(currentProfile, currentRows)); + currentRows = []; + } + currentProfile = match[1]; + } else { + throw Error(`syntax error reading fan profiles from "${filePath}"`); + } + } + if(currentProfile !== null) { + profiles.push(this.createFanProfile(currentProfile, currentRows)); + } + return profiles; } writeFanTables(fanTables: ITccFanProfile[], filePath: string = this.pathFanTables) { - this.writeConfig(fanTables, filePath, { mode: this.fantablesFileMod }); + let lines = []; + for(var profile of fanTables) { + lines.push(`[${profile.name}]`) + if(profile.tableCPU.length !== profile.tableGPU.length) { + throw Error("invalid fan profile. Temperatures don't match"); + } + for(var i = 0; i < profile.tableCPU.length; i++) { + let cpu_entry = profile.tableCPU[i]; + let gpu_entry = profile.tableGPU[i]; + if(cpu_entry.temp !== gpu_entry.temp) { + throw Error("invalid fan profile. Temperatures don't match"); + } + lines.push(`${cpu_entry.temp},${cpu_entry.speed},${gpu_entry.speed}`) + } + lines.push(''); + } + this.fanTables = fanTables; + let data = lines.join('\n'); + this.writeFile(data, filePath, { mode: this.fantablesFileMod }); } public readConfig(filename: string): T { @@ -93,7 +152,10 @@ export class ConfigHandler { } public writeConfig(config: T, filePath: string, writeFileOptions): void { - const fileData = JSON.stringify(config); + this.writeFile(JSON.stringify(config), filePath, writeFileOptions); + } + + private writeFile(fileData: string, filePath: string, writeFileOptions): void { try { if (!fs.existsSync(path.dirname(filePath))) { fs.mkdirSync(path.dirname(filePath), { mode: 0o755, recursive: true }); @@ -150,7 +212,8 @@ export class ConfigHandler { } } - public getDefaultFanProfiles(): ITccFanProfile[] { - return this.copyConfig(defaultFanProfiles); + public getFanProfiles(): ITccFanProfile[] { + return this.copyConfig(this.fanTables); } + } diff --git a/src/dist-data/fantables b/src/dist-data/fantables new file mode 100644 index 00000000..253f1e9d --- /dev/null +++ b/src/dist-data/fantables @@ -0,0 +1,514 @@ +[Silent] +0,0,0 +1,0,0 +2,0,0 +3,0,0 +4,0,0 +5,0,0 +6,0,0 +7,0,0 +8,0,0 +9,0,0 +10,0,0 +11,0,0 +12,0,0 +13,0,0 +14,0,0 +15,0,0 +16,0,0 +17,0,0 +18,0,0 +19,0,0 +20,0,0 +21,0,0 +22,0,0 +23,0,0 +24,0,0 +25,0,0 +26,0,0 +27,0,0 +28,0,0 +29,0,0 +30,0,0 +31,0,0 +32,0,0 +33,0,0 +34,0,0 +35,0,0 +36,0,0 +37,0,0 +38,0,0 +39,0,0 +40,0,0 +41,0,0 +42,0,0 +43,0,0 +44,0,0 +45,0,0 +46,0,0 +47,0,0 +48,0,0 +49,0,0 +50,0,0 +51,0,0 +52,0,0 +53,0,0 +54,0,0 +55,0,0 +56,0,0 +57,0,0 +58,0,0 +59,0,0 +60,0,0 +61,15,22 +62,15,22 +63,15,22 +64,20,23 +65,20,24 +66,25,25 +67,25,25 +68,25,28 +69,25,30 +70,30,33 +71,30,37 +72,35,40 +73,35,43 +74,40,44 +75,40,46 +76,45,48 +77,45,52 +78,50,52 +79,50,55 +80,55,55 +81,55,60 +82,60,60 +83,60,65 +84,65,65 +85,65,70 +86,70,70 +87,70,80 +88,75,80 +89,80,85 +90,85,85 +91,90,100 +92,90,100 +93,95,100 +94,95,100 +95,100,100 +96,100,100 +97,100,100 +98,100,100 +99,100,100 +100,100,100 + +[Quiet] +0,0,0 +1,0,0 +2,0,0 +3,0,0 +4,0,0 +5,0,0 +6,0,0 +7,0,0 +8,0,0 +9,0,0 +10,0,0 +11,0,0 +12,0,0 +13,0,0 +14,0,0 +15,0,0 +16,0,0 +17,0,0 +18,0,0 +19,0,0 +20,0,0 +21,0,0 +22,0,0 +23,0,0 +24,0,0 +25,0,0 +26,0,0 +27,0,0 +28,0,0 +29,0,0 +30,0,0 +31,0,0 +32,0,0 +33,0,0 +34,0,0 +35,0,0 +36,0,0 +37,0,0 +38,0,0 +39,0,0 +40,0,0 +41,0,0 +42,0,0 +43,0,0 +44,0,0 +45,0,0 +46,0,0 +47,0,0 +48,0,0 +49,0,0 +50,0,0 +51,10,10 +52,11,11 +53,12,12 +54,12,12 +55,12,12 +56,12,12 +57,17,17 +58,17,17 +59,17,17 +60,17,17 +61,22,22 +62,22,22 +63,22,22 +64,23,23 +65,24,24 +66,25,25 +67,25,25 +68,28,28 +69,30,30 +70,33,33 +71,37,37 +72,40,40 +73,43,43 +74,44,44 +75,46,46 +76,48,48 +77,52,52 +78,52,52 +79,55,55 +80,55,55 +81,60,60 +82,60,60 +83,65,65 +84,65,65 +85,70,70 +86,70,70 +87,80,80 +88,80,80 +89,85,85 +90,85,85 +91,90,100 +92,90,100 +93,95,100 +94,95,100 +95,100,100 +96,100,100 +97,100,100 +98,100,100 +99,100,100 +100,100,100 + +[Balanced] +0,0,0 +1,0,0 +2,0,0 +3,0,0 +4,0,0 +5,0,0 +6,0,0 +7,0,0 +8,0,0 +9,0,0 +10,0,0 +11,0,0 +12,0,0 +13,0,0 +14,0,0 +15,0,0 +16,0,0 +17,0,0 +18,0,0 +19,0,0 +20,0,0 +21,0,0 +22,0,0 +23,0,0 +24,0,0 +25,0,0 +26,0,0 +27,0,0 +28,0,0 +29,0,0 +30,0,0 +31,0,0 +32,0,0 +33,0,0 +34,0,0 +35,0,0 +36,0,0 +37,0,0 +38,0,0 +39,0,0 +40,0,0 +41,0,0 +42,0,0 +43,0,0 +44,0,0 +45,0,0 +46,10,10 +47,12,12 +48,16,16 +49,19,19 +50,19,19 +51,19,19 +52,23,23 +53,23,23 +54,26,26 +55,26,26 +56,26,26 +57,30,30 +58,30,30 +59,30,30 +60,33,33 +61,33,33 +62,33,33 +63,35,35 +64,35,35 +65,38,38 +66,40,40 +67,42,42 +68,45,45 +69,47,47 +70,50,50 +71,50,50 +72,52,52 +73,53,53 +74,53,53 +75,57,57 +76,57,57 +77,60,60 +78,60,60 +79,63,63 +80,65,65 +81,65,65 +82,70,70 +83,70,70 +84,75,75 +85,75,75 +86,80,80 +87,80,80 +88,85,85 +89,90,90 +90,90,90 +91,90,100 +92,95,100 +93,95,100 +94,95,100 +95,100,100 +96,100,100 +97,100,100 +98,100,100 +99,100,100 +100,100,100 + +[Cool] +0,0,0 +1,0,0 +2,0,0 +3,0,0 +4,0,0 +5,0,0 +6,0,0 +7,0,0 +8,0,0 +9,0,0 +10,0,0 +11,0,0 +12,0,0 +13,0,0 +14,0,0 +15,0,0 +16,0,0 +17,0,0 +18,0,0 +19,0,0 +20,0,0 +21,0,0 +22,0,0 +23,0,0 +24,0,0 +25,0,0 +26,0,0 +27,0,0 +28,0,0 +29,0,0 +30,0,0 +31,0,0 +32,0,0 +33,0,0 +34,0,0 +35,0,0 +36,0,0 +37,0,0 +38,0,0 +39,0,0 +40,15,15 +41,15,15 +42,15,15 +43,15,15 +44,15,15 +45,15,15 +46,20,20 +47,20,20 +48,20,20 +49,20,20 +50,20,20 +51,25,25 +52,25,25 +53,25,25 +54,27,27 +55,27,27 +56,30,30 +57,30,30 +58,32,32 +59,33,33 +60,35,35 +61,37,37 +62,40,40 +63,40,40 +64,42,42 +65,45,45 +66,45,45 +67,45,45 +68,47,47 +69,50,50 +70,50,50 +71,52,52 +72,55,55 +73,55,55 +74,57,57 +75,60,60 +76,60,60 +77,65,65 +78,65,65 +79,70,70 +80,70,70 +81,75,75 +82,75,75 +83,80,80 +84,80,80 +85,85,85 +86,85,85 +87,90,90 +88,90,90 +89,90,95 +90,95,95 +91,95,100 +92,95,100 +93,95,100 +94,95,100 +95,100,100 +96,100,100 +97,100,100 +98,100,100 +99,100,100 +100,100,100 + +[Freezy] +0,0,0 +1,0,0 +2,0,0 +3,0,0 +4,0,0 +5,0,0 +6,0,0 +7,0,0 +8,0,0 +9,0,0 +10,0,0 +11,0,0 +12,0,0 +13,0,0 +14,0,0 +15,0,0 +16,0,0 +17,0,0 +18,0,0 +19,0,0 +20,10,10 +21,10,10 +22,10,10 +23,10,10 +24,10,10 +25,15,15 +26,15,15 +27,15,15 +28,15,15 +29,15,15 +30,15,15 +31,15,15 +32,15,15 +33,15,15 +34,15,15 +35,15,15 +36,15,15 +37,15,15 +38,15,15 +39,15,15 +40,20,20 +41,20,20 +42,20,20 +43,20,20 +44,20,20 +45,25,25 +46,25,25 +47,25,25 +48,25,25 +49,25,25 +50,30,30 +51,30,30 +52,30,30 +53,30,30 +54,35,35 +55,35,35 +56,35,35 +57,35,35 +58,40,40 +59,40,40 +60,40,40 +61,40,40 +62,45,45 +63,45,45 +64,45,45 +65,45,45 +66,50,50 +67,50,50 +68,50,50 +69,50,50 +70,55,55 +71,55,55 +72,55,55 +73,55,55 +74,60,60 +75,60,60 +76,65,65 +77,65,65 +78,70,70 +79,70,70 +80,75,75 +81,75,75 +82,80,80 +83,80,80 +84,85,85 +85,85,85 +86,90,90 +87,90,90 +88,90,90 +89,90,95 +90,95,95 +91,95,100 +92,95,100 +93,95,100 +94,95,100 +95,100,100 +96,100,100 +97,100,100 +98,100,100 +99,100,100 +100,100,100 diff --git a/src/ng-app/app/config.service.ts b/src/ng-app/app/config.service.ts index 357bca0e..8ee5e767 100644 --- a/src/ng-app/app/config.service.ts +++ b/src/ng-app/app/config.service.ts @@ -26,7 +26,7 @@ import { environment } from '../environments/environment'; import { ElectronService } from 'ngx-electron'; import { Observable, Subject, BehaviorSubject } from 'rxjs'; import { UtilsService } from './utils.service'; -import { ITccFanProfile, defaultFanProfiles } from '../../common/models/TccFanTable'; +import { ITccFanProfile } from '../../common/models/TccFanTable'; @Injectable({ providedIn: 'root' @@ -331,6 +331,6 @@ export class ConfigService { } public getFanProfiles(): ITccFanProfile[] { - return this.config.getDefaultFanProfiles(); + return this.config.getFanProfiles(); } } diff --git a/src/service-app/classes/TuxedoControlCenterDaemon.ts b/src/service-app/classes/TuxedoControlCenterDaemon.ts index 7f5e4a6c..b7c4f339 100644 --- a/src/service-app/classes/TuxedoControlCenterDaemon.ts +++ b/src/service-app/classes/TuxedoControlCenterDaemon.ts @@ -294,7 +294,7 @@ export class TuxedoControlCenterDaemon extends SingleProcess { } // Attempt to find fan profile from tcc profile - let chosenFanProfile = this.config.getDefaultFanProfiles() + let chosenFanProfile = this.config.getFanProfiles() .find(fanProfile => fanProfile.name === this.getCurrentProfile().fan.fanProfile); if (chosenFanProfile === undefined) { @@ -305,11 +305,15 @@ export class TuxedoControlCenterDaemon extends SingleProcess { } getFallbackFanProfile(): ITccFanProfile { + let fanProfiles = this.config.readFanTables(); + if(fanProfiles.length == 0) { + throw Error("no fan profiles found"); + } // Fallback to 'Balanced' - let chosenFanProfile = this.config.getDefaultFanProfiles().find(fanProfile => fanProfile.name === 'Balanced'); + let chosenFanProfile = fanProfiles.find(fanProfile => fanProfile.name === 'Balanced'); // Fallback to first in list if (chosenFanProfile === undefined) { - chosenFanProfile = this.config.getDefaultFanProfiles()[0]; + chosenFanProfile = fanProfiles[0]; } return chosenFanProfile; } From 26a7b81ab8d8246d952ffacc3002dca2af516b8a Mon Sep 17 00:00:00 2001 From: Matthew Broadway Date: Sun, 30 Aug 2020 20:21:16 +0100 Subject: [PATCH 05/12] removed hard coded fan table defaults --- src/common/classes/ConfigHandler.ts | 2 +- src/common/models/TccFanTable.ts | 1048 --------------------------- 2 files changed, 1 insertion(+), 1049 deletions(-) diff --git a/src/common/classes/ConfigHandler.ts b/src/common/classes/ConfigHandler.ts index d5d7d8da..828e3168 100644 --- a/src/common/classes/ConfigHandler.ts +++ b/src/common/classes/ConfigHandler.ts @@ -21,7 +21,7 @@ import * as path from 'path'; import { ITccSettings, defaultSettings } from '../models/TccSettings'; import { ITccProfile, defaultProfiles, defaultCustomProfile, defaultCustomProfileXP1508UHD } from '../models/TccProfile'; import { ITccAutosave, defaultAutosave } from '../models/TccAutosave'; -import { ITccFanProfile, defaultFanProfiles } from '../models/TccFanTable'; +import { ITccFanProfile } from '../models/TccFanTable'; export class ConfigHandler { public settingsFileMod: number; diff --git a/src/common/models/TccFanTable.ts b/src/common/models/TccFanTable.ts index 765145b8..ce731db0 100644 --- a/src/common/models/TccFanTable.ts +++ b/src/common/models/TccFanTable.ts @@ -26,1051 +26,3 @@ export interface ITccFanTableEntry { temp: number; speed: number; } - -export const defaultFanProfiles = [ - { - name: 'Silent', - tableCPU: [ - { temp: 0, speed: 0 }, - { temp: 1, speed: 0 }, - { temp: 2, speed: 0 }, - { temp: 3, speed: 0 }, - { temp: 4, speed: 0 }, - { temp: 5, speed: 0 }, - { temp: 6, speed: 0 }, - { temp: 7, speed: 0 }, - { temp: 8, speed: 0 }, - { temp: 9, speed: 0 }, - { temp: 10, speed: 0 }, - { temp: 11, speed: 0 }, - { temp: 12, speed: 0 }, - { temp: 13, speed: 0 }, - { temp: 14, speed: 0 }, - { temp: 15, speed: 0 }, - { temp: 16, speed: 0 }, - { temp: 17, speed: 0 }, - { temp: 18, speed: 0 }, - { temp: 19, speed: 0 }, - { temp: 20, speed: 0 }, - { temp: 21, speed: 0 }, - { temp: 22, speed: 0 }, - { temp: 23, speed: 0 }, - { temp: 24, speed: 0 }, - { temp: 25, speed: 0 }, - { temp: 26, speed: 0 }, - { temp: 27, speed: 0 }, - { temp: 28, speed: 0 }, - { temp: 29, speed: 0 }, - { temp: 30, speed: 0 }, - { temp: 31, speed: 0 }, - { temp: 32, speed: 0 }, - { temp: 33, speed: 0 }, - { temp: 34, speed: 0 }, - { temp: 35, speed: 0 }, - { temp: 36, speed: 0 }, - { temp: 37, speed: 0 }, - { temp: 38, speed: 0 }, - { temp: 39, speed: 0 }, - { temp: 40, speed: 0 }, - { temp: 41, speed: 0 }, - { temp: 42, speed: 0 }, - { temp: 43, speed: 0 }, - { temp: 44, speed: 0 }, - { temp: 45, speed: 0 }, - { temp: 46, speed: 0 }, - { temp: 47, speed: 0 }, - { temp: 48, speed: 0 }, - { temp: 49, speed: 0 }, - { temp: 50, speed: 0 }, - { temp: 51, speed: 0 }, - { temp: 52, speed: 0 }, - { temp: 53, speed: 0 }, - { temp: 54, speed: 0 }, - { temp: 55, speed: 0 }, - { temp: 56, speed: 0 }, - { temp: 57, speed: 0 }, - { temp: 58, speed: 0 }, - { temp: 59, speed: 0 }, - { temp: 60, speed: 0 }, - { temp: 61, speed: 15 }, - { temp: 62, speed: 15 }, - { temp: 63, speed: 15 }, - { temp: 64, speed: 20 }, - { temp: 65, speed: 20 }, - { temp: 66, speed: 25 }, - { temp: 67, speed: 25 }, - { temp: 68, speed: 25 }, - { temp: 69, speed: 25 }, - { temp: 70, speed: 30 }, - { temp: 71, speed: 30 }, - { temp: 72, speed: 35 }, - { temp: 73, speed: 35 }, - { temp: 74, speed: 40 }, - { temp: 75, speed: 40 }, - { temp: 76, speed: 45 }, - { temp: 77, speed: 45 }, - { temp: 78, speed: 50 }, - { temp: 79, speed: 50 }, - { temp: 80, speed: 55 }, - { temp: 81, speed: 55 }, - { temp: 82, speed: 60 }, - { temp: 83, speed: 60 }, - { temp: 84, speed: 65 }, - { temp: 85, speed: 65 }, - { temp: 86, speed: 70 }, - { temp: 87, speed: 70 }, - { temp: 88, speed: 75 }, - { temp: 89, speed: 80 }, - { temp: 90, speed: 85 }, - { temp: 91, speed: 90 }, - { temp: 92, speed: 90 }, - { temp: 93, speed: 95 }, - { temp: 94, speed: 95 }, - { temp: 95, speed: 100 }, - { temp: 96, speed: 100 }, - { temp: 97, speed: 100 }, - { temp: 98, speed: 100 }, - { temp: 99, speed: 100 }, - { temp: 100, speed: 100 } - ], - tableGPU: [ - { temp: 0, speed: 0 }, - { temp: 1, speed: 0 }, - { temp: 2, speed: 0 }, - { temp: 3, speed: 0 }, - { temp: 4, speed: 0 }, - { temp: 5, speed: 0 }, - { temp: 6, speed: 0 }, - { temp: 7, speed: 0 }, - { temp: 8, speed: 0 }, - { temp: 9, speed: 0 }, - { temp: 10, speed: 0 }, - { temp: 11, speed: 0 }, - { temp: 12, speed: 0 }, - { temp: 13, speed: 0 }, - { temp: 14, speed: 0 }, - { temp: 15, speed: 0 }, - { temp: 16, speed: 0 }, - { temp: 17, speed: 0 }, - { temp: 18, speed: 0 }, - { temp: 19, speed: 0 }, - { temp: 20, speed: 0 }, - { temp: 21, speed: 0 }, - { temp: 22, speed: 0 }, - { temp: 23, speed: 0 }, - { temp: 24, speed: 0 }, - { temp: 25, speed: 0 }, - { temp: 26, speed: 0 }, - { temp: 27, speed: 0 }, - { temp: 28, speed: 0 }, - { temp: 29, speed: 0 }, - { temp: 30, speed: 0 }, - { temp: 31, speed: 0 }, - { temp: 32, speed: 0 }, - { temp: 33, speed: 0 }, - { temp: 34, speed: 0 }, - { temp: 35, speed: 0 }, - { temp: 36, speed: 0 }, - { temp: 37, speed: 0 }, - { temp: 38, speed: 0 }, - { temp: 39, speed: 0 }, - { temp: 40, speed: 0 }, - { temp: 41, speed: 0 }, - { temp: 42, speed: 0 }, - { temp: 43, speed: 0 }, - { temp: 44, speed: 0 }, - { temp: 45, speed: 0 }, - { temp: 46, speed: 0 }, - { temp: 47, speed: 0 }, - { temp: 48, speed: 0 }, - { temp: 49, speed: 0 }, - { temp: 50, speed: 0 }, - { temp: 51, speed: 0 }, - { temp: 52, speed: 0 }, - { temp: 53, speed: 0 }, - { temp: 54, speed: 0 }, - { temp: 55, speed: 0 }, - { temp: 56, speed: 0 }, - { temp: 57, speed: 0 }, - { temp: 58, speed: 0 }, - { temp: 59, speed: 0 }, - { temp: 60, speed: 0 }, - { temp: 61, speed: 22 }, - { temp: 62, speed: 22 }, - { temp: 63, speed: 22 }, - { temp: 64, speed: 23 }, - { temp: 65, speed: 24 }, - { temp: 66, speed: 25 }, - { temp: 67, speed: 25 }, - { temp: 68, speed: 28 }, - { temp: 69, speed: 30 }, - { temp: 70, speed: 33 }, - { temp: 71, speed: 37 }, - { temp: 72, speed: 40 }, - { temp: 73, speed: 43 }, - { temp: 74, speed: 44 }, - { temp: 75, speed: 46 }, - { temp: 76, speed: 48 }, - { temp: 77, speed: 52 }, - { temp: 78, speed: 52 }, - { temp: 79, speed: 55 }, - { temp: 80, speed: 55 }, - { temp: 81, speed: 60 }, - { temp: 82, speed: 60 }, - { temp: 83, speed: 65 }, - { temp: 84, speed: 65 }, - { temp: 85, speed: 70 }, - { temp: 86, speed: 70 }, - { temp: 87, speed: 80 }, - { temp: 88, speed: 80 }, - { temp: 89, speed: 85 }, - { temp: 90, speed: 85 }, - { temp: 91, speed: 100 }, - { temp: 92, speed: 100 }, - { temp: 93, speed: 100 }, - { temp: 94, speed: 100 }, - { temp: 95, speed: 100 }, - { temp: 96, speed: 100 }, - { temp: 97, speed: 100 }, - { temp: 98, speed: 100 }, - { temp: 99, speed: 100 }, - { temp: 100, speed: 100 } - ] - }, - { - name: 'Quiet', - tableCPU: [ - { temp: 0, speed: 0 }, - { temp: 1, speed: 0 }, - { temp: 2, speed: 0 }, - { temp: 3, speed: 0 }, - { temp: 4, speed: 0 }, - { temp: 5, speed: 0 }, - { temp: 6, speed: 0 }, - { temp: 7, speed: 0 }, - { temp: 8, speed: 0 }, - { temp: 9, speed: 0 }, - { temp: 10, speed: 0 }, - { temp: 11, speed: 0 }, - { temp: 12, speed: 0 }, - { temp: 13, speed: 0 }, - { temp: 14, speed: 0 }, - { temp: 15, speed: 0 }, - { temp: 16, speed: 0 }, - { temp: 17, speed: 0 }, - { temp: 18, speed: 0 }, - { temp: 19, speed: 0 }, - { temp: 20, speed: 0 }, - { temp: 21, speed: 0 }, - { temp: 22, speed: 0 }, - { temp: 23, speed: 0 }, - { temp: 24, speed: 0 }, - { temp: 25, speed: 0 }, - { temp: 26, speed: 0 }, - { temp: 27, speed: 0 }, - { temp: 28, speed: 0 }, - { temp: 29, speed: 0 }, - { temp: 30, speed: 0 }, - { temp: 31, speed: 0 }, - { temp: 32, speed: 0 }, - { temp: 33, speed: 0 }, - { temp: 34, speed: 0 }, - { temp: 35, speed: 0 }, - { temp: 36, speed: 0 }, - { temp: 37, speed: 0 }, - { temp: 38, speed: 0 }, - { temp: 39, speed: 0 }, - { temp: 40, speed: 0 }, - { temp: 41, speed: 0 }, - { temp: 42, speed: 0 }, - { temp: 43, speed: 0 }, - { temp: 44, speed: 0 }, - { temp: 45, speed: 0 }, - { temp: 46, speed: 0 }, - { temp: 47, speed: 0 }, - { temp: 48, speed: 0 }, - { temp: 49, speed: 0 }, - { temp: 50, speed: 0 }, - { temp: 51, speed: 10 }, - { temp: 52, speed: 11 }, - { temp: 53, speed: 12 }, - { temp: 54, speed: 12 }, - { temp: 55, speed: 12 }, - { temp: 56, speed: 12 }, - { temp: 57, speed: 17 }, - { temp: 58, speed: 17 }, - { temp: 59, speed: 17 }, - { temp: 60, speed: 17 }, - { temp: 61, speed: 22 }, - { temp: 62, speed: 22 }, - { temp: 63, speed: 22 }, - { temp: 64, speed: 23 }, - { temp: 65, speed: 24 }, - { temp: 66, speed: 25 }, - { temp: 67, speed: 25 }, - { temp: 68, speed: 28 }, - { temp: 69, speed: 30 }, - { temp: 70, speed: 33 }, - { temp: 71, speed: 37 }, - { temp: 72, speed: 40 }, - { temp: 73, speed: 43 }, - { temp: 74, speed: 44 }, - { temp: 75, speed: 46 }, - { temp: 76, speed: 48 }, - { temp: 77, speed: 52 }, - { temp: 78, speed: 52 }, - { temp: 79, speed: 55 }, - { temp: 80, speed: 55 }, - { temp: 81, speed: 60 }, - { temp: 82, speed: 60 }, - { temp: 83, speed: 65 }, - { temp: 84, speed: 65 }, - { temp: 85, speed: 70 }, - { temp: 86, speed: 70 }, - { temp: 87, speed: 80 }, - { temp: 88, speed: 80 }, - { temp: 89, speed: 85 }, - { temp: 90, speed: 85 }, - { temp: 91, speed: 90 }, - { temp: 92, speed: 90 }, - { temp: 93, speed: 95 }, - { temp: 94, speed: 95 }, - { temp: 95, speed: 100 }, - { temp: 96, speed: 100 }, - { temp: 97, speed: 100 }, - { temp: 98, speed: 100 }, - { temp: 99, speed: 100 }, - { temp: 100, speed: 100 } - ], - tableGPU: [ - { temp: 0, speed: 0 }, - { temp: 1, speed: 0 }, - { temp: 2, speed: 0 }, - { temp: 3, speed: 0 }, - { temp: 4, speed: 0 }, - { temp: 5, speed: 0 }, - { temp: 6, speed: 0 }, - { temp: 7, speed: 0 }, - { temp: 8, speed: 0 }, - { temp: 9, speed: 0 }, - { temp: 10, speed: 0 }, - { temp: 11, speed: 0 }, - { temp: 12, speed: 0 }, - { temp: 13, speed: 0 }, - { temp: 14, speed: 0 }, - { temp: 15, speed: 0 }, - { temp: 16, speed: 0 }, - { temp: 17, speed: 0 }, - { temp: 18, speed: 0 }, - { temp: 19, speed: 0 }, - { temp: 20, speed: 0 }, - { temp: 21, speed: 0 }, - { temp: 22, speed: 0 }, - { temp: 23, speed: 0 }, - { temp: 24, speed: 0 }, - { temp: 25, speed: 0 }, - { temp: 26, speed: 0 }, - { temp: 27, speed: 0 }, - { temp: 28, speed: 0 }, - { temp: 29, speed: 0 }, - { temp: 30, speed: 0 }, - { temp: 31, speed: 0 }, - { temp: 32, speed: 0 }, - { temp: 33, speed: 0 }, - { temp: 34, speed: 0 }, - { temp: 35, speed: 0 }, - { temp: 36, speed: 0 }, - { temp: 37, speed: 0 }, - { temp: 38, speed: 0 }, - { temp: 39, speed: 0 }, - { temp: 40, speed: 0 }, - { temp: 41, speed: 0 }, - { temp: 42, speed: 0 }, - { temp: 43, speed: 0 }, - { temp: 44, speed: 0 }, - { temp: 45, speed: 0 }, - { temp: 46, speed: 0 }, - { temp: 47, speed: 0 }, - { temp: 48, speed: 0 }, - { temp: 49, speed: 0 }, - { temp: 50, speed: 0 }, - { temp: 51, speed: 10 }, - { temp: 52, speed: 11 }, - { temp: 53, speed: 12 }, - { temp: 54, speed: 12 }, - { temp: 55, speed: 12 }, - { temp: 56, speed: 12 }, - { temp: 57, speed: 17 }, - { temp: 58, speed: 17 }, - { temp: 59, speed: 17 }, - { temp: 60, speed: 17 }, - { temp: 61, speed: 22 }, - { temp: 62, speed: 22 }, - { temp: 63, speed: 22 }, - { temp: 64, speed: 23 }, - { temp: 65, speed: 24 }, - { temp: 66, speed: 25 }, - { temp: 67, speed: 25 }, - { temp: 68, speed: 28 }, - { temp: 69, speed: 30 }, - { temp: 70, speed: 33 }, - { temp: 71, speed: 37 }, - { temp: 72, speed: 40 }, - { temp: 73, speed: 43 }, - { temp: 74, speed: 44 }, - { temp: 75, speed: 46 }, - { temp: 76, speed: 48 }, - { temp: 77, speed: 52 }, - { temp: 78, speed: 52 }, - { temp: 79, speed: 55 }, - { temp: 80, speed: 55 }, - { temp: 81, speed: 60 }, - { temp: 82, speed: 60 }, - { temp: 83, speed: 65 }, - { temp: 84, speed: 65 }, - { temp: 85, speed: 70 }, - { temp: 86, speed: 70 }, - { temp: 87, speed: 80 }, - { temp: 88, speed: 80 }, - { temp: 89, speed: 85 }, - { temp: 90, speed: 85 }, - { temp: 91, speed: 100 }, - { temp: 92, speed: 100 }, - { temp: 93, speed: 100 }, - { temp: 94, speed: 100 }, - { temp: 95, speed: 100 }, - { temp: 96, speed: 100 }, - { temp: 97, speed: 100 }, - { temp: 98, speed: 100 }, - { temp: 99, speed: 100 }, - { temp: 100, speed: 100 } - ] - }, - { - name: 'Balanced', - tableCPU: [ - { temp: 0, speed: 0 }, - { temp: 1, speed: 0 }, - { temp: 2, speed: 0 }, - { temp: 3, speed: 0 }, - { temp: 4, speed: 0 }, - { temp: 5, speed: 0 }, - { temp: 6, speed: 0 }, - { temp: 7, speed: 0 }, - { temp: 8, speed: 0 }, - { temp: 9, speed: 0 }, - { temp: 10, speed: 0 }, - { temp: 11, speed: 0 }, - { temp: 12, speed: 0 }, - { temp: 13, speed: 0 }, - { temp: 14, speed: 0 }, - { temp: 15, speed: 0 }, - { temp: 16, speed: 0 }, - { temp: 17, speed: 0 }, - { temp: 18, speed: 0 }, - { temp: 19, speed: 0 }, - { temp: 20, speed: 0 }, - { temp: 21, speed: 0 }, - { temp: 22, speed: 0 }, - { temp: 23, speed: 0 }, - { temp: 24, speed: 0 }, - { temp: 25, speed: 0 }, - { temp: 26, speed: 0 }, - { temp: 27, speed: 0 }, - { temp: 28, speed: 0 }, - { temp: 29, speed: 0 }, - { temp: 30, speed: 0 }, - { temp: 31, speed: 0 }, - { temp: 32, speed: 0 }, - { temp: 33, speed: 0 }, - { temp: 34, speed: 0 }, - { temp: 35, speed: 0 }, - { temp: 36, speed: 0 }, - { temp: 37, speed: 0 }, - { temp: 38, speed: 0 }, - { temp: 39, speed: 0 }, - { temp: 40, speed: 0 }, - { temp: 41, speed: 0 }, - { temp: 42, speed: 0 }, - { temp: 43, speed: 0 }, - { temp: 44, speed: 0 }, - { temp: 45, speed: 0 }, - { temp: 46, speed: 10 }, - { temp: 47, speed: 12 }, - { temp: 48, speed: 16 }, - { temp: 49, speed: 19 }, - { temp: 50, speed: 19 }, - { temp: 51, speed: 19 }, - { temp: 52, speed: 23 }, - { temp: 53, speed: 23 }, - { temp: 54, speed: 26 }, - { temp: 55, speed: 26 }, - { temp: 56, speed: 26 }, - { temp: 57, speed: 30 }, - { temp: 58, speed: 30 }, - { temp: 59, speed: 30 }, - { temp: 60, speed: 33 }, - { temp: 61, speed: 33 }, - { temp: 62, speed: 33 }, - { temp: 63, speed: 35 }, - { temp: 64, speed: 35 }, - { temp: 65, speed: 38 }, - { temp: 66, speed: 40 }, - { temp: 67, speed: 42 }, - { temp: 68, speed: 45 }, - { temp: 69, speed: 47 }, - { temp: 70, speed: 50 }, - { temp: 71, speed: 50 }, - { temp: 72, speed: 52 }, - { temp: 73, speed: 53 }, - { temp: 74, speed: 53 }, - { temp: 75, speed: 57 }, - { temp: 76, speed: 57 }, - { temp: 77, speed: 60 }, - { temp: 78, speed: 60 }, - { temp: 79, speed: 63 }, - { temp: 80, speed: 65 }, - { temp: 81, speed: 65 }, - { temp: 82, speed: 70 }, - { temp: 83, speed: 70 }, - { temp: 84, speed: 75 }, - { temp: 85, speed: 75 }, - { temp: 86, speed: 80 }, - { temp: 87, speed: 80 }, - { temp: 88, speed: 85 }, - { temp: 89, speed: 90 }, - { temp: 90, speed: 90 }, - { temp: 91, speed: 90 }, - { temp: 92, speed: 95 }, - { temp: 93, speed: 95 }, - { temp: 94, speed: 95 }, - { temp: 95, speed: 100 }, - { temp: 96, speed: 100 }, - { temp: 97, speed: 100 }, - { temp: 98, speed: 100 }, - { temp: 99, speed: 100 }, - { temp: 100, speed: 100 } - ], - tableGPU: [ - { temp: 0, speed: 0 }, - { temp: 1, speed: 0 }, - { temp: 2, speed: 0 }, - { temp: 3, speed: 0 }, - { temp: 4, speed: 0 }, - { temp: 5, speed: 0 }, - { temp: 6, speed: 0 }, - { temp: 7, speed: 0 }, - { temp: 8, speed: 0 }, - { temp: 9, speed: 0 }, - { temp: 10, speed: 0 }, - { temp: 11, speed: 0 }, - { temp: 12, speed: 0 }, - { temp: 13, speed: 0 }, - { temp: 14, speed: 0 }, - { temp: 15, speed: 0 }, - { temp: 16, speed: 0 }, - { temp: 17, speed: 0 }, - { temp: 18, speed: 0 }, - { temp: 19, speed: 0 }, - { temp: 20, speed: 0 }, - { temp: 21, speed: 0 }, - { temp: 22, speed: 0 }, - { temp: 23, speed: 0 }, - { temp: 24, speed: 0 }, - { temp: 25, speed: 0 }, - { temp: 26, speed: 0 }, - { temp: 27, speed: 0 }, - { temp: 28, speed: 0 }, - { temp: 29, speed: 0 }, - { temp: 30, speed: 0 }, - { temp: 31, speed: 0 }, - { temp: 32, speed: 0 }, - { temp: 33, speed: 0 }, - { temp: 34, speed: 0 }, - { temp: 35, speed: 0 }, - { temp: 36, speed: 0 }, - { temp: 37, speed: 0 }, - { temp: 38, speed: 0 }, - { temp: 39, speed: 0 }, - { temp: 40, speed: 0 }, - { temp: 41, speed: 0 }, - { temp: 42, speed: 0 }, - { temp: 43, speed: 0 }, - { temp: 44, speed: 0 }, - { temp: 45, speed: 0 }, - { temp: 46, speed: 10 }, - { temp: 47, speed: 12 }, - { temp: 48, speed: 16 }, - { temp: 49, speed: 19 }, - { temp: 50, speed: 19 }, - { temp: 51, speed: 19 }, - { temp: 52, speed: 23 }, - { temp: 53, speed: 23 }, - { temp: 54, speed: 26 }, - { temp: 55, speed: 26 }, - { temp: 56, speed: 26 }, - { temp: 57, speed: 30 }, - { temp: 58, speed: 30 }, - { temp: 59, speed: 30 }, - { temp: 60, speed: 33 }, - { temp: 61, speed: 33 }, - { temp: 62, speed: 33 }, - { temp: 63, speed: 35 }, - { temp: 64, speed: 35 }, - { temp: 65, speed: 38 }, - { temp: 66, speed: 40 }, - { temp: 67, speed: 42 }, - { temp: 68, speed: 45 }, - { temp: 69, speed: 47 }, - { temp: 70, speed: 50 }, - { temp: 71, speed: 50 }, - { temp: 72, speed: 52 }, - { temp: 73, speed: 53 }, - { temp: 74, speed: 53 }, - { temp: 75, speed: 57 }, - { temp: 76, speed: 57 }, - { temp: 77, speed: 60 }, - { temp: 78, speed: 60 }, - { temp: 79, speed: 63 }, - { temp: 80, speed: 65 }, - { temp: 81, speed: 65 }, - { temp: 82, speed: 70 }, - { temp: 83, speed: 70 }, - { temp: 84, speed: 75 }, - { temp: 85, speed: 75 }, - { temp: 86, speed: 80 }, - { temp: 87, speed: 80 }, - { temp: 88, speed: 85 }, - { temp: 89, speed: 90 }, - { temp: 90, speed: 90 }, - { temp: 91, speed: 100 }, - { temp: 92, speed: 100 }, - { temp: 93, speed: 100 }, - { temp: 94, speed: 100 }, - { temp: 95, speed: 100 }, - { temp: 96, speed: 100 }, - { temp: 97, speed: 100 }, - { temp: 98, speed: 100 }, - { temp: 99, speed: 100 }, - { temp: 100, speed: 100 } - ] - }, - { - name: 'Cool', - tableCPU: [ - { temp: 0, speed: 0 }, - { temp: 1, speed: 0 }, - { temp: 2, speed: 0 }, - { temp: 3, speed: 0 }, - { temp: 4, speed: 0 }, - { temp: 5, speed: 0 }, - { temp: 6, speed: 0 }, - { temp: 7, speed: 0 }, - { temp: 8, speed: 0 }, - { temp: 9, speed: 0 }, - { temp: 10, speed: 0 }, - { temp: 11, speed: 0 }, - { temp: 12, speed: 0 }, - { temp: 13, speed: 0 }, - { temp: 14, speed: 0 }, - { temp: 15, speed: 0 }, - { temp: 16, speed: 0 }, - { temp: 17, speed: 0 }, - { temp: 18, speed: 0 }, - { temp: 19, speed: 0 }, - { temp: 20, speed: 0 }, - { temp: 21, speed: 0 }, - { temp: 22, speed: 0 }, - { temp: 23, speed: 0 }, - { temp: 24, speed: 0 }, - { temp: 25, speed: 0 }, - { temp: 26, speed: 0 }, - { temp: 27, speed: 0 }, - { temp: 28, speed: 0 }, - { temp: 29, speed: 0 }, - { temp: 30, speed: 0 }, - { temp: 31, speed: 0 }, - { temp: 32, speed: 0 }, - { temp: 33, speed: 0 }, - { temp: 34, speed: 0 }, - { temp: 35, speed: 0 }, - { temp: 36, speed: 0 }, - { temp: 37, speed: 0 }, - { temp: 38, speed: 0 }, - { temp: 39, speed: 0 }, - { temp: 40, speed: 15 }, - { temp: 41, speed: 15 }, - { temp: 42, speed: 15 }, - { temp: 43, speed: 15 }, - { temp: 44, speed: 15 }, - { temp: 45, speed: 15 }, - { temp: 46, speed: 20 }, - { temp: 47, speed: 20 }, - { temp: 48, speed: 20 }, - { temp: 49, speed: 20 }, - { temp: 50, speed: 20 }, - { temp: 51, speed: 25 }, - { temp: 52, speed: 25 }, - { temp: 53, speed: 25 }, - { temp: 54, speed: 27 }, - { temp: 55, speed: 27 }, - { temp: 56, speed: 30 }, - { temp: 57, speed: 30 }, - { temp: 58, speed: 32 }, - { temp: 59, speed: 33 }, - { temp: 60, speed: 35 }, - { temp: 61, speed: 37 }, - { temp: 62, speed: 40 }, - { temp: 63, speed: 40 }, - { temp: 64, speed: 42 }, - { temp: 65, speed: 45 }, - { temp: 66, speed: 45 }, - { temp: 67, speed: 45 }, - { temp: 68, speed: 47 }, - { temp: 69, speed: 50 }, - { temp: 70, speed: 50 }, - { temp: 71, speed: 52 }, - { temp: 72, speed: 55 }, - { temp: 73, speed: 55 }, - { temp: 74, speed: 57 }, - { temp: 75, speed: 60 }, - { temp: 76, speed: 60 }, - { temp: 77, speed: 65 }, - { temp: 78, speed: 65 }, - { temp: 79, speed: 70 }, - { temp: 80, speed: 70 }, - { temp: 81, speed: 75 }, - { temp: 82, speed: 75 }, - { temp: 83, speed: 80 }, - { temp: 84, speed: 80 }, - { temp: 85, speed: 85 }, - { temp: 86, speed: 85 }, - { temp: 87, speed: 90 }, - { temp: 88, speed: 90 }, - { temp: 89, speed: 90 }, - { temp: 90, speed: 95 }, - { temp: 91, speed: 95 }, - { temp: 92, speed: 95 }, - { temp: 93, speed: 95 }, - { temp: 94, speed: 95 }, - { temp: 95, speed: 100 }, - { temp: 96, speed: 100 }, - { temp: 97, speed: 100 }, - { temp: 98, speed: 100 }, - { temp: 99, speed: 100 }, - { temp: 100, speed: 100 } - ], - tableGPU: [ - { temp: 0, speed: 0 }, - { temp: 1, speed: 0 }, - { temp: 2, speed: 0 }, - { temp: 3, speed: 0 }, - { temp: 4, speed: 0 }, - { temp: 5, speed: 0 }, - { temp: 6, speed: 0 }, - { temp: 7, speed: 0 }, - { temp: 8, speed: 0 }, - { temp: 9, speed: 0 }, - { temp: 10, speed: 0 }, - { temp: 11, speed: 0 }, - { temp: 12, speed: 0 }, - { temp: 13, speed: 0 }, - { temp: 14, speed: 0 }, - { temp: 15, speed: 0 }, - { temp: 16, speed: 0 }, - { temp: 17, speed: 0 }, - { temp: 18, speed: 0 }, - { temp: 19, speed: 0 }, - { temp: 20, speed: 0 }, - { temp: 21, speed: 0 }, - { temp: 22, speed: 0 }, - { temp: 23, speed: 0 }, - { temp: 24, speed: 0 }, - { temp: 25, speed: 0 }, - { temp: 26, speed: 0 }, - { temp: 27, speed: 0 }, - { temp: 28, speed: 0 }, - { temp: 29, speed: 0 }, - { temp: 30, speed: 0 }, - { temp: 31, speed: 0 }, - { temp: 32, speed: 0 }, - { temp: 33, speed: 0 }, - { temp: 34, speed: 0 }, - { temp: 35, speed: 0 }, - { temp: 36, speed: 0 }, - { temp: 37, speed: 0 }, - { temp: 38, speed: 0 }, - { temp: 39, speed: 0 }, - { temp: 40, speed: 15 }, - { temp: 41, speed: 15 }, - { temp: 42, speed: 15 }, - { temp: 43, speed: 15 }, - { temp: 44, speed: 15 }, - { temp: 45, speed: 15 }, - { temp: 46, speed: 20 }, - { temp: 47, speed: 20 }, - { temp: 48, speed: 20 }, - { temp: 49, speed: 20 }, - { temp: 50, speed: 20 }, - { temp: 51, speed: 25 }, - { temp: 52, speed: 25 }, - { temp: 53, speed: 25 }, - { temp: 54, speed: 27 }, - { temp: 55, speed: 27 }, - { temp: 56, speed: 30 }, - { temp: 57, speed: 30 }, - { temp: 58, speed: 32 }, - { temp: 59, speed: 33 }, - { temp: 60, speed: 35 }, - { temp: 61, speed: 37 }, - { temp: 62, speed: 40 }, - { temp: 63, speed: 40 }, - { temp: 64, speed: 42 }, - { temp: 65, speed: 45 }, - { temp: 66, speed: 45 }, - { temp: 67, speed: 45 }, - { temp: 68, speed: 47 }, - { temp: 69, speed: 50 }, - { temp: 70, speed: 50 }, - { temp: 71, speed: 52 }, - { temp: 72, speed: 55 }, - { temp: 73, speed: 55 }, - { temp: 74, speed: 57 }, - { temp: 75, speed: 60 }, - { temp: 76, speed: 60 }, - { temp: 77, speed: 65 }, - { temp: 78, speed: 65 }, - { temp: 79, speed: 70 }, - { temp: 80, speed: 70 }, - { temp: 81, speed: 75 }, - { temp: 82, speed: 75 }, - { temp: 83, speed: 80 }, - { temp: 84, speed: 80 }, - { temp: 85, speed: 85 }, - { temp: 86, speed: 85 }, - { temp: 87, speed: 90 }, - { temp: 88, speed: 90 }, - { temp: 89, speed: 95 }, - { temp: 90, speed: 95 }, - { temp: 91, speed: 100 }, - { temp: 92, speed: 100 }, - { temp: 93, speed: 100 }, - { temp: 94, speed: 100 }, - { temp: 95, speed: 100 }, - { temp: 96, speed: 100 }, - { temp: 97, speed: 100 }, - { temp: 98, speed: 100 }, - { temp: 99, speed: 100 }, - { temp: 100, speed: 100 } - ] - }, - { - name: 'Freezy', - tableCPU: [ - { temp: 0, speed: 0 }, - { temp: 1, speed: 0 }, - { temp: 2, speed: 0 }, - { temp: 3, speed: 0 }, - { temp: 4, speed: 0 }, - { temp: 5, speed: 0 }, - { temp: 6, speed: 0 }, - { temp: 7, speed: 0 }, - { temp: 8, speed: 0 }, - { temp: 9, speed: 0 }, - { temp: 10, speed: 0 }, - { temp: 11, speed: 0 }, - { temp: 12, speed: 0 }, - { temp: 13, speed: 0 }, - { temp: 14, speed: 0 }, - { temp: 15, speed: 0 }, - { temp: 16, speed: 0 }, - { temp: 17, speed: 0 }, - { temp: 18, speed: 0 }, - { temp: 19, speed: 0 }, - { temp: 20, speed: 10 }, - { temp: 21, speed: 10 }, - { temp: 22, speed: 10 }, - { temp: 23, speed: 10 }, - { temp: 24, speed: 10 }, - { temp: 25, speed: 15 }, - { temp: 26, speed: 15 }, - { temp: 27, speed: 15 }, - { temp: 28, speed: 15 }, - { temp: 29, speed: 15 }, - { temp: 30, speed: 15 }, - { temp: 31, speed: 15 }, - { temp: 32, speed: 15 }, - { temp: 33, speed: 15 }, - { temp: 34, speed: 15 }, - { temp: 35, speed: 15 }, - { temp: 36, speed: 15 }, - { temp: 37, speed: 15 }, - { temp: 38, speed: 15 }, - { temp: 39, speed: 15 }, - { temp: 40, speed: 20 }, - { temp: 41, speed: 20 }, - { temp: 42, speed: 20 }, - { temp: 43, speed: 20 }, - { temp: 44, speed: 20 }, - { temp: 45, speed: 25 }, - { temp: 46, speed: 25 }, - { temp: 47, speed: 25 }, - { temp: 48, speed: 25 }, - { temp: 49, speed: 25 }, - { temp: 50, speed: 30 }, - { temp: 51, speed: 30 }, - { temp: 52, speed: 30 }, - { temp: 53, speed: 30 }, - { temp: 54, speed: 35 }, - { temp: 55, speed: 35 }, - { temp: 56, speed: 35 }, - { temp: 57, speed: 35 }, - { temp: 58, speed: 40 }, - { temp: 59, speed: 40 }, - { temp: 60, speed: 40 }, - { temp: 61, speed: 40 }, - { temp: 62, speed: 45 }, - { temp: 63, speed: 45 }, - { temp: 64, speed: 45 }, - { temp: 65, speed: 45 }, - { temp: 66, speed: 50 }, - { temp: 67, speed: 50 }, - { temp: 68, speed: 50 }, - { temp: 69, speed: 50 }, - { temp: 70, speed: 55 }, - { temp: 71, speed: 55 }, - { temp: 72, speed: 55 }, - { temp: 73, speed: 55 }, - { temp: 74, speed: 60 }, - { temp: 75, speed: 60 }, - { temp: 76, speed: 65 }, - { temp: 77, speed: 65 }, - { temp: 78, speed: 70 }, - { temp: 79, speed: 70 }, - { temp: 80, speed: 75 }, - { temp: 81, speed: 75 }, - { temp: 82, speed: 80 }, - { temp: 83, speed: 80 }, - { temp: 84, speed: 85 }, - { temp: 85, speed: 85 }, - { temp: 86, speed: 90 }, - { temp: 87, speed: 90 }, - { temp: 88, speed: 90 }, - { temp: 89, speed: 90 }, - { temp: 90, speed: 95 }, - { temp: 91, speed: 95 }, - { temp: 92, speed: 95 }, - { temp: 93, speed: 95 }, - { temp: 94, speed: 95 }, - { temp: 95, speed: 100 }, - { temp: 96, speed: 100 }, - { temp: 97, speed: 100 }, - { temp: 98, speed: 100 }, - { temp: 99, speed: 100 }, - { temp: 100, speed: 100 } - ], - tableGPU: [ - { temp: 0, speed: 0 }, - { temp: 1, speed: 0 }, - { temp: 2, speed: 0 }, - { temp: 3, speed: 0 }, - { temp: 4, speed: 0 }, - { temp: 5, speed: 0 }, - { temp: 6, speed: 0 }, - { temp: 7, speed: 0 }, - { temp: 8, speed: 0 }, - { temp: 9, speed: 0 }, - { temp: 10, speed: 0 }, - { temp: 11, speed: 0 }, - { temp: 12, speed: 0 }, - { temp: 13, speed: 0 }, - { temp: 14, speed: 0 }, - { temp: 15, speed: 0 }, - { temp: 16, speed: 0 }, - { temp: 17, speed: 0 }, - { temp: 18, speed: 0 }, - { temp: 19, speed: 0 }, - { temp: 20, speed: 10 }, - { temp: 21, speed: 10 }, - { temp: 22, speed: 10 }, - { temp: 23, speed: 10 }, - { temp: 24, speed: 10 }, - { temp: 25, speed: 15 }, - { temp: 26, speed: 15 }, - { temp: 27, speed: 15 }, - { temp: 28, speed: 15 }, - { temp: 29, speed: 15 }, - { temp: 30, speed: 15 }, - { temp: 31, speed: 15 }, - { temp: 32, speed: 15 }, - { temp: 33, speed: 15 }, - { temp: 34, speed: 15 }, - { temp: 35, speed: 15 }, - { temp: 36, speed: 15 }, - { temp: 37, speed: 15 }, - { temp: 38, speed: 15 }, - { temp: 39, speed: 15 }, - { temp: 40, speed: 20 }, - { temp: 41, speed: 20 }, - { temp: 42, speed: 20 }, - { temp: 43, speed: 20 }, - { temp: 44, speed: 20 }, - { temp: 45, speed: 25 }, - { temp: 46, speed: 25 }, - { temp: 47, speed: 25 }, - { temp: 48, speed: 25 }, - { temp: 49, speed: 25 }, - { temp: 50, speed: 30 }, - { temp: 51, speed: 30 }, - { temp: 52, speed: 30 }, - { temp: 53, speed: 30 }, - { temp: 54, speed: 35 }, - { temp: 55, speed: 35 }, - { temp: 56, speed: 35 }, - { temp: 57, speed: 35 }, - { temp: 58, speed: 40 }, - { temp: 59, speed: 40 }, - { temp: 60, speed: 40 }, - { temp: 61, speed: 40 }, - { temp: 62, speed: 45 }, - { temp: 63, speed: 45 }, - { temp: 64, speed: 45 }, - { temp: 65, speed: 45 }, - { temp: 66, speed: 50 }, - { temp: 67, speed: 50 }, - { temp: 68, speed: 50 }, - { temp: 69, speed: 50 }, - { temp: 70, speed: 55 }, - { temp: 71, speed: 55 }, - { temp: 72, speed: 55 }, - { temp: 73, speed: 55 }, - { temp: 74, speed: 60 }, - { temp: 75, speed: 60 }, - { temp: 76, speed: 65 }, - { temp: 77, speed: 65 }, - { temp: 78, speed: 70 }, - { temp: 79, speed: 70 }, - { temp: 80, speed: 75 }, - { temp: 81, speed: 75 }, - { temp: 82, speed: 80 }, - { temp: 83, speed: 80 }, - { temp: 84, speed: 85 }, - { temp: 85, speed: 85 }, - { temp: 86, speed: 90 }, - { temp: 87, speed: 90 }, - { temp: 88, speed: 90 }, - { temp: 89, speed: 95 }, - { temp: 90, speed: 95 }, - { temp: 91, speed: 100 }, - { temp: 92, speed: 100 }, - { temp: 93, speed: 100 }, - { temp: 94, speed: 100 }, - { temp: 95, speed: 100 }, - { temp: 96, speed: 100 }, - { temp: 97, speed: 100 }, - { temp: 98, speed: 100 }, - { temp: 99, speed: 100 }, - { temp: 100, speed: 100 } - ] - } -]; From 065525fdf2e971257f5fdfad52e5153230597f2a Mon Sep 17 00:00:00 2001 From: Matthew Broadway Date: Tue, 1 Sep 2020 19:40:03 +0100 Subject: [PATCH 06/12] small fixes --- src/common/classes/ConfigHandler.ts | 2 +- src/service-app/classes/TuxedoControlCenterDaemon.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/classes/ConfigHandler.ts b/src/common/classes/ConfigHandler.ts index 828e3168..f6ae2d38 100644 --- a/src/common/classes/ConfigHandler.ts +++ b/src/common/classes/ConfigHandler.ts @@ -92,7 +92,7 @@ export class ConfigHandler { let profiles = []; const blankLineRegex = /^\s*(#.*)?$/ const sectionLineRegex = /^\s*\[([^\]]+)\]\s*(#.*)?$/ - const rowLineRegex = /^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(#.*)?/ + const rowLineRegex = /^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(#.*)?$/ let match for(var line of lines) { if(blankLineRegex.test(line)) { diff --git a/src/service-app/classes/TuxedoControlCenterDaemon.ts b/src/service-app/classes/TuxedoControlCenterDaemon.ts index b7c4f339..a532c38a 100644 --- a/src/service-app/classes/TuxedoControlCenterDaemon.ts +++ b/src/service-app/classes/TuxedoControlCenterDaemon.ts @@ -305,7 +305,7 @@ export class TuxedoControlCenterDaemon extends SingleProcess { } getFallbackFanProfile(): ITccFanProfile { - let fanProfiles = this.config.readFanTables(); + let fanProfiles = this.config.getFanProfiles(); if(fanProfiles.length == 0) { throw Error("no fan profiles found"); } From 033710c07ad0950f29e6ab763e1730ffd6e8d1e1 Mon Sep 17 00:00:00 2001 From: Matthew Broadway Date: Tue, 1 Sep 2020 20:48:03 +0100 Subject: [PATCH 07/12] added a way to debug the service --- .vscode/launch.json | 9 +++++++++ README.md | 5 ++++- package.json | 1 + 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index d841b4a1..9fc87493 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,6 +1,15 @@ { "version": "0.2.0", "configurations": [ + { + "name": "Attach", + "port": 9229, + "request": "attach", + "skipFiles": [ + "/**" + ], + "type": "pwa-node" + }, { "name": "Debug Main Process", "type": "node", diff --git a/README.md b/README.md index 1dc78499..8125953e 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,10 @@ tuxedo-control-center | inc-version-major | Major version increase (updates package.json files) | ### Debugging -Debugging of electron main and render process is configured for vscode in .vscode/launch.json +Debugging of electron main and render process is configured for vscode in `.vscode/launch.json`. +Note that the application must be rebuilt each time a change is made. Usually `npm run build-ng` is sufficient. + +To debug the service, run `npm run debug-service` the launch the `Attach` target in `.vscode/launch.json`. ## Screenshots ### English diff --git a/package.json b/package.json index f1611408..1e12f1e1 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "build-service": "tsc -p ./src/service-app && cp ./src/package.json ./dist/tuxedo-control-center/service-app/package.json && run-s bundle-service", "bundle-service": "pkg --target node10-linux-x64 --output ./dist/tuxedo-control-center/data/service/tccd ./dist/tuxedo-control-center/service-app/package.json", "start-service": "sudo NODE_PATH=\"./dist/tuxedo-control-center/data/service:${NODE_PATH}\" node ./dist/tuxedo-control-center/service-app/service-app/main.js --start", + "debug-service": "sudo NODE_PATH=\"./dist/tuxedo-control-center/data/service:${NODE_PATH}\" node --inspect-brk ./dist/tuxedo-control-center/service-app/service-app/main.js --start", "build-native": "node-gyp configure && node-gyp rebuild", "copy-files": "run-s copy-package-json copy-dist-files copy-native", "copy-native": "mkdir -p ./dist/tuxedo-control-center/service-app/native-lib && cp ./build/Release/TuxedoWMIAPI.node ./dist/tuxedo-control-center/data/service", From dfb9bc6872886f84e5fb110f14acf7564ec93099 Mon Sep 17 00:00:00 2001 From: Matthew Broadway Date: Tue, 1 Sep 2020 20:58:41 +0100 Subject: [PATCH 08/12] added stack trace to error printing --- src/service-app/classes/TuxedoControlCenterDaemon.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/service-app/classes/TuxedoControlCenterDaemon.ts b/src/service-app/classes/TuxedoControlCenterDaemon.ts index a532c38a..0c31d67d 100644 --- a/src/service-app/classes/TuxedoControlCenterDaemon.ts +++ b/src/service-app/classes/TuxedoControlCenterDaemon.ts @@ -134,7 +134,11 @@ export class TuxedoControlCenterDaemon extends SingleProcess { public catchError(err: Error) { this.logLine('Tccd Exception'); - const errorLine = err.name + ': ' + err.message; + let errorLine = err.name + ': ' + err.message; + let stack = err.stack; + if(stack !== undefined) { + errorLine += '\n\nStack Trace:\n' + stack; + } this.logLine(errorLine); if (this.started) { this.onExit(); From 7709ee957da14f754450d44c129badf46c8e92b2 Mon Sep 17 00:00:00 2001 From: Matthew Broadway Date: Tue, 1 Sep 2020 20:59:34 +0100 Subject: [PATCH 09/12] removed script used to create hard coded fan tables --- build-src/fan_table_format.ts | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 build-src/fan_table_format.ts diff --git a/build-src/fan_table_format.ts b/build-src/fan_table_format.ts deleted file mode 100644 index e20ab0b4..00000000 --- a/build-src/fan_table_format.ts +++ /dev/null @@ -1,22 +0,0 @@ -import * as process from 'process'; -import * as readline from 'readline'; -import { SIGINT, SIGTERM } from 'constants'; - -const dataList: string[] = []; - -process.stdin.on('data', (dataChunk: Buffer) => { - dataList.push(dataChunk.toString()); -}); - -process.on('SIGINT', () => { - const data = dataList.join(''); - const lines: string[] = data.split('\n'); - let pairs = lines.map(line => line.split(RegExp('[ \t]+'))); - pairs = pairs.filter(pair => pair.length === 2); - const stringEntries = pairs.map(pair => ({ temp: pair[0].trim(), speed: pair[1].trim() })); - for (const entry of stringEntries) { - if (entry.speed === '') { entry.speed = '0'; } - process.stdout.write('{ temp: ' + entry.temp + ', speed: ' + entry.speed + ' },\n'); - } - process.exit(SIGINT); -}); From 9ed1256f28ed3e0df11bcdcb3274e82904a8d415 Mon Sep 17 00:00:00 2001 From: Matt Broadway Date: Thu, 12 Nov 2020 20:04:52 +0000 Subject: [PATCH 10/12] changed error message Co-authored-by: NickMa --- src/common/classes/ConfigHandler.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/classes/ConfigHandler.ts b/src/common/classes/ConfigHandler.ts index f6ae2d38..45514083 100644 --- a/src/common/classes/ConfigHandler.ts +++ b/src/common/classes/ConfigHandler.ts @@ -123,7 +123,7 @@ export class ConfigHandler { for(var profile of fanTables) { lines.push(`[${profile.name}]`) if(profile.tableCPU.length !== profile.tableGPU.length) { - throw Error("invalid fan profile. Temperatures don't match"); + throw Error("invalid fan profile. CPU and GPU table length mismatch"); } for(var i = 0; i < profile.tableCPU.length; i++) { let cpu_entry = profile.tableCPU[i]; From 29c0d76c243d85bbc1ad972839f5dbc7280f8355 Mon Sep 17 00:00:00 2001 From: Matthew Broadway Date: Thu, 12 Nov 2020 20:30:53 +0000 Subject: [PATCH 11/12] print line number in error message --- src/common/classes/ConfigHandler.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/classes/ConfigHandler.ts b/src/common/classes/ConfigHandler.ts index 45514083..70715858 100644 --- a/src/common/classes/ConfigHandler.ts +++ b/src/common/classes/ConfigHandler.ts @@ -94,12 +94,12 @@ export class ConfigHandler { const sectionLineRegex = /^\s*\[([^\]]+)\]\s*(#.*)?$/ const rowLineRegex = /^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(#.*)?$/ let match - for(var line of lines) { + for(const [i, line] of lines.entries()) { if(blankLineRegex.test(line)) { continue; } else if((match = rowLineRegex.exec(line)) !== null) { if(currentProfile === null) { - throw Error(`syntax error reading fan profiles from "${filePath}"`); + throw Error(`syntax error on line ${i+1} reading fan profiles from "${filePath}"`); } currentRows.push([parseInt(match[1]), parseInt(match[2]), parseInt(match[3])]); } else if((match = sectionLineRegex.exec(line)) !== null) { @@ -109,7 +109,7 @@ export class ConfigHandler { } currentProfile = match[1]; } else { - throw Error(`syntax error reading fan profiles from "${filePath}"`); + throw Error(`syntax error on line ${i+1} reading fan profiles from "${filePath}"`); } } if(currentProfile !== null) { From 7e639b905d962116dd1110229b3d1561aa85497a Mon Sep 17 00:00:00 2001 From: Matthew Broadway Date: Thu, 12 Nov 2020 20:33:02 +0000 Subject: [PATCH 12/12] use const --- src/service-app/classes/TuxedoControlCenterDaemon.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/service-app/classes/TuxedoControlCenterDaemon.ts b/src/service-app/classes/TuxedoControlCenterDaemon.ts index 0c31d67d..4b8c586b 100644 --- a/src/service-app/classes/TuxedoControlCenterDaemon.ts +++ b/src/service-app/classes/TuxedoControlCenterDaemon.ts @@ -135,7 +135,7 @@ export class TuxedoControlCenterDaemon extends SingleProcess { public catchError(err: Error) { this.logLine('Tccd Exception'); let errorLine = err.name + ': ' + err.message; - let stack = err.stack; + const stack = err.stack; if(stack !== undefined) { errorLine += '\n\nStack Trace:\n' + stack; }