Database entries
The database consists of different tables, which connect with one to many relations. The relations are specified using a "parent id" on the children elements.
UID
UID is a structure storing instrument serial number and a timestamp, thus providing a unique identifier
| Field | Type |
|---|---|
| instrument_serial | int32 |
| timestamp | int32 |
The instrument_serial field doesn't use first 5 bits, so we use them as a counter.
The counter helps us when data is saved multiple times in a single second.
The timestamp field is in seconds since EPOCH (01-01-1970).
Project
Project is a top-level structure, which stores a name and code.
| Field | Type |
|---|---|
| Project ID | UID |
| Sequence number | int32 |
| Client code | int32 |
| Site code | int32 |
| Results | [Result] |
| Time of last update | int32 |
Station
Station is a structure that specifies the station being tested.
| Field | Type |
|---|---|
| Station ID | UID |
| Sequence number | int32 |
| Settings | [Setting] |
| Project ID | UID |
| Results | [Result] |
| Earth bond limit connection point 1 | float |
| Earth bond limit connection point 2 | optional float |
| Earth bond limit test points | [float] |
| Time of last update | int32 |
| MFTs used | [int32] |
| Marked for deletion | bool |
Test
Test is a structure that specifies a group of measurements that can be repeated.
| Field | Type |
|---|---|
| Test ID | UID |
| Test type | int32 |
| Station part | int32 |
| Time of last update | int32 |
| Results | [Result] |
| Station ID | UID |
Measurement
Measurement is a structure that contains Results.
| Field | Type |
|---|---|
| Measurement ID | UID |
| Settings | [Setting] |
| Results | [Result] |
| Graph | optional Graph |
| Test ID | UID |
Graph
Graph is a structure that holds bytes that can be shown inside of the graph widget on the Hamilton.
| Field | Type |
|---|---|
| Byte_Array | byte_array |
Result
Result is a structure that holds a value, limit and evaluation of the result. Value can be an integer, float or an enum, so it's returned as a string.
| Field | Type |
|---|---|
| Name enum | int32 |
| Limit | optional string |
| Numeric value | optional string |
| Enum value | optional int32 |
| Evaluation | int32 |
| Unit | optional int32 |
| User forced state | optional int32 |
Setting
| Field | Type |
|---|---|
| Name enum | int32 |
| Numeric value | optional string |
| Enum value | optional int32 |