Add data layer
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good

This commit is contained in:
Willem Dantuma 2020-06-29 15:44:23 +02:00
parent 0d247e6416
commit 0b7564e874
8 changed files with 50 additions and 82 deletions

View File

@ -1,82 +1,5 @@
{ {
"name": "@farmmaps/common-map", "name": "@farmmaps/common-map",
"version": "0.0.1", "version": "0.0.1",
"lockfileVersion": 1, "lockfileVersion": 1
"requires": true,
"dependencies": {
"@openlayers/pepjs": {
"version": "0.5.3",
"resolved": "https://registry.npmjs.org/@openlayers/pepjs/-/pepjs-0.5.3.tgz",
"integrity": "sha512-Bgvi5c14BS0FJWyYWWFstNEnXsB30nK8Jt8hkAAdqr7E0gDdBBWVDglF3Ub19wTxvgJ/CVHyTY6VuCtnyRzglg=="
},
"ieee754": {
"version": "1.1.13",
"resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz",
"integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg=="
},
"ngx-openlayers": {
"version": "1.0.0-next.13",
"resolved": "https://registry.npmjs.org/ngx-openlayers/-/ngx-openlayers-1.0.0-next.13.tgz",
"integrity": "sha512-6y724s5JV6n1oxEhryxP3wcbwzpierj9RLiMLXInfKOG3l5IO1AtPNkeK9+mKctVDUVm5URIfzzZH02Ld+bvSQ==",
"requires": {
"tslib": "^1.9.0"
}
},
"ol": {
"version": "6.1.1",
"resolved": "https://registry.npmjs.org/ol/-/ol-6.1.1.tgz",
"integrity": "sha512-0dL3i3eJqgOpqIjDKEY3grkeQnjAYfV5L/JCxhOu4SxiaizRwFrFgeas6LILRoxKa03jhQFbut2r2bbgcLGQeA==",
"requires": {
"@openlayers/pepjs": "^0.5.3",
"pbf": "3.2.1",
"pixelworks": "1.1.0",
"rbush": "^3.0.1"
}
},
"pbf": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/pbf/-/pbf-3.2.1.tgz",
"integrity": "sha512-ClrV7pNOn7rtmoQVF4TS1vyU0WhYRnP92fzbfF75jAIwpnzdJXf8iTd4CMEqO4yUenH6NDqLiwjqlh6QgZzgLQ==",
"requires": {
"ieee754": "^1.1.12",
"resolve-protobuf-schema": "^2.1.0"
}
},
"pixelworks": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/pixelworks/-/pixelworks-1.1.0.tgz",
"integrity": "sha1-Hwla1I3Ki/ihyCWOAJIDGkTyLKU="
},
"protocol-buffers-schema": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/protocol-buffers-schema/-/protocol-buffers-schema-3.4.0.tgz",
"integrity": "sha512-G/2kcamPF2S49W5yaMGdIpkG6+5wZF0fzBteLKgEHjbNzqjZQ85aAs1iJGto31EJaSTkNvHs5IXuHSaTLWBAiA=="
},
"quickselect": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/quickselect/-/quickselect-2.0.0.tgz",
"integrity": "sha512-RKJ22hX8mHe3Y6wH/N3wCM6BWtjaxIyyUIkpHOvfFnxdI4yD4tBXEBKSbriGujF6jnSVkJrffuo6vxACiSSxIw=="
},
"rbush": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/rbush/-/rbush-3.0.1.tgz",
"integrity": "sha512-XRaVO0YecOpEuIvbhbpTrZgoiI6xBlz6hnlr6EHhd+0x9ase6EmeN+hdwwUaJvLcsFFQ8iWVF1GAK1yB0BWi0w==",
"requires": {
"quickselect": "^2.0.0"
}
},
"resolve-protobuf-schema": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/resolve-protobuf-schema/-/resolve-protobuf-schema-2.1.0.tgz",
"integrity": "sha512-kI5ffTiZWmJaS/huM8wZfEMer1eRd7oJQhDuxeCLe3t7N7mX3z94CN0xPxBQxFYQTSNz9T0i+v6inKqSdK8xrQ==",
"requires": {
"protocol-buffers-schema": "^3.3.1"
}
},
"tslib": {
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz",
"integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ=="
}
}
} }

