Ejemplo n.º 1
0
        //public string IfSaveHighPrecisionEFilm { get; private set; }

        #endregion



        #region [---Public Methods---]

        public void DeserializedFromXml(XmlNode currNode)
        {
            try
            {
                Logger.LogFuncUp();

                if (null == currNode)
                {
                    return;
                }

                this.CurrPrinterAE            = OffScreenRenderXmlHelper.GetChildNodeValue(currNode, OffScreenRenderXmlHelper.CURRENT_PRINTER_AE);
                this.CurrFilmSize             = OffScreenRenderXmlHelper.GetChildNodeValue(currNode, OffScreenRenderXmlHelper.CURRENT_FILM_SIZE);
                this.CurrOrientation          = OffScreenRenderXmlHelper.GetChildNodeValue(currNode, OffScreenRenderXmlHelper.CURRENT_ORIENTATION);
                this.CurrCopyCount            = OffScreenRenderXmlHelper.GetChildNodeValue(currNode, OffScreenRenderXmlHelper.CURRENT_COPY_COUNT);
                this.CurrMediumType           = OffScreenRenderXmlHelper.GetChildNodeValue(currNode, OffScreenRenderXmlHelper.CURRENT_MEDIUM_TYPE);
                this.CurrFilmDestination      = OffScreenRenderXmlHelper.GetChildNodeValue(currNode, OffScreenRenderXmlHelper.CURRENT_FILM_DESTINATION);
                this.CurrPrinterDPI           = OffScreenRenderXmlHelper.GetChildNodeValue(currNode, OffScreenRenderXmlHelper.CURRENT_PRINTER_DPI);
                this.IfSaveHighPrecisionEFilm = OffScreenRenderXmlHelper.GetChildNodeValue(currNode, OffScreenRenderXmlHelper.IF_SAVE_HIGH_PRECISION_EFILM);
                this.IfSave       = OffScreenRenderXmlHelper.GetChildNodeValue(currNode, OffScreenRenderXmlHelper.IF_SAVE_EFILM_WHEN_FILMING);
                this.IfColorPrint = OffScreenRenderXmlHelper.GetChildNodeValue(currNode, OffScreenRenderXmlHelper.IF_COLOR_PRINT);


                Logger.LogFuncDown();
            }
            catch (Exception ex)
            {
                Logger.LogFuncException(ex.Message + ex.StackTrace);
            }
        }
Ejemplo n.º 2
0
        public void DeserializedFromXml(XmlNode currNode)
        {
            try
            {
                Logger.LogFuncUp();

                if (null == currNode)
                {
                    return;
                }

                this.DisplayFont     = OffScreenRenderXmlHelper.GetChildNodeValue(currNode, OffScreenRenderXmlHelper.DISPLAY_FONT);
                this.DisplayPosition = OffScreenRenderXmlHelper.GetChildNodeValue(currNode, OffScreenRenderXmlHelper.DISPLAY_POSITION);
                this.PatientName     = OffScreenRenderXmlHelper.GetChildNodeValue(currNode, OffScreenRenderXmlHelper.PATIENT_NAME_FLAG);
                this.PatientId       = OffScreenRenderXmlHelper.GetChildNodeValue(currNode, OffScreenRenderXmlHelper.PATIENT_ID_FLAG);
                this.Age             = OffScreenRenderXmlHelper.GetChildNodeValue(currNode, OffScreenRenderXmlHelper.AGE_FLAG);
                this.Sex             = OffScreenRenderXmlHelper.GetChildNodeValue(currNode, OffScreenRenderXmlHelper.SEX_FLAG);
                this.StudyDate       = OffScreenRenderXmlHelper.GetChildNodeValue(currNode, OffScreenRenderXmlHelper.STUDY_DATE_FLAG);
                this.HospitalInfo    = OffScreenRenderXmlHelper.GetChildNodeValue(currNode, OffScreenRenderXmlHelper.HOSPITAL_INFO_FLAG);
                this.Comment         = OffScreenRenderXmlHelper.GetChildNodeValue(currNode, OffScreenRenderXmlHelper.COMMENT);
                this.PageNo          = OffScreenRenderXmlHelper.GetChildNodeValue(currNode, OffScreenRenderXmlHelper.PAGE_NO);
                this.AccessionNo     = OffScreenRenderXmlHelper.GetChildNodeValue(currNode,
                                                                                  OffScreenRenderXmlHelper.ACCESSION_NO);
                this.StudyInstanceUid = OffScreenRenderXmlHelper.GetChildNodeValue(currNode,
                                                                                   OffScreenRenderXmlHelper.FILMING_STUDY_INSTANCE_UID);
                Logger.LogFuncDown();
            }
            catch (Exception ex)
            {
                Logger.LogFuncException(ex.Message + ex.StackTrace);
            }
        }
