Files
create/src/Base/QuantityPy.xml
2022-08-15 11:42:26 +02:00

94 lines
3.3 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<GenerateModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="generateMetaModel_Module.xsd">
<PythonExport
Father="PyObjectBase"
Name="QuantityPy"
Twin="Quantity"
TwinPointer="Quantity"
Include="Base/Quantity.h"
FatherInclude="Base/PyObjectBase.h"
Namespace="Base"
NumberProtocol="true"
RichCompare="true"
Constructor="true"
Delete="true"
FatherNamespace="Base">
<Documentation>
<Author Licence="LGPL" Name="Juergen Riegel" EMail="FreeCAD@juergen-riegel.net" />
<UserDocu>Quantity
defined by a value and a unit.
The following constructors are supported:
Quantity() -- empty constructor
Quantity(Value) -- empty constructor
Quantity(Value,Unit) -- empty constructor
Quantity(Quantity) -- copy constructor
Quantity(string) -- arbitrary mixture of numbers and chars defining a Quantity
</UserDocu>
<DeveloperDocu>Quantity</DeveloperDocu>
</Documentation>
<Methode Name="toStr" Const="true">
<Documentation>
<UserDocu>
toStr([decimals])
returns a string representation rounded to number of decimals. If no decimals are specified then
the internal precision is used
</UserDocu>
</Documentation>
</Methode>
<Methode Name="getUserPreferred" Const="true">
<Documentation>
<UserDocu>
returns a quantity with the translation factor and a string with the prevered unit
</UserDocu>
</Documentation>
</Methode>
<Methode Name="getValueAs" Const="true">
<Documentation>
<UserDocu>
returns a floating point value as the provided unit
Following parameters are allowed:
getValueAs('m/s') # unit string to parse
getValueAs(2.45,1) # translation value and unit signature
getValueAs(FreeCAD.Units.Pascal) # predefined standard units
getValueAs(Qantity('N/m^2')) # a quantity
getValueAs(Unit(0,1,0,0,0,0,0,0)) # a unit
</UserDocu>
</Documentation>
</Methode>
<Methode Name="__round__" Const="true">
<Documentation>
<UserDocu>
Return the Integral closest to x, rounding half toward even.
When an argument is passed, work like built-in round(x, ndigits).
</UserDocu>
</Documentation>
</Methode>
<Attribute Name="Value" ReadOnly="false">
<Documentation>
<UserDocu>Numeric Value of the Quantity (in internal system mm,kg,s)</UserDocu>
</Documentation>
<Parameter Name="Value" Type="Float" />
</Attribute>
<Attribute Name="Unit" ReadOnly="false">
<Documentation>
<UserDocu>Unit of the Quantity</UserDocu>
</Documentation>
<Parameter Name="Unit" Type="Object" />
</Attribute>
<Attribute Name="UserString" ReadOnly="true">
<Documentation>
<UserDocu>Unit of the Quantity</UserDocu>
</Documentation>
<Parameter Name="UserString" Type="String" />
</Attribute>
<Attribute Name="Format" ReadOnly="false">
<Documentation>
<UserDocu>Format of the Quantity</UserDocu>
</Documentation>
<Parameter Name="Format" Type="Dict" />
</Attribute>
</PythonExport>
</GenerateModel>