Difference between revisions of "CAEngine/zh"

(Created page with "返回最近一次与ADE服务器通讯产生的错误代码。 ErrorCode属性应该在设置和检索关键 CAEngine属性和CAEngine方...")
 
(42 intermediate revisions by the same user not shown)
Line 2: Line 2:
 
[[Category:ADE User Guide]]
 
[[Category:ADE User Guide]]
 
<languages />
 
<languages />
[[ADE User Guide/zh | ADE 用户指南]] > [[ADE服务器类型参考]] >
+
[[ADE User Guide/zh | ADE 用户指南]] > [[ADE Server Class Reference/zh | ADE服务器类型参考]] >
  
= 分类CAEngine(ADE)=
+
= CAEngine(ADE)类型 =
  
 
= 进程内和进程外实例化 =
 
= 进程内和进程外实例化 =
Line 27: Line 27:
 
=== {get,put} [[CAObject]] [[CAEngine::CurrentModule/zh | CurrentModule]] ===
 
=== {get,put} [[CAObject]] [[CAEngine::CurrentModule/zh | CurrentModule]] ===
  
新建立的对象放在[[CurrentModule/zh | CurrentModule]]中;一次,在建立任何新对象钱,你应该设定[[CurrentModule/zh | CurrentModule]]。设置:<code>[[CurrentModule]] = Nothing</code>表示没有模块打开,所有新对象都在顶层模块或者当前已经打开的模型中建立。
+
新建立的对象放在[[CAEngine::CurrentModule/zh | CurrentModule]]中;因此,在建立任何新对象前,你应该设定[[CAEngine::CurrentModule/zh | CurrentModule]]。设置:<code>[[CAEngine::CurrentModule/zh | CurrentModule]] = Nothing</code>表示没有模块打开,所有新对象都在顶层模块或者当前已经打开的模型中建立。
  
 
=== {get,put} [[CARenderingStyle/zh | CARenderingStyle]] [[CAEngine::DefaultDefTableRenderingStyle/zh | DefaultDefTableRenderingStyle]] ===
 
=== {get,put} [[CARenderingStyle/zh | CARenderingStyle]] [[CAEngine::DefaultDefTableRenderingStyle/zh | DefaultDefTableRenderingStyle]] ===
Line 35: Line 35:
 
=== {get,put} long [[CAEngine::DefaultEvaluationTimeLimit/zh | DefaultEvaluationTimeLimit]] ===
 
=== {get,put} long [[CAEngine::DefaultEvaluationTimeLimit/zh | DefaultEvaluationTimeLimit]] ===
  
对于[[CAEngine/zh | CAEngine]]中的方法,[[CAEngine::SendCommand/zh | SendCommand]],[[CAEngine::Send/zh | Send]],[[CAEngine::OpenModel/zh | OpenModel]]和[[CAEngine::AddModule/zh | AddModule]],以及对于任何实例化的[[CAObject/zh | CAObject]]的[[CAObject::MethodEvaluationTimeLimit/zh | CAObject::MethodEvaluationTimeLimit]]默认值,求值计算都强加了最大时间限制(毫秒)。
+
[[CAEngine/zh | CAEngine]]中的方法,例如[[CAEngine::SendCommand/zh | SendCommand]],[[CAEngine::Send/zh | Send]],[[CAEngine::OpenModel/zh | OpenModel]]和[[CAEngine::AddModule/zh | AddModule]],以及任何被实例化的[[CAObject/zh | CAObject]]的[[CAObject::MethodEvaluationTimeLimit/zh | CAObject::MethodEvaluationTimeLimit]]默认值等等,指定求值计算时的大时间限制(毫秒)。
  
 
=== {get,put} [[CARenderingStyle/zh | CARenderingStyle]] [[CAEngine::DefaultRenderingStyle/zh | DefaultRenderingStyle]] ===
 
=== {get,put} [[CARenderingStyle/zh | CARenderingStyle]] [[CAEngine::DefaultRenderingStyle/zh | DefaultRenderingStyle]] ===
Line 43: Line 43:
 
=== {get} short int [[CAEngine::ErrorCode/zh | ErrorCode]] ===
 
=== {get} short int [[CAEngine::ErrorCode/zh | ErrorCode]] ===
  
返回最近一次与ADE服务器通讯产生的错误代码。[[ErrorCode/zh | ErrorCode]]属性应该在设置和检索关键[[CAEngine/zh | CAEngine]]属性和CAEngine方法后检查。零ErrorCode表示最后的动作是成功的。
+
返回最近一次与ADE服务器通讯产生的错误代码。[[ErrorCode/zh | ErrorCode]]属性应该在设置和检索关键[[CAEngine/zh | CAEngine]]属性和CAEngine方法后检查。零错误代码表示最后的动作是成功的。
  
 
=== {get} string [[CAEngine::ErrorText/zh | ErrorText]] ===
 
