Beispiel #1
0
        private void Run(object args)
        {
            Arguments arguments = (Arguments)args;

            VerificationServiceSCU echo = new VerificationServiceSCU();

            echo.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            Association association = new Association();

            association.AddService(echo);

            SetStatusBarText("Running ...");
            if (association.Open(arguments.Scp, arguments.Scu))
            {
                ServiceStatus status = echo.Echo();
                SetStatusBarText(status.ToString());
            }
            else
            {
                SetStatusBarText("Can't establish association");
            }

            association.Close();
            association.Dispose();
        }
Beispiel #2
0
        static void echomwl(string title, IPAddress address, int port)
        {
            VerificationServiceSCU echo = new VerificationServiceSCU();

            echo.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            QueryRetrieveServiceSCU mwl = new QueryRetrieveServiceSCU();

            mwl.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            Association association = new Association();

            association.AddService(mwl);
            association.AddService(echo);

            if (association.Open(title, address, port))
            {
                bool result = echo.Echo();
                System.Console.WriteLine("\necho {0}.", (result) ? "succeded" : "failed");
                if (result)
                {
                    DataSet          query   = GetQuery(null);
                    RecordCollection records = mwl.CFind(query);
                    WriteRecords(records);
                }
            }
            else
            {
                System.Console.WriteLine("\ncan't Open.");
            }
            association.Close();
        }
Beispiel #3
0
        static void get(ApplicationEntity host)
        {
            CMoveServiceSCU get = new CMoveServiceSCU(SOPClass.PatientRootQueryRetrieveInformationModelGET);

            get.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            StorageServiceSCP store = new StorageServiceSCP(SOPClass.DigitalXRayImageStorageForPresentation);

            store.Role = Role.Scp;
            store.Syntaxes.Add(Syntax.ExplicitVrLittleEndian);
            store.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            VerificationServiceSCU echo = new VerificationServiceSCU();

            echo.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            Association association = new Association();

            association.AddService(store);
            association.AddService(get);
            association.AddService(echo);

            if (association.Open(host))
            {
                if (get.Active && store.Active)
                {
                    store.ImageStored += new ImageStoredEventHandler(OnImageStored);
                    try
                    {
                        Element element = new Element(t.PatientID, "759274");
                        DataSet results = get.CGet(element);
                    }
                    catch (Exception ex)
                    {
                        Debug.WriteLine(ex.Message);
                    }
                    finally
                    {
                        store.ImageStored -= new ImageStoredEventHandler(OnImageStored);
                    }
                }
            }
            else
            {
                Debug.WriteLine("\ncan't Open.");
            }

            association.Close();
        }
        public bool IsPortOpened()
        {
            var result = false;

            using (var association = new Association())
            {
                var echo = new VerificationServiceSCU();
                echo.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

                association.AddService(echo);
                if (association.Open(AeTitle, IPAddress.Parse("127.0.0.1"), Port))
                {
                    result = true;
                }
                association.Close();
            }
            return(result);
        }
Beispiel #5
0
        private bool TestServer()
        {
            bool result = false;

            using (Association association = new Association())
            {
                VerificationServiceSCU echo = new VerificationServiceSCU();
                echo.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

                association.AddService(echo);
                if (association.Open(aetitle, IPAddress.Parse("127.0.0.1"), port))
                {
                    result = true;
                }
                echo = null;
            }
            return(result);
        }
Beispiel #6
0
        static void echo(string title, IPAddress address, int port)
        {
            VerificationServiceSCU echo = new VerificationServiceSCU();

            echo.Syntaxes.Add(Syntax.ExplicitVrLittleEndian);

            Association association = new Association();

            association.AddService(echo);

            if (association.Open(title, address, port))
            {
                bool result = echo.Echo();
                System.Console.WriteLine("\necho {0}.", (result) ? "succeded" : "failed");
            }
            else
            {
                System.Console.WriteLine("\ncan't Open.");
            }
            association.Close();
        }
Beispiel #7
0
        static void echo(string title, IPAddress address, int port)
        {
            VerificationServiceSCU echo = new VerificationServiceSCU();

            echo.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            Association association = new Association();

            association.AddService(echo);

            if (association.Open(title, address, port))
            {
                ServiceStatus status = echo.Echo();
                Debug.WriteLine(String.Format("\necho {0}.", status));
            }
            else
            {
                Debug.WriteLine(String.Format("\ncan't Open."));
            }

            echo = null;
            association.Dispose();
            association = null;
        }
Beispiel #8
0
 public VerificationServiceSCU(VerificationServiceSCU other)
     : base(other)
 {
 }