Engee documentation

Public methods of programme management

All public methods of the engee programme control are presented here. For engee.script methods, please refer to the article Software script management.

engee methods

engee.add_block(block_identity::String, tgt_block_path::String; sync_gui::Bool=false)

Adds a block from the library.

Arguments

  • lib_block_path::String: full path to the block in the library. The path starts with /.

  • tgt_block_path::String: path to system and expected name . example: path/to/system/new block name . If no name is specified, it is set automatically.

  • syng_gui::Bool=false: named parameter for synchronisation with the GUI.

Examples

engee.add_block("/Basic/Math Operations/Add", "newmodel_1/")

You can also add a block from the library to the system and name it immediately.

engee.add_block("/Basic/Math Operations/Complex to Real-Imag", "newmodel_1/Test_name")
engee.add_line(src_port::String, dst_port::String) = engee.add_line(engee.gcs(), src_port::String, dst_port::String)
engee.add_line(system::String|System, src_port::String, dst_port::String)
engee.add_line(system_id::UUID, src_port::String, dst_port::String)

Adds a link (data flow) between blocks.

Arguments

  • system::System: the path to the system or an object of type System.

  • src_port::String: full path to out (output) port of the block. The serial number of the port is used as the port name. The format of the entry is "system_name/block_name/idx". For physical blocks, the programme name of the port is used, e.g. Resistor/ac_1.

  • tgt_port::String: full path to in (input) port of the block. The name and format of the entry is similar to the input port.

  • syng_gui::Bool=false: named parameter for synchronisation with the GUI.

Examples

# соединить первый входной порт блока `Sine Wave` и первый выходной порт блока `Terminator` в текущей модели
engee.add_line("Sine Wave/1", "Terminator/1")
# первый параметр может быть объектом `System`
system = engee.gcs()
# вызов эквивалентен предыдущему
engee.add_line(system, "Sine Wave-1/1", "Terminator-1/1")
# для физических блоков
engee.add_line("Resistor/ac_1", "Current Sensor/ac_1")
engee.addpath(path::Vararg{String})

Adds one or more paths to the system variable LOAD_PATH. LOAD_PATH - is a system variable that Engee uses to find the desired executable objects (e.g. .engee, .ngscript), as well as any other paths used in commands.

Arguments

path::Vararg{String}: one or more paths on the file system.

Examples

engee.addpath("/user/models")
engee.load("model.engee") #загрузка модели
engee.clear()

Clears all variables in the current workspace. clear() removes all data stored in variables to free up memory for new calculations and data streams. Returns nothing.

engee.clear_all()

Clears all variables, functions, and defined modules from the current workspace. clear_all() returns the current workspace to its original state. Returns nothing.

engee.close(model_name::String; force::Bool = false)
engee.close(model::Model; force::Bool = false)
engee.close(; force::Bool = false)

Closes the model named model_name. The model opened in the visual editor tab to the left becomes the current model. If no model is specified, closes the current model. If the current model is not specified, it does nothing. If the model does not already exist, it does nothing.

Arguments

  • model_name::String: the name of the model to be closed.

  • model::Model: workspace model, which can be loaded into memory using the function engee.gcm. This model can be active in the workspace, but not necessarily open in the GUI.

  • force::Bool: default = false. If there are unsaved changes and the parameter force = false, it terminates with an error. If force = true, the unsaved changes will be lost.

Examples

# Выгрузить из памяти модель `newmodel_1`
engee.close( "newmodel_1" )
# Выгрузить из памяти модель `newmodel_1` без сохранения последних изменений
engee.close( "newmodel_1", force=true )
# Закрыть модель `newmodel_1` (выгрузить и убрать с холста)
engee.close( "newmodel_1", force=true, sync_gui=true )
engee.close_all()
engee.close_all(; sync_gui=true)

Closes all models.

Examples

# Выгрузить из памяти все открытые модели
engee.close_all()
# Закрыть все модели (выгрузить из памяти и закрыть на холсте)
engee.close_all( sync_gui=true )
engee.compare_models(model_path_1::String, model_path_2::String; subsystem_id_a=UUID_YOU_SUBSYSTEM_IN_MODEL_m)

Compares a pair of models and returns a list of differences.

Arguments

  • model_path_1::String: path to the first model to compare.

  • model_path_2::String: the path to the second model to compare with the first.

  • subsystem_id_a: (optional) subsystem identifier, which is used to compare only a specific part of the model (in the subsystem). The specific UUID is used for the call. This parameter can be useful if a comparison of a specific subsystem within a model is required.

