CalculationApi
| Method | Description |
|---|---|
| Calculate | Calculate RCS project |
| GetRawResults | Get calculated results in XML format |
| GetResults | Get calculated results |
Calculate
List<RcsSectionResultOverview> Calculate (Guid projectId, RcsCalculationParameters rcsCalculationParameters = null)
Calculate RCS project
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectId | Guid | Project Id | |
| rcsCalculationParameters | RcsCalculationParameters | Calculation parameters | [optional] |
Return type
List<RcsSectionResultOverview>
Example
Note: this example is autogenerated.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using IdeaStatiCa.RcsApi.Api;
using IdeaStatiCa.RcsApi.Client;
using IdeaStatiCa.RcsApi.Model;
namespace Example
{
public class CalculateExample
{
public static void Main()
{
// Create the client which is connected to the service.
ConnectionApiClientFactory clientFactory = new ConnectionApiClientFactory("http://localhost:5000");
using (var conClient = await clientFactory.CreateConnectionApiClient())
{
var rcsCalculationParameters = new RcsCalculationParameters(); // RcsCalculationParameters | Calculation parameters (optional)
try
{
// Calculate RCS project
List<RcsSectionResultOverview> result = conClient.Calculation.Calculate(projectId, rcsCalculationParameters);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Console.WriteLine("Exception when calling Calculation.Calculate: " + e.Message);
Console.WriteLine("Status Code: " + e.ErrorCode);
Console.WriteLine(e.StackTrace);
}
finally
{
}
}
}
}
}
Code Samples
using IdeaStatiCa.Api.RCS.Model;
using IdeaStatiCa.RcsApi;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CodeSamples
{
public partial class ClientExamples
{
/// <summary>
/// Calculates all avaliable sections in an existing RCS project.
/// </summary>
/// <param name="rcsClient">The connected RCS API Client</param>
public static async Task Calculate(IRcsApiClient rcsClient)
{
string filePath = "Inputs/Project1.IdeaRcs";
RcsProject rcsProject = await rcsClient.Project.OpenProjectAsync(filePath);
List<RcsSection> sections = await rcsClient.Section.SectionsAsync(rcsProject.ProjectId);
Console.WriteLine("Avaliable Sections in Project.");
foreach (RcsSection section in sections)
{
Console.WriteLine($"{section.Id}={section.Name}");
}
List<RcsSectionResultOverview> summary = await rcsClient.Calculation.CalculateAsync(rcsProject.ProjectId, new RcsCalculationParameters
{
Sections = sections.ConvertAll(x => x.Id).ToList()
});
foreach (RcsSectionResultOverview result in summary)
{
Console.WriteLine("Results for secion Id: {result.SectionId}");
var overrallItem = result.OverallItems;
foreach (var item in overrallItem)
{
Console.WriteLine($"Check: {item.ResultType}, Result: {item.ResultType}, Value: {item.CheckValue}");
}
}
}
}
}
Looking for a code sample? request some help on our discussion page.
REST Usage
Http Request
All URIs are relative to http://localhost
POST /api/1/projects/{projectId}/calculate
Using the CalculateWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// Calculate RCS project
ApiResponse<List<RcsSectionResultOverview>> response = conClient.Calculation.CalculateWithHttpInfo(projectId, rcsCalculationParameters);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling CalculationApi.CalculateWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Authorization
No authorization required
HTTP request headers
- Content-Type: application/json-patch+json, application/json, text/json, application/*+json
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | OK | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetRawResults
string GetRawResults (Guid projectId, RcsResultParameters rcsResultParameters = null)
Get calculated results in XML format
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectId | Guid | ||
| rcsResultParameters | RcsResultParameters | [optional] |
Return type
string
Example
Note: this example is autogenerated.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using IdeaStatiCa.RcsApi.Api;
using IdeaStatiCa.RcsApi.Client;
using IdeaStatiCa.RcsApi.Model;
namespace Example
{
public class GetRawResultsExample
{
public static void Main()
{
// Create the client which is connected to the service.
ConnectionApiClientFactory clientFactory = new ConnectionApiClientFactory("http://localhost:5000");
using (var conClient = await clientFactory.CreateConnectionApiClient())
{
var rcsResultParameters = new RcsResultParameters(); // RcsResultParameters | (optional)
try
{
// Get calculated results in XML format
string result = conClient.Calculation.GetRawResults(projectId, rcsResultParameters);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Console.WriteLine("Exception when calling Calculation.GetRawResults: " + e.Message);
Console.WriteLine("Status Code: " + e.ErrorCode);
Console.WriteLine(e.StackTrace);
}
finally
{
}
}
}
}
}
Code Samples
It looks like the sample you are looking for does not exist.
Looking for a code sample? request some help on our discussion page.
REST Usage
Http Request
All URIs are relative to http://localhost
POST /api/1/projects/{projectId}/get-raw-results
Using the GetRawResultsWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// Get calculated results in XML format
ApiResponse<string> response = conClient.Calculation.GetRawResultsWithHttpInfo(projectId, rcsResultParameters);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling CalculationApi.GetRawResultsWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Authorization
No authorization required
HTTP request headers
- Content-Type: application/json-patch+json, application/json, text/json, application/*+json
- Accept: text/plain
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | OK | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetResults
List<RcsSectionResultDetailed> GetResults (Guid projectId, RcsResultParameters rcsResultParameters = null)
Get calculated results
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectId | Guid | Project Id | |
| rcsResultParameters | RcsResultParameters | Calculation parameters | [optional] |
Return type
List<RcsSectionResultDetailed>
Example
Note: this example is autogenerated.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using IdeaStatiCa.RcsApi.Api;
using IdeaStatiCa.RcsApi.Client;
using IdeaStatiCa.RcsApi.Model;
namespace Example
{
public class GetResultsExample
{
public static void Main()
{
// Create the client which is connected to the service.
ConnectionApiClientFactory clientFactory = new ConnectionApiClientFactory("http://localhost:5000");
using (var conClient = await clientFactory.CreateConnectionApiClient())
{
var rcsResultParameters = new RcsResultParameters(); // RcsResultParameters | Calculation parameters (optional)
try
{
// Get calculated results
List<RcsSectionResultDetailed> result = conClient.Calculation.GetResults(projectId, rcsResultParameters);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Console.WriteLine("Exception when calling Calculation.GetResults: " + e.Message);
Console.WriteLine("Status Code: " + e.ErrorCode);
Console.WriteLine(e.StackTrace);
}
finally
{
}
}
}
}
}
Code Samples
It looks like the sample you are looking for does not exist.
Looking for a code sample? request some help on our discussion page.
REST Usage
Http Request
All URIs are relative to http://localhost
POST /api/1/projects/{projectId}/get-results
Using the GetResultsWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// Get calculated results
ApiResponse<List<RcsSectionResultDetailed>> response = conClient.Calculation.GetResultsWithHttpInfo(projectId, rcsResultParameters);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling CalculationApi.GetResultsWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Authorization
No authorization required
HTTP request headers
- Content-Type: application/json-patch+json, application/json, text/json, application/*+json
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | OK | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]