Ejemplo n.º 1
0
        //------------------------------------
        private void btn_MouseLeave(object sender, MouseEventArgs e)
        {
            DotButton btn = sender as DotButton;

            if (btn == null)
            {
                return;
            }
            btn.HollowButton     = true;
            ToolTipLabel.Content = "";
        }
Ejemplo n.º 2
0
        //------------------------------------
        private void btn_MouseEnter(object sender, MouseEventArgs e)
        {
            DotButton btn = sender as DotButton;

            if (btn == null)
            {
                return;
            }
            btn.HollowButton     = false;
            ToolTipLabel.Content = btn.ButtonText;
            Canvas.SetLeft(ToolTipLabel, btn.ToolTipPos.X);
        }
Ejemplo n.º 3
0
        //--------------------------------------
        public void tareBtn_Click(object sender, MouseButtonEventArgs args)
        {
            DotButton btn = sender as DotButton;

            if (btn == null)
            {
                return;
            }
            btn.HollowButton     = true;
            ToolTipLabel.Content = "";

            double[] temp = new double[4];
            for (int i = 0; i < 4; i++)
            {
                temp[i] = tare[i];                          //save for cancel event
            }
            stopBtn.Content = (string)btn.ButtonText + " [완료]";

            xMode saveMode = currentMode;

            setMode(xMode.TARE_INFO);

            string msg = "1. 침대 위에 침구 이외의 물건을 모두 치우세요.\n\n" +
                         "2. 침대가 수평을 이루고 있는지 확인하세요.\n\n" +
                         "3. 침대의 중량이 모든 센서에 고르게 분포되도록 센서의 높이를 조절하세요.\n\n" +
                         "4. 확인버튼을 눌러서 메시지 창을 닫으면 '자체중량' 평균값의 측정이 시작됩니다.\n\n" +
                         "5. 창이 닫힌 후 네 모서리의 숫자가 일정한 값에 수렴 할 때까지 기다렸다가 왼쪽의 [완료] 버튼을 누르세요.";

            if (MessageBox.Show(msg, "자체중량 지정", MessageBoxButton.OKCancel) == MessageBoxResult.Cancel)
            {
                for (int i = 0; i < 4; i++)
                {
                    tare[i] = temp[i];
                }

                setMode(saveMode);

                return;
            }

            samplingCount = 0;

            setMode(xMode.TARE);
        }
Ejemplo n.º 4
0
        //--------------------------------------
        void measureBtn_Click(object sender, MouseButtonEventArgs args)
        {
            DotButton btn = sender as DotButton;

            if (btn == null)
            {
                return;
            }
            btn.HollowButton     = true;
            ToolTipLabel.Content = "";

            stopBtn.Content = (string)btn.ButtonText + " [완료]";
            setMode(xMode.MEASURE);

            stopWatch.Start();
            ResetBtn.IsEnabled = true;

            BedsoreTime();
        }
Ejemplo n.º 5
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 15 "..\..\..\SPRS_Main.xaml"
                ((Loadcell.SPRS)(target)).Loaded += new System.Windows.RoutedEventHandler(this.SPRS_Loaded);

            #line default
            #line hidden
                return;

            case 2:
                this.bedCanvas = ((System.Windows.Controls.Canvas)(target));
                return;

            case 3:
                this.thisgrid = ((System.Windows.Controls.Grid)(target));
                return;

            case 4:
                this.UpLeft = ((System.Windows.Controls.Label)(target));
                return;

            case 5:
                this.UpRight = ((System.Windows.Controls.Label)(target));
                return;

            case 6:
                this.DnLeft = ((System.Windows.Controls.Label)(target));
                return;

            case 7:
                this.DnRight = ((System.Windows.Controls.Label)(target));
                return;

            case 8:
                this.Center = ((System.Windows.Controls.Label)(target));
                return;

            case 9:
                this.Circle = ((System.Windows.Shapes.Ellipse)(target));
                return;

            case 10:
                this.cross1 = ((System.Windows.Shapes.Line)(target));
                return;

            case 11:
                this.cross2 = ((System.Windows.Shapes.Line)(target));
                return;

            case 12:
                this.userPanel = ((System.Windows.Controls.StackPanel)(target));
                return;

            case 13:
                this.camera_content = ((System.Windows.Controls.Frame)(target));
                return;

            case 14:
                this.dateTimeString = ((System.Windows.Controls.Label)(target));
                return;

            case 15:
                this.ProgressTimer = ((System.Windows.Controls.TextBox)(target));
                return;

            case 16:
                this.ResetBtn = ((System.Windows.Controls.Button)(target));

            #line 134 "..\..\..\SPRS_Main.xaml"
                this.ResetBtn.Click += new System.Windows.RoutedEventHandler(this.ResetBtn_Click);

            #line default
            #line hidden
                return;

            case 17:
                this.dgUsers = ((System.Windows.Controls.DataGrid)(target));
                return;

            case 18:
                this.ToolTipLabel = ((System.Windows.Controls.Label)(target));
                return;

            case 19:
                this.buttonStack = ((System.Windows.Controls.StackPanel)(target));
                return;

            case 20:
                this.tareBtn = ((Loadcell.DotButton)(target));
                return;

            case 21:
                this.unitBtn = ((Loadcell.DotButton)(target));
                return;

            case 22:
                this.measureBtn = ((Loadcell.DotButton)(target));
                return;

            case 23:
                this.cameraBtn = ((Loadcell.DotButton)(target));
                return;

            case 24:
                this.chartBtn = ((Loadcell.DotButton)(target));
                return;

            case 25:
                this.weightBtn = ((Loadcell.DotButton)(target));
                return;

            case 26:
                this.LRChartBtn = ((Loadcell.DotButton)(target));
                return;

            case 27:
                this.closeBtn = ((Loadcell.DotButton)(target));
                return;

            case 28:
                this.stopBtn = ((System.Windows.Controls.Label)(target));

            #line 218 "..\..\..\SPRS_Main.xaml"
                this.stopBtn.MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.stopBtn_Click);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
