コード例 #1
0
        /// <summary>
        /// 类初始化时执行的公共代码
        /// </summary>
        public void ClassInit(ref CControlCentral Controller)
        {
            control_central = Controller;
            control_central.ControllerCommStatusChanged += Control_central_ControllerCommStatusChanged;

            bgw_cure = new BackgroundWorker();
            bgw_cure.WorkerSupportsCancellation = true;
            bgw_cure.WorkerReportsProgress      = true;
            bgw_cure.DoWork             += bgw_cure_DoWork;
            bgw_cure.ProgressChanged    += bgw_cure_ProgressChanged;
            bgw_cure.RunWorkerCompleted += Bgw_cure_RunWorkerCompleted;
            //bgw_cure.RunWorkerAsync();

            realtime_temperature_collection = new CRealtimeTemperatureCollection();
            presetted_sequence = new CTemperatureSequence();

            /* 初始化倒计时时基的定时器 */
            timer_countdown_tick = new Timer(OnTimerIntervalEvent, null, Timeout.Infinite, COUNTDOWN_BASETIME_MS);
            sem_countdown_tick   = new Semaphore(0, 1);

            /* 初始化Command */
            command_start_resume = new RelayCommand <object>(p => StartOrResumeExecute(p));

            this.patient_name = "";
        }
コード例 #2
0
        public MainWindow()
        {
            // 设置鼠标光标到等待模式
            System.Windows.Input.Mouse.OverrideCursor = System.Windows.Input.Cursors.AppStarting;
            this.Loaded += MainWindow_Loaded;

            try
            {
                DXSplashScreen.SetState("正在启动...");

                InitializeComponent();

                /* 初始化控制板实例,该实例包含了串口通讯的协议 */
                control_central = new CControlCentral();
                control_central.ControllerCommStatusChanged += Control_central_ControllerCommStatusChanged;

                /* 初始化左侧导航栏里的按钮 */
                CPublicVariables.CureBandList = new ObservableCollection<CCureBandClass>();
                for (int i = 0; i < 8; i++)
                {
                    CPublicVariables.CureBandList.Add(new CCureBandClass(i, ref control_central));

                }
                leftNavBar.ItemCollection = CPublicVariables.CureBandList;

                // pre-load windows to accelerate the openning speed
                DXSplashScreen.SetState("加载历史记录...");
                HistoryShow frmh = new HistoryShow();
                DXSplashScreen.SetState("加载治疗信息...");
                NewCureSetup fnew = new NewCureSetup(null);
                DXSplashScreen.SetState("加载设置...");
                Setting fset = new Setting();
            }
            catch(Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
            }
            finally
            {
                // 回复鼠标光标到默认模式
                System.Windows.Input.Mouse.OverrideCursor = System.Windows.Input.Cursors.Arrow;
            }
        }
コード例 #3
0
        /// <summary>
        /// 类初始化时执行的公共代码
        /// </summary>
        public void ClassInit(ref CControlCentral Controller)
        {
            control_central = Controller;
            control_central.ControllerCommStatusChanged += Control_central_ControllerCommStatusChanged;

            bgw_cure = new BackgroundWorker();
            bgw_cure.WorkerSupportsCancellation = true;
            bgw_cure.WorkerReportsProgress = true;
            bgw_cure.DoWork += bgw_cure_DoWork;
            bgw_cure.ProgressChanged += bgw_cure_ProgressChanged;
            bgw_cure.RunWorkerCompleted += Bgw_cure_RunWorkerCompleted;
            //bgw_cure.RunWorkerAsync();

            realtime_temperature_collection = new CRealtimeTemperatureCollection();
            presetted_sequence = new CTemperatureSequence();

            /* 初始化倒计时时基的定时器 */
            timer_countdown_tick = new Timer(OnTimerIntervalEvent, null, Timeout.Infinite, COUNTDOWN_BASETIME_MS);
            sem_countdown_tick = new Semaphore(0, 1);

            /* 初始化Command */
            command_start_resume = new RelayCommand<object>(p => StartOrResumeExecute(p));

            this.patient_name = "";
        }
コード例 #4
0
 public CCureBandClass(int Channel, ref CControlCentral Controller)
 {
     this.Channel = Channel;
     ClassInit(ref Controller);
 }
コード例 #5
0
 public CCureBandClass(int Channel, ref CControlCentral Controller)
 {
     this.Channel = Channel;
     ClassInit(ref Controller);
 }