Difference between revisions of "Unit GlobalConfig"

From Ultibo.org
Jump to: navigation, search
Line 382: Line 382:
 
|}
 
|}
 
</div></div>
 
</div></div>
<br />
+
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function CPUIDToString(CPUID:LongWord):String;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Convert a CPU ID constant to a string</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''Note'''
 +
| ''None applicable''
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function FPUTypeToString(FPUType:LongWord):String;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Convert a FPU type constant to a string</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''Note'''
 +
| ''None applicable''
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function GPUTypeToString(GPUType:LongWord):String;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Convert a GPU type constant to a string</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''Note'''
 +
| ''None applicable''
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function CacheTypeToString(CacheType:LongWord):String;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Convert a filesystem Cache type constant to a string</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''Note'''
 +
| ''None applicable''
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BoardTypeToString(BoardType:LongWord):String;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Convert a Board type constant to a string</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''Note'''
 +
| ''None applicable''
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function MachineTypeToString(MachineType:LongWord):String;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Convert a Machine type constant to a string</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''Note'''
 +
| ''None applicable''
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function PowerIDToString(PowerID:LongWord):String;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Convert a Power ID constant to a string</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''Note'''
 +
| ''None applicable''
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function PowerStateToString(PowerState:LongWord):String;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Convert a Power state constant to a string</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''Note'''
 +
| ''None applicable''
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function ClockIDToString(ClockID:LongWord):String;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Convert a Clock ID constant to a string</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''Note'''
 +
| ''None applicable''
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function ClockStateToString(ClockState:LongWord):String;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Convert a Clock state constant to a string</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''Note'''
 +
| ''None applicable''
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function TurboIDToString(TurboID:LongWord):String;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Convert a Turbo ID constant to a string</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''Note'''
 +
| ''None applicable''
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function VoltageIDToString(VoltageID:LongWord):String;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Convert a Voltage ID constant to a string</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''Note'''
 +
| ''None applicable''
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function TemperatureIDToString(TemperatureID:LongWord):String;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Convert a Temperature ID constant to a string</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''Note'''
 +
| ''None applicable''
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function LogLevelToLoggingSeverity(LogLevel:LongWord):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Convert a log level constant to a severity level</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''Note'''
 +
| ''None applicable''
 +
|-
 +
|}
 +
</div></div>
 +
<br />
  
 
Return to [[Unit_Reference|Unit Reference]]
 
Return to [[Unit_Reference|Unit Reference]]

Revision as of 06:42, 21 September 2016

Return to Unit Reference


Description


The GlobalConfig unit contains variables used throughout Ultibo core to provide configuration and parameters to common modules and sub systems. Many of these variables may also be passed on the command line as environment variables to customize the behavior of Ultibo core without needing to recompile the application. This unit also includes a small number of widely used common functions.

Constants


None defined

Type definitions


None defined

Public variables


To be documented

GetLastErrorHandler:TGetLastError; - Registered handler for the global GetLastError function
SetLastErrorHandler:TSetLastError; - Registered handler for the global SetLastError function

Function declarations



Global functions

function Min(A,B:LongInt):LongInt; inline;
Description: Return the minimum value of A and B
Note None applicable


function Max(A,B:LongInt):LongInt; inline;
Description: Return the maximum value of A and B
Note None applicable


function Clamp(Value,Low,High:LongInt):LongInt;
Description: To be documented
Note None applicable


function RoundUp(Value,Multiple:LongWord):LongWord;
Description: Round Value to the next highest multiple of Multiple
Note None applicable


function RoundDown(Value,Multiple:LongWord):LongWord;
Description: Round Value to the next lowest multiple of Multiple
Note None applicable


function DivRoundClosest(Value,Divisor:LongInt):LongWord;
Description: To be documented
Note None applicable


function HIWORD(L:LongInt):Word; inline;
Description: Return the high word of L
Note None applicable


function LOWORD(L:LongInt):Word; inline;
Description: Return the low word of L
Note None applicable


function HIBYTE(W:LongInt):Byte; inline;
Description: Return the high byte of W
Note None applicable


function LOBYTE(W:LongInt):Byte; inline;
Description: Return the low byte of W
Note None applicable


