ADE服务器类型参考

Revision as of 19:18, 5 October 2015 by Jhuawen (talk | contribs)
Other languages:
English • ‎中文

ADE 用户指南 >

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

CAEngine

全文请查看 CAEngine

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

CAObject

全文请查看 CAObject

A CAObject is ADE's wrapper for an Analytica object, such as a variable or module. It provides access the the object's attributes, including its definition and result. It often is used as a stepping stone for obtaining a variable's result table.

CATable

全文请查看 CATable

ADE's CATable class provides the equivalent of an intelligent array. It is used to wrap an Edit Table, allowing your program to change cell values, or a result array, allowing you to access individual cells, slices, or even a graph image of the result.

CAIndex

全文请查看 CAIndex

The CAIndex class provides information about the index of a CATable.

CARenderingStyle

全文请查看 CARenderingStyle

A CARenderingStyle controls how atomic values are returned by ADE methods and properties. For example, you may want numbers returned numerically, or as formatted text. A CARenderingStyle is already present as a property on any CAObject or CATable. Separate default CARenderingStyle for both DefTables and ResultTables are maintained on CAEngine::DefaultDefTableRenderingStyle and CAEngine::DefaultRenderingStyle.

CALicense

全文请查看 CALicense

The CALicense provides a method for instantiating a CAEngine, and provides details about why such an instantiation failed, which would otherwise not be available if you instantiate the CAEngine directly. It also provides some information about limitations in your license to use ADE.

IAdeUICallbacks

全文请查看 IAdeUICallbacks

ADE 4.6新特征

This interface allows you to implement callbacks that are called when Analytica functions requiring user input are evaluated. You can implement these callbacks to support these user interface interactions in your own application. In many cases, the name of each method corresponds fairly directly with the name of the Analytica function that produces the user interaction.

When your application does not implement this interface, most of the functions requiring user interaction will do nothing when evaluated in 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.