DCCL v4
test.proto
1 // Copyright 2015-2023:
2 // GobySoft, LLC (2013-)
3 // Community contributors (see AUTHORS file)
4 // File authors:
5 // Toby Schneider <toby@gobysoft.org>
6 // Stephanie Petillo <stephanie@gobysoft.org>
7 // Chris Murphy <cmurphy@aphysci.com>
8 //
9 //
10 // This file is part of the Dynamic Compact Control Language Library
11 // ("DCCL").
12 //
13 // DCCL is free software: you can redistribute it and/or modify
14 // it under the terms of the GNU Lesser General Public License as published by
15 // the Free Software Foundation, either version 2.1 of the License, or
16 // (at your option) any later version.
17 //
18 // DCCL is distributed in the hope that it will be useful,
19 // but WITHOUT ANY WARRANTY; without even the implied warranty of
20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 // GNU Lesser General Public License for more details.
22 //
23 // You should have received a copy of the GNU Lesser General Public License
24 // along with DCCL. If not, see <http://www.gnu.org/licenses/>.
25 syntax = "proto2";
26 import "dccl/option_extensions.proto";
27 
28 message CTDTestMessage
29 {
30  option (dccl.msg).unit_system = "si";
31 
32  optional double conductivity = 2
33  [(dccl.field).units.derived_dimensions = "conductance/length"];
34  required double temperature = 3 [(dccl.field) = {
35  units {
36  derived_dimensions: "temperature"
37  // system:
38  // "celsius"
39  }
40  min: 0
41  max: 30
42  precision: -1
43  }];
44 
45  required double micro_temp = 5 [(dccl.field) = {
46  units {
47  base_dimensions: "K"
48  prefix: "micro"
49  relative_temperature: true
50  }
51  min: 0
52  max: 30
53  precision: -1
54  }];
55 
56  required int32 pressure = 4
57  [(dccl.field).units.derived_dimensions = "pressure"];
58 
59  required double salinity = 10 [(dccl.field).units.base_dimensions = "-"];
60  required double sound_speed = 11
61  [(dccl.field).units.base_dimensions = " LT^-1"];
62  optional double density = 12
63  [(dccl.field).units.base_dimensions = "M L^-3"];
64 
65  required int32 depth = 13 [(dccl.field) = {
66  units { derived_dimensions: "length" prefix: "kilo" }
67  min: 0
68  max: 6000
69  }];
70 
71  required double auv_speed = 14 [(dccl.field).units.unit = "metric::knot"];
72 }
73 
74 message Parent
75 {
76  option (dccl.msg).unit_system = "cgs";
77 
78  required int32 mass = 1
79  [(dccl.field).units.base_dimensions = "M"]; // should be grams
80  required int32 si_mass = 2 [
81  (dccl.field) = { units { system: "si" base_dimensions: "M" } }
82  ]; // should be kilograms
83 
84  required Child child = 3;
85 
86  message Child
87  {
88  required int32 length = 1 [(dccl.field).units.derived_dimensions =
89  "length"]; // should be centimeters
90  }
91 }
92 
93 message OuterChild
94 {
95  required int32 length = 1 [
96  (dccl.field).units.derived_dimensions = "length",
97  (dccl.field).units.system = "si"
98  ];
99 }