public void Ticket429_2_1() { ThreadManager threadManager = new ThreadManager(); LotsOfLoggingDicomThread lotsOfLoggingDicomThread1 = new LotsOfLoggingDicomThread(); lotsOfLoggingDicomThread1.Initialize(threadManager); HliForm hliForm = new HliForm(); // hliForm.AutoExit = false; hliForm.Attach(lotsOfLoggingDicomThread1); lotsOfLoggingDicomThread1.Start(); lotsOfLoggingDicomThread1.WaitForCompletion(); hliForm.ClearActivityLogging(); LotsOfLoggingDicomThread lotsOfLoggingDicomThread2 = new LotsOfLoggingDicomThread(); lotsOfLoggingDicomThread2.Initialize(threadManager); hliForm.Attach(lotsOfLoggingDicomThread2); lotsOfLoggingDicomThread2.numberOfLinesToLog = 10; lotsOfLoggingDicomThread2.Start(); hliForm.WaitUntilClosed(); }
/// <summary> /// Reset the singleton, i.e. when the GetSingleton method is called afterwards, a new /// HliForm object will be returned. /// </summary> public static void ResetSingleton() { lock (singletonLock) { singleton = null; } }
/// <summary> /// When outside this class, there is a need to use one HliForm instance in different places, /// this method may provide this single instance. /// </summary> /// <returns></returns> public static HliForm GetSingleton() { lock (singletonLock) { if (singleton == null) { singleton = new HliForm(); } return(singleton); } }
public void TestTextProperty() { ThreadManager threadManager = new ThreadManager(); HliForm hliForm = new HliForm(); DicomThread1 dicomThread1 = new DicomThread1(hliForm); dicomThread1.Initialize(threadManager); // No logging needed this time. dicomThread1.Options.StartAndStopResultsGatheringEnabled = false; hliForm.Attach(dicomThread1); dicomThread1.Start(); dicomThread1.WaitForCompletion(); }
/// <summary> /// Constructor. /// </summary> /// <param name="hliForm">The HLIForm instance that uses this internal form.</param> public HliInternalForm(HliForm hliForm) { // Required for Windows Form Designer support InitializeComponent(); this.hliForm = hliForm; this.threadsInThreadState[(int)ThreadState.UnStarted] = new ArrayList(); this.threadsInThreadState[(int)ThreadState.Running] = new ArrayList(); this.threadsInThreadState[(int)ThreadState.Stopping] = new ArrayList(); this.threadsInThreadState[(int)ThreadState.Stopped] = new ArrayList(); this.threadStateChangeEventHandler = new Thread.ThreadStateChangeHandler(this.HandleThreadStateChangeEvent); // Create and start the timer. this.timer = new System.Windows.Forms.Timer(); this.timer.Tick += new EventHandler(this.PerformActions); Interval = 100; this.timer.Start(); this.buttonStop.Text = TEXT_STOP; }
public void TestTextProperty() { ThreadManager threadManager = new ThreadManager(); HliForm hliForm = new HliForm(); DicomThread1 dicomThread1 = new DicomThread1(hliForm); dicomThread1.Initialize(threadManager); // No logging needed this time. dicomThread1.Options.StartAndStopResultsGatheringEnabled = false; hliForm.Attach(dicomThread1); dicomThread1.Start(); dicomThread1.WaitForCompletion(); }
public DicomThread1(HliForm hliForm) { this.hliForm = hliForm; }
public void Ticket429_2_1() { ThreadManager threadManager = new ThreadManager(); LotsOfLoggingDicomThread lotsOfLoggingDicomThread1 = new LotsOfLoggingDicomThread(); lotsOfLoggingDicomThread1.Initialize(threadManager); HliForm hliForm = new HliForm(); // hliForm.AutoExit = false; hliForm.Attach(lotsOfLoggingDicomThread1); lotsOfLoggingDicomThread1.Start(); lotsOfLoggingDicomThread1.WaitForCompletion(); hliForm.ClearActivityLogging(); LotsOfLoggingDicomThread lotsOfLoggingDicomThread2 = new LotsOfLoggingDicomThread(); lotsOfLoggingDicomThread2.Initialize(threadManager); hliForm.Attach(lotsOfLoggingDicomThread2); lotsOfLoggingDicomThread2.numberOfLinesToLog = 10; lotsOfLoggingDicomThread2.Start(); hliForm.WaitUntilClosed(); }
public DicomThread1(HliForm hliForm) { this.hliForm = hliForm; }
public void TestFixtureSetUp() { Dvtk.Setup.Initialize(); ThreadManager threadManager = new ThreadManager(); dicomThread = new DicomMainThread(); dicomThread.Initialize(threadManager); dicomThread.Options.ResultsDirectory = Paths.ResultsDirectoryFullPath; dicomThread.Options.Identifier = "Overview"; dicomThread.Options.LogChildThreadsOverview = false; HliForm theHliForm = new HliForm(); theHliForm.Attach(dicomThread); theHliForm.AutoExit = true; dicomThread.Start(); }
public void Ticket1293_4_1() { ThreadManager threadManager = new ThreadManager(); Ticket1293MainDicomThread ticket1293MainDicomThread = new Ticket1293MainDicomThread("1.2.840.10008.5.1.4.1.1.7"); ticket1293MainDicomThread.Initialize(threadManager); Config.SetOptions(ticket1293MainDicomThread, "Ticket1293", "Main 1.2.840.10008.5.1.4.1.1.7"); ticket1293MainDicomThread.Options.LoadDefinitionFile(Path.Combine(Paths.DefinitionsDirectoryFullPath, "PatientRootQueryRetrieve-FIND.def")); HliForm hliForm = new HliForm(); hliForm.Attach(ticket1293MainDicomThread); ticket1293MainDicomThread.Start(); ticket1293MainDicomThread.WaitForCompletion(); Assert.That(ticket1293MainDicomThread.NrOfErrors + ticket1293MainDicomThread.NrOfWarnings, Is.EqualTo(0)); }
public void Ticket1293_2_1() { ThreadManager threadManager = new ThreadManager(); Ticket1293MainDicomThread ticket1293MainDicomThread = new Ticket1293MainDicomThread("1.2.840.10008.1.2.1"); ticket1293MainDicomThread.Initialize(threadManager); Config.SetOptions(ticket1293MainDicomThread, "Ticket1293", "Main 1.2.840.10008.1.2.1"); HliForm hliForm = new HliForm(); hliForm.Attach(ticket1293MainDicomThread); ticket1293MainDicomThread.Start(); ticket1293MainDicomThread.WaitForCompletion(); Assert.That(ticket1293MainDicomThread.NrOfErrors + ticket1293MainDicomThread.NrOfWarnings, Is.EqualTo(0)); }
/// <summary> /// Reset the singleton, i.e. when the GetSingleton method is called afterwards, a new /// HliForm object will be returned. /// </summary> public static void ResetSingleton() { lock(singletonLock) { singleton = null; } }
/// <summary> /// When outside this class, there is a need to use one HliForm instance in different places, /// this method may provide this single instance. /// </summary> /// <returns></returns> public static HliForm GetSingleton() { lock(singletonLock) { if (singleton == null) { singleton = new HliForm(); } return(singleton); } }
public void Ticket1232_1_1() { ThreadManager threadManager1 = new ThreadManager(); ThreadManager threadManager2 = new ThreadManager(); HliForm hliForm = new HliForm(); EchoSCP echoSCP = new EchoSCP("SCP_Association"); echoSCP.Initialize(threadManager1); Config.SetOptions(echoSCP, "Ticket1232_1_1", "SCP"); echoSCP.Options.AutoValidate = false; hliForm.Attach(echoSCP); echoSCP.Start(); System.Threading.Thread.Sleep(2000); for (int index = 0; index < 10; index++) { DicomThread_NUnit.EchoSCU echoSCU = new DicomThread_NUnit.EchoSCU(); echoSCU.Initialize(threadManager2); Config.SetOptions(echoSCU, "Ticket1232_1_1", "SCU_" + index.ToString()); echoSCU.Options.AutoValidate = false; hliForm.Attach(echoSCU); echoSCU.Start(); System.Threading.Thread.Sleep(500); } threadManager2.WaitForCompletionThreads(); echoSCP.Stop(); echoSCP.WaitForCompletion(); Assert.That(echoSCP.NrOfErrors + echoSCP.NrOfWarnings, Is.EqualTo(0)); }