1
<?xml version="1.0" encoding="UTF-8"?>
2
<GenerateModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="generateMetaModel_Module.xsd">
8
Include="Base/Quantity.h"
9
FatherInclude="Base/PyObjectBase.h"
15
FatherNamespace="Base">
17
<Author Licence="LGPL" Name="Juergen Riegel" EMail="FreeCAD@juergen-riegel.net" />
19
defined by a value and a unit.
21
The following constructors are supported:
22
Quantity() -- empty constructor
23
Quantity(Value) -- empty constructor
24
Quantity(Value,Unit) -- empty constructor
25
Quantity(Quantity) -- copy constructor
26
Quantity(string) -- arbitrary mixture of numbers and chars defining a Quantity
28
<DeveloperDocu>Quantity</DeveloperDocu>
30
<Methode Name="toStr" Const="true">
34
returns a string representation rounded to number of decimals. If no decimals are specified then
35
the internal precision is used
39
<Methode Name="getUserPreferred" Const="true">
42
returns a quantity with the translation factor and a string with the prevered unit
46
<Methode Name="getValueAs" Const="true">
49
returns a floating point value as the provided unit
51
Following parameters are allowed:
52
getValueAs('m/s') # unit string to parse
53
getValueAs(2.45,1) # translation value and unit signature
54
getValueAs(FreeCAD.Units.Pascal) # predefined standard units
55
getValueAs(Qantity('N/m^2')) # a quantity
56
getValueAs(Unit(0,1,0,0,0,0,0,0)) # a unit
60
<Methode Name="__round__" Const="true">
63
Return the Integral closest to x, rounding half toward even.
64
When an argument is passed, work like built-in round(x, ndigits).
68
<Attribute Name="Value" ReadOnly="false">
70
<UserDocu>Numeric Value of the Quantity (in internal system mm,kg,s)</UserDocu>
72
<Parameter Name="Value" Type="Float" />
74
<Attribute Name="Unit" ReadOnly="false">
76
<UserDocu>Unit of the Quantity</UserDocu>
78
<Parameter Name="Unit" Type="Object" />
80
<Attribute Name="UserString" ReadOnly="true">
82
<UserDocu>Unit of the Quantity</UserDocu>
84
<Parameter Name="UserString" Type="String" />
86
<Attribute Name="Format" ReadOnly="false">
88
<UserDocu>Format of the Quantity</UserDocu>
90
<Parameter Name="Format" Type="Dict" />