Ejemplo n.º 6
0
        //--------------------------------------
        void unitBtn_Click(object sender, MouseButtonEventArgs args)
        {
            DotButton btn = sender as DotButton;

            if (btn == null)
            {
                return;
            }
            btn.HollowButton     = true;
            ToolTipLabel.Content = "";

            stopBtn.Content = (string)btn.ButtonText + " [완료]";

            double[] temp = new double[4];

            for (int i = 0; i < 4; i++)
            {
                temp[i] = unit[i];                          //save for cancel event
            }
            xMode saveMode = currentMode;

            setMode(xMode.UNIT_INFO);

            SensorValuePerKgDlg dlg = new SensorValuePerKgDlg();
            string Msg = "1. 침상의 중앙에 질량을 알고 있는 물체를 놓고 물체의 질량 값(Kg)을 아래의 입력창에 입력하세요\n\n" +
                         "2. 'OK' 버튼을 눌러서 창을 닫으면 입력된 질량에 해당하는 센서의 평균값을 측정합니다.\n\n" +
                         "3. 메시지 창이 닫힌 후 네 모서리의 숫자가 일정한 값에 수렴할 때까지 기다렸다가 왼쪽의 [완료] 버튼을 누르세요.";

            dlg.infoMsg.Text = Msg;
            dlg.samplingMass.Focus();
            dlg.ShowDialog();

            if (dlg.DialogResult == false)
            {
                for (int i = 0; i < 4; i++)
                {
                    unit[i] = temp[i];
                }

                setMode(saveMode);

                return;
            }

            try { samplingMass = Convert.ToDouble(dlg.samplingMass.Text) / 4.0; }
            catch (Exception e)
            {
                MessageBox.Show("적절한 double타입의 값이 아닙니다.", "Error");
                Console.WriteLine(e.Message);

                for (int i = 0; i < 4; i++)
                {
                    unit[i] = temp[i];
                }

                setMode(saveMode);

                return;
            }

            if (samplingMass <= 0.0)
            {
                MessageBox.Show("샘플 질량 값은 0보다 커야 합니다.", "Error");

                for (int i = 0; i < 4; i++)
                {
                    unit[i] = temp[i];
                }

                setMode(saveMode);

                return;
            }
            samplingCount = 0;
            setMode(xMode.UNIT);
        }
