Free cookie consent management tool by TermsFeed Policy Generator

Changeset 343


Ignore:
Timestamp:
06/26/08 13:19:05 (16 years ago)
Author:
gkronber
Message:

fixed serialization and display of floating point number in plugin HeuristicLab.Data (ticket #175). Had to make the dataGridView in ArrayDataBaseView and MatrixDataBaseView to protected to be able to change the format of cells in DoubleArrayDataView and DoubleMatrixDataView.

Location:
branches/Ticket175Branch/HeuristicLab.Data
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • branches/Ticket175Branch/HeuristicLab.Data/ArrayDataBaseView.Designer.cs

    r2 r343  
    105105    private System.Windows.Forms.Label sizeLabel;
    106106    private System.Windows.Forms.TextBox lengthTextBox;
    107     private System.Windows.Forms.DataGridView dataGridView;
     107    protected System.Windows.Forms.DataGridView dataGridView;
    108108  }
    109109}
  • branches/Ticket175Branch/HeuristicLab.Data/ArrayDataBaseView.cs

    r2 r343  
    6464        dataGridView.RowCount = length;
    6565        for (int i = 0; i < length; i++) {
    66           dataGridView.Rows[i].Cells[0].Value = ArrayDataBase.Data.GetValue(i); ;
     66          dataGridView.Rows[i].Cells[0].Value = ArrayDataBase.Data.GetValue(i);
    6767        }
    6868      } else {
  • branches/Ticket175Branch/HeuristicLab.Data/ConstrainedDoubleDataView.cs

    r2 r343  
    6262      } else {
    6363        dataTextBox.Enabled = true;
    64         dataTextBox.Text = ConstrainedDoubleData.ToString();
     64        dataTextBox.Text = ConstrainedDoubleData.Data.ToString("r");
    6565      }
    6666    }
  • branches/Ticket175Branch/HeuristicLab.Data/DoubleArrayData.cs

    r2 r343  
    6565      for(int i = 0; i < Data.Length; i++) {
    6666        builder.Append(";");
    67         builder.Append(Data[i].ToString(format));
     67        builder.Append(Data[i].ToString("r", format));
    6868      }
    6969      if(builder.Length > 0)
  • branches/Ticket175Branch/HeuristicLab.Data/DoubleArrayDataView.cs

    r2 r343  
    3737    public DoubleArrayDataView() {
    3838      InitializeComponent();
     39      // round-trip format for all cells
     40      dataGridView.DefaultCellStyle.Format = "r";
    3941    }
    4042    public DoubleArrayDataView(DoubleArrayData doubleArrayData)
  • branches/Ticket175Branch/HeuristicLab.Data/DoubleData.cs

    r2 r343  
    5454    public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid,IStorable> persistedObjects) {
    5555      XmlNode node = base.GetXmlNode(name, document, persistedObjects);
    56       node.InnerText = Data.ToString(CultureInfo.InvariantCulture.NumberFormat);
     56      node.InnerText = Data.ToString("r", CultureInfo.InvariantCulture.NumberFormat);
    5757      return node;
    5858    }
  • branches/Ticket175Branch/HeuristicLab.Data/DoubleDataView.cs

    r2 r343  
    5959      } else {
    6060        dataTextBox.Enabled = true;
    61         dataTextBox.Text = DoubleData.ToString();
     61        dataTextBox.Text = DoubleData.Data.ToString("r");
    6262      }
    6363    }
  • branches/Ticket175Branch/HeuristicLab.Data/DoubleMatrixData.cs

    r2 r343  
    8181        for (int j = 0; j < Data.GetLength(1); j++) {
    8282          builder.Append(";");
    83           builder.Append(Data[i, j].ToString(format));
     83          builder.Append(Data[i, j].ToString("r", format));
    8484        }
    8585      }
  • branches/Ticket175Branch/HeuristicLab.Data/DoubleMatrixDataView.cs

    r2 r343  
    3737    public DoubleMatrixDataView() {
    3838      InitializeComponent();
     39      // round-trip format for all cells
     40      dataGridView.DefaultCellStyle.Format = "r";
    3941    }
    4042    public DoubleMatrixDataView(DoubleMatrixData doubleMatrixData)
  • branches/Ticket175Branch/HeuristicLab.Data/MatrixDataBaseView.Designer.cs

    r2 r343  
    132132    private System.Windows.Forms.Label rowsLabel;
    133133    private System.Windows.Forms.TextBox rowsTextBox;
    134     private System.Windows.Forms.DataGridView dataGridView;
     134    protected System.Windows.Forms.DataGridView dataGridView;
    135135    private System.Windows.Forms.TextBox columnsTextBox;
    136136    private System.Windows.Forms.Label columnsLabel;
Note: See TracChangeset for help on using the changeset viewer.