public override void ApplyConfig(DicomConfig config) { MppsScp mppsScp = new MppsScp(); mppsScp.AddDefaultMessageHandlers(); Scp = mppsScp; base.ApplyConfig(config); }
public virtual void ApplyConfig(DicomConfig config) { if (_scp != null) { _scp.Initialize(ParentActor.DvtThreadManager); _scp.Options.Identifier = String.Format("{0:000}_To_{1}_From_{2}", config.SessionId, ActorNames.Name(ParentActor.ActorName), ActorNames.Name(ActorName)); if (config.ResultsRootDirectory.Length != 0) { _scp.Options.StartAndEndResultsGathering = true; _scp.Options.ResultsFilePerAssociation = true; _scp.Options.ResultsFileName = String.Format("{0:000}_To_{1}_From_{2}_res.xml", config.SessionId, ActorNames.Name(ParentActor.ActorName), ActorNames.Name(ActorName)); _scp.Options.ResultsDirectory = config.ResultsRootDirectory; } else { _scp.Options.StartAndEndResultsGathering = false; } _scp.Options.DvtAeTitle = config.DvtAeTitle; _scp.Options.DvtPort = config.DvtPortNumber; _scp.Options.SutAeTitle = config.SutAeTitle; _scp.Options.SutPort = config.SutPortNumber; _scp.Options.SutIpAddress = config.SutIpAddress; _scp.Options.DataDirectory = config.DataDirectory; if (config.StoreData == true) { _scp.Options.StorageMode = Dvtk.Sessions.StorageMode.AsMedia; } else { _scp.Options.StorageMode = Dvtk.Sessions.StorageMode.NoStorage; } foreach (System.String filename in config.DefinitionFiles) { _scp.Options.LoadDefinitionFile(filename); } } }
public override void ApplyConfig(DicomConfig config) { // load the information models _informationModels.Load(config.DataDirectory); // add any default attribute values to the information models _informationModels.AddDefaultAttribute("0x00080005", DvtkData.Dimse.VR.CS, "ISO IR 6"); _informationModels.AddDefaultAttribute("0x00080090", DvtkData.Dimse.VR.PN, "Referring^Physician^Dr"); // set up the storage commit SCP StorageCommitScp storageCommitScp = new StorageCommitScp(); Scp = storageCommitScp; // apply the remaining configuration base.ApplyConfig(config); // add the default message handlers storageCommitScp.AddDefaultMessageHandlers(); }
public void LoadConfiguration(System.String configurationFilename) { XmlTextReader reader = new XmlTextReader(configurationFilename); while (reader.EOF == false) { reader.ReadStartElement("IheIntegrationProfile"); _profileName = reader.ReadElementString("IntegrationProfileName"); while (reader.IsStartElement()) { reader.ReadStartElement("IheActorConfiguration"); System.String actorNameString = reader.ReadElementString("ActorName"); BaseActor actor = CreateActor(actorNameString); ActorConfig actorConfig = new ActorConfig(actor.ActorName); while (reader.IsStartElement()) { reader.ReadStartElement("PeerIheActorDicomConfiguration"); System.String peerActorNameString = reader.ReadElementString("ActorName"); ActorNameEnum peerActorName = ActorNames.NameEnum(peerActorNameString); DicomConfig dicomConfig = new DicomConfig(peerActorName); dicomConfig.SessionId = UInt16.Parse(reader.ReadElementString("SessionId")); reader.ReadStartElement("DvtNode"); dicomConfig.DvtAeTitle = reader.ReadElementString("AeTitle"); dicomConfig.DvtIpAddress = reader.ReadElementString("IpAddress"); dicomConfig.DvtPortNumber = UInt16.Parse(reader.ReadElementString("PortNumber")); reader.ReadEndElement(); reader.ReadStartElement("SutNode"); dicomConfig.SutAeTitle = reader.ReadElementString("AeTitle"); dicomConfig.SutIpAddress = reader.ReadElementString("IpAddress"); dicomConfig.SutPortNumber = UInt16.Parse(reader.ReadElementString("PortNumber")); reader.ReadEndElement(); dicomConfig.DataDirectory = reader.ReadElementString("DataDirectory"); System.String storeData = reader.ReadElementString("StoreData"); if (storeData == "True") { dicomConfig.StoreData = true; } else { dicomConfig.StoreData = false; } reader.ReadStartElement("DefinitionFiles"); bool readingDefinitions = true; while (readingDefinitions == true) { dicomConfig.AddDefinitionFile(reader.ReadElementString("DefinitionFile")); reader.Read(); if ((reader.NodeType == XmlNodeType.EndElement) && (reader.Name == "DefinitionFiles")) { reader.Read(); readingDefinitions = false; } } dicomConfig.ResultsRootDirectory = reader.ReadElementString("ResultsRootDirectory"); _resultsDirectory = dicomConfig.ResultsRootDirectory; reader.ReadEndElement(); actorConfig.Add(dicomConfig); } reader.ReadEndElement(); actor.ConfigActor(actorConfig); _actors.Add(actor); } reader.ReadEndElement(); } reader.Close(); }