1 // Copyright 2013-2023:
2 // GobySoft, LLC (2013-)
3 // Massachusetts Institute of Technology (2007-2014)
4 // Community contributors (see AUTHORS file)
6 // Toby Schneider <toby@gobysoft.org>
7 // Davide Fenucci <davfen@noc.ac.uk>
10 // This file is part of the Dynamic Compact Control Language Library
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.
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.
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/>.
27 import "dccl/option_extensions.proto";
32 option (dccl.msg).id = 10;
33 option (dccl.msg).max_bytes = 32;
34 option (dccl.msg).codec_version = 4;
36 optional double a = 1 [
37 (dccl.field).max = 180,
38 (dccl.field).min = -180,
39 (dccl.field).precision = 12,
40 (dccl.field).in_head = true
43 optional double b = 2 [
44 (dccl.field).max = 18,
45 (dccl.field).min = -18,
46 (dccl.field).resolution = 0.0001
49 // max is 2^64 rounded to 1e5
50 required uint64 u1 = 3 [
51 (dccl.field).max = 18446744073709500000,
53 (dccl.field).precision = -5
56 // max is 2^64 rounded to 1e5
57 required uint64 u2 = 4 [
58 (dccl.field).max = 18446744073709500000,
60 (dccl.field).resolution = 100000
64 required double u3 = 5 [
65 (dccl.field).max = 15.5,
66 (dccl.field).min = 5.5,
67 (dccl.field).resolution = 0.5
71 required double u4 = 6 [(dccl.field).max = 20.0, (dccl.field).min = 0.0];
74 required double u5 = 7 [
75 (dccl.field).max = 3.6,
76 (dccl.field).min = 1.44,
77 (dccl.field).resolution = 0.12
80 // old precision field did not require min and max to be a multiple of
82 required int32 u6 = 8 [
84 (dccl.field).max = 25599,
85 (dccl.field).precision = -2
89 message NegativeResolutionNumericMsg // Invalid resolution
91 option (dccl.msg).id = 10;
92 option (dccl.msg).max_bytes = 32;
93 option (dccl.msg).codec_version = 4;
95 optional double a = 1 [
96 (dccl.field).min = -20,
97 (dccl.field).max = 20,
98 (dccl.field).resolution = -0.5
101 optional int32 b = 2 [
102 (dccl.field).min = -500000,
103 (dccl.field).max = 500000,
104 (dccl.field).precision = -3
108 message BothResolutionAndPrecisionSetNumericMsg
110 option (dccl.msg).id = 11;
111 option (dccl.msg).max_bytes = 32;
112 option (dccl.msg).codec_version = 4;
114 optional double a = 1 [
115 (dccl.field).max = 180,
116 (dccl.field).min = -180,
117 (dccl.field).precision = 1,
118 (dccl.field).resolution = 0.1
122 message TooBigNumericMsg
124 option (dccl.msg).id = 11;
125 option (dccl.msg).max_bytes = 32;
126 option (dccl.msg).codec_version = 4;
128 optional double a = 1 [
129 (dccl.field).max = 180,
130 (dccl.field).min = -180,
131 (dccl.field).resolution = 1e-15
135 message MinNotMultipleOfResolution
137 option (dccl.msg).id = 11;
138 option (dccl.msg).max_bytes = 32;
139 option (dccl.msg).codec_version = 4;
141 required double a = 1 [
142 (dccl.field).max = 3.6,
143 (dccl.field).min = 1.5,
144 (dccl.field).resolution = 0.2
148 message MaxNotMultipleOfResolution
150 option (dccl.msg).id = 11;
151 option (dccl.msg).max_bytes = 32;
152 option (dccl.msg).codec_version = 4;
154 required double a = 1 [
155 (dccl.field).max = 3.5,
156 (dccl.field).min = 1.4,
157 (dccl.field).resolution = 0.2