示例#1
0
        // Motor 4 GUI Object event handlers
        public async void buttonM4Speed_Click(object sender, RoutedEventArgs e)
        {
            if (_keypadOpen)
            {
                return;
            }
            _keypadOpen = true;
            NumericKeypad       displayKeypad = new NumericKeypad("Speed", M4Speed, pwmDevice.M4.MinSpeed, pwmDevice.M4.MaxSpeed);
            ContentDialogResult result        = await displayKeypad.ShowAsync();

            if (displayKeypad.Result == KeypadResult.EntryOK)
            {
                pwmDevice.M4.Speed_Cmd = displayKeypad.ReturnValue;
                M4Speed = displayKeypad.ReturnValue.ToString();
            }
            _keypadOpen = false;
        }
示例#2
0
        public async void buttonFrequency_Click(object sender, RoutedEventArgs e)
        {
            if (_keypadOpen)
            {
                return;
            }
            _keypadOpen = true;
            NumericKeypad displayKeypad = new NumericKeypad("Frequency", Frequency, 50.0f, 1000.0f);

            displayKeypad.VerticalAlignment   = VerticalAlignment.Center;
            displayKeypad.HorizontalAlignment = HorizontalAlignment.Center;
            ContentDialogResult result = await displayKeypad.ShowAsync();

            if (displayKeypad.Result == KeypadResult.EntryOK)
            {
                pwmDevice.SetFrequency((int)displayKeypad.ReturnValue);
                Frequency = pwmDevice.Frequency.ToString();
            }
            _keypadOpen = false;
        }
