private void progressLinkLabel_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
 {
     ProgressMonitorForm.BringFormUp(false);
 }
Beispiel #2
0
 //private void RunPM(object state, DateTime requestEnqueueTime)
 private void RunPM(object state)
 {
     ProgressMonitorForm.BringFormUp(true);
 }
Beispiel #3
0
        private void action(bool previewOnly)
        {
            // a little hack here to disallow loading 4 meters tiles at 50 miles (like 15,000 tiles at once).
            if (PictureManager.This.CameraManager.Elev > (25.1d) * Distance.METERS_PER_MILE && m_scaleShift != 0 && Project.preloadScale2 == 0)
            {
                messageLabel.Text = "Error: too many tiles to load, move closer or try another scale";
                return;
            }

            messageLabel.Text = "IP: please wait, computing layout...";
            this.Refresh();
            Cursor.Current = Cursors.WaitCursor;
            int total  = 0;
            int toLoad = 0;

            directionPadControlPanel.Enabled = true;

            bool saveOffline = Project.serverAvailable;

            if (previewOnly)
            {
                Project.serverAvailable = false;
            }
            //else
            //{
            // in case we had tiles in cache marked Empty, we need to make them become reloadable
            TileSetTerra.This.ReTileSpecialClear();
            //}

            GeoCoord topLeft;
            GeoCoord bottomRight;
            int      scale = 10 + (m_scaleShift == 0 ? Project.preloadScale1 : (Project.preloadScale2 + m_scaleShift));

            if (TileSetTerra.This.ReTileSpecial(scale, out total, out toLoad, out topLeft, out bottomRight))
            {
                int toLoadMb = toLoad * 6 / 1000;
                messageLabel.Text = "IP: total number of tiles: " + total + " to load : " + toLoad
                                    + (toLoadMb > 0 ? "   (approx" + toLoadMb + "Mb)" : "");
                if (scaleUpCheckBox.Checked)
                {
                    if (toLoad > 10)
                    {
                        messageLabel.Text += "\n       (and up to 30% more from higher scale tiles)";
                    }
                    else
                    {
                        messageLabel.Text += "\n       (and may be more from higher scale tiles)";
                    }
                }
                if (!previewOnly)
                {
                    if (scaleUpCheckBox.Checked)
                    {
                        TileSetTerraLayout.downloadAtLevel(topLeft, bottomRight, scale + 1, true);
                    }
                    messageLabel.Text += "\nIP: loading...\n\nYou can close this dialog or continue to define new areas -\n        downloads will proceed in the background.\nTo stop downloading, click \"Preview\".";
                }
                PictureManager.This.Refresh();
                if (!previewOnly && Project.preloadDoProgress)
                {
                    ProgressMonitorForm.BringFormUp(false);
                }
            }
            else
            {
                messageLabel.Text = "Error: cannot compute layout, try another scale";
            }
            Project.serverAvailable = saveOffline;
            m_lastAction            = previewOnly;
        }