Engee documentation

Software control of RITM

To work with the functions of the program control of the KPM "RITM" in Engee, install the Engee subsystem.Integrations:

engee.package.install("Engee-Device-Manager")

On this page all available functions of the program management of the KPM "RITM" in Engee are presented.

Methods RITM

ritm.compile_model(model, is_ext_mode)

Builds a model based on the RITM.

Arguments

  • model::Model: an object of the Model type.

  • is_ext_mode::Bool: a flag indicating the execution mode of the model. true — the model is executed interactively. false — the model runs in independent mode.

Examples

model = engee.gcm()
ritm.upload_model(model)
ritm.generate_executable_code(model, false)
ritm.compile_model(model, false)
ritm.generate_executable_code(model, is_ext_mode)

Generates a Si-strapping on the RITM.

Arguments

  • model::Model: an object of the Model type.

  • is_ext_mode::Bool: a flag indicating the execution mode of the model. true — the model is executed interactively. false — the model runs in independent mode.

Examples

model = engee.gcm()
ritm.upload_model(model)
ritm.generate_executable_code(model, false)
ritm.set_url(url)

Sets the address of the RITM machine.

Arguments

url::String: the address of the RITM machine.

Examples

ritm = Targets.RITM.Ritm()
ritm.set_url("http://192.168.56.3:8000/")
ritm.start_model(model)

Starts the model based on the RITM.

Arguments

model::Model: an object of the Model type.

Examples

ritm.start_model(model)
ritm.stop_model()

Stops the model at the RITM.

Examples

ritm.stop_model()
ritm.upload_model(model)

Loads the model to the RITM.

Arguments

model::Model: an object of the Model type.

Examples

model = engee.gcm()
ritm.upload_model(model)
RITM_API.getData(ritm::Any, model_name::String, file_path::String, in_file::Bool = false)

Returns the result of profiling the model based on the RITM. Depending on the value in_file the result can be returned as a string or saved to a file using the specified path.

Arguments

  • ritm::Any: an object of the target RITM platform. It is set using sequential commands ritm = Targets.RITM.Ritm() and Targets.RITM.set_url(ritm, "http://192.168.56.3:8000/").

  • model_name::String: the name of the model for which profiling data is requested.

  • file_path::String: the path to save the result (if in_file = true). If in_file = false, the value is ignored.

  • in_file::Bool = false: specifies how to return the result. If true, the data is saved to a file by file_path. If false, returns the result string.

Examples

# Gets the profiling data as a string
result = RITM_API.getData(ritm, "newmodel_1", "", false)

# Saves data to a file at RITM
RITM_API.getData(ritm, "newmodel_1", "/user/profile.txt", true)
RITM_API.getFile(ritm::Any, file_name::String; from=/mydir::String, to=::String)

Retrieves the specified file file_name from the directory /home/ritm/build/model_name/build/, where model_name — the name of the model in Engee.

Arguments

  • ritm::Any: an object of the target RITM platform. It is set using consecutive commands ritm = Targets.RITM.Ritm() and Targets.RITM.set_url(ritm, "http://192.168.56.3:8000/").

  • file_name::String: the name of the file of interest.

  • from=/mydir::String: the path to the directory with the file of interest (by default /home/ritm/build/model_name/build/).

  • to=::String: the path to the directory in Engee to save the file (by default in the current one).

Examples

RITM_API.getFile(ritm, "install_manifest.txt"; from="/home/ritm/build/newmodel_1/build/", to="")
RITM_API.getLog(ritm::Any, num::Int64)

Returns the specified number of lines of model execution logs for the RITM.

Arguments

  • ritm::Any: an object of the target RITM platform. It is set using consecutive commands ritm = Targets.RITM.Ritm() and Targets.RITM.set_url(ritm, "http://192.168.56.3:8000/").

  • num::Int64: the number of output lines from the logs.

Examples

RITM_API.getLog(ritm, 10)
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 name of the output file can be specified explicitly; by default, it is used "screenshot.png".

Arguments

  • ritm::Any: an object of the target RITM platform. It is set using sequential commands ritm = Targets.RITM.Ritm() and Targets.RITM.set_url(ritm, "http://192.168.56.3:8000/").

  • filename::String = "screenshot.png": the name of the file where the screenshot will be saved (on the RITM side).

Examples

# Creates a screenshot and gets the path to it
path = RITM_API.getScreenshot(ritm, "example.png")
RITM_API.isConnected(ritm::Any)