function MAKELONG(A,B:LongInt):LongInt; inline;
Description: Make a longword value from A and B
Note None applicable


function MAKEWORD(A,B:LongInt):Word; inline;
Description: Make a word value from A and B
Note None applicable


function WordNtoBE(Value:Word):Word; inline;
Description: Convert word Value from native to big endian
Note These functions are simply wrappers to force the compiler to select the correct function without typecasting


function WordNtoLE(Value:Word):Word; inline;
Description: To be documented
Note These functions are simply wrappers to force the compiler to select the correct function without typecasting


function WordLEtoN(Value:Word):Word; inline;
Description: To be documented
Note These functions are simply wrappers to force the compiler to select the correct function without typecasting


function LongWordNtoLE(Value:LongWord):LongWord; inline;
Description: To be documented
Note These functions are simply wrappers to force the compiler to select the correct function without typecasting


function LongWordLEtoN(Value:LongWord):LongWord; inline;
Description: To be documented
Note These functions are simply wrappers to force the compiler to select the correct function without typecasting


function Int64NtoLE(const Value:Int64):Int64; inline;
Description: To be documented
Note These functions are simply wrappers to force the compiler to select the correct function without typecasting


function Int64LEtoN(const Value:Int64):Int64; inline;
Description: To be documented
Note These functions are simply wrappers to force the compiler to select the correct function without typecasting


function BCDtoBin(Value:Byte):Byte; inline;
Description: To be documented
Note None applicable


function BintoBCD(Value:Byte):Byte; inline;
Description: To be documented
Note None applicable


function GetLastError:LongWord; inline;
Description: Return the last error code for the current thread
Note None applicable


procedure SetLastError(LastError:LongWord); inline;
Description: Set the last error code for the current thread
Note None applicable


Conversion functions

function ErrorToString(Error:LongWord):String;
Description: Convert an error code value to a string
Note None applicable


function SysErrorToString(ErrorCode:Integer):String;
Description: Convert an error code value to a string (RTL)
Note None applicable


function BooleanToString(Value:Boolean):String;
Description: Convert a boolean value to a string
Note None applicable


function CPUArchToString(CPUArch:LongWord):String;
Description: To be documented
Note None applicable


function CPUTypeToString(CPUType:LongWord):String;
Description: Convert a CPU type constant to a string
Note None applicable


function CPUModelToString(CPUModel:LongWord):String;
Description: Convert a CPU model constant to a string
Note None applicable


function CPUIDToString(CPUID:LongWord):String;
Description: Convert a CPU ID constant to a string
Note None applicable


function FPUTypeToString(FPUType:LongWord):String;
Description: Convert a FPU type constant to a string
Note None applicable


function GPUTypeToString(GPUType:LongWord):String;
Description: Convert a GPU type constant to a string
Note None applicable


function CacheTypeToString(CacheType:LongWord):String;
Description: Convert a filesystem Cache type constant to a string
Note None applicable


function BoardTypeToString(BoardType:LongWord):String;
Description: Convert a Board type constant to a string
Note None applicable


function MachineTypeToString(MachineType:LongWord):String;
Description: Convert a Machine type constant to a string
Note None applicable


function PowerIDToString(PowerID:LongWord):String;
Description: Convert a Power ID constant to a string
Note None applicable


function PowerStateToString(PowerState:LongWord):String;
Description: Convert a Power state constant to a string
Note None applicable


function ClockIDToString(ClockID:LongWord):String;
Description: Convert a Clock ID constant to a string
Note None applicable


function ClockStateToString(ClockState:LongWord):String;
Description: Convert a Clock state constant to a string
Note None applicable


function TurboIDToString(TurboID:LongWord):String;
Description: Convert a Turbo ID constant to a string
Note None applicable


function VoltageIDToString(VoltageID:LongWord):String;
Description: Convert a Voltage ID constant to a string
Note None applicable


function TemperatureIDToString(TemperatureID:LongWord):String;
Description: Convert a Temperature ID constant to a string
Note None applicable


function LogLevelToLoggingSeverity(LogLevel:LongWord):LongWord;
Description: Convert a log level constant to a severity level
Note None applicable


Return to Unit Reference