private void buttonBuildExpression_Click(object sender, EventArgs e) { var s = m_series as CalculationSeries; string tmpExp = s.Expression; var DB = s.TimeSeriesDatabase; CalculationProperties p = new CalculationProperties(s, new TimeSeriesTreeModel(DB), DB.GetUniqueUnits()); if (p.ShowDialog() == System.Windows.Forms.DialogResult.OK) { this.textBoxExpression.Text = s.Expression; } else { this.textBoxExpression.Text = tmpExp; } }
/// <summary> /// Adds new Calculation Series /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void AddCalculationClick(object sender, EventArgs e) { CalculationSeries s = new CalculationSeries(DB); CalculationProperties p = new CalculationProperties(s, new TimeSeriesTreeModel( DB), DB.GetUniqueUnits()); if (p.ShowDialog() == DialogResult.OK) { DB.AddSeries(s, CurrentFolder); // tree refresh.. Add node. if( p.Calculate) s.Calculate(); // save again // refresh. DB.RefreshFolder(CurrentFolder); } }