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

FieldType
instrument_serialint32
timestampint32

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.

FieldType
Project IDUID
Sequence numberint32
Client codeint32
Site codeint32
Results[Result]
Time of last updateint32

Station

Station is a structure that specifies the station being tested.

FieldType
Station IDUID
Sequence numberint32
Settings[Setting]
Project IDUID
Results[Result]
Earth bond limit connection point 1float
Earth bond limit connection point 2optional float
Earth bond limit test points[float]
Time of last updateint32
MFTs used[int32]
Marked for deletionbool

Test

Test is a structure that specifies a group of measurements that can be repeated.

FieldType
Test IDUID
Test typeint32
Station partint32
Time of last updateint32
Results[Result]
Station IDUID

Measurement

Measurement is a structure that contains Results.

FieldType
Measurement IDUID
Settings[Setting]
Results[Result]
Graphoptional Graph
Test IDUID

Graph

Graph is a structure that holds bytes that can be shown inside of the graph widget on the Hamilton.

FieldType
Byte_Arraybyte_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.

FieldType
Name enumint32
Limitoptional string
Numeric valueoptional string
Enum valueoptional int32
Evaluationint32
Unitoptional int32
User forced stateoptional int32

Setting

FieldType
Name enumint32
Numeric valueoptional string
Enum valueoptional int32