Engee documentation

Software management of T-FLEX DOCs

This page contains all the available software management functions of T-FLEX DOCs in Engee.

To work with the software management functions of T-FLEX DOCs in Engee, install the hardware support package as specified in article. After that, perform:

using Main.EngeeDeviceManager.Devices.TFLEXDOCS
TFLEXDOCS.download_files(tdocs, calculation_name)

Unloads the source data for the calculation from the specified T-FLEX DOCs calculation object.

Arguments

  • tdocs::TFLEXDOCS: the T-FLEX DOCs object.

  • calculation_name::String: the name of the existing calculation object in T-FLEX DOCs.

Examples

tdocs = TFLEXDOCS.Tflexdocs()

# Получаем все файлы из указанного объекта расчета
download_files = TFLEXDOCS.download_files(tdocs, "new_calc")

# Подготавливаем файлы для сохранения в Engee
function prepare_files_for_engee(calc_files::Dict{String, Vector{UInt8}})
    for (key, value) in calc_files
        write(key, value)
    end
end

prepare_files_for_engee(download_files)
TFLEXDOCS.new_calculation(tdocs, name, denotation)

Creates a new calculation object in T-FLEX DOCs.

Arguments

  • tdocs::TFLEXDOCS: the T-FLEX DOCs object.

  • name::String: name of the new calculation object.

  • denotation::String: description of the new calculation object.

Examples

tdocs = TFLEXDOCS.Tflexdocs()
TFLEXDOCS.new_calculation(tdocs, "new_calc", "default")
TFLEXDOCS.start_work(tdocs, docsPath, exePath)

Creates a session for working with T-FLEX DOCs.

Arguments

  • tdocs::TFLEXDOCS: the T-FLEX DOCs object.

  • docsPath::String: the path to the Program directory in the installed T-FLEX DOCs. By default: "C:\Program Files (x86)\T-FLEX DOCs %version%\Program".

  • exePath::String: the path to the exe file of the TflexDocsEngee directory in the folder with the installed T-FLEX DOCs. By default: "C:\Program Files (x86)\T-FLEX DOCs %version%\Program\TflexDocsEngee\TflexDocsEngee.exe".

Examples

using Main.EngeeDeviceManager.Devices.TFLEXDOCS
tdocs = TFLEXDOCS.Tflexdocs()
TFLEXDOCS.start_work(tdocs)
TFLEXDOCS.stop_work(tdocs)

Ends the session of working with T-FLEX DOCs.

Arguments

tdocs::TFLEXDOCS: the T-FLEX DOCs object.

Examples

tdocs = TFLEXDOCS.Tflexdocs()
TFLEXDOCS.stop_work(tdocs)
TFLEXDOCS.upload_files(tdocs, files, calculation_name)

Uploads the calculation results to the specified T-FLEX DOCs calculation object.

Arguments

  • tdocs::TFLEXDOCS: the T-FLEX DOCs object.

  • files::Dict{String, Vector{UInt8}}: a dictionary where the key is the file name and the value is the contents of the file as an array of bytes.

  • calculation_name::String: the name of the existing calculation object in T-FLEX DOCs.

Examples

tdocs = TFLEXDOCS.Tflexdocs()

# Произведем расчет
path = "results.txt"
result = ""
for i in 1:10
    exh = i * 100 / i^3
    result *= string(exh) * "\n"
end

# Запишем результат этого расчета в файл
write(path, result)

# Подготовим данные для передачи в DOCs
function prepare_files_for_docs(paths::Vector{String})
    files::Dict{String, Vector{UInt8}} = Dict()
    for path in paths
        content = read(path)
        base = basename(path)
        files[base] = content
    end
    return files
end

# Запишем все пути к файлам, которые нужно отправить в DOCs
files = prepare_files_for_docs([path])

# Отправим файлы в DOCs
TFLEXDOCS.upload_files(tdocs, files, "new_calc")