Beispiel #1
0
 private void InitActor()
 {
     _hl7Servers       = new Hashtable();
     _hl7Clients       = new Hashtable();
     _dicomServers     = new Hashtable();
     _dicomClients     = new Hashtable();
     _actorState       = ActorStateEnum.ActorCreated;
     _dvtThreadManager = new DvtThreadManager(ActorNames.Name(_actorName));
 }
Beispiel #2
0
 /// <summary>
 /// Initialize the Actor
 /// </summary>
 private void InitActor()
 {
     _hl7Servers    = new Hashtable();
     _hl7Clients    = new Hashtable();
     _dicomServers  = new Hashtable();
     _dicomClients  = new Hashtable();
     _actorState    = ActorStateEnum.ActorCreated;
     _threadManager = new ThreadManager();
 }
Beispiel #3
0
        /// <summary>
        /// Stop the Actor.
        /// </summary>
        public void StopActor()
        {
            switch (_actorState)
            {
            case ActorStateEnum.ActorStarted:
            {
                ICollection hl7Servers = _hl7Servers.Values;
                foreach (Hl7Server hl7Server in hl7Servers)
                {
                    hl7Server.StopServer();
                }

                ICollection hl7Clients = _hl7Clients.Values;
                foreach (Hl7Client hl7Client in hl7Clients)
                {
                    hl7Client.StopClient();
                }

                ICollection dicomServers = _dicomServers.Values;
                foreach (DicomServer dicomServer in dicomServers)
                {
                    dicomServer.StopServer();
                }

                ICollection dicomClients = _dicomClients.Values;
                foreach (DicomClient dicomClient in dicomClients)
                {
                    dicomClient.StopClient();
                }

                _threadManager.WaitForCompletionThreads();
                _actorState          = ActorStateEnum.ActorStopped;
                _defaultValueManager = null;
                break;
            }

            default:
                // actor either not configured or already stopped
                break;
            }
        }
Beispiel #4
0
        public void ConfigActor(ActorConfig actorConfig)
        {
            switch (_actorState)
            {
            case ActorStateEnum.ActorCreated:
            case ActorStateEnum.ActorStopped:
                // initialize the actor - this allows an actor to be re-configured after being used
                InitActor();

                // call sub-class method to apply the actor specific config
                ApplyConfig(actorConfig);

                // set state to stopped
                _actorState = ActorStateEnum.ActorStopped;
                break;

            default:
                // actor is started - so cannot be (re)configured
                break;
            }
        }
Beispiel #5
0
        public void StartActor()
        {
            switch (_actorState)
            {
            case ActorStateEnum.ActorStopped:
            {
                ICollection hl7Servers = _hl7Servers.Values;
                foreach (Hl7Server hl7Server in hl7Servers)
                {
                    hl7Server.StartServer();
                }

                ICollection hl7Clients = _hl7Clients.Values;
                foreach (Hl7Client hl7Client in hl7Clients)
                {
                    hl7Client.StartClient();
                }

                ICollection dicomServers = _dicomServers.Values;
                foreach (DicomServer dicomServer in dicomServers)
                {
                    dicomServer.StartServer();
                }

                ICollection dicomClients = _dicomClients.Values;
                foreach (DicomClient dicomClient in dicomClients)
                {
                    dicomClient.StartClient();
                }

                _actorState = ActorStateEnum.ActorStarted;
                break;
            }

            default:
                // actor either not configured or already started
                break;
            }
        }
Beispiel #6
0
 private void InitActor()
 {
     _hl7Servers = new Hashtable();
     _hl7Clients = new Hashtable();
     _dicomServers = new Hashtable();
     _dicomClients = new Hashtable();
     _actorState = ActorStateEnum.ActorCreated;
     _dvtThreadManager = new DvtThreadManager(ActorNames.Name(_actorName));
 }
Beispiel #7
0
        public void StopActor()
        {
            switch (_actorState)
            {
                case ActorStateEnum.ActorStarted:
                {
                    ICollection hl7Servers = _hl7Servers.Values;
                    foreach (Hl7Server hl7Server in hl7Servers)
                    {
                        hl7Server.StopServer();
                    }

                    ICollection hl7Clients = _hl7Clients.Values;
                    foreach (Hl7Client hl7Client in hl7Clients)
                    {
                        hl7Client.StopClient();
                    }

                    ICollection dicomServers = _dicomServers.Values;
                    foreach (DicomServer dicomServer in dicomServers)
                    {
                        dicomServer.StopServer();
                    }

                    ICollection dicomClients = _dicomClients.Values;
                    foreach (DicomClient dicomClient in dicomClients)
                    {
                        dicomClient.StopClient();
                    }

                    _dvtThreadManager.WaitForCompletionThreads();
                    _actorState = ActorStateEnum.ActorStopped;
                    break;
                }
                default:
                    // actor either not configured or already stopped
                    break;
            }
        }