Ejemplo n.º 7
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 10 "..\..\SPRS_Main - 복사본(2).xaml"
                ((Loadcell.SPRS)(target)).Loaded += new System.Windows.RoutedEventHandler(this.SPRS_Loaded);

            #line default
            #line hidden
                return;

            case 2:
                this.Port = ((System.Windows.Controls.Label)(target));
                return;

            case 3:
                this.Baud = ((System.Windows.Controls.Label)(target));
                return;

            case 4:
                this.tareUL = ((System.Windows.Controls.Label)(target));
                return;

            case 5:
                this.tareUR = ((System.Windows.Controls.Label)(target));
                return;

            case 6:
                this.tareLL = ((System.Windows.Controls.Label)(target));
                return;

            case 7:
                this.tareLR = ((System.Windows.Controls.Label)(target));
                return;

            case 8:
                this.unitUL = ((System.Windows.Controls.Label)(target));
                return;

            case 9:
                this.unitUR = ((System.Windows.Controls.Label)(target));
                return;

            case 10:
                this.unitLL = ((System.Windows.Controls.Label)(target));
                return;

            case 11:
                this.unitLR = ((System.Windows.Controls.Label)(target));
                return;

            case 12:
                this.analogMeterUL = ((Loadcell.AnalogMeter)(target));
                return;

            case 13:
                this.analogMeterUR = ((Loadcell.AnalogMeter)(target));
                return;

            case 14:
                this.analogMeterLL = ((Loadcell.AnalogMeter)(target));
                return;

            case 15:
                this.analogMeterLR = ((Loadcell.AnalogMeter)(target));
                return;

            case 16:
                this.analogMeterTotal = ((Loadcell.AnalogMeter)(target));
                return;

            case 17:
                this.ToolTipLabel = ((System.Windows.Controls.Label)(target));
                return;

            case 18:
                this.buttonStack = ((System.Windows.Controls.StackPanel)(target));
                return;

            case 19:
                this.tareBtn = ((Loadcell.DotButton)(target));
                return;

            case 20:
                this.unitBtn = ((Loadcell.DotButton)(target));
                return;

            case 21:
                this.measureBtn = ((Loadcell.DotButton)(target));
                return;

            case 22:
                this.loginBtn = ((Loadcell.DotButton)(target));
                return;

            case 23:
                this.dataBtn = ((Loadcell.DotButton)(target));
                return;

            case 24:
                this.closeBtn = ((Loadcell.DotButton)(target));
                return;

            case 25:
                this.stopBtn = ((System.Windows.Controls.Label)(target));

            #line 242 "..\..\SPRS_Main - 복사본(2).xaml"
                this.stopBtn.MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.stopBtn_Click);

            #line default
            #line hidden
                return;

            case 26:
                this.bedCanvas = ((System.Windows.Controls.Canvas)(target));
                return;

            case 27:
                this.thisgrid = ((System.Windows.Controls.Grid)(target));
                return;

            case 28:
                this.UpLeft = ((System.Windows.Controls.Label)(target));
                return;

            case 29:
                this.UpRight = ((System.Windows.Controls.Label)(target));
                return;

            case 30:
                this.DnLeft = ((System.Windows.Controls.Label)(target));
                return;

            case 31:
                this.DnRight = ((System.Windows.Controls.Label)(target));
                return;

            case 32:
                this.Center = ((System.Windows.Controls.Label)(target));
                return;

            case 33:
                this.Circle = ((System.Windows.Shapes.Ellipse)(target));
                return;

            case 34:
                this.cross1 = ((System.Windows.Shapes.Line)(target));
                return;

            case 35:
                this.cross2 = ((System.Windows.Shapes.Line)(target));
                return;

            case 36:
                this.userPanel = ((System.Windows.Controls.StackPanel)(target));
                return;

            case 37:
                this.dateTimeString = ((System.Windows.Controls.Label)(target));
                return;

            case 38:
                this.name = ((System.Windows.Controls.Label)(target));
                return;

            case 39:
                this.sex = ((System.Windows.Controls.Label)(target));
                return;

            case 40:
                this.age = ((System.Windows.Controls.Label)(target));
                return;

            case 41:
                this.height = ((System.Windows.Controls.Label)(target));
                return;

            case 42:
                this.weight = ((System.Windows.Controls.Label)(target));
                return;

            case 43:
                this.fstate = ((System.Windows.Controls.Label)(target));
                return;

            case 44:
                this.bstate = ((System.Windows.Controls.Label)(target));
                return;

            case 45:
                this.BedsoreBar = ((System.Windows.Controls.Label)(target));
                return;

            case 46:
                this.ProgressTimer = ((System.Windows.Controls.TextBox)(target));
                return;

            case 47:
                this.ResetBtn = ((System.Windows.Controls.Button)(target));

            #line 419 "..\..\SPRS_Main - 복사본(2).xaml"
                this.ResetBtn.Click += new System.Windows.RoutedEventHandler(this.ResetBtn_Click);

            #line default
            #line hidden
                return;

            case 48:
                this.dgUsers = ((System.Windows.Controls.DataGrid)(target));
                return;

            case 49:
                this.canvas1 = ((System.Windows.Controls.Canvas)(target));
                return;

            case 50:
                this.bedimage = ((System.Windows.Controls.Image)(target));
                return;

            case 51:

            #line 441 "..\..\SPRS_Main - 복사본(2).xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.ShowImageBtn_Click);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }