//--------------// // Class Methods //--------------// public CReversalParameters GetCopy() { CReversalParameters c = new CReversalParameters(); c.m_gauss = m_gauss.GetCopy(); c.m_randm = m_randm.GetCopy(); c.m_vctr = m_vctr.GetCopy(); c.m_enabled = m_enabled; //c.m_diveRateEnabled = m_diveRateEnabled; c.reversalDiveRateType = m_reversalDiveRateType; //c.m_diveRate c.m_diveRate = m_diveRate.GetCopy(); c.m_ascentRate = m_ascentRate.GetCopy(); c.type = type; return c; }
public FormReversal(CReversalParameters P) { InitializeComponent(); m_r = P; this.Text = m_szTitle; MeanCntTextBox.Text = "" + P.gauss.meanCnt; StdCntTextBox.Text = "" + P.gauss.stdCnt; GaussProbTextBox.Text = "" + P.gauss.prob; GaussMeanTimeTextBox.Text = "" + P.gauss.meanTime; GaussStdTimeTextBox.Text = "" + P.gauss.stdTime; MaxCntTextBox.Text = "" + P.randm.maxCnt; MinCntTextBox.Text = "" + P.randm.minCnt; RandProbTextBox.Text = "" + P.randm.prob; RndMeanTimeTextBox.Text = "" + P.randm.meanTime; RndStdTimeTextBox.Text = "" + P.randm.stdTime; if(P.reversalDiveRateType == REVERSAL_DIVE_RATE_TYPE.INDEPENDENT) { DescentAscentLabel.Text = "Dive Rate"; DescentAscentLabel.Enabled = true; MeanDescentAscentRateTextBox.Enabled = true; StdDescentAscentRateTextBox.Enabled = true; CoeffDescentAscentRateTextBox.Enabled = true; MeanDescentAscentLabel.Enabled = true; StdDescentAscentLabel.Enabled = true; CoefficientDescentAscentGaussLabel.Enabled = true; AscentLabel.Text = "---"; AscentLabel.Enabled = false; MeanAscentRateTextBox.Enabled = false; StdAscentRateTextBox.Enabled = false; CoeffAscentRateTextBox.Enabled = false; MeanAscentLabel.Enabled = false; StdAscentLabel.Enabled = false; CoefficientAscentGaussLabel.Enabled = false; } else if(P.reversalDiveRateType == REVERSAL_DIVE_RATE_TYPE.INDEPENDENT_DIVE_AND_ASCENT) { DescentAscentLabel.Text = "Descent Rate"; DescentAscentLabel.Enabled = true; MeanDescentAscentRateTextBox.Enabled = true; StdDescentAscentRateTextBox.Enabled = true; CoeffDescentAscentRateTextBox.Enabled = true; MeanDescentAscentLabel.Enabled = true; StdDescentAscentLabel.Enabled = true; CoefficientDescentAscentGaussLabel.Enabled = true; AscentLabel.Text = "Ascent Rate"; AscentLabel.Enabled = true; MeanAscentRateTextBox.Enabled = true; StdAscentRateTextBox.Enabled = true; CoeffAscentRateTextBox.Enabled = true; MeanAscentLabel.Enabled = true; StdAscentLabel.Enabled = true; CoefficientAscentGaussLabel.Enabled = true; } else { DescentAscentLabel.Text = "Dive Rate"; DescentAscentLabel.Enabled = false; MeanDescentAscentRateTextBox.Enabled = false; StdDescentAscentRateTextBox.Enabled = false; CoeffDescentAscentRateTextBox.Enabled = false; MeanDescentAscentLabel.Enabled = false; StdDescentAscentLabel.Enabled = false; CoefficientDescentAscentGaussLabel.Enabled = false; AscentLabel.Text = "---"; AscentLabel.Enabled = false; MeanAscentRateTextBox.Enabled = false; StdAscentRateTextBox.Enabled = false; CoeffAscentRateTextBox.Enabled = false; MeanAscentLabel.Enabled = false; StdAscentLabel.Enabled = false; CoefficientAscentGaussLabel.Enabled = false; } MeanDescentAscentRateTextBox.Text = "" + P.diveRate.mean; StdDescentAscentRateTextBox.Text = "" + P.diveRate.std; CoeffDescentAscentRateTextBox.Text = "" + P.diveRate.coeff; MeanAscentRateTextBox.Text = "" + P.ascentRate.mean; StdAscentRateTextBox.Text = "" + P.ascentRate.std; CoeffAscentRateTextBox.Text = "" + P.ascentRate.coeff; ProbTextBox.Text = P.vector.probabilityElement.ConvertToString(); CountVectorTextBox.Text = P.vector.countVector.ConvertToString(); DurTextBox.Text = P.vector.durationVector.ConvertToString(); StepDurTextBox.Text = P.vector.durationStepElement.ConvertToString(); UpdateVectorModel(); groupBox2.Enabled = false; // Gaussian groupBox1.Enabled = false; // Random groupBox3.Enabled = false; // Vector if(P.type == MODELTYPE.GAUSSIAN) groupBox2.Enabled = true; else if(P.type == MODELTYPE.RANDOM) groupBox1.Enabled = true; else if(P.type == MODELTYPE.MATRIX) groupBox3.Enabled = true; RefreshButton.Enabled = false; OkButton.Enabled = true; m_initializing = false; }