Example #1
0
        public PrintSCPService(System.IO.Stream stream, Dicom.Log.Logger log) : base(stream, log)
        {
            var pi = stream.GetType().GetProperty("Socket", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);

            if (pi != null)
            {
                var endPoint = ((System.Net.Sockets.Socket)pi.GetValue(stream, null)).RemoteEndPoint as System.Net.IPEndPoint;
                CallingIP = endPoint.Address.ToString();
            }
            else
            {
                CallingIP = "127, 0, 0, 1";
            }
        }
Example #2
0
        public PrintService(System.IO.Stream stream, Dicom.Log.Logger log)
            : base(stream, log)
        {
            var pi = stream.GetType().GetProperty("Socket", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);

            if (pi != null)
            {
                var endPoint = ((System.Net.Sockets.Socket)pi.GetValue(stream, null)).RemoteEndPoint as System.Net.IPEndPoint;
                RemoteIP = endPoint.Address;
            }
            else
            {
                RemoteIP = new System.Net.IPAddress(new byte[] { 127, 0, 0, 1 });
            }
        }
Example #3
0
        /// <summary>
        /// Construct new print job using specified SOP instance UID. If passed SOP instance UID is missing, new UID will
        /// be generated
        /// </summary>
        /// <param name="sopInstance">New print job SOP instance uID</param>
        public PrintJob(DicomUID sopInstance, Printer printer, string originator, Dicom.Log.Logger log)
            : base()
        {
            if (printer == null)
            {
                throw new ArgumentNullException("printer");
            }

            Log = log;

            if (sopInstance == null || sopInstance.UID == string.Empty)
            {
                SOPInstanceUID = DicomUID.Generate();
            }
            else
            {
                SOPInstanceUID = sopInstance;
            }

            this.Add(DicomTag.SOPClassUID, SOPClassUID);
            this.Add(DicomTag.SOPInstanceUID, SOPInstanceUID);

            Printer = printer;

            Status = PrintJobStatus.Pending;

            PrinterName = Printer.PrinterAet;

            Originator = originator;

            if (CreationDateTime == DateTime.MinValue)
            {
                CreationDateTime = DateTime.Now;
            }

            PrintJobFolder = SOPInstanceUID.UID;

            var receivingFolder = Environment.CurrentDirectory + @"\PrintJobs";

            FullPrintJobFolder = string.Format(@"{0}\{1}", receivingFolder.TrimEnd('\\'), PrintJobFolder);

            FilmBoxFolderList = new List <string>();
        }
 public AsynchronousClient(Dicom.Log.Logger log)
 {
     Log = log;
 }
Example #5
0
        /// <summary>
        /// Construct new print job using specified SOP instance UID. If passed SOP instance UID is missing, new UID will
        /// be generated
        /// </summary>
        /// <param name="sopInstance">New print job SOP instance uID</param>
        public PrintJob(DicomUID sopInstance, Printer printer, string originator, Dicom.Log.Logger log)
            : base()
        {
            if (printer == null)
            {
                throw new ArgumentNullException("printer");
            }

            Log = log;

            if (sopInstance == null || sopInstance.UID == string.Empty)
            {
                SOPInstanceUID = DicomUID.Generate();
            }
            else
            {
                SOPInstanceUID = sopInstance;
            }

            this.Add(DicomTag.SOPClassUID, SOPClassUID);
            this.Add(DicomTag.SOPInstanceUID, SOPInstanceUID);

            Printer = printer;

            Status = PrintJobStatus.Pending;

            PrinterName = Printer.PrinterAet;

            Originator = originator;

            if (CreationDateTime == DateTime.MinValue)
            {
                CreationDateTime = DateTime.Now;
            }

            PrintJobFolder = SOPInstanceUID.UID;

            var receivingFolder = Environment.CurrentDirectory + @"\PrintJobs";

            FullPrintJobFolder = string.Format(@"{0}\{1}", receivingFolder.TrimEnd('\\'), PrintJobFolder);

            FilmBoxFolderList = new List<string>();
        }
Example #6
0
        /// <summary>
        /// Construct new print job using specified SOP instance UID. If passed SOP instance UID is missing, new UID will
        /// be generated
        /// </summary>
        /// <param name="sopInstance">New print job SOP instance uID</param>
        public PrintJob(DicomUID sopInstance, Printer printer, IPAddress callingIPAddress, string callingAETitle, string calledAETitle, Dicom.Log.Logger log)
            : base()
        {
            if (printer == null)
            {
                throw new ArgumentNullException("printer");
            }

            Log = log;

            if (sopInstance == null || sopInstance.UID == string.Empty)
            {
                SOPInstanceUID = DicomUID.Generate();
            }
            else
            {
                SOPInstanceUID = sopInstance;
            }

            this.Add(DicomTag.SOPClassUID, SOPClassUID);
            this.Add(DicomTag.SOPInstanceUID, SOPInstanceUID);

            Printer = printer;

            Status = PrintJobStatus.Pending;

            PrinterName = Printer.PrinterAet;

            CallingAETitle   = callingAETitle;
            CalledAETitle    = calledAETitle;
            CallingIPAddress = callingIPAddress;

            if (CreationDateTime == DateTime.MinValue)
            {
                CreationDateTime = DateTime.Now;
            }

            PrintJobFolder = SOPInstanceUID.UID;



            //imageFolder should read from ini file
            var    iniPath     = string.Format(@"{0}\{1}", Environment.CurrentDirectory, @"PrintSCPConfiguration.ini");
            string imageFolder = IniFile.ReadIniData("PrintSCP", "ImageFolder", "PrintImages", iniPath);

            if (imageFolder == String.Empty)
            {
                imageFolder = "PrintImages";
            }

            //Get Current Date
            string dateFolder = DateTime.Now.ToString("yyyyMMdd");

            var receivingFolder = string.Format(@"{0}\{1}", imageFolder, dateFolder);

            //FullPrintJobFolder shoud pad with AutoID, Which is get from DataBase
            // Can We use This SOPInstanceUID As AutoID??
            FullPrintJobFolder = string.Format(@"{0}\{1}", receivingFolder.TrimEnd('\\'), PrintJobFolder);

            FilmBoxFolderList = new List <string>();

            _asynchronousClient = new AsynchronousClient(log);
        }
Example #7
0
        //---------------------------

        public CStoreSCP(INetworkStream stream, Encoding fallbackEncoding, Dicom.Log.Logger log)
            : base(stream, fallbackEncoding, log)
        {
        }