Пример #1
0
        private void ui_post_query_success(QueryUserCmdAck ack)
        {
            Helper.enable_control(this.btnPrintDcm, ack.dcm_files_ready);
            Helper.enable_control(this.btnPrintReport, ack.report_files_ready);
            Helper.enable_control(this.btnPrintBoth, ack.dcm_files_ready || ack.report_files_ready);

            //Helper.enable_control(this.btnQuery, true);
            Helper.enable_control(this.txtUserID, true);
            Helper.set_text(this.txtUserID, "");

            Helper.set_text(this.lblUserName, ack.user.name);
            Helper.set_text(this.lblUserID, ack.user.id);
            Helper.set_text(this.lblReportNumber, ack.report_files_ready ?
                            ack.report_files_number : 0);
            Helper.set_text(this.lblReportPrintFlag, ack.report_files_ready ?
                            (ack.printed_report_times > 0 ? "已打印" : "未打印") : "");
            Helper.set_text(this.lblDcmNumber, ack.dcm_files_ready ?
                            ack.dcm_files_number : 0);
            Helper.set_text(this.lblDcmPrintFlag, ack.dcm_files_ready ?
                            (ack.printed_dcm_times > 0 ? "已打印" : "未打印") : "");

            Helper.add_text(this.txtMsg, Environment.NewLine + "查询操作成功..." + Environment.NewLine);
        }
Пример #2
0
        private void OnQueryUser(IScsServerClient sc, QueryUserCmd cmd)
        {
            Thread.Sleep(5000);

            QueryUserCmdAck ack = new QueryUserCmdAck();

            ack.RepliedMessageId      = cmd.MessageId;
            ack.sender_name           = this_name;
            ack.user.id               = cmd.user_id;
            ack.user.name             = "李四";
            ack.user.is_male          = true;
            ack.user.age              = 42;
            ack.user.dcm_num          = 3;
            ack.user.report_num       = 1;
            ack.dcm_files_number      = 3;
            ack.report_files_number   = 1;
            ack.dcm_files_ready       = true;
            ack.report_files_ready    = true;
            ack.printed_report_times  = 0;
            ack.printed_dcm_times     = 2;
            ack.transfer_dcm_files    = false; //todo
            ack.transfer_report_files = false; //todo
            Helper.tcp_server_send(sc, ack);
        }
Пример #3
0
        private void p1_client_query()
        {
            _query_ack = null;

            ui_pre_query();

            try
            {
                start_p1_tcp_client();
                connect_p1_tcp_client(_p1_server_ip, _p1_server_port);

                Helper.add_text(this.txtMsg,
                                string.Format("{0}连接数据服务器P1: {1}{0}",
                                              Environment.NewLine,
                                              (Helper.is_tcp_client_normal(_p1_tcp_client) ? "成功" : "失败")));
                Helper.add_text(this.txtMsg,
                                string.Format("{0}向数据服务器P1发查询命令, 等待服务器P1返回结果...{0}",
                                              Environment.NewLine));

                //1min之内能否传输完成?需要实验确定
                QueryUserCmd qu = new QueryUserCmd();
                qu.sender_name      = this_name;
                qu.user_id          = this.txtUserID.Text.Trim(); //patient id
                qu.get_dcm_files    = is_local_print_dcm;         //本地打印则获取dcm,远程打印不获取
                qu.get_report_files = is_local_print_dcm;         //本地打印则获取dcm,远程打印不获取
                _query_ack          = Helper.tcp_client_send_and_response(_p1_tcp_client, qu, 60000) as QueryUserCmdAck;

                Helper.add_text(this.txtMsg,
                                string.Format("{0}数据服务器P1返回查询结果: {1}{0}",
                                              Environment.NewLine,
                                              (_query_ack == null ? "失败" : "成功")));

                //if (_query_ack != null)
                //{
                //    if (ack.transfer_report_files)
                //    {
                //        Helper.add_text(this.txtMsg, Environment.NewLine+"存储报告文件..."+Environment.NewLine);
                //        //_query_ack.report_file_contents
                //    }
                //    if (ack.transfer_dcm_files)
                //    {
                //        Helper.add_text(this.txtMsg, Environment.NewLine+"存储胶片文件..."+Environment.NewLine);
                //        //_query_ack.dcm_file_contents
                //    }
                //}
            }
            catch (System.Exception ex)
            {
                EzLogger.GlobalLogger.warning(string.Format("{0}{2}{1}{2}", ex.Message, ex.StackTrace, Environment.NewLine));
            }
            finally { stop_p1_tcp_client(); }

            try { ui_post_query_success(_query_ack); }
            catch
            {
                Helper.add_text(this.txtMsg,
                                string.Format("{0}请检查本机与数据服务器P1的网络连接是否正常.{0}",
                                              Environment.NewLine));

                ui_post_query_failed();
            }
        }