=== {get} string [[CAEngine::ErrorText/zh | ErrorText]] ===
  
Short text explanation of error from [[ErrorCode]].
+
来自于[[ErrorCode/zh | ErrorCode]]的短文本错误解释。
  
 
=== {get,put} unsigned long [[CAEngine::Flags/zh | Flags]] ===
 
=== {get,put} unsigned long [[CAEngine::Flags/zh | Flags]] ===
  
A bit field of flags that control certain behaviors within ADE.
+
控制ADE内部某种行为的位域标志。
  
 
=== {get} string [[CAEngine::Log/zh | Log]] ===
 
=== {get} string [[CAEngine::Log/zh | Log]] ===
  
A record of all commands sent to the ADE typescript and the results received from those commands,
+
当Photo属性true时,获取关于发送给ADE typescript的指令和从这些指令检索的结果的记录。
when the Photo property is true.
 
  
 
=== {get} string [[CAEngine::OutputBuffer/zh | OutputBuffer]] ===
 
=== {get} string [[CAEngine::OutputBuffer/zh | OutputBuffer]] ===
  
A text string buffer that contains the result of the last typescript (i.e., using the Command property
+
包含最后的typescript 结果的本文字符串缓冲(例如,使用Command属性和Send方法)与ADE相互作用。
and Send method) interaction with the ADE.
 
  
=== {get,put} bool [[CAEngine::Photo/zh | Photo]] ===
+
=== {get,put} bool [[CAEngine::Photo | Photo]] ===
  
When '''Photo''' is True, ADE records all typescript commands and results into the [[CAEngine::Log|Log]] property.
+
'''Photo'''为True时,ADE将所有typescript指令和结果记录到[[CAEngine::Log/zh | |Log]]属性当中。
  
=方法=
+
= 方法 =
  
 
=== string [[CAEngine::AddModule/zh | AddModule]](string filePath,bool Merge) ===
 
=== string [[CAEngine::AddModule/zh | AddModule]](string filePath,bool Merge) ===
  
Adds a module from file fileName into the CurrentModule. The merge parameter currently has
+
将来自文件fileName的模块添加到CurrentModule中。合并参数当前没有任何作用,应该设置成True。
no effect and should be set to True.
 
  
 
=== bool [[CAEngine::CloseModel/zh | CloseModel]]() ===
 
=== bool [[CAEngine::CloseModel/zh | CloseModel]]() ===
Line 80: Line 77:
 
=== [[CAObject/zh | CAObject]] [[CAEngine::CreateObject/zh | CreateObject]](string objName, string objType) ===
 
=== [[CAObject/zh | CAObject]] [[CAEngine::CreateObject/zh | CreateObject]](string objName, string objType) ===
  
Creates a new Analytica object with identifier objName and class objClass in the CurrentModule
+
在CurrentModule当中建立一个标识符为objName,类型为objClass的新Analytica对象,并作为一个CAObject返回。
and returns it as a CAObject.
 
  
 
=== bool [[CAEngine::CreateModel/zh | CreateModel]](string newModelName) ===
 
=== bool [[CAEngine::CreateModel/zh | CreateModel]](string newModelName) ===
  
Creates a new Analytica model with identifier modelName.
+
建立一个标识符为modelName的新Analytica模型。
  
 
=== bool [[CAEngine::DeleteObject/zh | DeleteObject]]( [[CAObject/zh | CAObject]] aObject ) ===
 
=== bool [[CAEngine::DeleteObject/zh | DeleteObject]]( [[CAObject/zh | CAObject]] aObject ) ===
  
Deletes CAObject obj from the current model.
+
从当前模型中删除CAObject对象。
  
=== [[CAObject/zh | CAObject]] [[CAEngine::Get/zh | Get]](string objName) ===
+
=== [[CAObject/zh | CAObject]] [[CAEngine::GetObjectByName/zh | Get]](string objName) ===
  
与[[CAEngine::GetObjectByName/ | GetObjectByName]]等同
+
与[[CAEngine::GetObjectByName/zh | GetObjectByName]]等同
  
 
=== [[CAObject/zh | CAObject]] [[CAEngine::GetObjectByName/zh | GetObjectByName]](string objName) ===
 
=== [[CAObject/zh | CAObject]] [[CAEngine::GetObjectByName/zh | GetObjectByName]](string objName) ===
  
Returns an object of type [[CAObject]] for an existing Analytica object with identifier objName.
+
返回一个[[CAObject/zh | CAObject]]类型对象给标识符为objName的现有Analytica对象。
  
 
=== bool [[CAEngine::MonitorProcess/zh | MonitorProcess]](long pid) ===
 
=== bool [[CAEngine::MonitorProcess/zh | MonitorProcess]](long pid) ===
  
