Add data layer
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
This commit is contained in:
parent
0d247e6416
commit
0b7564e874
79
projects/common-map/package-lock.json
generated
79
projects/common-map/package-lock.json
generated
@ -1,82 +1,5 @@
|
||||
{
|
||||
"name": "@farmmaps/common-map",
|
||||
"version": "0.0.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=="
|
||||
}
|
||||
}
|
||||
"lockfileVersion": 1
|
||||
}
|
||||
|
@ -11,7 +11,7 @@
|
||||
"@ngrx/router-store": "^9.0",
|
||||
"@ngrx/store": "^9.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",
|
||||
"ol": "6.1.1"
|
||||
}
|
||||
|
@ -30,6 +30,7 @@ import { NgbDateNativeAdapter } from './services/date-adapter.service'
|
||||
import { AuthConfigFactory } from './shared/authconfigFactory';
|
||||
import { StateSerializerService } from './services/state-serializer.service';
|
||||
import { PackageService } from './services/package.service';
|
||||
import { SenmlService } from './services/senml-service';
|
||||
|
||||
export {
|
||||
FolderService,
|
||||
@ -51,7 +52,8 @@ export {
|
||||
NgbDateNativeAdapter,
|
||||
StateSerializerService,
|
||||
SchemaService,
|
||||
PackageService
|
||||
PackageService,
|
||||
SenmlService
|
||||
};
|
||||
|
||||
@NgModule({
|
||||
|
@ -41,11 +41,14 @@ import { IItemType } from './models/item.type';
|
||||
import { IItemTypes } from './models/item.types';
|
||||
import { IItemTask, ItemTask } from './models/itemTask';
|
||||
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 { IUser } from './models/user';
|
||||
import { IQueryState } from './models/query.state';
|
||||
import { ICodeListItem } from './models/code.list.item';
|
||||
import { IDataLayer } from './models/data.layer';
|
||||
import * as commonActions from './actions/app-common.actions';
|
||||
import * as commonReducers from './reducers/app-common.reducer';
|
||||
import * as commonEffects from './effects/app-common.effects';
|
||||
@ -86,7 +89,9 @@ export {
|
||||
AuthConfigFactory,
|
||||
MenuBackgroundComponent,
|
||||
SecureOAuthStorage,
|
||||
WeatherCurrentObservation
|
||||
WeatherCurrentObservation,
|
||||
IJsonline,
|
||||
ISenMLItem
|
||||
};
|
||||
|
||||
@NgModule({
|
||||
|
7
projects/common/src/fm/models/data.layer.ts
Normal file
7
projects/common/src/fm/models/data.layer.ts
Normal file
@ -0,0 +1,7 @@
|
||||
export interface IDataLayer {
|
||||
name: string,
|
||||
unit: string,
|
||||
index: number,
|
||||
indexKey?: string,
|
||||
scale: number,
|
||||
}
|
5
projects/common/src/fm/models/json-line.ts
Normal file
5
projects/common/src/fm/models/json-line.ts
Normal file
@ -0,0 +1,5 @@
|
||||
export interface IJsonline {
|
||||
time: string;
|
||||
type: string;
|
||||
data: any;
|
||||
}
|
5
projects/common/src/fm/models/senml-item.ts
Normal file
5
projects/common/src/fm/models/senml-item.ts
Normal file
@ -0,0 +1,5 @@
|
||||
export interface ISenMLItem {
|
||||
u?: string;
|
||||
v?: string;
|
||||
n?: string;
|
||||
}
|
21
projects/common/src/fm/services/senml-service.ts
Normal file
21
projects/common/src/fm/services/senml-service.ts
Normal 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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user