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)

Exports the input data for the calculation from the specified T-FLEX DOCs calculation object.

Arguments

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

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

Examples

tdocs = TFLEXDOCS.Tflexdocs()

# We retrieve all the files from the specified calculation object
download_files = TFLEXDOCS.download_files(tdocs, "new_calc")

# We prepare the files for saving to 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 : a T-FLEX DOCs object.

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

  • denotation::String : a 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: path to the exe file in the TflexDocsEngee directory within the folder where T-FLEX DOCs is installed. 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 T-FLEX DOCs session.

Arguments

tdocs::TFLEXDOCS: T-FLEX DOCs object.

Examples

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

Loads the calculation results into the specified T-FLEX DOCs calculation object.

Arguments

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

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

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

Examples

tdocs = TFLEXDOCS.Tflexdocs()

# Let’s perform the calculation
path = "results.txt"
result = ""
for i in 1:10
    exh = i * 100 / i^3
    result *= string(exh) * "\n"
end

# Let’s save the result of this calculation to a file
write(path, result)

# Let’s prepare the data for submission to 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

# Let’s record all the file paths that need to be sent to DOCs
files = prepare_files_for_docs([path])

# Let’s send the files to DOCs
TFLEXDOCS.upload_files(tdocs, files, "new_calc")