Пример #1
0
 public ConfigForm(SetupForm myParent)
 {
     InitializeComponent();
     parentForm = myParent;
     if (parentForm.isClassC)
         serverIP = "192.168.2.50";
     else
         serverIP = "172.16.150.50";
 }
Пример #2
0
        //type: 1=speaker ready, 2=breakout
        public SyncForm(SetupForm myParent, Dictionary<int,int> compDict, SetupForm.Comp[] myCompInfo, int myType)
        {
            InitializeComponent();

            //sets the bounds of high and low based on the config file
            ipBounds = new int[4];
            XmlDocument doc = new XmlDocument();
            doc.Load(@"\\127.0.0.1\cshow\extras\syncManagerConfig.xml");
            ipBounds[0] = Convert.ToInt16(doc.SelectSingleNode("/configs/divisions/startSRLow").InnerText);
            ipBounds[1] = Convert.ToInt16(doc.SelectSingleNode("/configs/divisions/endSRHigh").InnerText);
            ipBounds[2] = Convert.ToInt16(doc.SelectSingleNode("/configs/divisions/startBOLow").InnerText);
            ipBounds[3] = Convert.ToInt16(doc.SelectSingleNode("/configs/divisions/endBOHigh").InnerText);
            ipScheme = doc.SelectSingleNode("/configs/ipScheme").InnerText.Equals("Class C");
            type = myType;

            //takes the modifiers from the config file and updates them
            inclusions = new string[6];
            exclusions = new string[6];
            numCompsActiveByType = new int[6];
            for (int i = 0; i < 6; i++)
                exclusions[i] = univFilter;
            if (type == 1) //speaker ready
            {
                numComps = Math.Abs(ipBounds[1] - ipBounds[0])+1;
                lowBottomBound = Convert.ToInt16(doc.SelectSingleNode("/configs/divisions/startSRLow").InnerText);
                lowTopBound = Convert.ToInt16(doc.SelectSingleNode("/configs/divisions/endSRLow").InnerText);
                highBottomBound = Convert.ToInt16(doc.SelectSingleNode("/configs/divisions/startSRHigh").InnerText);
                highTopBound = Convert.ToInt16(doc.SelectSingleNode("/configs/divisions/endSRHigh").InnerText);
                Text = "Speaker Ready";
                inclusions[0] = doc.SelectSingleNode("/configs/modifiers/speakerReady/up/inclusions").InnerText;
                inclusions[1] = doc.SelectSingleNode("/configs/modifiers/speakerReady/down/inclusions").InnerText;
                inclusions[2] = doc.SelectSingleNode("/configs/modifiers/speakerReady/highUp/inclusions").InnerText;
                inclusions[3] = doc.SelectSingleNode("/configs/modifiers/speakerReady/highDown/inclusions").InnerText;
                inclusions[4] = doc.SelectSingleNode("/configs/modifiers/speakerReady/lowUp/inclusions").InnerText;
                inclusions[5] = doc.SelectSingleNode("/configs/modifiers/speakerReady/lowDown/inclusions").InnerText;
                exclusions[0] = doc.SelectSingleNode("/configs/modifiers/speakerReady/up/exclusions").InnerText;
                exclusions[1] = doc.SelectSingleNode("/configs/modifiers/speakerReady/down/exclusions").InnerText;
                exclusions[2] = doc.SelectSingleNode("/configs/modifiers/speakerReady/highUp/exclusions").InnerText;
                exclusions[3] = doc.SelectSingleNode("/configs/modifiers/speakerReady/highDown/exclusions").InnerText;
                exclusions[4] = doc.SelectSingleNode("/configs/modifiers/speakerReady/lowUp/exclusions").InnerText;
                exclusions[5] = doc.SelectSingleNode("/configs/modifiers/speakerReady/lowDown/exclusions").InnerText;
            }
            else if(type==2) //breakout
            {
                numComps = Math.Abs(ipBounds[3] - ipBounds[2])+1;
                lowBottomBound = Convert.ToInt16(doc.SelectSingleNode("/configs/divisions/startBOLow").InnerText);
                lowTopBound = Convert.ToInt16(doc.SelectSingleNode("/configs/divisions/endBOLow").InnerText);
                highBottomBound = Convert.ToInt16(doc.SelectSingleNode("/configs/divisions/startBOHigh").InnerText);
                highTopBound = Convert.ToInt16(doc.SelectSingleNode("/configs/divisions/endBOHigh").InnerText);
                Text = "Breakout";
                inclusions[0] = doc.SelectSingleNode("/configs/modifiers/breakout/up/inclusions").InnerText;
                inclusions[1] = doc.SelectSingleNode("/configs/modifiers/breakout/down/inclusions").InnerText;
                inclusions[2] = doc.SelectSingleNode("/configs/modifiers/breakout/highUp/inclusions").InnerText;
                inclusions[3] = doc.SelectSingleNode("/configs/modifiers/breakout/highDown/inclusions").InnerText;
                inclusions[4] = doc.SelectSingleNode("/configs/modifiers/breakout/lowUp/inclusions").InnerText;
                inclusions[5] = doc.SelectSingleNode("/configs/modifiers/breakout/lowDown/inclusions").InnerText;
                exclusions[0] = doc.SelectSingleNode("/configs/modifiers/breakout/up/exclusions").InnerText;
                exclusions[1] = doc.SelectSingleNode("/configs/modifiers/breakout/down/exclusions").InnerText;
                exclusions[2] = doc.SelectSingleNode("/configs/modifiers/breakout/highUp/exclusions").InnerText;
                exclusions[3] = doc.SelectSingleNode("/configs/modifiers/breakout/highDown/exclusions").InnerText;
                exclusions[4] = doc.SelectSingleNode("/configs/modifiers/breakout/lowUp/exclusions").InnerText;
                exclusions[5] = doc.SelectSingleNode("/configs/modifiers/breakout/lowDown/exclusions").InnerText;
            }
            else //zone
            {
                numComps = Math.Abs(ipBounds[3] - ipBounds[2]) + 1;
                lowBottomBound = Convert.ToInt16(doc.SelectSingleNode("/configs/divisions/startBOLow").InnerText);
                lowTopBound = Convert.ToInt16(doc.SelectSingleNode("/configs/divisions/endBOLow").InnerText);
                highBottomBound = Convert.ToInt16(doc.SelectSingleNode("/configs/divisions/startBOHigh").InnerText);
                highTopBound = Convert.ToInt16(doc.SelectSingleNode("/configs/divisions/endBOHigh").InnerText);
                Text = "Zones";
                inclusions[0] = doc.SelectSingleNode("/configs/modifiers/zone/up/inclusions").InnerText;
                inclusions[1] = doc.SelectSingleNode("/configs/modifiers/zone/down/inclusions").InnerText;
                inclusions[2] = doc.SelectSingleNode("/configs/modifiers/zone/highUp/inclusions").InnerText;
                inclusions[3] = doc.SelectSingleNode("/configs/modifiers/zone/highDown/inclusions").InnerText;
                inclusions[4] = doc.SelectSingleNode("/configs/modifiers/zone/lowUp/inclusions").InnerText;
                inclusions[5] = doc.SelectSingleNode("/configs/modifiers/zone/lowDown/inclusions").InnerText;
                exclusions[0] = doc.SelectSingleNode("/configs/modifiers/zone/up/exclusions").InnerText;
                exclusions[1] = doc.SelectSingleNode("/configs/modifiers/zone/down/exclusions").InnerText;
                exclusions[2] = doc.SelectSingleNode("/configs/modifiers/zone/highUp/exclusions").InnerText;
                exclusions[3] = doc.SelectSingleNode("/configs/modifiers/zone/highDown/exclusions").InnerText;
                exclusions[4] = doc.SelectSingleNode("/configs/modifiers/zone/lowUp/exclusions").InnerText;
                exclusions[5] = doc.SelectSingleNode("/configs/modifiers/zone/lowDown/exclusions").InnerText;
            }

            //changes where the windows will appear based on the config screensize
            isServer = doc.SelectSingleNode("/configs/screenSize").InnerText.Equals("Server");
            if (isServer)
                baseLeft = 2220;
            else
                baseLeft = 300;

            //sets the IP scheme based on the config file
            serverIP = baseIP + "50";
            if (!ipScheme)
            {
                baseIP = "172.16.";
                serverIP = baseIP + "150.50";
            }

            //set the current show folder location
            cshowHighLoc = doc.SelectSingleNode("/configs/cshowHighLoc").InnerText;
            cshowLowLoc = doc.SelectSingleNode("/configs/cshowLowLoc").InnerText;

            //make sure to save the config file when done (works like closing it)
            doc.Save(@"\\127.0.0.1\cshow\extras\syncManagerConfig.xml");

            //setting up a bunch of empty arrays to be used
            clientComps = new ClientComputer[numComps];
            parentForm = myParent;
            runningSyncs = new bool[6];
            switchType = new bool[6];
            channelIsUsingUnivFilter = new bool[6];
            for (int i = 0; i < 6; i++)
            {
                channelIsUsingUnivFilter[i] = true;
                numCompsActiveByType[i] = 0;
                switchType[i] = false;
            }
            lowestIP = lowBottomBound;
            compInfo = myCompInfo;
            index2ip = compDict;
        }