Examples

m1 = "/user/modelname_1.engee"  # абсолютный путь (с указанием полного пути до файла)
m2 = "modelname_2.engee"  # относительный путь (лежит в папке рядом с test1.engee)
engee.compare_models(m1, m2)  # вернет результат сравнения m1 и m2.
engee.convert_model(model_path::String,[out_path::String])

Generates an engee script to build the current model using program control commands.

Arguments

  • model_path::String: path to the model to be converted.

  • out_path::String: (optional) path to save the generated engee script. If this argument is not specified, the script can be saved in the default folder (/user).

Examples

m_path = "/user/modelname_1.engee"  # работа с абсолютным путем
engee.convert_model(m_path)  # выведет engee-скрипт

m_abs_path = "modelname_2.engee"  # работа с относительным путем
engee.convert_model(m_abs_path)
engee.copy_block(src_block_path::String, tgt_block_path::String)

Copies a block from the system.

Arguments

  • src_block_path::String: full path to the block in the system.

  • tgt_block_path::String: the path to the system and the expected name. The format of the entry is path/to/system/new_block_name. If no name is specified, it is set automatically.

Examples

# добавить блок из модели `newmodel_1` и присвоить ему имя в модели `newmodel_2` автоматически
engee.copy_block("newmodel_1/Add-3", "newmodel_2/")
# добавить блок из модели `newmodel_1` с именем "Test_name" в модель `nemodel_2`
engee.copy_block("newmodel_1/Custom Block Name", "newmodel_2/Test_name")
engee.copy_contents(src_system_path::String, tgt_system_path::String)
engee.copy_contents(src_system_id::UUID, tgt_system_id::UUID)

Copies the contents of one system to another. The target system must be empty. Recursive copying is not allowed.

Arguments

  • src_system_path::String: path to the system from which to copy.

  • tgt_system_path::String: path to the system being copied to.

  • src_system_id::UUID: ID of the system being copied from.

  • src_system_id::UUID: ID of the system being copied from.

Examples

# копирование содержимого из root системы `newmodel_1` в root систему `newmodel_2`
engee.copy_contents("newmodel_1", "newmodel_2")
# копирование содержимого из системы "newmodel_1/Subsystem" в систему `newmodel_1/Subsystem-1`
engee.copy_contents("newmodel_1/Subsystem", "newmodel_1/Subsystem-1")
ERROR: "newmodel_1/Subsystem-1 must be empty. Use `engee.delete_contents`"
engee.delete_contents("newmodel_1/Subsystem-1")
engee.copy_contents("newmodel_1/Subsystem", "newmodel_1/Subsystem-1")
engee.create(model_name::String; sync_gui=false)::Model

Creates a new model named model_name with default parameters. Returns Model. The model becomes the current model. Its root system becomes the current system. If a model with this name already exists, it terminates with the error EngeeException.

Arguments

  • model_name::String: desired name of the model on the system. The model name must not contain the character /.

  • sync_gui: default =false. If you specify sync_gui=true, the newly created model is displayed on the screen.

Examples

engee.create("NewModel")
Model(
        name: NewModel
        id: 6b59d80d-8b48-419d-83e7-a90660aa1a6a
)
engee.delete_block(block_path::String; sync_gui::Bool=false)

Removes the block, all associated lines, and writable ports from the system.

Arguments

  • block_path::String: path to block.

  • syng_gui::Bool=false: named parameter to synchronise with the GUI.

Examples

engee.delete_block("newmodel_1/Sine Wave") # удалить блок Sine Wave и все связанные с ним линии и блоки из системы
engee.delete_contents(system_path::String)
engee.delete_contents(system_id::UUID)

Deletes the contents of the system.

Arguments

  • system_path::String: path to the system whose content will be deleted.

  • system_id::UUID: ID of the system whose content will be deleted.

Examples

# Удаление всех блоков из подсистемы Subsystem-1 в модели newmodel_1
engee.delete_contents("newmodel_1/Subsystem-1")
engee.delete_line(src_port::String, dst_port::String; sync_gui::Bool=false) = delete_line(gcs(), src_port::String, dst_port::String; sync_gui::Bool=false)
engee.delete_line(system::System, src_port::String, dst_port::String; sync_gui::Bool=false)

