forked from octahemo/bacnet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
unit_string.go
264 lines (258 loc) · 11 KB
/
unit_string.go
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
// Code generated by "stringer -type=Unit"; DO NOT EDIT.
package bacnet
import "strconv"
func _() {
// An "invalid array index" compiler error signifies that the constant values have changed.
// Re-run the stringer command to generate them again.
var x [1]struct{}
_ = x[MetersPerSecondPerSecond-166]
_ = x[SquareMeters-0]
_ = x[SquareCentimeters-116]
_ = x[SquareFeet-1]
_ = x[SquareInches-115]
_ = x[Milliamperes-2]
_ = x[Amperes-3]
_ = x[AmperesPerMeter-167]
_ = x[AmperesPerSquareMeter-168]
_ = x[AmpereSquareMeters-169]
_ = x[Decibels-199]
_ = x[DecibelsMillivolt-200]
_ = x[DecibelsVolt-201]
_ = x[Farads-170]
_ = x[Henrys-171]
_ = x[Ohms-4]
_ = x[OhmMeters-172]
_ = x[Milliohms-145]
_ = x[Kilohms-122]
_ = x[Megohms-123]
_ = x[Microsiemens-190]
_ = x[Millisiemens-202]
_ = x[Siemens-173]
_ = x[SiemensPerMeter-174]
_ = x[Teslas-175]
_ = x[Volts-5]
_ = x[Millivolts-124]
_ = x[Kilovolts-6]
_ = x[Megavolts-7]
_ = x[VoltAmperes-8]
_ = x[KilovoltAmperes-9]
_ = x[MegavoltAmperes-10]
_ = x[VoltAmperesReactive-11]
_ = x[KilovoltAmperesReactive-12]
_ = x[MegavoltAmperesReactive-13]
_ = x[VoltsPerDegreeKelvin-176]
_ = x[VoltsPerMeter-177]
_ = x[DegreesPhase-14]
_ = x[PowerFactor-15]
_ = x[Webers-178]
_ = x[Joules-16]
_ = x[Kilojoules-17]
_ = x[KilojoulesPerKilogram-125]
_ = x[Megajoules-126]
_ = x[WattHours-18]
_ = x[KilowattHours-19]
_ = x[MegawattHours-146]
_ = x[WattHoursReactive-203]
_ = x[KilowattHoursReactive-204]
_ = x[MegawattHoursReactive-205]
_ = x[Btus-20]
_ = x[KiloBtus-147]
_ = x[MegaBtus-148]
_ = x[Therms-21]
_ = x[TonHours-22]
_ = x[JoulesPerKilogramDryAir-23]
_ = x[KilojoulesPerKilogramDryAir-149]
_ = x[MegajoulesPerKilogramDryAir-150]
_ = x[BtusPerPoundDryAir-24]
_ = x[BtusPerPound-117]
_ = x[JoulesPerDegreeKelvin-127]
_ = x[KilojoulesPerDegreeKelvin-151]
_ = x[MegajoulesPerDegreeKelvin-152]
_ = x[JoulesPerKilogramDegreeKelvin-128]
_ = x[Newton-153]
_ = x[CyclesPerHour-25]
_ = x[CyclesPerMinute-26]
_ = x[Hertz-27]
_ = x[Kilohertz-129]
_ = x[Megahertz-130]
_ = x[PerHour-131]
_ = x[GramsOfWaterPerKilogramDryAir-28]
_ = x[PercentRelativeHumidity-29]
_ = x[Micrometers-194]
_ = x[Millimeters-30]
_ = x[Centimeters-118]
_ = x[Kilometers-193]
_ = x[Meters-31]
_ = x[Inches-32]
_ = x[Feet-33]
_ = x[Candelas-179]
_ = x[CandelasPerSquareMeter-180]
_ = x[WattsPerSquareFoot-34]
_ = x[WattsPerSquareMeter-35]
_ = x[Lumens-36]
_ = x[Luxes-37]
_ = x[FootCandles-38]
_ = x[Milligrams-196]
_ = x[Grams-195]
_ = x[Kilograms-39]
_ = x[PoundsMass-40]
_ = x[Tons-41]
_ = x[GramsPerSecond-154]
_ = x[GramsPerMinute-155]
_ = x[KilogramsPerSecond-42]
_ = x[KilogramsPerMinute-43]
_ = x[KilogramsPerHour-44]
_ = x[PoundsMassPerSecond-119]
_ = x[PoundsMassPerMinute-45]
_ = x[PoundsMassPerHour-46]
_ = x[TonsPerHour-156]
_ = x[Milliwatts-132]
_ = x[Watts-47]
_ = x[Kilowatts-48]
_ = x[Megawatts-49]
_ = x[BtusPerHour-50]
_ = x[KiloBtusPerHour-157]
_ = x[Horsepower-51]
_ = x[TonsRefrigeration-52]
_ = x[Pascals-53]
_ = x[Hectopascals-133]
_ = x[Kilopascals-54]
_ = x[Millibars-134]
_ = x[Bars-55]
_ = x[PoundsForcePerSquareInch-56]
_ = x[MillimetersOfWater-206]
_ = x[CentimetersOfWater-57]
_ = x[InchesOfWater-58]
_ = x[MillimetersOfMercury-59]
_ = x[CentimetersOfMercury-60]
_ = x[InchesOfMercury-61]
_ = x[DegreesCelsius-62]
_ = x[DegreesKelvin-63]
_ = x[DegreesKelvinPerHour-181]
_ = x[DegreesKelvinPerMinute-182]
_ = x[DegreesFahrenheit-64]
_ = x[DegreeDaysCelsius-65]
_ = x[DegreeDaysFahrenheit-66]
_ = x[DeltaDegreesFahrenheit-120]
_ = x[DeltaDegreesKelvin-121]
_ = x[Years-67]
_ = x[Months-68]
_ = x[Weeks-69]
_ = x[Days-70]
_ = x[Hours-71]
_ = x[Minutes-72]
_ = x[Seconds-73]
_ = x[HundredthsSeconds-158]
_ = x[Milliseconds-159]
_ = x[NewtonMeters-160]
_ = x[MillimetersPerSecond-161]
_ = x[MillimetersPerMinute-162]
_ = x[MetersPerSecond-74]
_ = x[MetersPerMinute-163]
_ = x[MetersPerHour-164]
_ = x[KilometersPerHour-75]
_ = x[FeetPerSecond-76]
_ = x[FeetPerMinute-77]
_ = x[MilesPerHour-78]
_ = x[CubicFeet-79]
_ = x[CubicMeters-80]
_ = x[ImperialGallons-81]
_ = x[Milliliters-197]
_ = x[Liters-82]
_ = x[UsGallons-83]
_ = x[CubicFeetPerSecond-142]
_ = x[CubicFeetPerMinute-84]
_ = x[CubicFeetPerHour-191]
_ = x[CubicMetersPerSecond-85]
_ = x[CubicMetersPerMinute-165]
_ = x[CubicMetersPerHour-135]
_ = x[ImperialGallonsPerMinute-86]
_ = x[MillilitersPerSecond-198]
_ = x[LitersPerSecond-87]
_ = x[LitersPerMinute-88]
_ = x[LitersPerHour-136]
_ = x[USGallonsPerMinute-89]
_ = x[USGallonsPerHour-192]
_ = x[DegreesAngular-90]
_ = x[DegreesCelsiusPerHour-91]
_ = x[DegreesCelsiusPerMinute-92]
_ = x[DegreesFahrenheitPerHour-93]
_ = x[DegreesFahrenheitPerMinute-94]
_ = x[JouleSeconds-183]
_ = x[KilogramsPerCubicMeter-186]
_ = x[KwHoursPerSquareMeter-137]
_ = x[KwHoursPerSquareFoot-138]
_ = x[MegajoulesPerSquareMeter-139]
_ = x[MegajoulesPerSquareFoot-140]
_ = x[NoUnits-95]
_ = x[NewtonSeconds-187]
_ = x[NewtonsPerMeter-188]
_ = x[PartsPerMillion-96]
_ = x[PartsPerBillion-97]
_ = x[Percent-98]
_ = x[PercentObscurationPerFoot-143]
_ = x[PercentObscurationPerMeter-144]
_ = x[PercentPerSecond-99]
_ = x[PerMinute-100]
_ = x[PerSecond-101]
_ = x[PsiPerDegreeFahrenheit-102]
_ = x[Radians-103]
_ = x[RadiansPerSecond-184]
_ = x[RevolutionsPerMinute-104]
_ = x[SquareMetersPerNewton-185]
_ = x[WattsPerMeterPerDegreeKelvin-189]
_ = x[WattsPerSquareMeterDegreeKelvin-141]
_ = x[PerMille-207]
_ = x[GramsPerGram-208]
_ = x[KilogramsPerKilogram-209]
_ = x[GramsPerKilogram-210]
_ = x[MilligramsPerGram-211]
_ = x[MilligramsPerKilogram-212]
_ = x[GramsPerMilliliter-213]
_ = x[GramsPerLiter-214]
_ = x[MilligramsPerLiter-215]
_ = x[MicrogramsPerLiter-216]
_ = x[GramsPerCubicMeter-217]
_ = x[MilligramsPerCubicMeter-218]
_ = x[MicrogramsPerCubicMeter-219]
_ = x[NanogramsPerCubicMeter-220]
_ = x[GramsPerCubicCentimeter-221]
_ = x[Becquerels-222]
_ = x[Megabecquerels-224]
_ = x[Gray-225]
_ = x[Milligray-226]
_ = x[Microgray-227]
_ = x[Sieverts-228]
_ = x[Millisieverts-229]
_ = x[Microsieverts-230]
_ = x[MicrosievertsPerHour-231]
_ = x[DecibelsA-232]
_ = x[NephelometricTurbidityUnit-233]
_ = x[Ph-234]
_ = x[GramsPerSquareMeter-235]
_ = x[MinutesPerDegreeKelvin-236]
}
const (
_Unit_name_0 = "SquareMetersSquareFeetMilliamperesAmperesOhmsVoltsKilovoltsMegavoltsVoltAmperesKilovoltAmperesMegavoltAmperesVoltAmperesReactiveKilovoltAmperesReactiveMegavoltAmperesReactiveDegreesPhasePowerFactorJoulesKilojoulesWattHoursKilowattHoursBtusThermsTonHoursJoulesPerKilogramDryAirBtusPerPoundDryAirCyclesPerHourCyclesPerMinuteHertzGramsOfWaterPerKilogramDryAirPercentRelativeHumidityMillimetersMetersInchesFeetWattsPerSquareFootWattsPerSquareMeterLumensLuxesFootCandlesKilogramsPoundsMassTonsKilogramsPerSecondKilogramsPerMinuteKilogramsPerHourPoundsMassPerMinutePoundsMassPerHourWattsKilowattsMegawattsBtusPerHourHorsepowerTonsRefrigerationPascalsKilopascalsBarsPoundsForcePerSquareInchCentimetersOfWaterInchesOfWaterMillimetersOfMercuryCentimetersOfMercuryInchesOfMercuryDegreesCelsiusDegreesKelvinDegreesFahrenheitDegreeDaysCelsiusDegreeDaysFahrenheitYearsMonthsWeeksDaysHoursMinutesSecondsMetersPerSecondKilometersPerHourFeetPerSecondFeetPerMinuteMilesPerHourCubicFeetCubicMetersImperialGallonsLitersUsGallonsCubicFeetPerMinuteCubicMetersPerSecondImperialGallonsPerMinuteLitersPerSecondLitersPerMinuteUSGallonsPerMinuteDegreesAngularDegreesCelsiusPerHourDegreesCelsiusPerMinuteDegreesFahrenheitPerHourDegreesFahrenheitPerMinuteNoUnitsPartsPerMillionPartsPerBillionPercentPercentPerSecondPerMinutePerSecondPsiPerDegreeFahrenheitRadiansRevolutionsPerMinute"
_Unit_name_1 = "SquareInchesSquareCentimetersBtusPerPoundCentimetersPoundsMassPerSecondDeltaDegreesFahrenheitDeltaDegreesKelvinKilohmsMegohmsMillivoltsKilojoulesPerKilogramMegajoulesJoulesPerDegreeKelvinJoulesPerKilogramDegreeKelvinKilohertzMegahertzPerHourMilliwattsHectopascalsMillibarsCubicMetersPerHourLitersPerHourKwHoursPerSquareMeterKwHoursPerSquareFootMegajoulesPerSquareMeterMegajoulesPerSquareFootWattsPerSquareMeterDegreeKelvinCubicFeetPerSecondPercentObscurationPerFootPercentObscurationPerMeterMilliohmsMegawattHoursKiloBtusMegaBtusKilojoulesPerKilogramDryAirMegajoulesPerKilogramDryAirKilojoulesPerDegreeKelvinMegajoulesPerDegreeKelvinNewtonGramsPerSecondGramsPerMinuteTonsPerHourKiloBtusPerHourHundredthsSecondsMillisecondsNewtonMetersMillimetersPerSecondMillimetersPerMinuteMetersPerMinuteMetersPerHourCubicMetersPerMinuteMetersPerSecondPerSecondAmperesPerMeterAmperesPerSquareMeterAmpereSquareMetersFaradsHenrysOhmMetersSiemensSiemensPerMeterTeslasVoltsPerDegreeKelvinVoltsPerMeterWebersCandelasCandelasPerSquareMeterDegreesKelvinPerHourDegreesKelvinPerMinuteJouleSecondsRadiansPerSecondSquareMetersPerNewtonKilogramsPerCubicMeterNewtonSecondsNewtonsPerMeterWattsPerMeterPerDegreeKelvinMicrosiemensCubicFeetPerHourUSGallonsPerHourKilometersMicrometersGramsMilligramsMillilitersMillilitersPerSecondDecibelsDecibelsMillivoltDecibelsVoltMillisiemensWattHoursReactiveKilowattHoursReactiveMegawattHoursReactiveMillimetersOfWaterPerMilleGramsPerGramKilogramsPerKilogramGramsPerKilogramMilligramsPerGramMilligramsPerKilogramGramsPerMilliliterGramsPerLiterMilligramsPerLiterMicrogramsPerLiterGramsPerCubicMeterMilligramsPerCubicMeterMicrogramsPerCubicMeterNanogramsPerCubicMeterGramsPerCubicCentimeterBecquerels"
_Unit_name_2 = "MegabecquerelsGrayMilligrayMicrograySievertsMillisievertsMicrosievertsMicrosievertsPerHourDecibelsANephelometricTurbidityUnitPhGramsPerSquareMeterMinutesPerDegreeKelvin"
)
var (
_Unit_index_0 = [...]uint16{0, 12, 22, 34, 41, 45, 50, 59, 68, 79, 94, 109, 128, 151, 174, 186, 197, 203, 213, 222, 235, 239, 245, 253, 276, 294, 307, 322, 327, 356, 379, 390, 396, 402, 406, 424, 443, 449, 454, 465, 474, 484, 488, 506, 524, 540, 559, 576, 581, 590, 599, 610, 620, 637, 644, 655, 659, 683, 701, 714, 734, 754, 769, 783, 796, 813, 830, 850, 855, 861, 866, 870, 875, 882, 889, 904, 921, 934, 947, 959, 968, 979, 994, 1000, 1009, 1027, 1047, 1071, 1086, 1101, 1119, 1133, 1154, 1177, 1201, 1227, 1234, 1249, 1264, 1271, 1287, 1296, 1305, 1327, 1334, 1354}
_Unit_index_1 = [...]uint16{0, 12, 29, 41, 52, 71, 93, 111, 118, 125, 135, 156, 166, 187, 216, 225, 234, 241, 251, 263, 272, 290, 303, 324, 344, 368, 391, 422, 440, 465, 491, 500, 513, 521, 529, 556, 583, 608, 633, 639, 653, 667, 678, 693, 710, 722, 734, 754, 774, 789, 802, 822, 846, 861, 882, 900, 906, 912, 921, 928, 943, 949, 969, 982, 988, 996, 1018, 1038, 1060, 1072, 1088, 1109, 1131, 1144, 1159, 1187, 1199, 1215, 1231, 1241, 1252, 1257, 1267, 1278, 1298, 1306, 1323, 1335, 1347, 1364, 1385, 1406, 1424, 1432, 1444, 1464, 1480, 1497, 1518, 1536, 1549, 1567, 1585, 1603, 1626, 1649, 1671, 1694, 1704}
_Unit_index_2 = [...]uint8{0, 14, 18, 27, 36, 44, 57, 70, 90, 99, 125, 127, 146, 168}
)
func (i Unit) String() string {
switch {
case i <= 104:
return _Unit_name_0[_Unit_index_0[i]:_Unit_index_0[i+1]]
case 115 <= i && i <= 222:
i -= 115
return _Unit_name_1[_Unit_index_1[i]:_Unit_index_1[i+1]]
case 224 <= i && i <= 236:
i -= 224
return _Unit_name_2[_Unit_index_2[i]:_Unit_index_2[i+1]]
default:
return "Unit(" + strconv.FormatInt(int64(i), 10) + ")"
}
}