Exemplo n.º 1
0
        private void Window_Loaded()
        {
            List <String> ls = iuc.GetStepNameCollection();

            ls.Remove(iuc.GetStepName());
            int position = -1;

            if (!stepName.Equals(String.Empty))
            {
                position = ls.IndexOf(stepName);
            }
            for (int i = 0; i < ls.Count; i++)
            {
                cbLightName.Items.Add(ls[i]);
            }
            if (ls.Count > 0)
            {
                if (position == -1)
                {
                    cbLightName.SelectedIndex = 0;
                }
                else
                {
                    cbLightName.SelectedIndex = position;
                    if (type == CollectionType.Intersection)
                    {
                        cbType.SelectedIndex = 1;
                    }
                    else if (type == CollectionType.Complement)
                    {
                        cbType.SelectedIndex = 2;
                    }
                }
            }
        }
Exemplo n.º 2
0
        private List <Light> GetRealData(List <Light> mLightList)
        {
            if (!iuc.finalDictionary.ContainsKey(iuc.GetStepName()))
            {
                return(mLightList);
            }
            //没有可操作的灯光组
            if (!iuc.lightScriptDictionary[iuc.GetStepName()].Contains(iuc.GetStepName() + "LightGroup"))
            {
                return(mLightList);
            }
            String[]      contents = iuc.finalDictionary[iuc.GetStepName()].Split(';');
            StringBuilder command  = new StringBuilder();

            foreach (String str in contents)
            {
                if (str.Equals(String.Empty))
                {
                    continue;
                }
                String[] strs      = str.Split('=');
                String   type      = strs[0];
                String[] _contents = strs[1].Split(',');

                if (type.Equals("Color"))
                {
                    foreach (String _str in _contents)
                    {
                        String[] mContents = _str.Split('-');
                        if (mContents[0].Equals("Format"))
                        {
                            if (mContents[1].Equals("Green"))
                            {
                                //mLightList = LightGroupMethod.SetColor(mLightList,new List<int>() { 73,74,75,76 });
                            }
                            if (mContents[1].Equals("Blue"))
                            {
                                //mLightList = LightGroupMethod.SetColor(mLightList, new List<int>() { 33, 37, 41, 45 });
                            }
                            if (mContents[1].Equals("Pink"))
                            {
                                //mLightList = LightGroupMethod.SetColor(mLightList, new List<int>() { 4, 94, 53, 57 });
                            }
                            if (mContents[1].Equals("Diy"))
                            {
                                List <int> intColors = new List <int>();
                                String[]   strColors = mContents[2].Split(' ');
                                for (int i = 0; i < strColors.Length; i++)
                                {
                                    intColors.Add(int.Parse(strColors[i]));
                                }
                                //mLightList = LightGroupMethod.SetColor(mLightList, intColors);
                            }
                        }
                        else if (mContents[0].Equals("Shape"))
                        {
                            if (mContents[1].Equals("Square"))
                            {
                                //mLightList = EditMethod.ShapeColor(mLightList,EditMethod.ShapeColorType.Square, mContents[2]);
                            }
                            else if (mContents[1].Equals("RadialVertical"))
                            {
                                //mLightList = EditMethod.ShapeColor(mLightList, EditMethod.ShapeColorType.RadialVertical, mContents[2]);
                            }
                            else if (mContents[1].Equals("RadialHorizontal"))
                            {
                                //mLightList = EditMethod.ShapeColor(mLightList, EditMethod.ShapeColorType.RadialHorizontal, mContents[2]);
                            }
                        }
                    }
                }
                if (type.Equals("Shape"))
                {
                    foreach (String _str in _contents)
                    {
                        if (_str.Equals("HorizontalFlipping"))
                        {
                            //mLightList = EditMethod.HorizontalFlipping(mLightList);
                        }
                        if (_str.Equals("VerticalFlipping"))
                        {
                            //mLightList = EditMethod.VerticalFlipping(mLightList);
                        }
                        if (_str.Equals("Clockwise"))
                        {
                            //mLightList = EditMethod.Clockwise(mLightList);
                        }
                        if (_str.Equals("AntiClockwise"))
                        {
                            //mLightList = EditMethod.AntiClockwise(mLightList);
                        }
                    }
                }
                if (type.Equals("Time"))
                {
                    foreach (String _str in _contents)
                    {
                        if (_str.Equals("Reversal"))
                        {
                            //mLightList = EditMethod.Reversal(mLightList);
                        }
                        String[] mContents = _str.Split('-');
                        if (mContents[0].Equals("ChangeTime"))
                        {
                            //mLightList = EditMethod.ChangeTime(mLightList,(EditMethod.Operator)int.Parse(mContents[1]),double.Parse(mContents[2]));
                        }
                        else if (mContents[0].Equals("StartTime"))
                        {
                            //mLightList = LightGroupMethod.SetStartTime(mLightList, int.Parse(mContents[1]));
                        }
                        else if (mContents[0].Equals("AllTime"))
                        {
                            //mLightList = LightGroupMethod.SetAllTime(mLightList, int.Parse(mContents[1]));
                        }
                    }
                }
                if (type.Equals("ColorOverlay"))
                {
                    foreach (String _str in _contents)
                    {
                        String[]   mContents = _str.Split('-');
                        List <int> intColors = new List <int>();
                        String[]   strColors = mContents[1].Split(' ');
                        for (int x = 0; x < strColors.Length; x++)
                        {
                            intColors.Add(int.Parse(strColors[x]));
                        }
                        if (mContents[0].Equals("true"))
                        {
                            //mLightList = EditMethod.CopyToTheFollow(mLightList, intColors);
                        }
                        else
                        {
                            //mLightList = EditMethod.CopyToTheEnd(mLightList, intColors);
                        }
                    }
                }
                if (type.Equals("SportOverlay"))
                {
                    foreach (String _str in _contents)
                    {
                        String[] mContents = _str.Split('-');

                        List <int> intColors = new List <int>();
                        String[]   strColors = mContents[0].Split(' ');
                        for (int x = 0; x < strColors.Length; x++)
                        {
                            intColors.Add(int.Parse(strColors[x]));
                        }
                        //mLightList = EditMethod.AccelerationOrDeceleration(mLightList, intColors);
                    }
                }
                if (type.Equals("Other"))
                {
                    foreach (String _str in _contents)
                    {
                        if (_str.Equals("RemoveBorder"))
                        {
                            // mLightList = EditMethod.RemoveBorder(mLightList);
                        }
                    }
                }
            }
            return(mLightList);
        }