Пример #1
0
        /// <summary>
        /// 복사 종료
        /// </summary>
        private void Complet()
        {
            try
            {
                //// 복사가 제대로 되었는지 체크

                //// 완료 파일 생성한다.
                if (!File.Exists(Path.Combine(this._orderInfo.patFolderFullPath, GlobalVar.BURN_CHK_FL_NM)))
                {
                    FileControl.CreateTextFile(Path.Combine(this._orderInfo.patFolderFullPath, GlobalVar.BURN_CHK_FL_NM));
                }

                //// 결과 저장
                WebUtils.InsertResult(this._orderInfo.OrderId,
                                      this._orderInfo.StartDateTime,
                                      Utils.GetNowTime(),
                                      this._orderInfo.patNo,
                                      this._orderInfo.patName,
                                      this._orderInfo.copies.ToString(),
                                      "USB",
                                      this._orderInfo.mediSize,
                                      "완료",
                                      ((this._orderInfo.BurnPatientKind.Equals("Y") || this._orderInfo.patList.Count > 1) ? this._orderInfo.DicomDescription : this._orderInfo.StudyModality),
                                      Utils.CheckNull(this._orderInfo.BurnPatientKind, "N"),
                                      this._orderInfo.TargetServer.IP,
                                      NetInfo.MyIP());

                //// 종료 : 창을 닫고 메인화면에 종료 메시지 전송
                GlobalVar.isCopyingToUSB = false;

                this._orderInfo.Finish = "Y";

                string message = string.Format("[{0} - {1}] USB로 복사되었습니다.\r\n", this._orderInfo.patNo, this._orderInfo.patName);

                DiscStatusForDisplay trace = new DiscStatusForDisplay();
                trace.OrderID          = this._orderInfo.OrderId;
                trace.ServerIP         = this._orderInfo.TargetServer.IP;
                trace.Status           = "FINISHED";
                trace.StatusType       = "Coping";
                trace.StateString      = "COPY TO USB Complete";
                trace.PercentCompleted = "100";
                trace.ResultMessage    = "완료";
                trace.Finish           = "Y";
                trace.ResultCode       = "2";

                this._mainForm.copyToUSBComplete(message, trace);

                this.Close();
            }
            catch { }
        }
Пример #2
0
        /// <summary>
        /// 진행상태 읽기
        /// </summary>
        public void ReadBurnProgress()
        {
            try
            {
                //// 오더아이디별 폴더로 되어 있음.
                foreach (string fld in Directory.GetDirectories(this.orderLogPath))
                {
                    if (fld.StartsWith("SVR_"))
                    {
                        continue;
                    }
                    if (fld.StartsWith("ERRORS"))
                    {
                        continue;
                    }

                    //// 굽기완료된 주문폴더인지 체크
                    var endFiles = Directory.GetFiles(fld, GlobalVar.BURN_CHK_FL_NM);
                    if (endFiles != null && endFiles.Length > 0)
                    {
                        //// 굽기완료되었을 경우 서버 상태값 읽어온다.
                        this.ReadServerConfig();
                        continue;
                    }

                    //// 폴더명이 주문번호임.
                    //// 기록된 파일중 제일 늦은거
                    var fileLst = Directory.GetFiles(fld, string.Format("{0}*", GlobalVar.PFX_TRC));
                    if (fileLst != null && fileLst.Length > 0)
                    {
                        var    fList = fileLst.OrderByDescending(s => s).ToList();
                        string file  = fList.First();

                        if (File.Exists(file))
                        {
                            string json = File.ReadAllText(file);

                            DiscStatusForDisplay obj = JsonParser.ConvertToDiscStatusForDisplay(json);

                            if (obj != null)
                            {
                                this.mReportForm.Invoke(this.mReportForm.burningTraceDel, obj);
                            }
                        }
                    }
                }
            }
            catch { }
        }