ADE服务器类型参考

Revision as of 06:58, 6 October 2015 by Jhuawen (talk | contribs) (Created page with "当你的应用程序没有执行该接口时,大多数需要用户交互的函数在ADE中被计算时不会做任何事情。")
Other languages:
English • ‎中文

ADE 用户指南 >

ADE服务器类型包括: CAEngine CAObject CATable CAIndex, CARenderingStyle CALicense IAdeUICallbacks。它们按照这顺序在下面列出,每一个类型都包含一个简单描述。

CAEngine

全文请查看 CAEngine

CAEngine类型包含的方法和属性允许你打开和关闭现有模型、建立新模型、建立新的Analytica对象,以及访问包你模型中所包含的Analytica对象等等。ADE的使用从建立CAEngine对象开始,其它一切都从它开始产生。

CAObject

全文请查看 CAObject

CAObject是ADE用于Analytica对象,例如一个变量或者模块,的包装器。允许访问对象的属性,包括其定义和结果。经常用来作为获取变量结果表的垫脚石。

CATable

全文请查看 CATable

ADE的 CATable类型提供智能数组等效对象。用来包装编辑表,允许你的程序改变单元格或结果数组的值,允许你访问单个单元格、切片、甚至结果的一个图形图像。

CAIndex

全文请查看 CAIndex

CAIndex类型提供关于 CATable索引的信息。

CARenderingStyle

全文请查看 CARenderingStyle

CARenderingStyle控制ADE方法和属性如何返回基元值。例如,你可能想要数字作为数字,或者格式化文本返回。 CARenderingStyle目前已作为 CAObject CATable的一个属性。 DefTables ResultTables CARenderingStyle默认设置分别保留在 CAEngine::DefaultDefTableRenderingStyle CAEngine::DefaultRenderingStyle上。

CALicense

全文请查看 CALicense

CALicense提供实例化 CAEngine的方法,并且提供关于实例化为何失败的详细信息,如果你直接实例化 CAEngine将无法获取关于错误原因的信息。它也提供关于你所使用的 ADE许可证的限制条款信息。

IAdeUICallbacks

全文请查看 IAdeUICallbacks

ADE 4.6新特征

当Analytica函数要求计算用户输入调用回调函数时,该接口允许你执行该函数。你可以执行这些回调函数以便支持你的应用程序中的这些用户界面交互性。在许多情况下,每种方法的名称直接和生成用户交互界面的Analytica函数名称相对应。

当你的应用程序没有执行该接口时,大多数需要用户交互的函数在ADE中被计算时不会做任何事情。

The "IAde" prefix stands for "Interface ADE". Your own code can define a class that subclasses this interface and implements its method, and then pass it to CAEngine::SetCallbackObject.

示例

PHP

The attached PHP script:

  1. Creates an instance of ADE.
  2. Creates a new model.
  3. Creates a Variable Object.
  4. Modifies the definition of the created Variable to '4+1*7'.
  5. Get the result back from the created object and prints it out.
  6. Saves the created model to a file 'TestModel.ana' in the current directory.
  7. Closes the model.
<?php
    $currentPath = getcwd()."\\";
    $ade = new COM("ADE4.CAEngine") or die("Unable to instantiate ADE");
    echo "ADE successfully loaded.\n";
    $modelCreated = $ade->CreateModel("MyNewModel");
    if($modelCreated == true){
        echo "Model successfully created.\n";

        $newObject = $ade->CreateObject("MyVariable", "Variable");
        $newObject->SetAttribute("Definition", "4+1*7");

        $result = $newObject->Result();
        echo "The new object's result is: ". $result .".\n";

        $ade->SaveModel($currentPath."TestModel.ana");
        $ade->CloseModel();
        echo "Model succussfully closed.\n\n";
    }
    else{
        echo "Model creation failed.\n\n";
    }
?>

另请参阅

另请参阅

在ADE中处理模型、模块和文件 <- ADE服务器类型参考 -> CAEngine
Comments


You are not allowed to post comments.