Removes the link (data flow) between blocks.

Arguments

  • system::String||System: the path to the system or an object of type System.

  • src_port::String: full path to out (output) port of the block. The serial number of the port is used as the port name. The format of the entry is "system_name/block_name/idx".

  • tgt_port::String: full path to in (input) of the block port. Name and entry format similar to out port.

  • syng_gui::Bool=false: named parameter for synchronisation with the GUI.

Examples

# удалить соединение между первым входным портом блока `Sine Wave` и первым выходным портом блока `Terminator` в модели `newmodel_1`
engee.delete_line("newmodel_1", "Sine Wave/1", "Terminator/1")
system = engee.gcs()
engee.delete_line(system, "Sine Wave-1/1", "Terminator-1/1")
# без указания системы. По умолчанию вызывается применительно к текущей системе.
engee.delete_line("Sine Wave-2/1", "Terminator-2/1")
engee.find_system(; blocktype::Maybe{String}=nothing, depth::Maybe{Int}=nothing, blockparams::Vector{<:Pair{<:AbstractString,<:Any}}=Vector{Pair{String, Any}}())

Searches for entities (models/systems/blocks) in all available models. Returns paths to the found entities.

Arguments

  • blocktype: Type of block to search for. Only blocks with the specified type will be returned.

  • depth: Maximum search depth (inclusive). For an unconstrained search, nothing must be passed. The enumeration starts with 0. The default is nothing.

  • blockparams: Only blocks with the specified parameters will be returned.

Examples

# Список всех сущностей
engee.find_system(;)
# Список сущностей моделей, не заходя в подсистемы
engee.find_system(; depth=0 )
# Список всех блоков типа `Sin`
engee.find_system(; blocktype="Sin")
# Список всех блоков с полем `Value` равным `1.0`
engee.find_system(; blockparams=["Value"=>1.0])

engee.find_system(path::String; blocktype::Maybe{String}=nothing, depth::Maybe{Int}=nothing, blockparams::Vector{<:Pair{<:AbstractString,<:Any}}=Vector{Pair{String, Any}}())

Searches for entities (models/systems/blocks) along the specified path. Returns the paths to the found entities.

Arguments:

  • path: Path to the entity to be searched for

  • blocktype: Type of block to search for. Only blocks with the specified type will be returned.

  • depth: Maximum search depth (inclusive). For an unconstrained search, nothing must be passed. The enumeration starts with 0. The default is nothing.

  • blockparams: Only blocks with the specified parameters will be returned.

Examples

# Список сущностей, из которых состоит модель с именем `newmodel_1` (подсистем, блоков)
engee.find_system( "newmodel_1" )
# Список сущностей модели `newmodel_1` не заходя в подсистемы
engee.find_system( "newmodel_1"; depth=0 )
# Список всех блоков типа `Sin` в модели `newmodel_1`
engee.find_system( "newmodel_1";  blocktype="Sin")
# Список всех блоков с полем `Value` равным `1.0` в модели `newmodel_1`
engee.find_system( "newmodel_1"; blockparams=["Value"=>1.0] )

engee.find_system(system::System; blocktype::Maybe{String}=nothing, depth::Maybe{Int}=nothing, blockparams::Vector{<:Pair{<:AbstractString,<:Any}}=Vector{Pair{String, Any}}())

Searches for entities (models/systems/blocks) in the specified system passed as an object of type System. Returns paths to the found entities.

Arguments:

  • system: The system to be searched

  • blocktype: The type of block to be searched. Only blocks with the specified type will be returned.

  • depth: Maximum search depth (inclusive). For an unconstrained search, nothing must be passed. The enumeration starts with 0. The default is nothing.

  • blockparams: Only blocks with the specified parameters will be returned.

Examples

# Список сущностей, из которых состоит cистема system (подсистем, блоков)
engee.find_system(system)
# Список сущностей системы system не заходя в подсистемы
engee.find_system(system; depth=0 )
# Список всех блоков типа `Sin` в системе system
engee.find_system(system;  blocktype="Sin")
# Список всех блоков с полем `Value` равным `1.0` в системе system
engee.find_system(system; blockparams=["Value"=>1.0] )

engee.find_system(model::Model; blocktype::Maybe{String}=nothing, depth::Maybe{Int}=nothing, blockparams::Vector{<:Pair{<:AbstractString,<:Any}}=Vector{Pair{String, Any}}())

