# Write Results to Indigo-DB

#### CLASS: DateTimeResults

```
    /// <summary>
    /// Date time.
    /// </summary>
    public DateTime Datetime { get; set; }
    
    /// <summary>
    /// Warning (depending on the threshold and probability).
    /// </summary>
    public bool Warning { get; set; }
    
    /// <summary>
    /// Probability (depending on the estimated and actual value(s)).
    /// </summary>
    public double Probability { get; set; }
    
    /// <summary>
    /// Multi-dimensional estimated output vector.
    /// </summary>
    public double[] OutputPointsEstimate { get; set; }
    
    /// <summary>
    /// Multi-dimensional output vector.
    /// </summary>
    public double[] OutputPoints { get; set; }
```

#### METHOD: Tranfer

```
  public static void SaveResults(List<DateTimeResult> listDateTimeResults, TrainingPreferences preferences, Asset asset)
    {
        var token = GetToken();
        List<string> channels = preferences.ParameterSettings.Where(x => x.Category == SignalCatgory.Output).Select(x => x.ParameterCode).ToList();


        string timeContentName = preferences.Methodology.ToString() + "-" + preferences.Name;
        var content = new TimedataContent(timeContentName);
        foreach (var channel in channels)
            content.Measurements.Add(new Measurement(channel + "-estimate", "-"));
        foreach (var channel in channels)
            content.Measurements.Add(new Measurement(channel + "-actual", "-"));
        content.Measurements.Add(new Measurement("Probability", "%"));
        content.Measurements.Add(new Measurement("Warning", "-"));

        foreach (var result in listDateTimeResults)
        {
            double[] resultrecord = new double[result.OutputPointsEstimate.Length + result.OutputPoints.Length + 2];

            for (int i = 0; i < result.OutputPointsEstimate.Length; i++)
                resultrecord[i] = result.OutputPointsEstimate[i];
            for (int i = 0; i < result.OutputPoints.Length; i++)
                resultrecord[result.OutputPointsEstimate.Length + i] = result.OutputPoints[i];

            resultrecord[result.OutputPointsEstimate.Length + result.OutputPoints.Length] = result.Probability;
            resultrecord[result.OutputPointsEstimate.Length + result.OutputPoints.Length + 1] = result.Warning ? 1 : 0;

            content.AppendDataset(result.Datetime, resultrecord);
        }

        var handler = new tk_MinCloudDatapublish.tkMinDatapublish(_applicationaccesskey);
        handler.UploadData(token, asset.Name, content).Wait();
    }
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://daniel-jaroszewski.gitbook.io/syswatch/indigo-interface/untitled.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
