System
Description
The System object provides device and operating system related properties such as clock, cpuLoad and hostname. It also allows changing the system hostname and configure system services required and/or used by the application.
- › Inherits:
Overview
Properties
Methods
Signals
Enumerations
Properties
architecture
This property holds the architecture which the device running this application is based on.
This property was introduced in InCore 2.8.
- › Type:
- › Attributes:
Readonly
bootloaderVersion
This property holds the version of the bootloader used for booting the operating system.
- › Type:
String
- › Attributes:
Readonly
brokenDownCpuUsage
This property holds the average usage of each CPU in percent. When polled for the first time, it will return the total CPU usages since system start while subsequent polls return the CPU usages since the previous poll.
This property was introduced in InCore 2.8.
- › Type:
List
- › Signal:
brokenDownCpuUsageChanged()
- › Attributes:
Readonly, Requires Polling
clock
This property holds the current UTC timestamp used by the system. This value is equivalent to the well-known UNIX time and represents the number of seconds that have elapsed since 00:00:00 Thursday, 1 January 1970 (UTC) minus leap seconds.
- › Type:
SignedBigInteger
- › Attributes:
Readonly
cpuLoad
This property holds the system load average for the last minute. The value is equivalent to the well-known UNIX load and indicates how many processes are consuming CPU time and waiting for I/O.
- › Type:
Double
- › Signal:
cpuLoadChanged()
- › Attributes:
Readonly, Requires Polling
cpuUsage
This property holds the average usage of all CPUs in percent. When polled for the first time, it will return the total CPU usage since system start while subsequent polls return the CPU usage since the previous poll.
This property was introduced in InCore 2.5.
- › Type:
SignedInteger
- › Signal:
cpuUsageChanged()
- › Attributes:
Readonly, Requires Polling
deviceHumidity
This property holds the relative humidity measured inside the device.
- › Type:
Float
- › Signal:
deviceHumidityChanged()
- › Attributes:
Readonly, Requires Polling
deviceId
This property holds a worldwide unique ID associated with the running device. The ID is based on the MAC address of the primary network interface and consists of 12 hexadecimal digits.
- › Type:
String
- › Attributes:
Readonly
deviceName
This property holds the name of the device. This can be a description with arbitrary UTF-8 characters.
- › Type:
String
- › Signal:
deviceNameChanged()
- › Attributes:
Writable
deviceTemperature
This property holds the temperature measured inside the device in °C. This temperature does not indicate the CPU temperature even though both temperatures correlate with each other.
- › Type:
Float
- › Signal:
deviceTemperatureChanged()
- › Attributes:
Readonly, Requires Polling
deviceTreeVariant
This property holds the device tree variant which is used for initializing the hardware of the current device. The proper values are deviceType-specific and only should be set by the vendor.
This property was introduced in InCore 2.8.
- › Type:
String
- › Signal:
deviceTreeVariantChanged()
- › Attributes:
Writable
deviceType
This property holds the type of the device which the application currently is running on.
- › Type:
- › Attributes:
Readonly
error
This property holds the most recently occurred error or System.NoError if no error occurred. If the same error occurs multiple times this property does not change. Use the errorOccurred() signal to detect multiple occurrences of the same error.
- › Type:
- › Signal:
errorChanged()
- › Attributes:
Readonly
errorString
This property holds the current human readable error string corresponding to the current value in the error property. It may include additional information such as failure reasons or locations.
- › Type:
String
- › Signal:
errorStringChanged()
- › Attributes:
Readonly
hostname
This property holds the hostname of the system. The hostname must follow the usual conventions for allowed characters. Changing this property allows operating multiple devices of the same type in a network and address them through multicast DNS (i.e. <hostname>.local) instead of regular DNS.
- › Type:
String
- › Signal:
hostnameChanged()
- › Attributes:
Writable
memoryAvailable
This property holds the available (unused) memory of the system in kiB.
This property was introduced in InCore 2.5.
- › Type:
SignedInteger
- › Signal:
memoryAvailableChanged()
- › Attributes:
Readonly, Requires Polling
memoryTotal
This property holds the total memory of the system in kiB.
This property was introduced in InCore 2.5.
- › Type:
SignedInteger
- › Attributes:
Readonly
networkInterfaces
This property holds the hardware names of all available network interfaces.
- › Type:
StringList
- › Signal:
networkInterfacesChanged()
- › Attributes:
Readonly
osEdition
This property holds the edition of the operating system currently running on the device.
This property was introduced in InCore 2.7.
- › Type:
String
- › Attributes:
Readonly
osVersion
This property holds the version of the operating system currently running on the device.
- › Type:
String
- › Attributes:
Readonly
processor
This property holds the processor of the device which the application currently is running on.
This property was introduced in InCore 2.8.
- › Type:
- › Attributes:
Readonly
services
This property holds a list of system services to configure and use in the application. See the documentation for SystemService for details.
- › Type:
- › Signal:
servicesChanged()
- › Attributes:
Readonly
storageUsage
This property holds information about the specific usage of the storage partition.
This property was introduced in InCore 2.8.
- › Type:
QJsonObject
- › Signal:
storageUsageChanged()
- › Attributes:
Readonly, Requires Polling
systemProcesses
This property holds information about all running system processes.
This property was introduced in InCore 2.8.
- › Type:
QJsonArray
- › Signal:
systemProcessesChanged()
- › Attributes:
Readonly, Requires Polling
uptime
This property holds how long the system has been running since last boot. The uptime is provided in days, hours and minutes.
- › Type:
String
- › Signal:
uptimeChanged()
- › Attributes:
Readonly, Requires Polling
Methods
pollBrokenDownCpuUsage()
This method polls the brokenDownCpuUsage property. It is called automatically when using a Polling property modifier on this property and usually does not have to be called manually.
pollCpuLoad()
This method polls the cpuLoad property. It is called automatically when using a Polling property modifier on this property and usually does not have to be called manually.
pollCpuUsage()
This method polls the cpuUsage property. It is called automatically when using a Polling property modifier on this property and usually does not have to be called manually.
pollDeviceHumidity()
This method polls the deviceHumidity property. It is called automatically when using a Polling property modifier on this property and usually does not have to be called manually.
pollDeviceTemperature()
This method polls the deviceTemperature property. It is called automatically when using a Polling property modifier on this property and usually does not have to be called manually.
pollMemoryAvailable()
This method polls the memoryAvailable property. It is called automatically when using a Polling property modifier on this property and usually does not have to be called manually.
pollStorageUsage()
This method polls the storageUsage property. It is called automatically when using a Polling property modifier on this property and usually does not have to be called manually.
pollSystemProcesses()
This method polls the systemProcesses property. It is called automatically when using a Polling property modifier on this property and usually does not have to be called manually.
pollUptime()
This method polls the uptime property. It is called automatically when using a Polling property modifier on this property and usually does not have to be called manually.
reboot()
This method initiates a full system restart. Since the application will be stopped almost immediately any actions such as logging or closing connections should be performed before calling this method.
This method was introduced in InCore 2.0.
resetVictoriaMetrics()
- › Returns:
Boolean
setHardwareClocks()
This method sets all available hardware clocks (RTCs) to the current system time.
This method was introduced in InCore 2.7.
shutdown()
This method initiates a clean system shutdown. Since the application will be stopped almost immediately any actions such as logging or closing connections should be performed before calling this method.
This method was introduced in InCore 2.7.
Signals
errorOccurred()
This signal is emitted whenever an error has occurred, regardless of whether the error property has changed or not. In contrast to the change notification signal of the error property this signal is also emitted several times if a certain error occurs several times in succession.
servicesDataChanged(SignedInteger index)
This signal is emitted whenever the List.dataChanged() signal is emitted, i.e. the item at index in the services list itself emitted the dataChanged() signal.
Enumerations
Architecture
This enumeration describes the device architecture which the application can run on.
This enumeration was introduced in InCore 2.8.
Name |
Value |
Description |
|---|---|---|
|
|
Other/unknown architecture. |
|
|
32 bit ARM architecture. |
|
|
64 bit ARM architecture. |
|
|
64 bit x86 architecture. |
DeviceType
This enumeration describes the type of the device which the application can run on.
Name |
Value |
Description |
|---|---|---|
|
|
Other/unknown device. |
|
|
A HUB-GM100 (single-core) device. |
|
|
A HUB-GM200 (dual-core) device. |
|
|
A HUB-GM400 (quad-core) device. |
|
|
A HUB-IO100 device. |
|
|
A HUB-CO100 device. |
|
|
A HUB-SE100 device. |
|
|
A HUB-SI100 device. |
|
|
A HUB-EN200 device. |
|
|
A TURCK IM18-CCM60 device. |
Error
This enumeration describes all errors which can occur in System objects. The most recently occurred error is stored in the error property.
Name |
Value |
Description |
|---|---|---|
|
|
No error occurred or was detected. |
|
|
Can’t set empty hostname. |
|
|
Hostname is invalid, likely due to invalid characters. |
Processor
This enumeration describes the processor which a device is equipped with.
This enumeration was introduced in InCore 2.8.
Name |
Value |
Description |
|---|---|---|
|
|
Other/unknown processor. |
|
|
TI-AM335X processor. |
|
|
NXP-IMX6ULL processor . |
|
|
NXP-IMX7D processor. |
|
|
NXP-IMX8QXP processor. |
Example
import InCore.Foundation 2.5
Application {
System {
Polling on cpuUsage { }
Polling on memoryAvailable { }
onCpuUsageChanged: console.log("CPU usage:", cpuUsage, "%")
onMemoryAvailableChanged: console.log(("%1 of %2 MiB used").arg(memoryTotal-memoryAvailable).arg(memoryTotal))
}
}