Searches for entities (models/systems/blocks) in the specified model passed as an object of type Model. Returns paths to the found entities.

Arguments:

  • model: The model to be searched

  • blocktype: The type of block to be searched. Only blocks with the specified type will be returned.

  • depth: Maximum search depth (inclusive). For an unconstrained search, nothing must be passed. The enumeration starts with 0. The default is nothing.

  • blockparams: Only blocks with the specified parameters will be returned.

Examples

# Список сущностей, из которых состоит модель model (подсистем, блоков)
engee.find_system(model)
# Список сущностей модель model не заходя в подсистемы
engee.find_system(model; depth=0 )
# Список всех блоков типа `Sin` в модели model
engee.find_system(model;  blocktype="Sin")
# Список всех блоков с полем `Value` равным `1.0` в модели model
engee.find_system(model; blockparams=["Value"=>1.0] )
engee.get_current_block()::String
engee.gcb()::String

Returns the path to the current (selected) block. If no block is selected, returns nothing.

engee.get_current_model()::Model
engee.gcm()::Model

Returns the current (active) model (returns an object with type Model). If there is no current model, throws an exception EngeeException.

Examples

engee.get_current_model()
Model(
        name: ssc_bridge_rectifier_modified
        id: c390ed60-d2c4-4e17-85df-07129aca8ba4
)
engee.get_current_system()::System
engee.gcs()::System

Returns the current system as an object of type System. If the current model does not exist, it raises an error EngeeException.

Examples

engee.get_current_system()
System(
        name: root
        id: 4db18dce-1bca-46ca-8441-6f4802a78c6f
)
engee.generate_code(path/to/modelname.engee::String, path/to/output_dir::String; subsystem_name=subsystem_path::String, subsystem_id=subsystem_id::String, target::String, jl_path::String)

Generates code in the specified language for a model or subsystem.

Arguments

  • path/to/modelname.engee::String: absolute or relative path to the model from which the code is generated. The argument can be a model object (an object of type model obtained by the function engee.gcm).

  • path/to/output_dir::String: absolute or relative path to the directory where the generated code will be saved. If the directory output_dir does not exist, it will be created automatically.

  • subsystem_name=path/to/subsystem::String: the full path to the atomic subsystem from which the code is generated.

  • subsystem_id=subsystem_id::String: unique identifier of the atomic subsystem from which the code is generated.

  • target::String: specification of the language for code generation. Supported languages are Си (default) or Verilog.

  • jl_path::String: absolute or relative path to the .jl file containing the template for code generation.

Examples

engee.generate_code("/user/newmodel_1.engee", "/user/newmodel_1/Subsystem") # генерация кода для подсистемы

engee.generate_code("/user/newmodel_1.engee", "/user/newmodel_1/codegen_output") # генерация через абсолютный путь к модели

engee.generate_code("newmodel_1.engee", "newmodel_1/codegen_output") # генерация через относительный путь к модели

m = engee.gcm()  # получение текущей открытой модели
engee.generate_code(m, "/user/newmodel_1/codegen_output")
engee.get_all_models(; sorted=true)::Vector{Model}

Returns a list of all models open in the current session, in the format Vector{Model}. If the parameter is sorted=true, it returns a list of models sorted by name.

Arguments

sorted::Bool: default true. Determines whether the list of models is sorted by name.

Examples

# Список с перечнем всех открытых моделей
models_list = engee.get_all_models()
# Список с названиями всех открытых моделей
model_names = [m.name for m in engee.get_all_models()]
engee.get_current_block()::String
engee.gcb()::String

Returns the path to the current (selected) block. If no block is selected, returns nothing.

engee.get_current_model()::Model
engee.gcm()::Model

Returns the current (active) model (returns an object with type Model). If there is no current model, throws an exception EngeeException.

Examples

engee.get_current_model()
Model(
        name: ssc_bridge_rectifier_modified
        id: c390ed60-d2c4-4e17-85df-07129aca8ba4
)
engee.get_current_system()::System
engee.gcs()::System

Returns the current system as an object of type System. If the current model does not exist, it raises an error EngeeException.

Examples

engee.get_current_system()
System(
        name: root
        id: 4db18dce-1bca-46ca-8441-6f4802a78c6f
)
engee.get_logs([m::Model])

Gets the log messages associated with the model. Returns an array with the messages.

Arguments

