Difference between revisions of "CAEngine/zh"
(Created page with " CAEngine中的方法,也就是 SendCommand, Send, OpenModel, and CAEng...") |
|||
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]], and [[CAEngine::AddModule/zh | AddModule]],求值计算都强加了最大时间限制(毫秒) | |
=== {get,put} [[CARenderingStyle/zh | CARenderingStyle]] [[CAEngine::DefaultRenderingStyle/zh | DefaultRenderingStyle]] === | === {get,put} [[CARenderingStyle/zh | CARenderingStyle]] [[CAEngine::DefaultRenderingStyle/zh | DefaultRenderingStyle]] === |
Revision as of 07:18, 7 October 2015
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, and AddModule,求值计算都强加了最大时间限制(毫秒)
{get,put} CARenderingStyle DefaultRenderingStyle
The default rendering style controlling how result values are returned from ADE. All CAObject instances inherit this rendering style when they are created.
{get} short int ErrorCode
Returns the error code generated by the last communication with the Analytica Decision Engine Server. The property ErrorCode should be checked after setting and retrieving critical CAEngine properties and calling CAEngine methods. An ErrorCode of zero indicates the last action was successful.
{get} string ErrorText
Short text explanation of error from ErrorCode.
{get,put} unsigned long Flags
A bit field of flags that control certain behaviors within ADE.
{get} string Log
A record of all commands sent to the ADE typescript and the results received from those commands, when the Photo property is true.
{get} string OutputBuffer
A text string buffer that contains the result of the last typescript (i.e., using the Command property and Send method) interaction with the ADE.
{get,put} bool Photo
When Photo is True, ADE records all typescript commands and results into the Log property.
方法
string AddModule(string filePath,bool Merge)
Adds a module from file fileName into the CurrentModule. The merge parameter currently has no effect and should be set to True.
bool CloseModel()
关闭模型
CAObject CreateObject(string objName, string objType)
Creates a new Analytica object with identifier objName and class objClass in the CurrentModule and returns it as a CAObject.
bool CreateModel(string newModelName)
Creates a new Analytica model with identifier modelName.
bool DeleteObject( CAObject aObject )
Deletes CAObject obj from the current model.
CAObject Get(string objName)
与 GetObjectByName等同
CAObject GetObjectByName(string objName)
Returns an object of type CAObject for an existing Analytica object with identifier objName.
bool 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.
string OpenModel(string filepath)
Reads a model from a disk file and opens it as the current model.
bool ReadScript(string filePath)
Reads and executes an Analytica script file.
void 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 SaveModel(string filePath)
Saves the model to file «filePath».
bool SaveModuleFile(string moduleName, string filePath)
Saves module with identifier «moduleName» into file «filePath».
bool Send()
Sends the string contained in the Command property as a command to be executed by ADE. See the Analytica Scripting Guide for details of commands and syntax.
bool SendCommand(string command)
Sends the string command property as a typescript command to be executed by ADE. See the Analytica Scripting Guide for details of commands and syntax.
bool SetCallbackObject(IUnknown* pCallbackObj)
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.
See Also
ADE Server Class Reference <- | CAEngine | -> CAObject |
Enable comment auto-refresher