Exemplo n.º 1
0
        void CheckForNewScans(object sender, EventArgs e)
        {
            UpdateQueueGrid();

            if (log.IsInfoEnabled)
            {
                log.Info("Checking internet connection");
            }

            if (!_uploader.CheckForInternetConnection())
            {
                if (log.IsInfoEnabled)
                {
                    log.Info("No internet connection found");
                }
                SetUI("No Internet Connection", "No Internet Connection currently available, scans will be queued until the system is online again", 0);
                return;
            }


            if (log.IsInfoEnabled)
            {
                log.Info("Checking for new scans");
            }

            if (worker.IsBusy)               //don't do anything if we're already processing the queue
            {
                if (log.IsDebugEnabled)
                {
                    log.Debug("Worker is busy");
                }

                return;
            }

            if (log.IsDebugEnabled)
            {
                log.Debug("Running background worker");
            }

            worker.RunWorkerAsync();
        }
Exemplo n.º 2
0
        void BtnSendToUploadManagerClick(object sender, EventArgs e)
        {
            if (log.IsInfoEnabled)
            {
                log.Info("Adding new scan to upload manager queue");
            }

            ToggleUIControls();
            _scan.modelingOptions          = _modelOpts;
            _scan.metadata.uploadStartTime = DateTime.Now.ToString(Scan.DATE_FORMAT);
            _scan.WriteManifest();
            _uploader.AddScanToQueue(_scan.metadata.scanID);
            string message = "The order has been added to the upload queue and will be processed by the upload manager.";

            if (!_uploader.CheckForInternetConnection())
            {
                message = "There is currently no internet connection on this machine.  The order has been added to the upload queue and will be processed by the upload manager once internet connetivity is restored.";
            }
            LogWriteLn(message);
            ToggleUIControls();
        }