示例#1
0
        private void Validation_BT_Click(object sender, RoutedEventArgs e)
        {
            Log.writeLine("Mise à jour Mapping");

            ONRGBPrimaryColor   = (int)ON_Primary_Color_CB.SelectedItem;
            ONRGBSecondaryColor = (int)ON_Secondary_Color_CB.SelectedItem;
            ONBlinkingType      = (BlinkingType)ON_Flashing_Type_CB.SelectedItem;
            ONBlinkingSpeed     = (BlinkingSpeed)ON_Flashing_Speed_CB.SelectedItem;

            OFFRGBPrimaryColor   = (int)OFF_Primary_Color_CB.SelectedItem;
            OFFRGBSecondaryColor = (int)OFF_Secondary_Color_CB.SelectedItem;
            OFFBlinkingType      = (BlinkingType)OFF_Flashing_Type_CB.SelectedItem;
            OFFBlinkingSpeed     = (BlinkingSpeed)OFF_Flashing_Speed_CB.SelectedItem;

            BTType = (buttonType)BT_Type_CB.SelectedItem;

            try
            {
                if ((string)Groupe_Selection.SelectedItem == "None")
                {
                    Groupe = -1;
                }
            }
            catch
            {
                Groupe = (int)Groupe_Selection.SelectedItem;
            }



            if (BT_Valid_Click != null)
            {
                this.BT_Valid_Click(this, e);
            }
        }
示例#2
0
        public RGBButton(int bID)
        {
            ID = bID;

            IsOnToogle = false;

            Type = buttonType.Momentary;

            offprimaryColor   = 0;
            offsecondaryColor = 0;
            offFlashingtype   = BlinkingType.OneShot;
            offFlashingspeed  = BlinkingSpeed._1_2;

            onprimaryColor   = 0;
            onsecondaryColor = 0;
            onFlashingtype   = BlinkingType.OneShot;
            onFlashingspeed  = BlinkingSpeed._1_2;

            Groupe = -1;
        }
示例#3
0
        /// <summary>
        /// Gestion  des Led RGB
        /// </summary>
        /// <param name="LedID"></param>
        /// <param name="type"></param>
        /// <param name="primarycolor"></param>
        /// <param name="secondarycolor"></param>
        /// <param name="speed"></param>
        /// <exception cref="ErrorSendingDataToAPC40Exception"
        public void Led(RGB_Led LedID, BlinkingType type, int primarycolor, int secondarycolor, BlinkingSpeed speed)
        {
            try
            {
                Log.writeLine("Changement Leds -> ID : " + LedID);

                _OuputAPC40.Send(new ChannelMessage(ChannelCommand.NoteOn, 0, (int)LedID, primarycolor));

                _OuputAPC40.Send(new ChannelMessage(ChannelCommand.NoteOn, (int)type * (int)speed, (int)LedID, secondarycolor));
            }
            catch
            {
                Log.writeLine("Impossible de communiquer avec l'APC40");
                throw new ErrorSendingDataToAPC40Exception();
            }
        }