コード例 #1
0
        private void InsertStudy(SopGenerator generator, DateTime currentDay)
        {
            try
            {
                DicomFile file = generator.NewStudy(currentDay);

                if (_partition == null)
                {
                    var scu = new StorageScu("TESTTOOL", _aeTitle, _host, _port);

                    scu.AddStorageInstance(new StorageInstance(file));
                    int series = _rand.Next(1, generator.MaxSeries);
                    for (int i = 1; i < series; i++)
                    {
                        file = generator.NewSeries();
                        scu.AddStorageInstance(new StorageInstance(file));
                    }
                    scu.Send();
                }
                else
                {
                    InsertInstance(file);
                    int series = _rand.Next(1, generator.MaxSeries);
                    for (int i = 1; i < series; i++)
                    {
                        file = generator.NewSeries();
                        InsertInstance(file);
                    }
                }
            }
            catch (Exception e)
            {
                Platform.Log(LogLevel.Error, e, "Unexecpted exception inserting instance into the database.");
            }
        }
コード例 #2
0
 public void AddSopGenerator(SopGenerator generator)
 {
     _generator.Add(generator);
 }