T-FLEX文档的软件管理
此页面包含 AnyMath 中T-FLEX DOCs的所有可用软件管理功能。
|
要在 AnyMath 中使用T-FLEX DOCs的软件管理功能,请按照 文章. 之后,执行:
|
#
Main.EngeeDeviceManager.Devices.TFLEXDOCS.Tflexdocs — Type
#
Main.EngeeDeviceManager.Devices.TFLEXDOCS.download_files — Method
TFLEXDOCS.download_files(tdocs, calculation_name)
从指定的T-FLEX DOCs计算对象卸载计算的源数据。
参数
-
tdocs::TFLEXDOCS:T-FLEX DOCs对象。 -
calculation_name::String:T-FLEX文档中现有计算对象的名称。
例子
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)
#
Main.EngeeDeviceManager.Devices.TFLEXDOCS.new_calculation — Method
TFLEXDOCS.new_calculation(tdocs, name, denotation)
在T-FLEX文档中创建一个新的计算对象。
参数
-
tdocs::TFLEXDOCS:T-FLEX DOCs对象。 -
name::String:新计算对象的名称。 -
denotation::String:新计算对象的描述。
例子
tdocs = TFLEXDOCS.Tflexdocs()
TFLEXDOCS.new_calculation(tdocs, "new_calc", "default")
#
Main.EngeeDeviceManager.Devices.TFLEXDOCS.start_work — Function
TFLEXDOCS.start_work(tdocs, docsPath, exePath)
创建用于使用T-FLEX文档的会话。
参数
-
tdocs::TFLEXDOCS:T-FLEX DOCs对象。 -
docsPath::String:已安装的T-FLEX文档中程序目录的路径。 默认情况下:"C:\Program Files (x86)\T-FLEX DOCs %version%\Program". -
exePath::String:在安装了t-FLEX文档的文件夹中TflexDocsEngee目录的exe文件的路径。 默认情况下:"C:\Program Files (x86)\T-FLEX DOCs %version%\Program\TflexDocsEngee\TflexDocsEngee.exe".
例子
using Main.EngeeDeviceManager.Devices.TFLEXDOCS
tdocs = TFLEXDOCS.Tflexdocs()
TFLEXDOCS.start_work(tdocs)
#
Main.EngeeDeviceManager.Devices.TFLEXDOCS.stop_work — Method
TFLEXDOCS.stop_work(tdocs)
结束使用T-FLEX文档的会话。
参数
tdocs::TFLEXDOCS:T-FLEX DOCs对象。
例子
tdocs = TFLEXDOCS.Tflexdocs()
TFLEXDOCS.stop_work(tdocs)
#
Main.EngeeDeviceManager.Devices.TFLEXDOCS.upload_files — Method
TFLEXDOCS.upload_files(tdocs, files, calculation_name)
将计算结果上传到指定的T-FLEX DOCs计算对象。
参数
-
tdocs::TFLEXDOCS:T-FLEX DOCs对象。 -
files::Dict{String, Vector{UInt8}}:一个字典,其中键是文件名,值是文件的内容,作为字节数组。 -
calculation_name::String:T-FLEX文档中现有计算对象的名称。
例子
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")