public ForceOutPuts()
        {
            InitializeComponent();
            ToggleButton[] ch1 = { btncalloutput1, btnfaultled1, btndetled1 };
            ToggleButton[] ch2 = { btncalloutput2, btnfaultled2, btndetled2 };
            ToggleButton[] ch3 = { btncalloutput3, btnfaultled3, btndetled3 };
            ToggleButton[] ch4 = { btncalloutput4, btnfaultled4, btndetled4 };
            Image[] ch1txt = { calloutput1, faultled1, detled1 };
            Image[] ch2txt = { calloutput2, faultled2, detled2 };
            Image[] ch3txt = { calloutput3, faultled3, detled3 };
            Image[] ch4txt = { calloutput4, faultled4, detled4 };

            ToggleButton[] debug = { btndebugled1, btndebugled2, btndebugled3, btndebugled4 };
            Image[] debugtxt = { debugled1, debugled2, debugled3, debugled4 };
            ToggleButton[] common = { btncommon1, btncommon2 };
            Image[] commontxt = { common1, common2 };
            ToggleButton[] leds = { btnledA, btnledB };
            Image[] ledstxt = { ledA, ledB };
            ToggleButton[] modems = { btnmodem };
            Image[] modemstxt = { modem };

            channel1 = new ChannelLED(ch1, ch1txt);
            channel2 = new ChannelLED(ch2, ch2txt);
            channel3 = new ChannelLED(ch3, ch3txt);
            channel4 = new ChannelLED(ch4, ch4txt);
            ganeral = new GaneralLeds(debug, debugtxt, common, commontxt, leds, ledstxt, modems, modemstxt);
            forceAllOutputandLeds = new ForceAllOutputandLeds();
            messages.Add(forceAllOutputandLeds);
            this.Visibility = Visibility.Collapsed;
        }
 private static byte GetLedsFromCannels(ChannelLED one, ChannelLED two, GaneralLeds general)
 {
     int resaultmode = 0;
     string b0 = Convert.ToInt32(two.detectLed).ToString();
     string b1 = Convert.ToInt32(two.faultLed).ToString();
     string b2 = Convert.ToInt32(two.callOutputs).ToString();
     string b3 = Convert.ToInt32(general.Modems[0]).ToString();
     string b4 = Convert.ToInt32(one.detectLed).ToString();
     string b5 = Convert.ToInt32(one.faultLed).ToString();
     string b6 = Convert.ToInt32(one.callOutputs).ToString();
     string result = "0" + b6 + b5 + b4 + b3 + b2 + b1 + b0;
     resaultmode = Convert.ToInt32(result, 2);
     return (byte)resaultmode;
 }