2012-07-04 20:44:53 -03:00
class Parameter ( object ) :
def __init__ ( self , name ) :
self . name = name
2016-07-31 07:22:06 -03:00
2012-07-04 20:44:53 -03:00
class Vehicle ( object ) :
2016-07-31 07:22:06 -03:00
def __init__ ( self , name , path ) :
2012-07-04 20:44:53 -03:00
self . name = name
self . path = path
self . params = [ ]
2016-07-31 07:22:06 -03:00
2012-07-04 20:44:53 -03:00
class Library ( object ) :
2016-07-31 07:22:06 -03:00
def __init__ ( self , name ) :
2012-07-04 20:44:53 -03:00
self . name = name
self . params = [ ]
2016-07-31 07:22:06 -03:00
2012-07-04 20:44:53 -03:00
known_param_fields = [
' Description ' ,
' DisplayName ' ,
' Values ' ,
' Range ' ,
' Units ' ,
' Increment ' ,
2015-05-29 03:35:33 -03:00
' User ' ,
2015-06-04 21:19:26 -03:00
' RebootRequired ' ,
2016-02-28 19:35:40 -04:00
' Bitmask ' ,
' Volatile ' ,
2016-07-31 07:22:06 -03:00
' ReadOnly ' ,
2012-07-04 21:42:38 -03:00
]
2017-05-02 07:36:14 -03:00
# Follow SI units conventions from:
# http://physics.nist.gov/cuu/Units/units.html
# http://physics.nist.gov/cuu/Units/outside.html
# and
# http://physics.nist.gov/cuu/Units/checklist.html
# http://www.bipm.org/en/publications/si-brochure/
# http://www1.bipm.org/en/CGPM/db/3/2/ g_n unit for G-force
# one further constrain is that only printable (7bit) ASCII characters are allowed
known_units = {
# abreviation : full-text (used in .html .rst and .wiki files)
# time
' s ' : ' seconds ' ,
' ds ' : ' deciseconds ' ,
' cs ' : ' centiseconds ' ,
' ms ' : ' milliseconds ' ,
2017-05-02 21:10:22 -03:00
' PWM ' : ' PWM in microseconds ' , # should be microseconds, this is NOT a SI unit, but follows https://github.com/ArduPilot/ardupilot/pull/5538#issuecomment-271943061
2017-05-02 07:36:14 -03:00
' Hz ' : ' hertz ' ,
# distance
2017-05-02 21:10:22 -03:00
' km ' : ' kilometers ' , # metre is the SI unit name, meter is the american spelling of it
' m ' : ' meters ' , # metre is the SI unit name, meter is the american spelling of it
' m/s ' : ' meters per second ' , # metre is the SI unit name, meter is the american spelling of it
' m/s/s ' : ' meters per square second ' , # metre is the SI unit name, meter is the american spelling of it
' m/s/s/s ' : ' meters per cubic second ' , # metre is the SI unit name, meter is the american spelling of it
' cm ' : ' centimeters ' , # metre is the SI unit name, meter is the american spelling of it
' cm/s ' : ' centimeters per second ' , # metre is the SI unit name, meter is the american spelling of it
' cm/s/s ' : ' centimeters per square second ' , # metre is the SI unit name, meter is the american spelling of it
' cm/s/s/s ' : ' centimeters per cubic second ' , # metre is the SI unit name, meter is the american spelling of it
' mm ' : ' millimeters ' , # metre is the SI unit name, meter is the american spelling of it
2017-05-02 07:36:14 -03:00
# temperature
2017-05-15 20:18:50 -03:00
' degC ' : ' degrees Celsius ' , # Not SI, but Kelvin is too cumbersome for most users
2017-05-02 07:36:14 -03:00
# angle
2017-05-15 20:18:50 -03:00
' deg ' : ' degrees ' , # Not SI, but is some situations more user-friendly than radians
' deg/s ' : ' degrees per second ' , # Not SI, but is some situations more user-friendly than radians
' cdeg ' : ' centidegrees ' , # Not SI, but is some situations more user-friendly than radians
' cdeg/s ' : ' centidegrees per second ' , # Not SI, but is some situations more user-friendly than radians
' cdeg/s/s ' : ' centidegrees per square second ' , # Not SI, but is some situations more user-friendly than radians
2017-05-02 07:36:14 -03:00
' rad ' : ' radians ' ,
' rad/s ' : ' radians per second ' ,
' rad/s/s ' : ' radians per square second ' ,
# electricity
' A ' : ' ampere ' ,
' V ' : ' volt ' ,
' W ' : ' watt ' ,
# magnetism
' Gauss ' : ' gauss ' , # Gauss is not an SI unit, but 1 tesla = 10000 gauss so a simple replacement is not possible here
' Gauss/s ' : ' gauss per second ' , # Gauss is not an SI unit, but 1 tesla = 10000 gauss so a simple replacement is not possible here
' mGauss ' : ' milligauss ' , # Gauss is not an SI unit, but 1 tesla = 10000 gauss so a simple replacement is not possible here
# pressure
' Pa ' : ' pascal ' ,
' mbar ' : ' millibar ' ,
# ratio
' % ' : ' percent ' ,
' % /s ' : ' percent per second ' ,
2017-05-02 21:10:22 -03:00
' d % ' : ' decipercent ' , # decipercent is strange, but "per-mille" is even more exotic
2017-05-02 07:36:14 -03:00
# compound
2017-05-02 21:10:22 -03:00
' m.m/s/s ' : ' square meter per square second ' ,
' deg/m/s ' : ' degrees per meter per second ' ,
2017-05-02 07:36:14 -03:00
' m/s/m ' : ' meters per second per meter ' , # Why not use Hz here ????
' mGauss/A ' : ' milligauss per ampere ' ,
2017-05-02 21:10:22 -03:00
' mA.h ' : ' milliampere hour ' ,
2017-05-02 07:36:14 -03:00
' A/V ' : ' ampere per volt ' ,
' m/V ' : ' meters per volt ' ,
' gravities ' : ' standard acceleration due to gravity ' , # g_n would be a more correct unit, but IMHO no one understands what g_n means
}
2013-05-21 04:01:13 -03:00
required_param_fields = [
' Description ' ,
' DisplayName ' ,
2016-07-31 07:22:06 -03:00
' User ' ,
2013-05-21 04:01:13 -03:00
]
2012-07-04 21:42:38 -03:00
known_group_fields = [
2016-07-31 07:22:06 -03:00
' Path ' ,
2013-05-21 04:01:13 -03:00
]