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:
|
#
Main.EngeeDeviceManager.Devices.TFLEXDOCS.Tflexdocs — Type
#
Main.EngeeDeviceManager.Devices.TFLEXDOCS.download_files — Method
TFLEXDOCS.download_files(tdocs, calculation_name)
Unloads the source data for the calculation from the specified calculation object T-FLEX DOCs.
Arguments
-
tdocs::TFLEXDOCS: T-FLEX DOCs object. -
calculation_name::String: name of an existing calculation object in T-FLEX DOCs.
Examples
tdocs = TFLEXDOCS.Tflexdocs()
# We get all the files from the specified calculation object
download_files = TFLEXDOCS.download_files(tdocs, "new_calc")
# Preparing files for saving in 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)
#
Main.EngeeDeviceManager.Devices.TFLEXDOCS.new_calculation — Method
TFLEXDOCS.new_calculation(tdocs, name, denotation)
Creates a new calculation object in T-FLEX DOCs.
Arguments
-
tdocs::TFLEXDOCS: 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")
#
Main.EngeeDeviceManager.Devices.TFLEXDOCS.start_work — Function
TFLEXDOCS.start_work(tdocs, docsPath, exePath)
Creates a session for working with T-FLEX DOCs.
Arguments
-
tdocs::TFLEXDOCS: 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)
#
Main.EngeeDeviceManager.Devices.TFLEXDOCS.stop_work — Method
TFLEXDOCS.stop_work(tdocs)
Ends the session with T-FLEX DOCs.
Arguments
tdocs::TFLEXDOCS: T-FLEX DOCs object.
Examples
tdocs = TFLEXDOCS.Tflexdocs()
TFLEXDOCS.stop_work(tdocs)
#
Main.EngeeDeviceManager.Devices.TFLEXDOCS.upload_files — Method
TFLEXDOCS.upload_files(tdocs, files, calculation_name)
Loads the calculation results to the specified calculation object T-FLEX DOCs.
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 contents of the file in the form of an array of bytes. -
calculation_name::String: name of an existing calculation object in T-FLEX DOCs.
Examples
tdocs = TFLEXDOCS.Tflexdocs()
# We will make the calculation
path = "results.txt"
result = ""
for i in 1:10
exh = i * 100 / i^3
result *= string(exh) * "\n"
end
# Let's write the result of this calculation to a file.
write(path, result)
# We will prepare the data for transmission 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 write down all the paths to the files that need to be sent to DOCs.
files = prepare_files_for_docs([path])
# We will send the files to DOCs
TFLEXDOCS.upload_files(tdocs, files, "new_calc")