Exemple #1
0
 private void Uctg_OnTravelSelectionChanged(HistoryEntry he, HistoryList hl)
 {
     if (he != null)
     {
         //System.Diagnostics.Debug.WriteLine("Star grid sel changed ask");
         computer.CalculateClosestSystems(he.System, (s, d) => BeginInvoke((MethodInvoker) delegate { NewStarListComputed(s, d); }));     // hook here, force closes system update
     }
 }
Exemple #2
0
 private void KickComputation(HistoryEntry he)
 {
     if (he?.System != null && he.System.HasCoordinate)
     {
         computer.CalculateClosestSystems(he.System,
                                          (s, d) => BeginInvoke((MethodInvoker) delegate { NewStarListComputed(s, d); }),
                                          maxitems, textMinRadius.Value, textMaxRadius.Value, true);
     }
 }
Exemple #3
0
        private void KickComputation(HistoryEntry he)
        {
            var x = this.Handle; // workaround to avoid throw an exception if open the panel as popup

            if (he?.System != null && he.System.HasCoordinate)
            {
                computer.CalculateClosestSystems(he.System,
                                                 (s, d) => BeginInvoke((MethodInvoker) delegate { NewStarListComputed(s, d); }),
                                                 maxitems, textMinRadius.Value, textMaxRadius.Value, true);
            }
        }
Exemple #4
0
        public override void Init()
        {
            computer = new StarDistanceComputer();

            HistoryEntry he = uctg.GetCurrentHistoryEntry;      // does our UCTG have a system selected?

            if (he != null)
            {
                //System.Diagnostics.Debug.WriteLine("Star grid started, uctg selected, ask");
                computer.CalculateClosestSystems(he.System, (s, d) => BeginInvoke((MethodInvoker) delegate { NewStarListComputed(s, d); }));     // hook here, force closes system update
            }

            uctg.OnTravelSelectionChanged += Uctg_OnTravelSelectionChanged;
        }
Exemple #5
0
        private void KickComputation(HistoryEntry he, bool force = false)
        {
            if (he != null && he.System != null && (force || !he.System.Equals(last_he?.System)))
            {
                last_he = he;

                //System.Diagnostics.Debug.WriteLine("Star grid started, uctg selected, ask");

                // Get nearby systems from the systems DB.
                computer.CalculateClosestSystems(he.System,
                                                 (s, d) => BeginInvoke((MethodInvoker) delegate { NewStarListComputed(s, d); }),
                                                 maxitems, textMinRadius.Value, textMaxRadius.Value, !checkBoxCube.Checked
                                                 ); // hook here, force closes system update
            }
        }
        public override void Init(EDDiscoveryForm ed, UserControlCursorType thc, int vn) //0=primary, 1 = first windowed version, etc
        {
            _discoveryForm = ed;
            uctg           = thc;
            uctg.OnTravelSelectionChanged += Uctg_OnTravelSelectionChanged;

            computer = new StarDistanceComputer();

            HistoryEntry he = uctg.GetCurrentHistoryEntry;      // does our UCTG have a system selected?

            if (he != null)
            {
                //System.Diagnostics.Debug.WriteLine("Star grid started, uctg selected, ask");
                computer.CalculateClosestSystems(he.System, (s, d) => BeginInvoke((MethodInvoker) delegate { NewStarListComputed(s, d); }));     // hook here, force closes system update
            }
        }
Exemple #7
0
        private void KickComputation(HistoryEntry he)
        {
            plotViewTop.Refresh();
            plotViewFront.Refresh();
            plotViewSide.Refresh();
            dataGridList.Rows.Clear();
            reportView.Text = string.Empty;
            reportView.Refresh();

            var x = this.Handle; // workaround to avoid throw an exception if open the panel as pop up

            if (he?.System != null && he.System.HasCoordinate)
            {
                computer.CalculateClosestSystems(he.System,
                                                 (s, d) => BeginInvoke((MethodInvoker) delegate { NewStarListComputed(s, d); }),
                                                 maxitems, textMinRadius.Value, textMaxRadius.Value, true);
            }
        }
        private void KickComputation(HistoryEntry he, bool force = false)
        {
            if (he != null && he.System != null && (force || !he.System.Equals(last_he?.System)))
            {
                last_he = he;

                //System.Diagnostics.Debug.WriteLine("Star grid started, uctg selected, ask");

                double lookup_max = Math.Min(textMaxRadius.Value, lookup_limit);
                //System.Diagnostics.Debug.WriteLine("Lookup limit " + lookup_limit + " lookup " + lookup_max);

                // Get nearby systems from the systems DB.
                computer.CalculateClosestSystems(he.System,
                                                 NewStarListComputedAsync,
                                                 maxitems, textMinRadius.Value, lookup_max, !checkBoxCube.Checked
                                                 ); // hook here, force closes system update
            }
        }