protected override void OnReceiveAssociateRequest(DcmAssociate association)
        {
            association.NegotiateAsyncOps = false;
            LogID = association.CallingAE;

            _config = Config.Instance.FindPrinter(association.CalledAE);
            if (_config == null)
            {
                SendAssociateReject(DcmRejectResult.Permanent, DcmRejectSource.ServiceUser, DcmRejectReason.CalledAENotRecognized);
                return;
            }

            foreach (DcmPresContext pc in association.GetPresentationContexts())
            {
                if (pc.AbstractSyntax == DicomUID.VerificationSOPClass ||
                    pc.AbstractSyntax == DicomUID.BasicColorPrintManagementMetaSOPClass ||
                    pc.AbstractSyntax == DicomUID.BasicGrayscalePrintManagementMetaSOPClass ||
                    pc.AbstractSyntax == DicomUID.PrinterSOPClass ||
                    //pc.AbstractSyntax == DicomUID.PrinterConfigurationRetrieval ||
                    //pc.AbstractSyntax == DicomUID.PrintJob ||
                    pc.AbstractSyntax == DicomUID.BasicFilmSessionSOPClass ||
                    pc.AbstractSyntax == DicomUID.BasicFilmBoxSOPClass ||
                    pc.AbstractSyntax == DicomUID.BasicGrayscaleImageBoxSOPClass ||
                    pc.AbstractSyntax == DicomUID.BasicColorImageBoxSOPClass)
                {
                    pc.SetResult(DcmPresContextResult.Accept);
                }
                else
                {
                    pc.SetResult(DcmPresContextResult.RejectAbstractSyntaxNotSupported);
                }
            }
            SendAssociateAccept(association);
        }
Beispiel #2
0
 private void OnClickAddPrinter(object sender, EventArgs e)
 {
     DicomPrintConfig config = new DicomPrintConfig();
     PrinterSettingsForm psf = new PrinterSettingsForm(config);
     if (psf.ShowDialog(this) == DialogResult.OK) {
         Config.Instance.Printers.Add(config);
         SaveSettings();
     }
 }
Beispiel #3
0
        private void OnClickAddPrinter(object sender, EventArgs e)
        {
            DicomPrintConfig    config = new DicomPrintConfig();
            PrinterSettingsForm psf    = new PrinterSettingsForm(config);

            if (psf.ShowDialog(this) == DialogResult.OK)
            {
                Config.Instance.Printers.Add(config);
                SaveSettings();
            }
        }
        public PrinterSettingsForm(DicomPrintConfig config)
        {
            InitializeComponent();

            _config = config;
            tbAETitle.Text = _config.AETitle;
            tbPrinterName.Text = _config.PrinterName;
            cbPaperSource.Items.Clear();
            cbPaperSource.Items.Add("Driver Select");
            foreach (PaperSource source in _config.PrinterSettings.PaperSources) {
                if (!String.IsNullOrEmpty(source.SourceName))
                    cbPaperSource.Items.Add(source.SourceName);
            }
            cbPaperSource.SelectedItem = _config.PaperSource;
            if (cbPaperSource.SelectedIndex == -1)
                cbPaperSource.SelectedIndex = 0;
            cbPreviewOnly.Checked = _config.PreviewOnly;
        }
Beispiel #5
0
        private void OnClickDeletePrinter(object sender, EventArgs e)
        {
            if (lvPrinters.SelectedItems.Count == 0)
            {
                return;
            }

            if (MessageBox.Show(this, "Are you sure you want to delete the selected printer?", "Delete Printer",
                                MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
            {
                return;
            }

            ListViewItem     lvi    = lvPrinters.SelectedItems[0];
            DicomPrintConfig config = (DicomPrintConfig)lvi.Tag;

            Config.Instance.Printers.Remove(config);
            SaveSettings();
        }
Beispiel #6
0
        private void OnClickPrinterSettings(object sender, EventArgs e)
        {
            if (lvPrinters.SelectedItems.Count == 0)
            {
                return;
            }

            ListViewItem        lvi    = lvPrinters.SelectedItems[0];
            DicomPrintConfig    config = (DicomPrintConfig)lvi.Tag;
            PrinterSettingsForm psf    = new PrinterSettingsForm(config);

            if (psf.ShowDialog(this) == DialogResult.OK)
            {
                SaveSettings();
            }
            else
            {
                LoadSettings();
            }
        }
Beispiel #7
0
        public PrinterSettingsForm(DicomPrintConfig config)
        {
            InitializeComponent();

            _config            = config;
            tbAETitle.Text     = _config.AETitle;
            tbPrinterName.Text = _config.PrinterName;
            cbPaperSource.Items.Clear();
            cbPaperSource.Items.Add("Driver Select");
            foreach (PaperSource source in _config.PrinterSettings.PaperSources)
            {
                if (!String.IsNullOrEmpty(source.SourceName))
                {
                    cbPaperSource.Items.Add(source.SourceName);
                }
            }
            cbPaperSource.SelectedItem = _config.PaperSource;
            if (cbPaperSource.SelectedIndex == -1)
            {
                cbPaperSource.SelectedIndex = 0;
            }
            cbPreviewOnly.Checked = _config.PreviewOnly;
        }
Beispiel #8
0
        protected override void OnReceiveAssociateRequest(DcmAssociate association)
        {
            association.NegotiateAsyncOps = false;
            LogID = association.CallingAE;

            _config = Config.Instance.FindPrinter(association.CalledAE);
            if (_config == null) {
                SendAssociateReject(DcmRejectResult.Permanent, DcmRejectSource.ServiceUser, DcmRejectReason.CalledAENotRecognized);
                return;
            }

            foreach (DcmPresContext pc in association.GetPresentationContexts()) {
                if (pc.AbstractSyntax == DicomUID.VerificationSOPClass ||
                    pc.AbstractSyntax == DicomUID.BasicColorPrintManagementMetaSOPClass ||
                    pc.AbstractSyntax == DicomUID.BasicGrayscalePrintManagementMetaSOPClass ||
                    pc.AbstractSyntax == DicomUID.PrinterSOPClass ||
                    //pc.AbstractSyntax == DicomUID.PrinterConfigurationRetrieval ||
                    //pc.AbstractSyntax == DicomUID.PrintJob ||
                    pc.AbstractSyntax == DicomUID.BasicFilmSessionSOPClass ||
                    pc.AbstractSyntax == DicomUID.BasicFilmBoxSOPClass ||
                    pc.AbstractSyntax == DicomUID.BasicGrayscaleImageBoxSOPClass ||
                    pc.AbstractSyntax == DicomUID.BasicColorImageBoxSOPClass) {
                    pc.SetResult(DcmPresContextResult.Accept);
                } else {
                    pc.SetResult(DcmPresContextResult.RejectAbstractSyntaxNotSupported);
                }
            }
            SendAssociateAccept(association);
        }
Beispiel #9
0
 public DcmPrintDocument(DicomPrintConfig config, DcmFilmSession session)
 {
     _session = session;
     _config = config;
     _filmBoxes = new List<DcmFilmBox>();
 }
 public DcmPrintDocument(DicomPrintConfig config, DcmFilmSession session)
 {
     _session   = session;
     _config    = config;
     _filmBoxes = new List <DcmFilmBox>();
 }