DCCL v4
Loading...
Searching...
No Matches
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/>.
25syntax = "proto2";
26import "dccl/option_extensions.proto";
27
28message CTDTestMessage
29{
30 option (dccl.msg).unit_system = "si";
31
32 required int32 conductivity = 1 [(dccl.field) = {
33 min: 40000
34 max: 60000
35 units {
36 custom {
37 unit: "dccl::units::microsiemens_per_cm_unit"
38 header: "dccl/units/conductivity.h"
39 }
40 }
41 }];
42
43 required double temperature = 3 [(dccl.field) = {
44 units {
45 derived_dimensions: "temperature"
46 // system:
47 // "celsius"
48 }
49 min: 0
50 max: 30
51 precision: -1
52 }];
53
54 required double micro_temp = 5 [(dccl.field) = {
55 units {
56 base_dimensions: "K"
57 prefix: "micro"
58 relative_temperature: true
59 }
60 min: 0
61 max: 30
62 precision: -1
63 }];
64
65 required int32 pressure = 4
66 [(dccl.field).units.derived_dimensions = "pressure"];
67
68 required double salinity = 10 [(dccl.field).units.base_dimensions = "-"];
69 required double sound_speed = 11
70 [(dccl.field).units.base_dimensions = " LT^-1"];
71 optional double density = 12
72 [(dccl.field).units.base_dimensions = "M L^-3"];
73
74 required int32 depth = 13 [(dccl.field) = {
75 units { derived_dimensions: "length" prefix: "kilo" }
76 min: 0
77 max: 6000
78 }];
79
80 required double auv_speed = 14 [(dccl.field).units.unit = "metric::knot"];
81}
82
83message Parent
84{
85 option (dccl.msg).unit_system = "cgs";
86
87 required int32 mass = 1
88 [(dccl.field).units.base_dimensions = "M"]; // should be grams
89 required int32 si_mass = 2 [
90 (dccl.field) = { units { system: "si" base_dimensions: "M" } }
91 ]; // should be kilograms
92
93 required Child child = 3;
94
95 message Child
96 {
97 required int32 length = 1 [(dccl.field).units.derived_dimensions =
98 "length"]; // should be centimeters
99 }
100}
101
102message OuterChild
103{
104 required int32 length = 1 [
105 (dccl.field).units.derived_dimensions = "length",
106 (dccl.field).units.system = "si"
107 ];
108}