示例#3
0
        public async void buttonPosition_Click(object sender, RoutedEventArgs e)
        {
            if (_keypadOpen)
            {
                return;
            }
            _keypadOpen = true;
            NumericKeypad displayKeypad = new NumericKeypad("Position", S1Position, pwmDevice.S1.MinRange, pwmDevice.S1.MaxRange);

            displayKeypad.VerticalAlignment   = VerticalAlignment.Center;
            displayKeypad.HorizontalAlignment = HorizontalAlignment.Center;
            ContentDialogResult result = await displayKeypad.ShowAsync();

            if (displayKeypad.Result == KeypadResult.EntryOK)
            {
                pwmDevice.S1.Position_Cmd = displayKeypad.ReturnValue;
                S1Position = pwmDevice.S1.Position_Cmd.ToString();
            }
            _keypadOpen = false;
        }
        //"DB2000.DBW10"
        //------------------------------------------------------------------------------//
        //                              Button Clicks                                   //
        //------------------------------------------------------------------------------//
        private void lblTargeMoisture_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            bool bOpen = Classes.StandardCode.IsSpecificWindowOpen(Application.Current.Windows, this.lblTitle.Content.ToString() + " Target");

            if (!bOpen && (MainWindow.stat_iUserLevel >= 2))
            {
                LiteCoSControls.NumericKeypad numKeypad1 = new NumericKeypad(lblTargetMoisture.Content.ToString());
                numKeypad1.NumericKeypad_Driver = NumericKeypad.eDrivers.INGEARS7;
                numKeypad1.NumericKeypad_TagDatatype = NumericKeypad.eTagDataTypes.DINT;
                numKeypad1.NumericKeypad_PLC_Write = ProfibusMOZFInfo_WriteController;
                numKeypad1.NumericKeypad_MinLimit = ProfibusMOZFInfo_InMoistureMinimum;
                numKeypad1.NumericKeypad_MaxLimit = ProfibusMOZFInfo_InMoistureMaximum;
                numKeypad1.NumericKeypad_Title = ProfibusMOZFInfo_Title;
                numKeypad1.NumericKeypad_PrimaryDBOffset = ProfibusMOZFInfo_TargetMoistureOffset; //"DB151.DBD506"
                numKeypad1.NumericKeypad_SecondaryDBOffset = ProfibusMOZFInfo_SecondaryTargetMoistureOffset;
                numKeypad1.NumericKeypad_IsValueWholeNumber = false;
                numKeypad1.NumericKeypad_IsValueSigned = ProfibusMOZFInfo_TargetMoistureSigned;
                numKeypad1.NumericKeypad_MultiplyWriteValue = ProfibusMOZFInfo_MultiplyWriteValueOffset;
                numKeypad1.NumericKeypad_DivideyWriteValue = ProfibusMOZFInfo_DivideByWriteValueOffset;

                numKeypad1.Show();
            }
        }
        //------------------------------------------------------------------------------//
        //                              Button Clicks                                   //
        //------------------------------------------------------------------------------//
        private void lblInFlowrate_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            bool bOpen = Classes.StandardCode.IsSpecificWindowOpen(Application.Current.Windows, this.lblTitle.Content.ToString());

            if (!bOpen && (MainWindow.stat_iUserLevel >= 2))
            {
                // DisplayWindows.NumericKeypad numKeypad = new DisplayWindows.NumericKeypad(lblInFlowrate.Content.ToString(), FlowbalancerInfo1_Title, FlowbalancerInfo1_WriteController, FlowbalancerInfo1_InFlowrateOffset, FlowbalancerInfo1_PercentageInput);

                //numKeypad.NumericKeypad_MinLimit = FlowbalancerInfo_InFlowrateMinimum;
                //numKeypad.NumericKeypad_MaxLimit = FlowbalancerInfo_InFlowrateMaximum;

                //numKeypad.Show();

                LiteCoSControls.NumericKeypad numKeypad1 = new NumericKeypad(lblInFlowrate.Content.ToString());
                numKeypad1.NumericKeypad_Driver = NumericKeypad.eDrivers.INGEARS7;
                numKeypad1.NumericKeypad_TagDatatype = NumericKeypad.eTagDataTypes.DINT;
                numKeypad1.NumericKeypad_PLC_Write = PLC_W;
                numKeypad1.NumericKeypad_MinLimit = FlowbalancerInfo_InFlowrateMinimum;
                numKeypad1.NumericKeypad_MaxLimit = FlowbalancerInfo_InFlowrateMaximum;
                numKeypad1.NumericKeypad_Title = FlowbalancerInfo3_Title;
                numKeypad1.NumericKeypad_PrimaryDBOffset = FlowbalancerInfo1_InFlowrateOffset;
                numKeypad1.NumericKeypad_IsValueWholeNumber = FlowbalancerInfo_IsValueWholeNumber;
                numKeypad1.NumericKeypad_IsValueSigned = FlowbalancerInfo_IsValueSigned;
                numKeypad1.NumericKeypad_MultiplyWriteValue = FlowbalancerInfo_MultiplyByWriteValue;
                numKeypad1.NumericKeypad_DivideyWriteValue = FlowbalancerInfo_DivideByWriteValue;

                numKeypad1.Show();
            }
        }
        //------------------------------------------------------------------------------//
        //                              Button Clicks                                   //
        //------------------------------------------------------------------------------//
        private void lblTargetTimeMins_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            bool bOpen = Classes.StandardCode.IsSpecificWindowOpen(Application.Current.Windows, this.lblTitle.Content.ToString() + " Target");

            if (!bOpen)
            {
                LiteCoSControls.NumericKeypad numKeypad1 = new NumericKeypad(lblTargetTimeMins.Content.ToString());
                numKeypad1.NumericKeypad_Driver = NumericKeypad.eDrivers.INGEARS7;
                numKeypad1.NumericKeypad_TagDatatype = NumericKeypad.eTagDataTypes.INT;
                numKeypad1.NumericKeypad_PLC_Write = StartingTimer_WriteController;
                numKeypad1.NumericKeypad_MinLimit = StartingTimer_TargetTimeMinimum;
                numKeypad1.NumericKeypad_MaxLimit = StartingTimer_TargetTimeMaximum;
                numKeypad1.NumericKeypad_Title = StartingTimer_Title;
                numKeypad1.NumericKeypad_PrimaryDBOffset = StartingTimer_TargetTimeDBOffset; //"DBX.DBWX"
                numKeypad1.NumericKeypad_IsValueWholeNumber = false;
                numKeypad1.NumericKeypad_IsValueSigned = StartingTimer_TargetTimeSigned;
                numKeypad1.NumericKeypad_MultiplyWriteValue = StartingTimer_MultiplyByWriteValue;
                numKeypad1.NumericKeypad_DivideyWriteValue = StartingTimer_DivideByWriteValue;

                numKeypad1.Show();
            }
        }