m::Model: the model with respect to which the operation is performed, defaults to the current model. If the model is not open, outputs an error NoModelOpenedException.

    engee.get_param(model::Model)
    engee.get_param(path::String, param::Union{Symbol, String})::Any
    engee.get_param(path::String, param::Union{Symbol, String})::Any
    engee.get_param(block::Block)
    engee.get_param(block::Block, param::Union{Symbol, String})::Any

For models

  • If a model name is specified but no parameter name is specified, returns the simulation settings for the selected model as a dictionary.

  • If a parameter name is specified, it returns the parameter value.

Arguments

  • model::Model: the model object from which the parameters are extracted.

  • path::String: string path to the model, if a path is used instead of the model object.

  • param::Union{Symbol, String}: the name of the parameter to be extracted. Can be a string or a character.

For blocks.

  • On the path to the block, returns either the value of the parameter (if specified) or a dictionary of parameters.

  • If a parameter name is specified, returns the parameter value.

Arguments

  • block::Block: the block object for which to retrieve parameters.

  • path::String: the string path to the block, if the path is used instead of the block object.

  • param::Union{Symbol, String}: the name of the block parameter to be extracted. Can be a string or a character.

engee.get_results(model_name::String)
engee.get_results(model::Model)
engee.get_results()

Returns the results of the last simulation of the model as a dictionary Dict{String, DataFrame}, where key is the name of the port being monitored. If the model is not open, it displays the error NoModelOpenedException. If the simulation is not running, it displays the error ModelIsNotRunningException.

Arguments

m::Model: the model against which the operation is performed, by default, the current model.

Examples

m = engee.load("start/examples/powersystems/models/power_line_apv.engee")
results1 = engee.run(m);
results2 = engee.get_results(m)
Dict{String, DataFrame} with 6 entries:
  "Va" => 40001×2 DataFrame…
  "Ia" => 40001×2 DataFrame…
  "Ib" => 40001×2 DataFrame…
  "Ic" => 40001×2 DataFrame…
  "Vc" => 40001×2 DataFrame…
  "Vb" => 40001×2 DataFrame…
results1 == results2
true
engee.get_status()::SimulationStatus

Returns the simulation status as an object of type SimulationStatus. Returns one of five simulation statuses of the model:

  • BUILDING: model under construction.

  • READY: model is ready.

  • NOT_READY: model not ready.

  • RUNNING: model in progress.

  • PAUSED: the model is on hold.

Examples

engee.get_status()
READY
engee.is_dirty(model::Model)::Bool
engee.is_dirty(model_path::String)

Checks if there are any unsaved changes to the model. Returns true if there are unsaved changes, otherwise returns false. If the model is already closed, returns false.

engee.load(file_path::String; name::Maybe{String}=nothing, force::Bool = false)::Model

Loads a model from a file with extension .engee, located at file_path. Returns Model. The model becomes the current model. Its root system becomes the current system. Features:

  • If a model with this name already exists and the parameter force = true, then reloads it and any changes not previously saved will be lost, if force = false, then throws an exception. The default is force = false.

  • The model can be loaded with a different name if it is specified in the parameter name. If the parameter is not specified, leaves the model name stored in the file.

  • If the file has a different extension or does not exist, throws an exception.

  • If you specify the parameter sync_gui=true, the loaded model is displayed on the screen.

Arguments

  • file_path::String: path to the file from which the model or data will be loaded.

  • name::Maybe{String}: used to specify the name of the model or data to be loaded.

  • force::Bool: the default is = false. If = true is set, the download will be performed if the file has already been previously downloaded.

Examples

engee.load("NewModel.engee"; force = true)
Model(
        name: NewModel
        id: 6b59d80d-8b48-419d-83e7-a90660aa1a6a
)
engee.open(path::String)::System
engee.open(model::Model)::System
engee.open(system::System)::System

Returns an open system System. If the model or system does not exist, it terminates with an error EngeeException. The behaviour of the method changes if:

  • The parameter specifies the name model_name of a previously opened model; it becomes the current model. Its root system becomes the current system;

  • The parameter specifies the path to an existing system system_path, its containing model becomes the current model, and the system itself becomes the current system that is displayed in the visual editor. Returns System. You can also pass directly an instance of Model or System instead of the path.

Arguments

  • path::String: path to model.

  • model::Model: the model with respect to which the operation is performed. The default is the current model.

  • system::System: system path or an object of type System.

Examples

