Esempio n. 1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            // Perform any additional setup after loading the view

            //一定要设置frame,否则显示空白
            this.View.Frame = UIScreen.MainScreen.Bounds;

            //如果不设置视图背景,默认是黑色
            this.View.BackgroundColor = UIColor.White;

            string[] studyInfo = new string[] {
                $"检查时间: {MyStudyList.SelectedStudy.SampleTime:HH:mm:ss}",
                $"诊断结果: {MyStudyList.SelectedStudy.Diagnose}",
                $"诊断医生: {MyStudyList.SelectedStudy.DoctorName}",
            };
            for (int i = 0; i < studyInfo.Length; i++)
            {
                this.View.CreateLabel(10, 90 + i * 30, studyInfo[i]);
            }

            //初始化绘制ECG波形对象
            MyDrawBioWave                 = new DrawBioWave(MyStudyList.SelectedStudy.BioBuf);
            MyDrawBioWave.Frame           = new CGRect(0, 200, this.View.Bounds.Width, 200);
            MyDrawBioWave.BackgroundColor = UIColor.White;
            this.View.AddSubview(MyDrawBioWave);
        }
Esempio n. 2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            // Perform any additional setup after loading the view

            //一定要设置frame,否则显示空白
            this.View.Frame = UIScreen.MainScreen.Bounds;

            //如果不设置视图背景,默认是黑色
            this.View.BackgroundColor = UIColor.White;

            string[] studyInfo = new string[] {
                $"检查时间: {MyStudyList.SelectedStudy.SampleTime.ToLocalTime():HH:mm:ss}",
                $"个人姓名: {MyStudyList.SelectedStudy.PatientName}",
            };
            for (int i = 0; i < studyInfo.Length; i++)
            {
                this.View.CreateLabel(10, 90 + i * 30, studyInfo[i]);
            }

            //初始化绘制ECG波形对象
            MyDrawBioWave                 = new DrawBioWave(MyStudyList.SelectedStudy.BioBuf);
            MyDrawBioWave.Frame           = new CGRect(0, 200, this.View.Bounds.Width, 200);
            MyDrawBioWave.BackgroundColor = UIColor.White;
            this.View.AddSubview(MyDrawBioWave);

            UIButton btnAutoAnalyse = this.View.CreateButton(10, 420, "自动分析");

            btnAutoAnalyse.TouchUpInside += (s1, e1) => AutoAnalyse();

            this.View.CreateLabel(10, 450, "诊断结果");

            //诊断结果列表
            DiagnoseList = new List <string>()
            {
                "正常", "轻度异常", "严重异常"
            };
            List <UIAlertAction> alertActions = new List <UIAlertAction>();

            foreach (string diagnose in DiagnoseList)
            {
                //所有选项共用一个回调函数
                UIAlertAction alertAction = UIAlertAction.Create(diagnose, UIAlertActionStyle.Default, SelectDiagnose);
                alertActions.Add(alertAction);
            }

            btnSelectDiagnose = this.View.CreateButton(10, 480, DiagnoseList[0]);
            btnSelectDiagnose.TouchUpInside += (s1, e1) =>
            {
                //必须沿用同一个UIAlertController,否则仅在第一次选择有效,因为ShowSheetBox每次重新创建UIAlertController
                if (DiagnoseAlertController == null)
                {
                    DiagnoseAlertController = this.ShowSheetBox("诊断", "请选择诊断结果", alertActions.ToArray());
                }
                else
                {
                    //显示弹出窗口
                    this.PresentViewController(DiagnoseAlertController, true, null);
                }
            };

            UIButton btnSave = this.View.CreateButton(10, 510, "完成诊断");

            btnSave.TouchUpInside += (s1, e1) => SaveStudy();
        }