Ejemplo n.º 1
0
        protected override void Execute()
        {
            //
            // The Worklist message handler.
            //
            MessageHandlerSendRandomCFindRsp wlHandler = null;

            Dvtk.DvtkDicomEmulators.WorklistMessageHandlers.CFindHandler worklistCFindHandler = null;

            if (sendRandomizeRsps)
            {
                ModalityWorklistInformationModel modalityWorklistInformationModel = RisEmulator.CreateMWLInformationModel(true, worklistThread);
                worklistCFindHandler = new Dvtk.DvtkDicomEmulators.WorklistMessageHandlers.CFindHandler(modalityWorklistInformationModel);
            }
            else
            {
                wlHandler = new MessageHandlerSendRandomCFindRsp();
                RandomizeDatasets();
                wlHandler.setRandomDatasets(randomizedDatasets);
            }

            //
            // The MPPS message handlers.
            //
            Dvtk.DvtkDicomEmulators.MppsMessageHandlers.NCreateHandler mppsNCreateHandler = new Dvtk.DvtkDicomEmulators.MppsMessageHandlers.NCreateHandler();
            Dvtk.DvtkDicomEmulators.MppsMessageHandlers.NSetHandler    mppsNSetHandler    = new Dvtk.DvtkDicomEmulators.MppsMessageHandlers.NSetHandler();
            MessageHandlerShowMPPSStatus messageHandlerShowMPPSStatus = new MessageHandlerShowMPPSStatus();

            //
            // Create the actual SCP's
            //
            if (this.mppsOptions.LocalPort == this.worklistOptions.LocalPort)
            {
                WriteWarning("Worklist SCP and MPPS are configured to listen to the same port. Only one DicomThread is started using the settings from the Worklist SCP");

                RISScp worklistMppsScp = new RISScp("Worklist_MPPS_SCP");
                worklistMppsScp.Initialize(this);
                worklistMppsScp.Options.DeepCopyFrom(this.worklistOptions);
                worklistMppsScp.Options.Identifier = "Worklist_MPPS_SCP";
                worklistMppsScp.setSupportedTS(selectedTSList);

                if (sendRandomizeRsps)
                {
                    worklistMppsScp.AddToFront(worklistCFindHandler);
                }
                else
                {
                    worklistMppsScp.AddToFront(wlHandler);
                }

                worklistMppsScp.AddToFront(messageHandlerShowMPPSStatus);
                worklistMppsScp.AddToFront(mppsNCreateHandler);
                worklistMppsScp.AddToFront(mppsNSetHandler);

                worklistMppsScp.Start();
            }
            else
            {
                RISScp mppsScp = new RISScp("MPPS_SCP");
                mppsScp.Initialize(this);
                mppsScp.Options.DeepCopyFrom(this.mppsOptions);
                mppsScp.Options.Identifier = "MPPS_SCP";
                mppsScp.setSupportedTS(selectedTSList);

                RISScp worklistScp = new RISScp("Worklist_SCP");
                worklistScp.Initialize(this);
                worklistScp.Options.DeepCopyFrom(this.worklistOptions);
                worklistScp.Options.Identifier = "Worklist_SCP";
                //worklistScp.setSupportedTS(selectedTSList);

                // Add the message handlers.
                if (sendRandomizeRsps)
                {
                    worklistScp.AddToFront(worklistCFindHandler);
                }
                else
                {
                    worklistScp.AddToFront(wlHandler);
                }

                mppsScp.AddToFront(messageHandlerShowMPPSStatus);
                mppsScp.AddToFront(mppsNCreateHandler);
                mppsScp.AddToFront(mppsNSetHandler);

                worklistScp.Start();
                mppsScp.Start();
            }
        }
Ejemplo n.º 2
0
        protected override void Execute()
        {
            //
            // The Worklist message handler.
            //
            MessageHandlerSendRandomCFindRsp wlHandler = null;
            Dvtk.DvtkDicomEmulators.WorklistMessageHandlers.CFindHandler worklistCFindHandler = null;

            if(sendRandomizeRsps)
            {
                ModalityWorklistInformationModel modalityWorklistInformationModel = RisEmulator.CreateMWLInformationModel(true, worklistThread);
                worklistCFindHandler = new Dvtk.DvtkDicomEmulators.WorklistMessageHandlers.CFindHandler(modalityWorklistInformationModel);
            }
            else
            {
                wlHandler = new MessageHandlerSendRandomCFindRsp();
                RandomizeDatasets();
                wlHandler.setRandomDatasets(randomizedDatasets);
            }

            //
            // The MPPS message handlers.
            //
            Dvtk.DvtkDicomEmulators.MppsMessageHandlers.NCreateHandler mppsNCreateHandler = new Dvtk.DvtkDicomEmulators.MppsMessageHandlers.NCreateHandler();
            Dvtk.DvtkDicomEmulators.MppsMessageHandlers.NSetHandler mppsNSetHandler = new Dvtk.DvtkDicomEmulators.MppsMessageHandlers.NSetHandler();
            MessageHandlerShowMPPSStatus messageHandlerShowMPPSStatus = new MessageHandlerShowMPPSStatus();

            //
            // Create the actual SCP's
            //
            if (this.mppsOptions.LocalPort == this.worklistOptions.LocalPort)
            {
                WriteWarning("Worklist SCP and MPPS are configured to listen to the same port. Only one DicomThread is started using the settings from the Worklist SCP");

                RISScp worklistMppsScp = new RISScp("Worklist_MPPS_SCP");
                worklistMppsScp.Initialize(this);
                worklistMppsScp.Options.DeepCopyFrom(this.worklistOptions);
                worklistMppsScp.Options.Identifier = "Worklist_MPPS_SCP";
                worklistMppsScp.setSupportedTS(selectedTSList);

                if(sendRandomizeRsps)
                    worklistMppsScp.AddToFront(worklistCFindHandler);
                else
                    worklistMppsScp.AddToFront(wlHandler);

                worklistMppsScp.AddToFront(messageHandlerShowMPPSStatus);
                worklistMppsScp.AddToFront(mppsNCreateHandler);
                worklistMppsScp.AddToFront(mppsNSetHandler);

                worklistMppsScp.Start();
            }
            else
            {
                RISScp mppsScp = new RISScp("MPPS_SCP");
                mppsScp.Initialize(this);
                mppsScp.Options.DeepCopyFrom(this.mppsOptions);
                mppsScp.Options.Identifier = "MPPS_SCP";
                mppsScp.setSupportedTS(selectedTSList);

                RISScp worklistScp = new RISScp("Worklist_SCP");
                worklistScp.Initialize(this);
                worklistScp.Options.DeepCopyFrom(this.worklistOptions);
                worklistScp.Options.Identifier = "Worklist_SCP";
                //worklistScp.setSupportedTS(selectedTSList);

                // Add the message handlers.
                if(sendRandomizeRsps)
                    worklistScp.AddToFront(worklistCFindHandler);
                else
                    worklistScp.AddToFront(wlHandler);

                mppsScp.AddToFront(messageHandlerShowMPPSStatus);
                mppsScp.AddToFront(mppsNCreateHandler);
                mppsScp.AddToFront(mppsNSetHandler);

                worklistScp.Start();
                mppsScp.Start();
            }
        }