CalcAlg

Syntax

CalcAlgResult CalcAlg(AlgId tAlg, ArgType tArg)

Parameters

tAlg. Moniker of opened indicators calculation algorithm instance.

tArg. Operation execution parameters.

Description

The CalcAlg operation calculates indicators calculation algorithm.

Comments

To execute the operation, in the tAlg field specify the opened calculation algorithm instance moniker, and in the tArg field specify operation execution parameters. The moniker can be obtained on executing the OpenAlg operation.

The operation results in the information about successful calculation or calculation errors and also the total calculation time and the total time spent on calculation.

Example

Below is the example of starting indicators calculation algorithm calculation. The request contains opened calculation algorithm instance moniker. The response contains information about calculation results.

SOAP request:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<CalcAlg xmlns="http://www.fsight.ru/PP.SOM.Som">
<tAlg xmlns="">
  <id>S1!M!S!C1</id>
  </tAlg>
<tArg xmlns="">
  <command>Start</command>
  <state>true</state>
  </tArg>
  </CalcAlg>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<CalcAlgResult xmlns="http://www.fsight.ru/PP.SOM.Som" xmlns:q1="http://www.fsight.ru/PP.SOM.Som" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<state xmlns="">
  <calculationState>Running</calculationState>
  <needUpdateStyles>1</needUpdateStyles>
  </state>
  </CalcAlgResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"CalcAlg" :
{
"tAlg" :
{
"id" : "S1!M!S!C1"
},
"tArg" :
{
"command" : "Start",
"state" : "true"
}
}
}

JSON response:

{
"CalcAlgResult" :
{
"state" :
{
"calculationState" : "Running",
"needUpdateStyles" : "1"
}
}
}
public static CalcAlgResult CalcAlg(string moniker)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
//Operation execution parameters
var tCalc = new CalcAlg()
{
tAlg = new AlgId() { id = moniker },
tArg = new CalcAlgArg()
{
command = AlgCalcCommand.Start,
state = true
}
};
//Execute indicators calculation algorithm
var result = somClient.CalcAlg(tCalc);
return result;
}

See also:

Working with Indicators Calculation Algorithm