Exemplo n.º 1
0
        private IList <Color[]> GetColors(TwistedElementType twistType, TwistInfo twistInfo)
        {
            string selectedSection;

            switch (twistType)
            {
            case TwistedElementType.single:
                selectedSection = "SinglesColors";
                break;

            case TwistedElementType.pair:
                selectedSection = "PairsColors";
                break;

            case TwistedElementType.triple:
                selectedSection = "TriplesColors";
                break;

            default: throw new ArgumentException("Кабели марки СКАБ не могут содержать изолированные элементы с таким типом скрутки!");
            }
            //var jsonDataPath = $"$.SkabInsulationColors.{polymerType}.{selectedSection}";
            var cableColorsSet = new List <Color[]>();// colorsRepository.GetObjects<Color[]>(colorsDataFileInfo, jsonDataPath);

            if (twistInfo.QuantityElements <= cableColorsSet.Count)
            {
                var colors = new List <Color[]>();
                for (int i = 0; i < twistInfo.QuantityElements; i++)
                {
                    colors.Add(cableColorsSet[i]);
                }
                return(colors);
            }
            return(GetCountingMarkingColors(twistType, twistInfo));
        }
Exemplo n.º 2
0
        private IList <Color[]> GetCountingMarkingColors(TwistedElementType twistType, TwistInfo twistInfo)
        {
            var colors = new List <Color[]>();
            //var jsonDataPath = $"$.SkabInsulationColors.{polymerType}.CountingMarkingColors";
            //var colorsDictionary = colorsRepository.GetObjects<TwistedElementType, CountingMarkingColors>(colorsDataFileInfo, jsonDataPath);
            //var countingMarkingGolors = colorsDictionary[twistType];
            var pairsCount = 1;

            for (int i = 0; i < twistInfo.LayersElementsCount.Length; i++)
            {
                for (int j = 0; j < twistInfo.LayersElementsCount[i]; j++)
                {
                    switch (pairsCount)
                    {
                    case 1:
                        //colors.Add(countingMarkingGolors.CountingColorsSet);
                        break;

                    case 2:
                        //colors.Add(countingMarkingGolors.DirectingColorsSet);
                        break;

                    default:
                        //colors.Add(countingMarkingGolors.OtherColorsSet);
                        break;
                    }
                    pairsCount++;
                }
                pairsCount = 1;
            }
            return(colors);
        }
Exemplo n.º 3
0
        private IList <Color[]> GetIndividualShieldColors(TwistedElementType twistType, TwistInfo twistInfo)
        {
            var colors = new List <Color[]>();

            //var jsonDataPath = $"$.SkabInsulationColors.{polymerType}.IndividualColorsCombine";
            //var colorsDictionary = colorsRepository.GetObjects<TwistedElementType, Color[]>(colorsDataFileInfo, jsonDataPath);
            //var individualColorsCombine = colorsDictionary[twistType];
            //for (int i = 0; i < twistInfo.QuantityElements; i++) colors.Add(individualColorsCombine);
            return(colors);
        }