''(requires ADE 4.3 or greater)'' Instructs ADE to terminate (kill itself) if the indicated process terminates before it.  Useful when debugging code that uses ADE to prevent zombie ADE processes when your code is terminated prematurely without having a chance to correctly release its objects.
+
''(需要ADE 4.3或者以上版本)''如果指示的进程在它ADE之前终止,将指示ADE终止(终止自己)。在调试使用ADE来阻止僵尸ADE进程的代码时,如果你的代码提前终止,而没有机会正确实发其对象时非常有用。
  
 
=== string [[CAEngine::OpenModel/zh | OpenModel]](string filepath) ===
 
=== string [[CAEngine::OpenModel/zh | OpenModel]](string filepath) ===
  
Reads a model from a disk file and opens it as the current model.
+
从磁盘文件读入一个模型,并作为当前模型打开。
  
 
=== bool [[CAEngine::ReadScript/zh | ReadScript]](string filePath) ===
 
=== bool [[CAEngine::ReadScript/zh | ReadScript]](string filePath) ===
  
Reads and executes an Analytica script file.
+
读入并执行一个Analytica脚本文件。
  
 
=== void [[CAEngine::ResetError/zh | ResetError]]() ===
 
=== void [[CAEngine::ResetError/zh | ResetError]]() ===
  
Resets the error code, error text string associated with the error code, and the output buffer to
+
重置与错误代码有关的错误代码、错误文本字符串,并输出缓存给默认值。该函数一般内部使用,单在其他环境可能也非常有用。
default values. This function is normally used internally, but could be useful in other circumstances
 
as well.
 
  
 
=== bool [[CAEngine::SaveModel/zh | SaveModel]](string filePath) ===
 
=== bool [[CAEngine::SaveModel/zh | SaveModel]](string filePath) ===
  
Saves the model to file «filePath».
+
将模型保存到«filePath»文件中。
  
 
=== bool [[CAEngine::SaveModuleFile/zh | SaveModuleFile]](string moduleName, string filePath) ===
 
=== bool [[CAEngine::SaveModuleFile/zh | SaveModuleFile]](string moduleName, string filePath) ===
  
Saves module with identifier «moduleName» into file «filePath».
+
将标识符为«moduleName»的模块保存到«filePath»文件中。
  
=== bool [[CAEngine::Send|Send]]() ===
+
=== bool [[CAEngine::Send/zh | Send]]() ===
  
Sends the string contained in the Command property as a command to be executed by ADE.
+
将包含在Command属性内的字符串作为指令发送给ADE去执行。
See the Analytica Scripting Guide for details of commands and syntax.
+
关于指令和语法的详细信息请参考Analytica脚本指南。
  
 
=== bool [[CAEngine::SendCommand/zh | SendCommand]](string command) ===
 
=== bool [[CAEngine::SendCommand/zh | SendCommand]](string command) ===
  
Sends the string command property as a typescript command to be executed by ADE. See the
+
将字符串指令属性作为typescript 指令ADE去执行。
Analytica Scripting Guide for details of commands and syntax.
+
关于指令和语法的详细信息请参考Analytica脚本指南。
  
 
=== bool [[CAEngine::SetCallbackObject/zh | SetCallbackObject]](IUnknown* pCallbackObj) ===
 
=== bool [[CAEngine::SetCallbackObject/zh | SetCallbackObject]](IUnknown* pCallbackObj) ===
  
''[[Analytica 4.6/zh | ADE 4.6]]新特征''
+
''[[Analytica 4.6 | ADE 4.6]]新特征''
  
You call this to provide an object that implements various callback interfaces, such as [[IAdeUICallbacks]], to enable interaction with end-users while evaluation is in-progress.
+
当求值计算在经常内时,你可以调用该方法以便提供一个执行各种回调接口,例如[[IAdeUICallbacks/zh | IAdeUICallbacks]],的对象来允许和终端用户互动。
  
  
=See Also=
+
= 另请参考 =
 
