partial void DoOptions() { OptionsDialog dlgOptions = new OptionsDialog(); DicomAE scp = _mySettings.GetServer(_mySettings.HighLevelStorageServer); if (scp == null) { return; } dlgOptions.ServerAE = scp.AE; dlgOptions.ServerPort = scp.Port; dlgOptions.ServerIP = scp.IPAddress; dlgOptions.ClientAE = _mySettings.ClientAe.AE; dlgOptions.Timeout = scp.Timeout; if (dlgOptions.ShowDialog(this) == System.Windows.Forms.DialogResult.OK) { scp.AE = dlgOptions.ServerAE; scp.Port = dlgOptions.ServerPort; scp.IPAddress = dlgOptions.ServerIP; scp.Timeout = dlgOptions.Timeout; _mySettings.ClientAe.AE = dlgOptions.ClientAE; _mySettings.HighLevelStorageServer = dlgOptions.ServerAE; DicomDemoSettingsManager.SaveSettings(_demoName, _mySettings); CreateFind(); } }
public MyServer(DicomAE dicomAE) { _sAE = dicomAE.AE; _sIP = dicomAE.IPAddress; _port = dicomAE.Port; _timeout = dicomAE.Timeout; _useTls = dicomAE.UseTls; }
private ScpInfo CreateWorkstationScp( ) { DicomAE wsAE = WorkstationShellController.Instance.WorkstationSettings.WorkstationDicomServer; if (null != wsAE) { return(new ScpInfo(wsAE.AE, wsAE.IPAddress, wsAE.Port, wsAE.Timeout, wsAE.UseTls)); } else { return(null); } }
private DicomDemoSettings DefaultSettings() { DicomDemoSettings settings = new DicomDemoSettings(); settings.ClientAe.AE = defaultClientAE; settings.ClientAe.Port = defaultServerPort; DicomAE serverAE = new DicomAE(); serverAE.AE = defaultServerAE; serverAE.IPAddress = defaultServerIP; serverAE.Port = defaultServerPort; serverAE.Timeout = defaultServerTimeout; serverAE.UseTls = defaultServerUseTls; settings.ServerList.Add(serverAE); SetOtherDefaults(settings); return(settings); }
private static void SetStorageServerInformationOptions(IOptionsDataAccessAgent optionsAgent) { if (null != ServerState.Instance.ServerService) { StorageServerInformation information = null; DicomAE ae = new DicomAE(ServerState.Instance.ServerService.Settings.AETitle, ServerState.Instance.ServerService.Settings.IpAddress, ServerState.Instance.ServerService.Settings.Port, 0, ServerState.Instance.ServerService.Settings.Secure); information = new StorageServerInformation(ae, ServerState.Instance.ServerService.ServiceName, Environment.MachineName); optionsAgent.Set <StorageServerInformation> (typeof(StorageServerInformation).Name, information, new Type[0]); } }
public void CopyGlobalSettings() { // Read the PACSConfigDemo settings string demoName = Path.GetFileName(Application.ExecutablePath); DicomDemoSettings globalSettings = DicomDemoSettingsManager.LoadSettings(demoName); if (globalSettings != null && globalSettings.IsPreconfigured && globalSettings.FirstRun) { globalSettings.FirstRun = false; // Servers DicomAE defaultStore = globalSettings.GetServer(globalSettings.DefaultStore); if (defaultStore != null) { MyServer storeServer = new MyServer(defaultStore); _settings.StoreServers.serverArrayList.Clear(); _settings.StoreServers.serverArrayList.Add(storeServer); } DicomAE defaultImageQuery = globalSettings.GetServer(globalSettings.DefaultImageQuery); if (defaultImageQuery != null) { MyServer imageQueryServer = new MyServer(defaultImageQuery); _settings.QuerySCPServers.serverArrayList.Clear(); _settings.QuerySCPServers.serverArrayList.Add(imageQueryServer); } DicomAE defaultMwlQuery = globalSettings.GetServer(globalSettings.DefaultMwlQuery); if (defaultMwlQuery != null) { MyServer mwlQueryServer = new MyServer(defaultMwlQuery); _settings.QueryMWLServers.serverArrayList.Clear(); _settings.QueryMWLServers.serverArrayList.Add(mwlQueryServer); } // Client _settings.clientAE = globalSettings.ClientAe.AE; _settings.clientPort = globalSettings.ClientAe.Port; DicomDemoSettingsManager.SaveSettings(demoName, globalSettings); Save(); } }
public DicomAE GetServer(string serverName) { DicomAE ret = null; if (serverName == WorkstationServer) { return(WorkstationDicomServer); } foreach (DicomAE ae in ServerList) { if (string.Compare(ae.AE, serverName, true) == 0) { ret = ae; break; } } return(ret); }
private void Initialize() { if (_mySettings != null) { DicomAE scp = GetScp(); if (scp == null) { return; } if (!string.IsNullOrEmpty(scp.IPAddress)) { IPAddress ip = IPAddress.None; if (IPAddress.TryParse(scp.IPAddress, out ip)) { _server.PeerAddress = ip; } } CreateFind(); } }
private void DoSearch() { ProgressDialog progress = new ProgressDialog(); _query.PatientQuery.PatientId = textBoxPatientId.Text; _query.PatientQuery.PatientName = GetPatientNameSearch(); listViewSeries.BeginUpdate(); listViewSeries.Items.Clear(); listViewSeries.EndUpdate(); //listViewPatients.BeginUpdate(); listViewPatients.Items.Clear(); _CurrentPatient = null; EditPatientButton.Enabled = false; DeletePatientButton.Enabled = false; EditSeriesButton.Enabled = false; DeleteSeriesButton.Enabled = false; DicomAE scp = GetScp(); if (scp == null) { return; } _server.AETitle = scp.AE; _server.PeerAddress = OptionsDialog.ResolveIPAddress(scp.IPAddress); _server.Port = scp.Port; _server.Timeout = scp.Timeout; Program.OtherPID.Clear(); Thread thread = new Thread(delegate() { try { _patientSearch = true; _find.Find <PatientRootQueryPatient, Patient>(_server, _query, (p, ds) => { string id = ds.GetValue <string>(DicomTag.OtherPatientIDs, string.Empty); if (!string.IsNullOrEmpty(id)) { Program.OtherPID[p.Id] = id; } SynchronizedInvoke(() => AddPatient(p)); }); if (_find.Rejected) { SynchronizedInvoke(() => { TaskDialogHelper.ShowMessageBox(this, "No Records Found", "Association Failed", _find.Reason, "Modify options and try again.", TaskDialogStandardButtons.Ok, TaskDialogStandardIcon.Error, TaskDialogStandardIcon.Information); }); } } catch (Exception e) { ApplicationUtils.ShowException(this, e); } SynchronizedInvoke(() => listViewPatients.Sort()); }); progress.Cancel = () => { if (_find.IsAssociated()) { _find.AbortRequest(DicomAbortSourceType.User, DicomAbortReasonType.Unexpected); } }; progress.ActionThread = thread; progress.Title = "Finding Patients"; progress.ProgressInfo = "Performing a patient search."; progress.ShowDialog(this); //listViewPatients.EndUpdate(); }