feat(config): Read / write hardware configuration area (#423)
* add write-hca.js * refactor: Move config serializer into the uhk-common package * refactor: Move getTransferBuffers into the uhk-usb package * refactor: delete obsoleted classes * build: add uhk-usb build command * refactor: move eeprom transfer to uhk-usb package * fix: Fix write-hca.js * feat: load hardware config from the device and * style: fix ts lint errors * build: fix rxjs dependency resolve * test: Add jasmine unit test framework to the tet serializer * fix(user-config): A "type": "basic", properties to the "keystroke" action types * feat(usb): set chmod+x on write-hca.js * feat(usb): Create USB logger * style: Fix type * build: Add chalk to dependencies. Chalk will colorize the output
This commit is contained in:
committed by
László Monda
parent
1122784bdb
commit
9294bede50
@@ -1,6 +1,6 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { UserConfiguration } from 'uhk-common';
|
||||
|
||||
import { UserConfiguration } from '../config-serializer/config-items/user-configuration';
|
||||
import { AutoUpdateSettings } from '../models/auto-update-settings';
|
||||
|
||||
@Injectable()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { UserConfiguration } from '../config-serializer/config-items/user-configuration';
|
||||
import { UserConfiguration } from 'uhk-common';
|
||||
|
||||
@Injectable()
|
||||
export class DefaultUserConfigurationService {
|
||||
@@ -7,7 +7,7 @@ export class DefaultUserConfigurationService {
|
||||
|
||||
constructor() {
|
||||
this._defaultConfig = new UserConfiguration()
|
||||
.fromJsonObject(require('../config-serializer/user-config.json'));
|
||||
.fromJsonObject(require('./user-config.json'));
|
||||
}
|
||||
|
||||
getDefault(): UserConfiguration {
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
SaveConfigurationReplyAction,
|
||||
SetPrivilegeOnLinuxReplyAction
|
||||
} from '../store/actions/device';
|
||||
import { LoadUserConfigFromDeviceReplyAction } from '../store/actions/user-config';
|
||||
import { LoadConfigFromDeviceReplyAction } from '../store/actions/user-config';
|
||||
|
||||
@Injectable()
|
||||
export class DeviceRendererService {
|
||||
@@ -29,8 +29,8 @@ export class DeviceRendererService {
|
||||
this.ipcRenderer.send(IpcEvents.device.saveUserConfiguration, JSON.stringify(buffer));
|
||||
}
|
||||
|
||||
loadUserConfiguration(): void {
|
||||
this.ipcRenderer.send(IpcEvents.device.loadUserConfiguration);
|
||||
loadConfigurationFromKeyboard(): void {
|
||||
this.ipcRenderer.send(IpcEvents.device.loadConfigurations);
|
||||
}
|
||||
|
||||
private registerEvents(): void {
|
||||
@@ -46,8 +46,8 @@ export class DeviceRendererService {
|
||||
this.dispachStoreAction(new SaveConfigurationReplyAction(response));
|
||||
});
|
||||
|
||||
this.ipcRenderer.on(IpcEvents.device.loadUserConfigurationReply, (event: string, response: string) => {
|
||||
this.dispachStoreAction(new LoadUserConfigFromDeviceReplyAction(JSON.parse(response)));
|
||||
this.ipcRenderer.on(IpcEvents.device.loadConfigurationReply, (event: string, response: string) => {
|
||||
this.dispachStoreAction(new LoadConfigFromDeviceReplyAction(JSON.parse(response)));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
8
packages/uhk-web/src/app/services/hardware-config.json
Normal file
8
packages/uhk-web/src/app/services/hardware-config.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"signature": "UHK",
|
||||
"dataModelVersion": 0,
|
||||
"hardwareId": 0,
|
||||
"brandId": 0,
|
||||
"isIso": false,
|
||||
"hasBacklighting": false
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { KeystrokeType } from '../config-serializer/config-items/key-action/keystroke-type';
|
||||
import { KeystrokeType } from 'uhk-common';
|
||||
|
||||
@Injectable()
|
||||
export class MapperService {
|
||||
|
||||
7430
packages/uhk-web/src/app/services/user-config.json
Normal file
7430
packages/uhk-web/src/app/services/user-config.json
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user