コード例 #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);
        }
コード例 #2
0
ファイル: MainForm.cs プロジェクト: k11hao/mdcm-printscp
 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();
     }
 }
コード例 #3
0
ファイル: MainForm.cs プロジェクト: wangxueqzz/mdcm-printscp
        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();
            }
        }
コード例 #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;
        }
コード例 #5
0
ファイル: MainForm.cs プロジェクト: wangxueqzz/mdcm-printscp
        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();
        }
コード例 #6
0
ファイル: MainForm.cs プロジェクト: wangxueqzz/mdcm-printscp
        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();
            }
        }
コード例 #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;
        }
コード例 #8
0
ファイル: NPrintService.cs プロジェクト: k11hao/mdcm-printscp
        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);
        }
コード例 #9
0
ファイル: NPrintService.cs プロジェクト: k11hao/mdcm-printscp
 public DcmPrintDocument(DicomPrintConfig config, DcmFilmSession session)
 {
     _session = session;
     _config = config;
     _filmBoxes = new List<DcmFilmBox>();
 }
コード例 #10
0
 public DcmPrintDocument(DicomPrintConfig config, DcmFilmSession session)
 {
     _session   = session;
     _config    = config;
     _filmBoxes = new List <DcmFilmBox>();
 }