# open model:
s1 = engee.open("NewModel")
System(root)
engee.gcm(), engee.gcs()
(Model(
        name: NewModel
        id: 6b59d80d-8b48-419d-83e7-a90660aa1a6a
)
, System(
        name: root
        id: 69f5da6f-250d-4fa7-a25f-645bac751aea
)
)
# open system:
engee.open("AnotherModel/Subsystem-1")
System(
        name: root
        id: 69f5da6f-250d-4fa7-a25f-645bac751aea
)
engee.gcm(), engee.gcs()
(Model(
        name: AnotherModel
        id: 6b59d80d-8b48-419d-83e7-a90660aa1a6a
)
, System(
        name: Subsystem-1
        id: 69f5da6f-250d-4fa7-a25f-645bac751aea
)
)
engee.pause()

Suspends the running simulation.

engee.reset()

Restarts the simulation kernel.

engee.resume(; verbose::Bool = false)

Resumes a suspended simulation.

Arguments

verbose::Bool = false: enables the output of simulation progress messages.

engee.rmpath(path::String)

Removes the path from the system variable LOAD_PATH. LOAD_PATH - is a system variable that Engee uses to find the desired executable objects (e.g., .engee, .ngscript), as well as any other paths used in commands.

Arguments

path::String: file system path to be removed from LOAD_PATH.

Examples

engee.addpath("/user/models")
engee.load("model.engee") # загрузка модели
engee.rmpath("/user/models")
engee.load("model.engee") #загрузка модели выдаст ошибку
engee.run([m::Model]; verbose=false)

Starts the execution of the model. If no model is specified, runs a simulation of the current model. If no model is open, throws an exception NoModelOpenedException.

Arguments

  • verbose: specifies whether the progress of the model execution should be printed (the default is = false - not printed).

  • m::Model: the model relative to which the operation is executed. The default is the current model.

Examples

m = engee.load("/user/start/examples/power_systems/power_line_apv/power_line_apv.engee")
engee.run(m)
Dict{String, DataFrame} with 6 entries:
  "Va" => 40001×2 DataFrame…
  "Ia" => 40001×2 DataFrame…
  "Ib" => 40001×2 DataFrame…
  "Ic" => 40001×2 DataFrame…
  "Vc" => 40001×2 DataFrame…
  "Vb" => 40001×2 DataFrame…

# Пример асинхронного, бесконечного моделирования
m = engee.load("/user/start/examples/controls/PID_controller/pid_controls_tf_stable.engee")
engee.set_param!(m, "end_time" => Inf)
ch = Channel(c -> put!(c, engee.run(m)))
sleep(10)
engee.stop()
take!(ch)
engee.save(model_name::String, file_path::String; force::Bool = false)
engee.save(model::Model, file_path::String; force::Bool = false)

Saves the model named model_name at path file_path to a file with extension .engee. Intermediate directories are created if necessary. Returns nothing.

Arguments

  • model::Model: object of type Model.

  • model_name::String: the desired name of the model in the system.

  • file_path::String: the directory of the model to be saved.

  • force::Bool: default = false. If the file already exists and the parameter force = true, overwrites the file. If force = false, it fails with the error FileAlreadyExists.

Examples

# Сохранить модель `newmodel_1` в новый файл `newmodel_1.engee`
engee.save( "newmodel_1", "newmodel_1.engee" )
# Сохранить модель `newmodel_1` в файл `newmodel_1.engee` (перезаписать файл)
engee.save( "newmodel_1", "newmodel_1.engee", force = true)
engee.screenshot(to_print::Union{Model, String, System}, save_path::String; position_mode::String="auto")

Saves screenshot of model/system to file at path save_path. Supported formats: PNG, SVG. In other cases an error is displayed ErrorException("unsuported picture format: <FORMAT>"). Positioning: "auto", "tiled", in other cases "auto" applies.

Arguments

  • to_print::Union{Model, String, System}: name of the model from which the screenshot will be taken.

  • save_path::String: path to save the screenshot.

  • position_mode::String: positioning of the screenshot.

Examples

engee.screenshot(loaded_model, "/user/saved.png"[; position_mode="tiled"])
engee.set_log(system_path::String, port_path::String; sync_gui=false)
engee.set_log(system::System, port_path::String; sync_gui=false)
engee.set_log(port_path::String; sync_gui=false)

Sets the port to write. To display in the GUI, you must pass the named parameter sync_gui=true.

