/// <summary> /// Method to obtain the Assessed Nav Accuracy at each timestep and populate the /// data structures that will be used to draw the graph. /// </summary> /// <param name="accuracyAssessedEvaluator">Evaluator for Assesssed Nav Accuracy.</param> private void ComputeValuesForAssessedAccGraph(Evaluator <NavigationAccuracyAssessed> accuracyAssessedEvaluator) { Duration dur = stopjd - startjd; double timestep = Double.Parse(TimeStep.Text); Duration ts = Duration.FromSeconds(timestep); // Initialize the progressbar with appropriate values progressBar1.Maximum = (int)dur.TotalSeconds; progressBar1.Step = (int)timestep; // now we'll iterate through time by adding seconds to the start time JulianDate object - // creating a new JulianDate each time step. for (JulianDate jd = startjd; jd <= stopjd; jd += ts) { try { //Evaluate at this particular time. NavigationAccuracyAssessed accuracyAssessed = accuracyAssessedEvaluator.Evaluate(jd); double txd = new XDate(jd.ToDateTime()); if (accuracyAssessed != null) { // Store it away in the PointPairList. AsAccData.Add(txd, accuracyAssessed.PositionSignalInSpace); } } catch { } // update the progress bar - we're done with this time step! progressBar1.PerformStep(); } // reset the progress bar progressBar1.Value = 0; }
/// <summary> /// Removes the receiver definition and clears the graphs /// </summary> private void OnDeleteReceiverClick(object sender, EventArgs e) { // when a receiver is deleted, we need to clear the graphs and delete the information in the tree // to delete info from a graph, just clear the graphs's curvelist DOPGraph.GraphPane.CurveList.Clear(); AzElGraph.GraphPane.CurveList.Clear(); NavAccGraph.GraphPane.CurveList.Clear(); // also, we need to clear all the data from the DOPData structure foreach (PointPairList ppl in DOPData) { ppl.Clear(); } // clear all the Azimuth / elevation data from their respective structures. AzElData_TimeBased.Clear(); AzElData_AzimuthBased.Clear(); // Clear all the Nav Accuracy Data from the zedGraph data structure that contain them. AsAccData.Clear(); PredAccData.Clear(); // always do these two steps, these make the graphs update themselves DOPGraph.AxisChange(); DOPGraph.Invalidate(); AzElGraph.AxisChange(); AzElGraph.Invalidate(); NavAccGraph.AxisChange(); NavAccGraph.Invalidate(); // Now clear the tree of the receiver, PSF and PAF information // Except for the first node (Almanac), remove all other nodes. string firstNodeName = rootNode.FirstNode.Text; rootNode.Nodes.Clear(); TreeNode newNode = new TreeNode(firstNodeName); rootNode.Nodes.Add(newNode); rootNode.Expand(); //Clear the textboxes that contain the PAF and PSF names. PAFName.Clear(); PSFName.Clear(); //enable and disable the appropriate buttons SetControlStates(false); }