コード例 #1
0
ファイル: plot.cs プロジェクト: RossAnderson55/Evado.Digital
    //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    #endregion
    #region Class methods


    //====================================================================================
    /// <summary>
    /// This method add a value to the plot data list.
    /// Using only the first 2 values of the array of float.
    /// </summary>
    /// <returns>String containing the JSON class output</returns>
    //-----------------------------------------------------------------------------------
    public String GetData ( )
    {
      System.Text.StringBuilder output = new System.Text.StringBuilder ( );

      if ( this._Data.Count == 0 )
      {
        return String.Empty;
      }

      if ( this._Data.Count == 1 )
      {
        output.Append ( "[ " );
        output.Append ( this._Data [ 0 ].GetData ( ) );
        output.AppendLine ( "] " );
      }
      else
      {
        //
        // get each array of data 
        //
        output.Append ( "[ " );
        for ( int i = 0; i < this._Data.Count; i++ )
        {
          if ( i > 0 )
          {
            output.AppendLine ( "," );
          }
          PlotData data = this._Data [ i ];
          output.Append ( data.GetData ( ) );
        }
        output.AppendLine ( "] " );
      }

      return output.ToString ( );
    }
コード例 #2
0
ファイル: plot.cs プロジェクト: RossAnderson55/Evado.Digital
    //====================================================================================
    /// <summary>
    /// This method add a value to the plot data list.
    /// Using only the first 2 values of the array of float.
    /// </summary>
    /// <param name="Data">PlotData object</param>
    //-----------------------------------------------------------------------------------
    public void AddData ( PlotData Data )
    {
      this._Data.Add ( Data );

    }