Checks the availability of the RITM.

Arguments

ritm::Any: an object of the target RITM platform. It is set using consecutive commands ritm = Targets.RITM.Ritm() and Targets.RITM.set_url(ritm, "http://192.168.56.3:8000/").

Examples

RITM_API.isConnected(ritm)
RITM_API.isRunning(ritm::Any, model_name::String)

Checks whether the specified model is running on the target RITM platform. Returns true if the model with the specified name is currently in progress on the RITM machine, and false if it is not executed.

Arguments

  • ritm::Any: an object of the target RITM platform. It is set using consecutive commands ritm = Targets.RITM.Ritm() and Targets.RITM.set_url(ritm, "http://192.168.56.3:8000/").

  • model_name::String: the name of the model whose condition needs to be checked.

Examples

# Checks whether the "newmodel_1" model is running
is_active = RITM_API.isRunning(ritm, "newmodel_1")
RITM_API.listFiles(ritm::Any, path::String)

Displays a list of files in the specified directory.

Arguments

  • ritm::Any: an object of the target RITM platform. It is set using consecutive commands ritm = Targets.RITM.Ritm() and Targets.RITM.set_url(ritm, "http://192.168.56.3:8000/").

  • path::String: the path to the directory of interest.

Examples

RITM_API.listFiles(ritm, "/home/ritm/")
RITM_API.memInfo(ritm::Any, model::String)

Displays information about the memory consumed by the model.

Arguments

  • ritm::Any: an object of the target RITM platform. It is set using consecutive commands ritm = Targets.RITM.Ritm() and Targets.RITM.set_url(ritm, "http://192.168.56.3:8000/").

  • model::String: the name of the model. If left empty "", then returns the result of profiling the system in the form [total, used, free]. If you specify the model name, it returns the number of bytes of memory consumed by the model.

Examples

RITM_API.memInfo(ritm, "newmodel_1")
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 — the name of the model in Engee.

Arguments

  • ritm::Any: an object of the target RITM platform. It is set using consecutive commands ritm = Targets.RITM.Ritm() and Targets.RITM.set_url(ritm, "http://192.168.56.3:8000/").

  • file_name::String: the name of the file of interest.

  • path=/mydir::String: the 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/")
RITM_API.removeFile(ritm::Any, path::String)::String

Deletes the file using the specified path on the target RITM platform. Returns the file deletion status from the RITM.

Arguments

  • ritm::Any: an object of the target RITM platform. It is set using consecutive commands ritm = Targets.RITM.Ritm() and Targets.RITM.set_url(ritm, "http://192.168.56.3:8000/").

  • path::String: the path to the file being deleted from the RITM.

Examples

using Main.EngeeDeviceManager.Targets
using Main.EngeeDeviceManager.RITM_API

# Creates the RITM object and sets the address
ritm = Targets.RITM.Ritm()
ritm.set_url("http://192.168.56.3:8000/")

# Deletes the file on RITM
status = RITM_API.removeFile(ritm, "/home/ritm/data/log.txt")
RITM_API.uploadFile(ritm::Any, filename::AbstractString; from::AbstractString=pwd(), to::AbstractString="/home/ritm")::String

Uploads a file from Engee to the target RITM platform.

Arguments

  • ritm::Any: an object of the target RITM platform. It is set using sequential commands ritm = Targets.RITM.Ritm() and Targets.RITM.set_url(ritm, "http://192.168.56.3:8000/").

  • filename::AbstractString: the name of the file uploaded to the server.

  • from::AbstractString = pwd(): the path in Engee to the directory where the downloaded file is located (by default, the current directory).

  • to::AbstractString = "/home/ritm": the path on the RITM where the file will be uploaded (by default — /home/ritm).

Examples

using Main.EngeeDeviceManager.Targets
using Main.EngeeDeviceManager.Targets.RITM.RITM_API

# Creates a RITM object and sets the address
ritm = Targets.RITM.Ritm()
ritm.set_url("http://192.168.56.3:8000 /")

# Downloads the test file.bin from the current Engee directory (pwd()) to /home/ritm on the RITM
res = RITM_API.uploadFile(ritm, "test.bin")

# Downloads a file from the specified Engee directory (/user/...) to the specified directory on the RITM
res = RITM_API.uploadFile(ritm, "install_manifest.txt "; from="/user/project/", to="/home/ritm/data/")