Ejemplo n.º 1
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);
        }
Ejemplo n.º 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();
     }
 }
Ejemplo n.º 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();
            }
        }
Ejemplo n.º 4
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;
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 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();
            }
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 9
0
 public DcmPrintDocument(DicomPrintConfig config, DcmFilmSession session)
 {
     _session = session;
     _config = config;
     _filmBoxes = new List<DcmFilmBox>();
 }
Ejemplo n.º 10
0
 public DcmPrintDocument(DicomPrintConfig config, DcmFilmSession session)
 {
     _session   = session;
     _config    = config;
     _filmBoxes = new List <DcmFilmBox>();
 }