Removed unnecessary services (#125)
They have been replaced with Store.
This commit is contained in:
committed by
József Farkas
parent
b16e83fc30
commit
a653333c9b
@@ -1,43 +0,0 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
import { Keymap } from '../config-serializer/config-items/Keymap';
|
||||
import { UhkConfiguration } from '../config-serializer/config-items/UhkConfiguration';
|
||||
|
||||
import { SvgModule } from '../components/svg/module/svg-module.model';
|
||||
|
||||
@Injectable()
|
||||
export class DataProviderService {
|
||||
|
||||
private uhkConfiguration: UhkConfiguration;
|
||||
|
||||
constructor() {
|
||||
this.uhkConfiguration = new UhkConfiguration().fromJsObject(require('json!../config-serializer/uhk-config.json'));
|
||||
}
|
||||
|
||||
getUHKConfig(): UhkConfiguration {
|
||||
return this.uhkConfiguration;
|
||||
}
|
||||
|
||||
getDefaultKeymaps(): Keymap[] {
|
||||
return (<any[]>require('json!../config-serializer/preset-keymaps.json')).map(keymap => new Keymap().fromJsObject(keymap));
|
||||
}
|
||||
|
||||
getKeyboardSvgAttributes(): { viewBox: string, transform: string, fill: string } {
|
||||
let svg: any = this.getBaseLayer();
|
||||
return {
|
||||
viewBox: svg.$.viewBox,
|
||||
transform: svg.g[0].$.transform,
|
||||
fill: svg.g[0].$.fill
|
||||
};
|
||||
}
|
||||
|
||||
getSvgModules(): SvgModule[] {
|
||||
let modules = this.getBaseLayer().g[0].g.map((obj: any) => new SvgModule(obj));
|
||||
return [modules[1], modules[0]]; // TODO: remove if the svg will be correct
|
||||
}
|
||||
|
||||
private getBaseLayer(): any {
|
||||
return require('xml!../../images/base-layer.svg').svg;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
import { UhkConfiguration } from '../config-serializer/config-items/UhkConfiguration';
|
||||
|
||||
import { DataProviderService } from './data-provider.service';
|
||||
|
||||
@Injectable()
|
||||
export class UhkConfigurationService {
|
||||
|
||||
private configuration: UhkConfiguration;
|
||||
|
||||
constructor(private dataProviderService: DataProviderService) {
|
||||
this.configuration = new UhkConfiguration().fromJsObject(this.dataProviderService.getUHKConfig());
|
||||
}
|
||||
|
||||
getUhkConfiguration(): UhkConfiguration {
|
||||
return this.configuration;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user