View File

@ -11,7 +11,7 @@
"@ngrx/router-store": "^9.0", "@ngrx/router-store": "^9.0",
"@ngrx/store": "^9.0", "@ngrx/store": "^9.0",
"tassign": "^1.0.0", "tassign": "^1.0.0",
"@farmmaps/common": ">=0.0.1-prerelease.284 <0.0.1", "@farmmaps/common": ">=0.0.1-prerelease.302 <0.0.1",
"ngx-openlayers": "1.0.0-next.13", "ngx-openlayers": "1.0.0-next.13",
"ol": "6.1.1" "ol": "6.1.1"
} }

View File

@ -30,6 +30,7 @@ import { NgbDateNativeAdapter } from './services/date-adapter.service'
import { AuthConfigFactory } from './shared/authconfigFactory'; import { AuthConfigFactory } from './shared/authconfigFactory';
import { StateSerializerService } from './services/state-serializer.service'; import { StateSerializerService } from './services/state-serializer.service';
import { PackageService } from './services/package.service'; import { PackageService } from './services/package.service';
import { SenmlService } from './services/senml-service';
export { export {
FolderService, FolderService,
@ -51,7 +52,8 @@ export {
NgbDateNativeAdapter, NgbDateNativeAdapter,
StateSerializerService, StateSerializerService,
SchemaService, SchemaService,
PackageService PackageService,
SenmlService
}; };
@NgModule({ @NgModule({

View File

@ -41,11 +41,14 @@ import { IItemType } from './models/item.type';
import { IItemTypes } from './models/item.types'; import { IItemTypes } from './models/item.types';
import { IItemTask, ItemTask } from './models/itemTask'; import { IItemTask, ItemTask } from './models/itemTask';
import { IListItem } from './models/list.item'; import { IListItem } from './models/list.item';
import { ITypeaheadItem } from './models/typeahead.item'; import { ITypeaheadItem } from './models/typeahead.item'
import { IJsonline } from './models/json-line';
import { ISenMLItem } from './models/senml-item';
import { IPackage,IPackages } from './models/package'; import { IPackage,IPackages } from './models/package';
import { IUser } from './models/user'; import { IUser } from './models/user';
import { IQueryState } from './models/query.state'; import { IQueryState } from './models/query.state';
import { ICodeListItem } from './models/code.list.item'; import { ICodeListItem } from './models/code.list.item';
import { IDataLayer } from './models/data.layer';
import * as commonActions from './actions/app-common.actions'; import * as commonActions from './actions/app-common.actions';
import * as commonReducers from './reducers/app-common.reducer'; import * as commonReducers from './reducers/app-common.reducer';
import * as commonEffects from './effects/app-common.effects'; import * as commonEffects from './effects/app-common.effects';
@ -86,7 +89,9 @@ export {
AuthConfigFactory, AuthConfigFactory,
MenuBackgroundComponent, MenuBackgroundComponent,
SecureOAuthStorage, SecureOAuthStorage,
WeatherCurrentObservation WeatherCurrentObservation,
IJsonline,
ISenMLItem
}; };
@NgModule({ @NgModule({

View File

@ -0,0 +1,7 @@
export interface IDataLayer {
name: string,
unit: string,
index: number,
indexKey?: string,
scale: number,
}

View File

@ -0,0 +1,5 @@
export interface IJsonline {
time: string;
type: string;
data: any;
}

View File

@ -0,0 +1,5 @@
export interface ISenMLItem {
u?: string;
v?: string;
n?: string;
}

View File

@ -0,0 +1,21 @@
import { Injectable } from '@angular/core';
import { IJsonline } from '../models/json-line';
import { ISenMLItem } from '../models/senml-item';
@Injectable({
providedIn: 'root',
})
export class SenmlService {
constructor() {
}
getSenMLItem(name:string,jsonLine:IJsonline): ISenMLItem {
if (jsonLine) {
var senmlPack = jsonLine.data as ISenMLItem[];
var temp = senmlPack.filter((i) => i.u == name);
if (temp.length == 1) return temp[0];
return null;
}
}
}