Software control of RITM
To work with RITM software control functions in Engee, install the hardware support package by executing the command:
|
This page presents all available functions of the software control of the CPM "RITM" in Engee.
Methods RITM
.
#
EngeeDeviceManager.Targets.RITM.compile_model
— Method
Targets.compile_model(ritm::Any, model::Model, is_ext_mode::Bool)
Assembling the model on RITM.
Arguments
-
ritm::Any
: object of the target RITM platform. Defined with the serial commandsritm = Targets.RITM.Ritm()
andTargets.RITM.set_url(ritm, "http://192.168.56.3:8000/")
. -
model::Model
: object of type Model. -
is_ext_mode::Bool
: flag indicating the mode of model execution.true
- the model is executed in interactive mode.false
- the model is executed in the independent mode.
Examples
model = Engee.engee.gcm()
Targets.upload_model(ritm, model)
Targets.generate_executable_code(ritm, model, false)
Targets.compile_model(ritm, model)
#
EngeeDeviceManager.Targets.RITM.generate_executable_code
— Method
Targets.generate_executable_code(ritm::Any, model::Model, is_ext_mode::Bool)
Generates C-binding on RITM.
Arguments
-
ritm::Any
: RITM target platform object. Defined with the serial commandsritm = Targets.RITM.Ritm()
andTargets.RITM.set_url(ritm, "http://192.168.56.3:8000/")
. -
model::Model
: object of type Model. -
is_ext_mode::Bool
: flag indicating the mode of model execution.true
- the model is executed in interactive mode.false
- the model is executed in the independent mode.
Examples
model = Engee.engee.gcm()
Targets.upload_model(ritm, model)
Targets.generate_executable_code(ritm, model, false)
#
EngeeDeviceManager.Targets.RITM.set_url
— Method
Targets.RITM.set_url(ritm:Any, url::String)
Sets the address of the RITM machine.
Arguments
-
ritm::Any
: RITM target platform object. Set with the serial commandsritm = Targets.RITM.Ritm()
andTargets.RITM.set_url(ritm, "http://192.168.56.3:8000/")
. -
url::String
: RITM machine address.
Examples
ritm = Targets.RITM.Ritm()
Targets.RITM.set_url(ritm, "http://192.168.56.3:8000/")
#
EngeeDeviceManager.Targets.RITM.start_model
— Method
Targets.start_model(ritm::Any, model::Model)
Runs the model on RITM.
Arguments
-
ritm::Any
: RITM target platform object. Defined with the serial commandsritm = Targets.RITM.Ritm()
andTargets.RITM.set_url(ritm, "http://192.168.56.3:8000/")
. -
model::Model
: object of type Model.
Examples
Targets.start_model(ritm, model)
#
EngeeDeviceManager.Targets.RITM.stop_model
— Method
Targets.stop_model(ritm::Any)
Stops the model at RITM.
Arguments
ritm::Any
: RITM target platform object. Defined with the consecutive commands ritm = Targets.RITM.Ritm()
and Targets.RITM.set_url(ritm, "http://192.168.56.3:8000/")
.
Examples
Targets.stop_model(ritm)
#
EngeeDeviceManager.Targets.RITM.upload_model
— Method
Targets.upload_model(ritm::Any, model::Model)
Uploads the model to RITM.
Arguments
-
ritm::Any
: RITM target platform object. Defined with the serial commandsritm = Targets.RITM.Ritm()
andTargets.RITM.set_url(ritm, "http://192.168.56.3:8000/")
. -
model::Model
: object of type Model.
Examples
model = Engee.engee.gcm()
Targets.upload_model(ritm, model)
#
EngeeDeviceManager.Targets.RITM_API.getData
— Function
RITM_API.getData(ritm::Any, model_name::String, file_path::String, in_file::Bool = false)
Returns the result of model profiling on RITM. Depending on the value of in_file
, the result can be returned as a string or saved to a file at the specified path.
Arguments
-
ritm::Any
: RITM target platform object. Specified with the consecutive commandsritm = Targets.RITM.Ritm()
andTargets.RITM.set_url(ritm, "http://192.168.56.3:8000/")
. -
model_name::String
: name of the model for which profiling data is requested. -
file_path::String
: path where to save the result (ifin_file = true
). Ifin_file = false
, the value is ignored. -
in_file::Bool = false
: specifies how to return the result. Iftrue
, the data is saved to a file atfile_path
. Iffalse
, a string with the result is returned.
Examples
# Получает данные профилирования как строку
result = RITM_API.getData(ritm, "newmodel_1", "", false)
# Сохраняет данные в файл на РИТМе
RITM_API.getData(ritm, "newmodel_1", "/user/profile.txt", true)
#
EngeeDeviceManager.Targets.RITM_API.getFile
— Method
RITM_API.getFile(ritm::Any, file_name::String; from=/mydir::String, to=::String)
Gets the specified file file_name
from the directory /home/ritm/build/model_name/build/
, where model_name
is the model name in Engee.
Arguments
-
ritm::Any
: RITM target platform object. Specified using the sequential commandsritm = Targets.RITM.Ritm()
andTargets.RITM.set_url(ritm, "http://192.168.56.3:8000/")
. -
file_name::String
: name of the file of interest. -
from=/mydir::String
: path to the directory with the file of interest (default/home/ritm/build/model_name/build/
). -
to=::String
: path to the directory in Engee to save the file (defaults to the current directory).
Examples
RITM_API.getFile(ritm, "install_manifest.txt"; from="/home/ritm/build/newmodel_1/build/", to="")
#
EngeeDeviceManager.Targets.RITM_API.getLog
— Method
RITM_API.getLog(ritm::Any, num::Int64)
Returns the specified number of model execution log lines on the RITM.
Arguments
-
ritm::Any
: RITM target platform object. Specified with the consecutive commandsritm = Targets.RITM.Ritm()
andTargets.RITM.set_url(ritm, "http://192.168.56.3:8000/")
. -
num::Int64
: number of output lines from the logs.
Examples
RITM_API.getLog(ritm, 10)
#
EngeeDeviceManager.Targets.RITM_API.getScreenshot
— Method
RITM_API.getScreenshot(ritm::Any, filename::String = "screenshot.png")
Creates a screenshot on the target RITM platform and returns the path to the saved image. The screenshot is saved in a temporary directory on the RITM machine. The output file name can be specified explicitly; the default is "screenshot.png"
.
Arguments
-
ritm::Any
: RITM target platform object. Specified using the serial commandsritm = Targets.RITM.Ritm()
andTargets.RITM.set_url(ritm, "http://192.168.56.3:8000/")
. -
filename::String = "screenshot.png"
: name of the file to which the screenshot will be saved (on the RITM side).
Examples
# Создает скриншот и получает путь к нему
path = RITM_API.getScreenshot(ritm, "example.png")
#
EngeeDeviceManager.Targets.RITM_API.isConnected
— Method
RITM_API.isConnected(ritm::Any)
Checks the availability of RITM.
Arguments
ritm::Any
: RITM target platform object. Defined with the serial commands ritm = Targets.RITM.Ritm()
and Targets.RITM.set_url(ritm, "http://192.168.56.3:8000/")
.
Examples
RITM_API.isConnected(ritm)
#
EngeeDeviceManager.Targets.RITM_API.isRunning
— Method
RITM_API.isRunning(ritm::Any, model_name::String)
Checks if the specified model is running on the target RITM platform. Returns true
, if the model with the specified name is currently running on the RITM machine, and false
if it is not.
Arguments
-
ritm::Any
: RITM target platform object. Specified with the serial commandsritm = Targets.RITM.Ritm()
andTargets.RITM.set_url(ritm, "http://192.168.56.3:8000/")
. -
model_name::String
: the name of the model whose state is to be checked.
Examples
# Проверяет, запущена ли модель "newmodel_1"
is_active = RITM_API.isRunning(ritm, "newmodel_1")
#
EngeeDeviceManager.Targets.RITM_API.listFiles
— Method
RITM_API.listFiles(ritm::Any, path::String)
Outputs a list of files in the specified directory.
Arguments
-
ritm::Any
: RITM target platform object. Specified with the consecutive commandsritm = Targets.RITM.Ritm()
andTargets.RITM.set_url(ritm, "http://192.168.56.3:8000/")
. -
path::String
: path to the directory of interest.
Examples
RITM_API.listFiles(ritm, "/home/ritm/")
#
EngeeDeviceManager.Targets.RITM_API.memInfo
— Function
RITM_API.memInfo(ritm::Any, model::String)
Displays information about the memory consumed by the model.
Arguments
-
ritm::Any
: RITM target platform object. Specified with the serial commandsritm = Targets.RITM.Ritm()
andTargets.RITM.set_url(ritm, "http://192.168.56.3:8000/")
. -
model::String
: model name. If""
is left blank, it will return the result of system profiling as[total, used, free]
. If you specify the model name, it will return the number of bytes of memory consumed by the model.
Examples
RITM_API.memInfo(ritm, "newmodel_1")
#
EngeeDeviceManager.Targets.RITM_API.readFile
— Method
RITM_API.readFile(ritm::Any, file_name::String; path=/mydir::String)
Outputs the contents of the specified file file_name
from the directory /home/ritm/build/model_name/build/
, where model_name
is the model name in Engee.
Arguments
-
ritm::Any
: RITM target platform object. Specified using the serial commandsritm = Targets.RITM.Ritm()
andTargets.RITM.set_url(ritm, "http://192.168.56.3:8000/")
. -
file_name::String
: name of the file of interest. -
path=/mydir::String
: path to the directory with the file of interest (by default/home/ritm/build/model_name/build/
).
Examples
RITM_API.readFile(ritm, "install_manifest.txt"; path="/home/ritm/build/newmodel_1/build/")