Ejemplo n.º 1
0
        private void RemoveServer(ResendServer server)
        {
            ListViewItem item = (from i in listViewMoves.Items.OfType <ListViewItem>()
                                 where i.Tag == server
                                 select i).FirstOrDefault();

            if (item != null)
            {
                listViewServers.Items.Remove(item);
            }
        }
Ejemplo n.º 2
0
        public void Store()
        {
            StoreFailure storeFailures = new StoreFailure();
            DicomServer  dcmServer     = ServiceLocator.Retrieve <DicomServer>();

            try
            {
                foreach (DicomScp scp in _Scps)
                {
                    string lastStatus = string.Empty;
                    string clientAE   = Module._Options.AETitle.Length > 0 ? Module._Options.AETitle : dcmServer.AETitle;

                    //
                    // If the store operation failed and we have enabled retry we need to schedule this action to be retried again
                    //
                    if (!Store(clientAE, scp, _DataSet, ref lastStatus))
                    {
                        ResendServer server = new ResendServer(scp);

                        server.AETitle    = clientAE;
                        server.RetryCount = NumberOfRetries;
                        server.LastStatus = lastStatus;
                        server.IPAddress  = scp.PeerAddress.ToString();
                        storeFailures.Scps.Add(server);
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.Global.SystemException(string.Empty, ex);
            }

            if (storeFailures.Scps.Count > 0)
            {
                storeFailures.Dataset = _DataSet;
                if (EnableRetry && NumberOfRetries > 0)
                {
                    Job <StoreFailure> retryJob = new Job <StoreFailure>()
                    {
                        Loops = 1, Data = storeFailures
                    };

                    retryJob.StartTime = Timeout.Milliseconds().FromNow();
                    Module.Scheduler.SubmitJob <StoreFailure>(retryJob, Retry);
                }
                else
                {
                    //
                    // Since we have no retries we will send this to manual resend
                    //
                    storeFailures.Save();
                }
            }
        }
Ejemplo n.º 3
0
        private void UpdateServerStatus(ResendServer server, string status)
        {
            ListViewItem item = (from i in listViewMoves.Items.OfType <ListViewItem>()
                                 where i.Tag == server
                                 select i).FirstOrDefault();

            if (item != null)
            {
                server.LastStatus = status;
                item.Text         = status;
            }
        }
Ejemplo n.º 4
0
        private void RemoveServerItem(ListViewItem item)
        {
            ResendServer server      = item.Tag as ResendServer;
            ListViewItem failureItem = listViewDatasets.SelectedItems[0];
            StoreFailure failure     = failureItem.Tag as StoreFailure;

            listViewServers.Items.Remove(item);
            failure.Scps.Remove(server);
            if (failure.Scps.Count == 0)
            {
                RemoveFailureItem(failureItem);
            }
        }
Ejemplo n.º 5
0
        private void toolStripButtonVerify_Click(object sender, EventArgs e)
        {
            ResendServer server = listViewServers.SelectedItems[0].Tag as ResendServer;

            using (WaitCursor wait = new WaitCursor())
            {
                try
                {
                    server.Verify(ProcessorConfiguration.Settings.AETitle);
                    MessageBox.Show("Successfull Verification", "Verified " + server.Scp.AETitle, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "Error verifying " + server.Scp.AETitle, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }