public static Study GenerateRandomStudy() { Random rand = new Random(); Study study = new Study(rand.Next(0, 100), "1.3.12.2.1107.5.12.3.1044.8.0.5102" + rand.Next(10000000, 99999999), DateTime.Now, rand.Next(1000100000, 1000999999).ToString()); Machine machine = new Machine(rand.Next(0, 100), "QC Light kamer " + rand.Next(1, 10), rand.Next(1000000, 9999999).ToString()); Detector detector = new Detector(rand.Next(0, 100), "Detector " + rand.Next(1, 10), rand.Next(1000000, 9999999).ToString()); StudyImage image = new StudyImage(rand.Next(0, 100), "1.3.12.2.1107.5.12.3.1044.6.0.2234" + rand.Next(10000000, 99999999).ToString(), ImageStatus.Good, machine, detector, "PIX-13 Automatic", DateTime.Now); study.AddImage(image); return(study); }
/// <summary> /// Adds an image to the array of images in the study /// </summary> /// <param name="image">The image information to add at the end of the array</param> public void AddImage(StudyImage image) { // Resize the array to the correct size if (images == null) { images = new StudyImage[1]; } else { Array.Resize(ref images, images.Length + 1); } // Add the image information at the end of the array images[images.Length - 1] = image; // Update the machines and detectors of the study UpdateMachinesAndDetectors(); }