public void Setup() { conductor = new Conductor(); billet = new InsulatedBillet { Conductor = conductor, PolymerGroup = new PolymerGroup() }; coverPolymerGroup = new PolymerGroup(); fireProtectionClass = new FireProtectionClass(); twistedElementType = new TwistedElementType(); operatingVoltage250 = new OperatingVoltage { ACVoltage = 380, ACFriquency = 400, DCVoltage = 540 }; operatingVoltage660 = new OperatingVoltage { ACVoltage = 660, ACFriquency = 400, DCVoltage = 1000 }; builder = new SkabTitleBuilder(); cable = new Cable { CoverPolymerGroup = coverPolymerGroup, TwistedElementType = twistedElementType, FireProtectionClass = fireProtectionClass, }; }
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); }
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)); }
public static double GetTwistStep(TwistedElementType singleTwistedElementType, double twistedCoreDiameter) { if (singleTwistedElementType == TwistedElementType.single) { return(twistedCoreDiameter * 16); } return(twistedCoreDiameter * 18); }
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); }
public static double GetTwistedCoreDiameterBySingleElement(int twistedElementsCount, double singleElementDiameter, TwistedElementType elementType) { if (elementType == TwistedElementType.core) { throw new ArgumentException("Метод не работает с типом скрученного сердечника Core!"); } CheckInputTwistedElementsCount(twistedElementsCount); var twistKoefficient = GetTwistKoefficient(twistedElementsCount); return(CalcCoreDiametersMethods[elementType].Invoke(singleElementDiameter, twistKoefficient)); }