Skip to content
Permalink
5b9c3d050d
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
243 lines (236 sloc) 2.08 KB
package main
const (
// Gateway addresses
websocketEndpoint = "wss://sd5-endpoint.engr.uconn.edu:48820/ws"
// Header constants
headerUUID = "uuid"
headerTimestamp = "time"
// message types
// outgoing
kindData = "data"
kindStatus = "status"
// incoming
kindResponse = "response"
messageReceived = "received"
// Time (in seconds) to wait between performing read/send operations
dataReadPeriod = 60
dataSendPeriod = 300
statusReadPeriod = 1
// Modbus data types
WORD = "WORD"
SWORD = "SWORD"
// Maximum number of modbus registers we can read at a time
maxRegisterRead = 50
)
var metrics = [...]Metric{
{
"l1.l2.voltage",
0,
300,
},
{
"l2.l3.voltage",
0,
300,
},
{
"l3.l1.voltage",
0,
300,
},
{
"l1.l0.voltage",
0,
300,
},
{
"l2.l0.voltage",
0,
300,
},
{
"l3.l0.voltage",
0,
300,
},
{
"l1.current",
0,
300,
},
{
"l2.current",
0,
300,
},
{
"l3.current",
0,
300,
},
{
"frequency",
0,
3000,
},
{
"total.kw",
0,
1000000,
},
{
"rate.kw",
0,
100,
},
{
"total.pf",
0,
100,
},
{
"l1.kw",
0,
1000000,
},
{
"l1.pf",
0,
100,
},
{
"l2.kw",
0,
1000000,
},
{
"l2.pf",
0,
100,
},
{
"l3.kw",
0,
1000000,
},
{
"l3.pf",
0,
100,
},
{
"total.kvar",
0,
1000,
},
{
"l1.kvar",
0,
1000,
},
{
"l2.kvar",
0,
1000,
},
{
"l3.kvar",
0,
1000,
},
{
"total.kva",
0,
1000,
},
{
"l1.kva",
0,
1000,
},
{
"l2.kva",
0,
1000,
},
{
"l3.kva",
0,
1000,
},
{
"oil.pressure",
0,
200,
},
{
"coolant.temp",
0,
120,
},
{
"engine.rpm",
0,
3000,
},
{
"battery.voltage",
0,
100,
},
{
"fuel.pressure",
0,
100,
},
{
"fuel.temp",
0,
200,
},
{
"fuel.rate",
0,
500,
},
{
"coolant.pressure",
0,
200,
},
{
"coolant.level",
0,
100,
},
{
"oil.temp",
0,
200,
},
{
"oil.level",
0,
100,
},
{
"crankcase.pressure",
0,
200,
},
{
"ambient.temp",
0,
200,
},
{
"intake.temp",
0,
200,
},
{
"intake.pressure",
0,
200,
},
}