-
Notifications
You must be signed in to change notification settings - Fork 0
/
XDR_Dictionary.cfg
111 lines (89 loc) · 3.58 KB
/
XDR_Dictionary.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
// This program uses libconfig
// https://www.hyperrealm.com/libconfig/libconfig_manual.html
// See the link above for more info on the libconfig and config files.
// This program only reads the settings below
// This program uses Tinyexpr for the algebraic expression engine
// https://github.com/codeplea/tinyexpr
// The program accepts input XDR strings (line by line) references this dictionary file and generates a corresponding
// output Signal K Delta message based on the input and a defined Signal K path.
// XDR messages can contain information relating to multiple sensors:
// Each sensor's information is contained in quadruplets
// example xdr messages
//$IIXDR,C,28.7,C,ENV_OUTSIDE_T,P,101400,P,ENV_ATMOS_P,H,47.38,P,ENV_OUTSIDE_H*32
//$IIXDR,C,,C,ENV_WATER_T,C,28.69,C,ENV_OUTAIR_T,P,101400,P,ENV_ATMOS_P*69
//$IIXDR,C,28.69,C,ENV_OUTSIDE_T,P,101400,P,ENV_ATMOS_P,H,47.38,P,ENV_OUTSIDE_H*0A
//$IIXDR,H,47.38,P,ENV_OUTSIDE_H*30
//$IIXDR,P,101400,P,ENV_ATMOS_P*03
// XDR source data - Source TCP server definition
TCP_in_address = "mplex.local";
TCP_in_port = 10300;
//Program offers a TCP server for output
TCP_out_address = "127.0.0.1";
TCP_out_port = 10250;
mmsi = "601270800"
// The XDR fields are defined with type, data, and units describing the contents of the input message
// The name field must match the field in the XDR message. This is used to reference both the sk_path and expression definitions
// The sk_path definition is used in the output Signal K delta message
// The expression field must contain a valid alegraic expression with x refering to the data contained in the input XDR data field.
// The expression field is used to convert the input data to the SI units required by Signal K. For example a conversion from
// Celcius to Kelvin has the expression (x+273.15)
// In Signal K volumes are reduced to percentage of full so dividing liters by the volume of the tank is done e.g. (x/225)
XDR_Dictionary =
{
sensors = (
// {type = "Water temperature";
// data = "temperature";
// units = "float"; //can be int, float or radians 0, 2 or 4 decimal places in output data
// name = "ENV_WATER_T";
// expression = "(x+273.15)"
// sk_path ="environment.water.temperature" },
{type = "Air temperature";
data = "temperature";
units = "float";
name = "ENV_OUTAIR_T";
expression = "(x+273.15)";
sk_path ="environment.outside.temperature" },
{type = "WaterLevel";
data = "volume";
units = "float";
name = "WATER#0";
expression = "(x/225)"
sk_path ="tanks.freshWater.0.currentLevel" },
{type = "FuelLevel";
data = "volume";
units = "float";
name = "FUEL#0";
expression = "(x/300)";
sk_path ="tanks.fuel.0.currentLevel" },
{type = "Outside temperature"
data = "temperature";
units = "float";
name = "ENV_OUTSIDE_T";
expression = "(x+273.15)";
sk_path ="environment.outside.temperature" },
{type = "Outside pressure";
data = "pressure";
units = "int";
name = "ENV_ATMOS_P";
expression = "(x*1)";
sk_path ="environment.outside.pressure" },
{type = "Outside humidity";
data = "humidity";
units = "float";
name = "ENV_OUTSIDE_H";
expression = "(x*1)";
sk_path = "environment.outside.humidity" },
{type = "Vessel attitude"; // "Vessel attitude" is treated special ...
data = "Vessel attitude";
units = "radians";
name = "ROLL"
expression = "(x*3.1415926/180)";
sk_path = "navigation.attitude"},
{type = "Vessel attitude";
data = "Vessel attitude";
units = "radians";
name = "PTCH"
expression = "(x*3.1415926/180)";
sk_path = "navigation.attitude"}
);
};