Beispiel #1
0
        public MinimunFreshAir()
        {
            this.InitializeComponent();
            handler = this;

            parameters.minimumPosition0 = minimumAir0;
            received   = new byte[readBufferLength];
            toSendSize = Marshal.SizeOf(typeof(ParametersMessage));
            toSend     = new byte[toSendSize];
        }
Beispiel #2
0
        public FlapperValveControl()
        {
            this.InitializeComponent();
            handler            = this;
            sizeofStruct       = 64;
            toSend             = new byte[sizeofStruct];
            nbcMode            = new bool[NUMBER_VALVES];
            stand_alone        = new bool[NUMBER_VALVES];
            manipulating       = new Boolean[NUMBER_VALVES];
            currentPosition    = new Byte[NUMBER_VALVES];
            lastPosition       = new Byte[NUMBER_VALVES];
            lastCommand        = new Byte[NUMBER_VALVES];
            commandValve       = new Byte[NUMBER_VALVES];
            lastSetpoint       = new Byte[NUMBER_VALVES];
            currentSetpoint    = new Byte[NUMBER_VALVES];
            last_minimum_air   = new Byte[NUMBER_VALVES];
            last_read_minimum  = new Byte[NUMBER_VALVES];
            minimunAirPosition = new Byte[NUMBER_VALVES];
            readBufferLength   = 64;
            received           = new byte[readBufferLength];
            listOfDials        = new ObservableCollection <Microsoft.Toolkit.Uwp.UI.Controls.RadialGauge>();

            listOfDials.Add(position);
            listOfDials.Add(position2);
            listOfDials.Add(MinimumPositionGauge);
            listOfDials.Add(MinimumPositionGauge2);
            listOfToggles = new ObservableCollection <ToggleSwitch>();
            listOfToggles.Add(EnableValve);
            listOfToggles.Add(EnableValve1);
            listOfTextBlocks = new ObservableCollection <TextBlock>();
            listOfTextBlocks.Add(AngleFlapper);
            listOfTextBlocks.Add(PressedLabel1);
            listOfTextBlocks.Add(PressedLabel2);
            listOfTextBlocks.Add(PressedLabel3);
            listOfTextBlocks.Add(AngleFlapper1);
            listOfTextBlocks.Add(PressedLabel4);
            listOfTextBlocks.Add(PressedLabel5);
            listOfTextBlocks.Add(PressedLabel6);
            listOfTextBlocks.Add(MinimunFlapper);
            listOfTextBlocks.Add(MinimunFlapper1);
            listOfTextBlocks.Add(StatusValve1);
            listOfTextBlocks.Add(StatusValve2);
            listOfBorders = new ObservableCollection <Border>();
            listOfBorders.Add(LimitSwitchBorder1);
            listOfBorders.Add(LimitSwitchBorder2);
            listOfBorders.Add(LimitSwitchBorder3);
            listOfBorders.Add(LimitSwitchBorder4);
            listOfBorders.Add(LimitSwitchBorder5);
            listOfBorders.Add(LimitSwitchBorder6);
            // listOfDials[0].Tapped += Position_Tapped;
            listOfDials[0].ManipulationStarted     += Position_ManipulationStarted;
            listOfDials[1].ManipulationStarted     += FlapperValveControl_ManipulationStarted;
            listOfDials[0].ManipulationCompleted   += position_ManipulationCompleted;
            listOfDials[1].ManipulationCompleted   += FlapperValveControl_ManipulationCompleted2;
            listOfToggles[0].ManipulationStarted   += EnableValve_ManipulationStarted;
            listOfToggles[0].ManipulationCompleted += EnableValve_ManipulationCompleted;
            listOfToggles[1].ManipulationStarted   += FlapperValveControl_ManipulationStarted1;
            listOfToggles[1].ManipulationCompleted += FlapperValveControl_ManipulationCompleted;

            listOfDarkAnimations  = new ObservableCollection <AnimationSet>();
            listOfLightAnimations = new ObservableCollection <AnimationSet>();
            for (int i = 0; i < NUMBER_VALVES; i++)
            {
                nbcMode[i]      = false;
                manipulating[i] = false;
                listOfDials[i].IsInteractive = false;
                // listOfDials[i].CanDrag = true;
                //   listOfDials[i].AllowDrop=true;
                listOfDials[i].IsHoldingEnabled = true;
                listOfDials[i].IsTapEnabled     = false;
                listOfDials[i].Opacity          = 0.2;
                listOfDarkAnimations.Add(listOfDials[i].Fade(value: 0.15f, duration: 1000, delay: 25, easingType: EasingType.Sine));
                listOfLightAnimations.Add(listOfDials[i].Fade(value: 0.95f, duration: 1000, delay: 25, easingType: EasingType.Sine));
                minimunAirPosition[i] = minimunFailValue;
            }

            listOfDarkAnimations[0].Completed  += NBC_Mode_Dark_Completed;
            listOfLightAnimations[0].Completed += NBC_Mode_Light_Completed;
            listOfDarkAnimations[1].Completed  += FlapperValveDarkAnimation_Completed1;
            listOfLightAnimations[1].Completed += FlapperValveLigthAnimation_Completed1;
            minimunValues = new MinimunFreshAir();



            timer_disposed = false;
        }