{| style="margin: 1em auto 1em auto;width: 100%;border:0;table-layout: fixed;" cellpadding=5
 
{| style="margin: 1em auto 1em auto;width: 100%;border:0;table-layout: fixed;" cellpadding=5
 
|- style="text-align: center"
 
|- style="text-align: center"
|  [[ADE Server Class Reference]]  <-  ||  [[CAEngine]] || -> [[CAObject]]
+
|  [[ADE Server Class Reference/zh | ADE服务器类型参考]]  <-  ||  [[CAEngine/zh | CAEngine]] || -> [[CAObject/zh | CAObject]]
 +
|}

Latest revision as of 03:57, 21 October 2015

Other languages:
English • ‎中文

ADE 用户指南 > ADE服务器类型参考 >

CAEngine(ADE)类型

进程内和进程外实例化

建立

ADE的使用从建立CAEngine对象开始,其它一切都从它开始产生。如果你使用ADEW.dll进程内服务器,你只能建立和使用一个CAEngine实例,如果你使用ADE.exe进程外服务器,你想建立多少个CAEngine实例都可以,每一个实例作为一个单一进程允许。在基于网络的应用程序里面,对于每一个用户会话都建立了一个单独的CAEngine实例。每一个CAEngine实例每次都可以载入一个模型。

你可以直接建立一个CAEngine实例,或者通过调用 CALicense::NewCAEngine()。后一方法需要你先建立一个 CALicense实例,其优点就是能够获得关于建立实例失败原因的更多信息。如果ADE使用许可证在指定计算机上无效,或者到期,直接建立CAEngine实例将失败。

Visual Basic.NET

C++

VBScript

属性

{get,put} string Command

Send()方法被调用时,将保持被执行的typescrip指令。

{get,put} CAObject CurrentModule

新建立的对象放在 CurrentModule中;因此,在建立任何新对象前,你应该设定 CurrentModule。设置: CurrentModule = Nothing表示没有模块打开,所有新对象都在顶层模块或者当前已经打开的模型中建立。

{get,put} CARenderingStyle DefaultDefTableRenderingStyle

控制定义表格值如何传入和传出ADE的默认风格类型。所有从 CAObject::DefTable返回的定义表在建立之初都继承这些设置。

{get,put} long DefaultEvaluationTimeLimit

CAEngine中的方法,例如 SendCommand Send OpenModel AddModule,以及任何被实例化的 CAObject CAObject::MethodEvaluationTimeLimit默认值等等,指定求值计算时的大时间限制(毫秒)。

{get,put} CARenderingStyle DefaultRenderingStyle

默认显示风格控制结果值如何从ADE返回。所有 实例在建立的时候都继承该显示风格。

{get} short int ErrorCode

返回最近一次与ADE服务器通讯产生的错误代码。 ErrorCode属性应该在设置和检索关键 CAEngine属性和CAEngine方法后检查。零错误代码表示最后的动作是成功的。

{get} string ErrorText

来自于 ErrorCode的短文本错误解释。

{get,put} unsigned long Flags

控制ADE内部某种行为的位域标志。

{get} string Log

当Photo属性true时,获取关于发送给ADE typescript的指令和从这些指令检索的结果的记录。

{get} string OutputBuffer

包含最后的typescript 结果的本文字符串缓冲(例如,使用Command属性和Send方法)与ADE相互作用。

{get,put} bool Photo

Photo为True时,ADE将所有typescript指令和结果记录到 |Log属性当中。

方法

string AddModule(string filePath,bool Merge)

将来自文件fileName的模块添加到CurrentModule中。合并参数当前没有任何作用,应该设置成True。

bool CloseModel()

关闭模型

CAObject CreateObject(string objName, string objType)

在CurrentModule当中建立一个标识符为objName,类型为objClass的新Analytica对象,并作为一个CAObject返回。

bool CreateModel(string newModelName)

建立一个标识符为modelName的新Analytica模型。

bool DeleteObject( CAObject aObject )

从当前模型中删除CAObject对象。

CAObject Get(string objName)

GetObjectByName等同

CAObject GetObjectByName(string objName)

返回一个 CAObject类型对象给标识符为objName的现有Analytica对象。

bool MonitorProcess(long pid)

(需要ADE 4.3或者以上版本)如果指示的进程在它ADE之前终止,将指示ADE终止(终止自己)。在调试使用ADE来阻止僵尸ADE进程的代码时,如果你的代码提前终止,而没有机会正确实发其对象时非常有用。

string OpenModel(string filepath)

从磁盘文件读入一个模型,并作为当前模型打开。

bool ReadScript(string filePath)

读入并执行一个Analytica脚本文件。

void ResetError()

重置与错误代码有关的错误代码、错误文本字符串,并输出缓存给默认值。该函数一般内部使用,单在其他环境可能也非常有用。

bool SaveModel(string filePath)

将模型保存到«filePath»文件中。

bool SaveModuleFile(string moduleName, string filePath)

将标识符为«moduleName»的模块保存到«filePath»文件中。

bool Send()

将包含在Command属性内的字符串作为指令发送给ADE去执行。 关于指令和语法的详细信息请参考Analytica脚本指南。

bool SendCommand(string command)

将字符串指令属性作为typescript 指令ADE去执行。 关于指令和语法的详细信息请参考Analytica脚本指南。

bool SetCallbackObject(IUnknown* pCallbackObj)

ADE 4.6新特征

当求值计算在经常内时,你可以调用该方法以便提供一个执行各种回调接口,例如 IAdeUICallbacks,的对象来允许和终端用户互动。


另请参考

ADE服务器类型参考 <- CAEngine -> CAObject
Comments


You are not allowed to post comments.