Arguments

  • system_path::String: system where the port is located.

  • system::System: system where the port is located.

  • port_path::String: the relative path to the port. If no system is provided as the first parameter, the default open system is used.

Examples

engee.set_log("Sine Wave/1"; sync_gui=true)
# порт блока Sine Wave в текущей системе установлен на запись
engee.set_log("newmodel_1/Subsystem","Sine Wave/1")
# порт блока Sine Wave в системе `newmodel_1/Subsystem` установлен на запись
system = engee.gcs()
engee.set_log(system, "Sine Wave/1")
# порт блока Sine Wave в системе `system` установлен на запись
engee.run()
Dict{String, DataFrames.DataFrame} with 1 entry:
  "Sine Wave.1" => 1001×2 DataFrame…

# запустили симуляцию и получили результаты
engee.set_param!(model::Model | model_name::String, param::Pair...)

Updates the parameters of the models. Returns nothing. If the parameters are incorrect, an error occurs.

Arguments

  • model::Model: the model object for which the parameters are set.

  • model_name::String: string path or model name.

  • param::Pair...: one or more parameters in the format "name" => value.

Examples

engee.set_param!("model_1", "solver"=>"ode45", "stop_time"=>10)
param_1 = engee.get_param("model_1")
engee.set_param!("model_2", param_1)

The structure of simulation settings is tied to a specific model - you can change the model settings directly through specifying structure fields, then:

params = engee.get_param(model::Model)
# структура params привязана к конкретной model
params.step_time = 0.01
0.01
# аналогично `engee.set_param!(model::Model, "step_time" => 0.01)`

Each parameter must be represented as a Pair consisting of the parameter name and its value (e.g. "StartTime" => 0.0). For the parameter param:

Simulation Parameters

  • start_time::String: simulation start time (Float64).

  • end_time::String: simulation end time (Float64).

  • type::String: solver type (fixed-step or variable-step).

  • name::String: solver name (depends on the type selected).

Parameters for fixed-step

fixed_stepsize::String: simulation step (Float64).

Parameters for variable-step

  • absolute_tolerance::String: Absolute precision (Float64 or 'auto').

  • initial_stepsize::String: Initial step (Float64 or 'auto').

  • maximum_stepsize::String: Maximum step (Float64 or 'auto').

  • minimum_stepsize::String: Minimum step (Float64 or 'auto'). : Minimum step (Float64 or 'auto').

  • output_interval::String: Output interval (Float64 or 'auto').

  • relative_tolerance::String: Relative precision (Float64 or 'auto'). : Relative accuracy (Float64 or 'auto').

  • dense_output::Bool: Dense output of the results.


engee.set_param!(block::Block | block_path::String, params::Pair{String}...)

Updates the parameters of the blocks.

Arguments

  • block::Block: block object.

  • block_path::String: string path to the block.

  • params::Pair{String}...: block parameters in the format "name" => value.

Examples

engee.set_param!("model_name", "StartTime" => 0.0, "StopTime" => 10.0, "SolverType" => "fixed-step", "SolverName" => "ode45")
engee.stop()

Stops the running simulation.

engee.unset_log(system_path::String, port_path::String)
engee.unset_log(system::System, port_path::String)
engee.unset_log(port_path::String)

Removes the port from writing. The named parameter sync_gui=true must be passed to display in the GUI .

Arguments

  • system_path::String: the system the port is on.

  • system::System: system where the port is located.

  • port_path::String: the relative path to the port. If no system is provided as the first parameter, the default open system is used.

Examples

engee.set_log("Sine Wave/1")
# порт блока Sine Wave в текущей системе установлен на запись
engee.run()
Dict{String, DataFrames.DataFrame} with 1 entry:
  "Sine Wave.1" => 1001×2 DataFrame…
# запустили симуляцию и получили результаты
engee.unset_log("Sine Wave/1")
# порт блока Sine Wave в текущей системе снят с записи
engee.run()
Dict{String, DataFrames.DataFrame}()

# Порт снят с записи.
engee.update_params()
engee.update_params(model::Model)
engee.update_params(model_name::String)
For a running simulation, recalculates on the fly block parameters using variables from workspace.
If there is no running simulation it does nothing.
Can take as an optional argument the name or object of the model to which the parameter update/recalculation is applied.
engee.version()

Returns the short version of Engee.

Examples

engee.version()
"24.10.0"