Ejemplo n.º 3
0
        public static PeerNode CurrentPeer      = new PeerNode();                                                                    //当前打印端口
        #endregion



        #region [---Public Methods---]

        public bool DeserializedFromXml(byte[] contentsByte, XmlNode filmPageNode)
        {
            try
            {
                Logger.LogFuncUp();

                string contentsString = Encoding.UTF8.GetString(contentsByte);
                var    xDoc           = new XmlDocument();
                xDoc.LoadXml(contentsString);

                var rootNode = xDoc.DocumentElement;
                if (null == rootNode)
                {
                    Logger.LogWarning("[FilmingSerivceFE]No Card info for print");
                    return(false);
                }

                this.IsPrint = bool.Parse(rootNode.Attributes[OffScreenRenderXmlHelper.OPERATION].Value);

                var printerSettingNode = rootNode.SelectSingleNode(OffScreenRenderXmlHelper.PRINTER_SETTING_INFO);
                this.PrinterSettingInfoModel.DeserializedFromXml(printerSettingNode);

                var filmingPageTitleSettingNode = rootNode.SelectSingleNode(OffScreenRenderXmlHelper.FILMING_PAGE_TITLE_SETTING);
                this.PageTitleConfigInfoModel.DeserializedFromXml(filmingPageTitleSettingNode);

                //PageControl大小
                DisplayedFilmPageHeight = FilmingUtility.DisplayedFilmPageHeight;
                DisplayedFilmPageWidth  = FilmingUtility.DisplayedFilmPageWidth;
                var filmingPageSizeNode = rootNode.SelectSingleNode(OffScreenRenderXmlHelper.FILMING_PAGE_SIZE);
                Double.TryParse(OffScreenRenderXmlHelper.GetChildNodeValue(filmingPageSizeNode, OffScreenRenderXmlHelper.FILMING_PAGE_HEIGHT), out DisplayedFilmPageHeight);
                Double.TryParse(OffScreenRenderXmlHelper.GetChildNodeValue(filmingPageSizeNode, OffScreenRenderXmlHelper.FILMING_PAGE_WIDTH), out DisplayedFilmPageWidth);
                Double.TryParse(OffScreenRenderXmlHelper.GetChildNodeValue(filmingPageSizeNode, OffScreenRenderXmlHelper.FILMING_PAGE_VIEWER_HEIGHT), out DisplayedFilmPageViewerHeight);

                var allFilmPagesNode = rootNode.SelectSingleNode(OffScreenRenderXmlHelper.ALL_FILMING_PAGE_INFO);
                if (allFilmPagesNode == null)
                {
                    Logger.LogWarning("[FilmingSerivceFE]No Common Page info for print");
                    return(false);
                }

                //全局PeerNode
                var ae   = this.PrinterSettingInfoModel.CurrPrinterAE;
                var peer = new PeerNode();

                if (-1 == Printers.Instance.GetPacsNodeParametersByAE(ae, ref peer))
                {
                    Printers.Instance.ReloadPrintersConfig();
                    if (-1 == Printers.Instance.GetPacsNodeParametersByAE(ae, ref peer))
                    {
                        Logger.LogWarning("[FilmingSerivceFE]Can Not Find Printer:" + ae + " in Config File.");
                        if (IsPrint)
                        {
                            return(false);
                        }
                    }
                }
                this.PeerNode = peer;

                //全局SeriesUid
                var uidManager        = McsfDatabaseDicomUIDManagerFactory.Instance().CreateUIDManager();
                var allEFilmSeriesUid = uidManager.CreateSeriesUID("");

                //全局FilmSize
                AllFilmSize = Widget.ConvertFilmSizeFrom(this.PrinterSettingInfoModel.CurrFilmSize,
                                                         int.Parse(this.PrinterSettingInfoModel.CurrPrinterDPI),
                                                         this.PrinterSettingInfoModel.CurrOrientation);
                var lowPrecisionEFilmSize = Widget.ConvertFilmSizeFrom(this.PrinterSettingInfoModel.CurrFilmSize,
                                                                       96,
                                                                       this.PrinterSettingInfoModel.CurrOrientation);
                //全局操作方式
                var ifPrint = IsPrint;
                var ifSave  = !IsPrint || bool.Parse(PrinterSettingInfoModel.IfSave);


                //  foreach (XmlNode filmPageNode in allFilmPagesNode)
                {
                    var filmPage = new PageModel(this.PrinterSettingInfoModel);

                    var eFilmModel = new EFilmModel();
                    filmPage.EFilmModel = eFilmModel;

                    FilmPageModel = filmPage;
                    if (!filmPage.DeserializedFromXml(filmPageNode))
                    {
                        Logger.LogWarning("[FilmingSerivceFE]Fail to get page info of a film page");
                        return(false);
                    }

                    eFilmModel.EFilmSeriesUid        = allEFilmSeriesUid;
                    eFilmModel.FilmSize              = AllFilmSize;
                    eFilmModel.LowPrecisionEFilmSize = lowPrecisionEFilmSize;
                    eFilmModel.PeerNode              = this.PeerNode;
                    eFilmModel.PrintSettings         = this.PrinterSettingInfoModel;
                    eFilmModel.PageTitlePosition     = filmPage.PageTitleInfoModel.DisplayPosition;//  PageTitleConfigInfoModel.DisplayPosition;
                    eFilmModel.IfSaveEFilm           = ifSave;
                    eFilmModel.IfPrint = ifPrint;
                }

                Logger.LogFuncDown();
            }
            catch (Exception ex)
            {
                Logger.LogFuncException(ex.Message + ex.StackTrace);
                return(false);
            }

            return(true);
        }