Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
example graph output with real data
- Loading branch information
Showing
12 changed files
with
465 additions
and
21 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { TestBed } from '@angular/core/testing'; | ||
|
||
import { NamesService } from './names.service'; | ||
|
||
describe('NamesService', () => { | ||
beforeEach(() => TestBed.configureTestingModule({})); | ||
|
||
it('should be created', () => { | ||
const service: NamesService = TestBed.get(NamesService); | ||
expect(service).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,182 @@ | ||
import { Injectable } from '@angular/core'; | ||
|
||
@Injectable({ | ||
providedIn: 'root' | ||
}) | ||
export class NamesService { | ||
|
||
constructor() { } | ||
|
||
convertNames(input, type) { | ||
const convChart = [ | ||
['L1 - L2 Voltage', 'l1.l2.voltage'], | ||
['L2 - L3 Voltage', 'l2.l3.voltage'], | ||
['L3 - L1 Voltage', 'l3.l1.voltage'], | ||
['L1 - L0 Voltage', 'l1.l0.voltage'], | ||
['L2 - L0 Voltage', 'l2.l0.voltage'], | ||
['L3 - L0 Voltage', 'l3.l0.voltage'], | ||
['L1 Current', 'l1.current'], | ||
['L2 Current', 'l2.current'], | ||
['L3 Current', 'l3.current'], | ||
['Frequency', 'frequency'], | ||
['Total kW', 'total.kw'], | ||
['Percent of Rated kW', 'rate.kw'], | ||
['Total Power Factor', 'total.pf'], | ||
['L1 kW', 'l1.kw'], | ||
['L1 Power Factor', 'l1.pf'], | ||
['L2 kW', 'l2.kw'], | ||
['L2 Power Factor', 'l2.pf'], | ||
['L3 kW', 'l3.kw'], | ||
['L3 Power Factor', 'l3.pf'], | ||
['Total kVAR', 'total.kvar'], | ||
['L1 kVAR', 'l1.kvar'], | ||
['L2 kVAR', 'l2.kvar'], | ||
['L3 kVAR', 'l3.kvar'], | ||
['Total kVA', 'total.kva'], | ||
['L1 kVA', 'l1.kva'], | ||
['L2 kVA', 'l2.kva'], | ||
['L3 kVA', 'l3.kva'], | ||
// 'Current Lead / Lag', | ||
// 'Reserved For Future Use', | ||
// 'Reserved For Future Use', | ||
// 'Reserved For Future Use', | ||
// 'Reserved For Future Use', | ||
['Oil Pressure *', 'oil.pressure'], | ||
['Coolant Temperature *', 'coolant.temp'], | ||
['Engine Speed *', 'engine.rpm'], | ||
['Local Battery Voltage *', 'battery.voltage'], | ||
['Fuel Pressure *', 'fuel.pressure'], | ||
['Fuel Temperature *', 'fuel.temp'], | ||
['Fuel Rate *', 'fuel.rate'], | ||
// 'Used Last Run *', | ||
['Coolant Pressure *', 'coolant.pressure'], | ||
['Coolant Level *', 'coolant.level'], | ||
['Lube Oil Temperature *', 'oil.temp'], | ||
['Oil Level *', 'oil.level'], | ||
['Crankcase Pressure *', 'crankcase.pressure'], | ||
['Ambient Temperature *', 'ambient.temp'], | ||
['ECM Battery Voltage *', 'ecm.battery.voltage'], | ||
// 'ECM Status', | ||
['Intake Air Temperature', 'intake.temp'], | ||
['Intake Air Pressure', 'intake.pressure'] | ||
]; | ||
|
||
let conv; | ||
if (type === 'layman') { | ||
for (conv of convChart) { | ||
if (conv[1] === input) { | ||
return conv[0]; | ||
} | ||
} | ||
} else if (type === 'metric') { | ||
for (conv of convChart) { | ||
if (conv[0] === input) { | ||
return conv[1]; | ||
} | ||
} | ||
} | ||
} | ||
|
||
getAllNames(type) { | ||
if (type === 'layman') { | ||
return [ | ||
'L1 - L2 Voltage', | ||
'L2 - L3 Voltage', | ||
'L3 - L1 Voltage', | ||
'L1 - L0 Voltage', | ||
'L2 - L0 Voltage', | ||
'L3 - L0 Voltage', | ||
'L1 Current', | ||
'L2 Current', | ||
'L3 Current', | ||
'Frequency', | ||
'Total kW', | ||
'Percent of Rated kW', | ||
'Total Power Factor', | ||
'L1 kW', | ||
'L1 Power Factor', | ||
'L2 kW', | ||
'L2 Power Factor', | ||
'L3 kW', | ||
'L3 Power Factor', | ||
'Total kVAR', | ||
'L1 kVAR', | ||
'L2 kVAR', | ||
'L3 kVAR', | ||
'Total kVA', | ||
'L1 kVA', | ||
'L2 kVA', | ||
'L3 kVA', | ||
// 'Current Lead / Lag', | ||
// 'Reserved For Future Use', | ||
// 'Reserved For Future Use', | ||
// 'Reserved For Future Use', | ||
// 'Reserved For Future Use', | ||
'Oil Pressure *', | ||
'Coolant Temperature *', | ||
'Engine Speed *', | ||
'Local Battery Voltage *', | ||
'Fuel Pressure *', | ||
'Fuel Temperature *', | ||
'Fuel Rate *', | ||
// 'Used Last Run *', | ||
'Coolant Pressure *', | ||
'Coolant Level *', | ||
'Lube Oil Temperature *', | ||
'Oil Level *', | ||
'Crankcase Pressure *', | ||
'Ambient Temperature *', | ||
'ECM Battery Voltage *', | ||
// 'ECM Status', | ||
'Intake Air Temperature', | ||
'Intake Air Pressure' | ||
]; | ||
} else if (type === 'metric') { | ||
return [ | ||
'l1.l2.voltage', | ||
'l2.l3.voltage', | ||
'l3.l1.voltage', | ||
'l1.l0.voltage', | ||
'l2.l0.voltage', | ||
'l3.l0.voltage', | ||
'l1.current', | ||
'l2.current', | ||
'l3.current', | ||
'frequency', | ||
'total.kw', | ||
'rate.kw', | ||
'total.pf', | ||
'l1.kw', | ||
'l1.pf', | ||
'l2.kw', | ||
'l2.pf', | ||
'l3.kw', | ||
'l3.pf', | ||
'total.kvar', | ||
'l1.kvar', | ||
'l2.kvar', | ||
'l3.kvar', | ||
'total.kva', | ||
'l1.kva', | ||
'l2.kva', | ||
'l3.kva', | ||
'oil.pressure', | ||
'coolant.temp', | ||
'engine.rpm', | ||
'battery.voltage', | ||
'fuel.pressure', | ||
'fuel.temp', | ||
'fuel.rate', | ||
'coolant.pressure', | ||
'coolant.level', | ||
'oil.temp', | ||
'oil.level', | ||
'crankcase.pressure', | ||
'ambient.temp', | ||
'ecm.battery.voltage', | ||
'intake.temp', | ||
'intake.pressure' | ||
]; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { TestBed } from '@angular/core/testing'; | ||
|
||
import { VisualizeService } from './visualize.service'; | ||
|
||
describe('VisualizeService', () => { | ||
beforeEach(() => TestBed.configureTestingModule({})); | ||
|
||
it('should be created', () => { | ||
const service: VisualizeService = TestBed.get(VisualizeService); | ||
expect(service).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { HttpClient } from '@angular/common/http'; | ||
|
||
@Injectable({ | ||
providedIn: 'root' | ||
}) | ||
export class VisualizeService { | ||
|
||
constructor(private http: HttpClient) { } | ||
|
||
getData(token, query) { | ||
return this.http.get('http://sd5-backend.engr.uconn.edu/data/query' + query, { | ||
headers: { | ||
Authorization: 'Bearer ' + token | ||
} | ||
}); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
div#textinput { | ||
width: 300px; | ||
} | ||
|
||
select#gen_select { | ||
width: 300px; | ||
} | ||
|
||
select#func_select { | ||
width: 300px; | ||
} | ||
|
||
select#data_select { | ||
width: 300px; | ||
} | ||
|
||
select#time_type_select { | ||
width: 300px; | ||
} | ||
|
||
p#visMessage { | ||
color: white; | ||
} |
Oops, something went wrong.