DCCL v3
test.proto
1 
2 import "dccl/option_extensions.proto";
3 
4 
5 message CTDTestMessage
6 {
7  option (dccl.msg).unit_system = "si";
8 
9  optional double conductivity = 2 [(dccl.field).units.derived_dimensions = "conductance/length"];
10  required double temperature = 3 [(dccl.field) = { units { derived_dimensions: "temperature"
11 // system: "celsius"
12  }
13  min: 0
14  max: 30
15  precision: -1 }];
16 
17  required double micro_temp = 5 [(dccl.field) = { units { base_dimensions: "K"
18  prefix: "micro"
19  relative_temperature: true
20  }
21  min: 0
22  max: 30
23  precision: -1 }];
24 
25  required int32 pressure = 4 [(dccl.field).units.derived_dimensions = "pressure"];
26 
27  required double salinity = 10 [(dccl.field).units.base_dimensions = "-"];
28  required double sound_speed = 11 [(dccl.field).units.base_dimensions = " LT^-1"];
29  optional double density = 12 [(dccl.field).units.base_dimensions = "M L^-3"];
30 
31  required int32 depth = 13 [(dccl.field) = { units { derived_dimensions: "length" prefix: "kilo" }
32  min: 0
33  max: 6000
34  }];
35 
36  required double auv_speed = 14 [(dccl.field).units.unit = "metric::knot"];
37 
38 
39 
40 }
41 
42 message Parent
43 {
44  option (dccl.msg).unit_system = "cgs";
45 
46  required int32 mass = 1 [(dccl.field).units.base_dimensions = "M"]; // should be grams
47  required int32 si_mass = 2 [(dccl.field) = { units { system: "si" base_dimensions: "M" } }]; // should be kilograms
48 
49  required Child child = 3;
50 
51  message Child
52  {
53  required int32 length = 1 [(dccl.field).units.derived_dimensions = "length"]; // should be centimeters
54  }
55 
56 }
57 
58 message OuterChild
59 {
60  required int32 length = 1 [(dccl.field).units.derived_dimensions = "length", (dccl.field).units.system = "si"];
61 }