Beispiel #8
0
        public void ConfigActor(ActorConfig actorConfig)
        {
            switch (_actorState)
            {
                case ActorStateEnum.ActorCreated:
                case ActorStateEnum.ActorStopped:
                    // initialize the actor - this allows an actor to be re-configured after being used
                    InitActor();

                    // call sub-class method to apply the actor specific config
                    ApplyConfig(actorConfig);

                    // set state to stopped
                    _actorState = ActorStateEnum.ActorStopped;
                    break;
                default:
                    // actor is started - so cannot be (re)configured
                    break;
            }
        }
Beispiel #9
0
        /// <summary>
        /// Start the Actor.
        /// </summary>
        public void StartActor(DefaultValueManager defaultValueManager)
        {
            switch (_actorState)
            {
            case ActorStateEnum.ActorStopped:
            {
                ICollection hl7Servers = _hl7Servers.Values;
                foreach (Hl7Server hl7Server in hl7Servers)
                {
                    // Each HL7 Server uses a HLI Thread internally.
                    // If this actor is attached to UserInterfaces that implement the
                    // IThreadUserInterface, attach the HLI thread to them.
                    AttachThreadToThreadUserInterfaces(hl7Server.Hl7Thread);

                    hl7Server.StartServer();
                }

                ICollection hl7Clients = _hl7Clients.Values;
                foreach (Hl7Client hl7Client in hl7Clients)
                {
                    // Each HL7 Client uses a HLI Thread internally.
                    // If this actor is attached to UserInterfaces that implement the
                    // IThreadUserInterface, attach the HLI thread to them.
                    AttachThreadToThreadUserInterfaces(hl7Client.Hl7Thread);

                    hl7Client.StartClient();
                }

                ICollection dicomServers = _dicomServers.Values;
                foreach (DicomServer dicomServer in dicomServers)
                {
                    // Each Dicom Server uses a HLI Thread internally.
                    // If this actor is attached to UserInterfaces that implement the
                    // IThreadUserInterface, attach the HLI thread to them.
                    AttachThreadToThreadUserInterfaces(dicomServer.Scp);

                    dicomServer.StartServer();
                }

                ICollection dicomClients = _dicomClients.Values;
                foreach (DicomClient dicomClient in dicomClients)
                {
                    // Each Dicom Client uses a HLI Thread internally.
                    // If this actor is attached to UserInterfaces that implement the
                    // IThreadUserInterface, attach the HLI thread to them.
                    AttachThreadToThreadUserInterfaces(dicomClient.Scu);

                    dicomClient.StartClient();
                }

                _actorState = ActorStateEnum.ActorStarted;

                // Save the default value manager
                _defaultValueManager = defaultValueManager;
                break;
            }

            default:
                // actor either not configured or already started
                break;
            }
        }
Beispiel #10
0
 /// <summary>
 /// Initialize the Actor
 /// </summary>
 private void InitActor()
 {
     _hl7Servers = new Hashtable();
     _hl7Clients = new Hashtable();
     _dicomServers = new Hashtable();
     _dicomClients = new Hashtable();
     _actorState = ActorStateEnum.ActorCreated;
     _threadManager = new ThreadManager();
 }
Beispiel #11
0
        /// <summary>
        /// Start the Actor.
        /// </summary>
        public void StartActor(DefaultValueManager defaultValueManager)
        {
            switch (_actorState)
            {
                case ActorStateEnum.ActorStopped:
                {
                    ICollection hl7Servers = _hl7Servers.Values;
                    foreach (Hl7Server hl7Server in hl7Servers)
                    {
                        // Each HL7 Server uses a HLI Thread internally.
                        // If this actor is attached to UserInterfaces that implement the
                        // IThreadUserInterface, attach the HLI thread to them.
                        AttachThreadToThreadUserInterfaces(hl7Server.Hl7Thread);

                        hl7Server.StartServer();
                    }

                    ICollection hl7Clients = _hl7Clients.Values;
                    foreach (Hl7Client hl7Client in hl7Clients)
                    {
                        // Each HL7 Client uses a HLI Thread internally.
                        // If this actor is attached to UserInterfaces that implement the
                        // IThreadUserInterface, attach the HLI thread to them.
                        AttachThreadToThreadUserInterfaces(hl7Client.Hl7Thread);

                        hl7Client.StartClient();
                    }

                    ICollection dicomServers = _dicomServers.Values;
                    foreach (DicomServer dicomServer in dicomServers)
                    {
                        // Each Dicom Server uses a HLI Thread internally.
                        // If this actor is attached to UserInterfaces that implement the
                        // IThreadUserInterface, attach the HLI thread to them.
                        AttachThreadToThreadUserInterfaces(dicomServer.Scp);

                        dicomServer.StartServer();
                    }

                    ICollection dicomClients = _dicomClients.Values;
                    foreach (DicomClient dicomClient in dicomClients)
                    {
                        // Each Dicom Client uses a HLI Thread internally.
                        // If this actor is attached to UserInterfaces that implement the
                        // IThreadUserInterface, attach the HLI thread to them.
                        AttachThreadToThreadUserInterfaces(dicomClient.Scu);

                        dicomClient.StartClient();
                    }

                    _actorState = ActorStateEnum.ActorStarted;

                    // Save the default value manager
                    _defaultValueManager = defaultValueManager;
                    break;
                }
                default:
                    // actor either not configured or already started
                    break;
            }
        }