40 lines
1.5 KiB
C#
40 lines
1.5 KiB
C#
|
using System.Text.RegularExpressions;
|
|||
|
|
|||
|
namespace RhSolutions.QueryModifiers.DrinkingWaterHeatingFittings;
|
|||
|
|
|||
|
public class ThreadTPieceInternal : DrinkingWaterHeatingFitting
|
|||
|
{
|
|||
|
protected override string? BuildRhSolutionsName(string query)
|
|||
|
{
|
|||
|
MatchCollection diametersMatches = _diameter.Matches(query);
|
|||
|
if (diametersMatches.Count == 0)
|
|||
|
{
|
|||
|
return null;
|
|||
|
}
|
|||
|
string thread = _thread.Match(query).Groups["Thread"].Value;
|
|||
|
int[] diameters = diametersMatches.Select(match => int.Parse(match.Groups["Diameter"].Value)).ToArray();
|
|||
|
if (diameters.Length == 1)
|
|||
|
{
|
|||
|
if (diameters[0] < 25)
|
|||
|
{
|
|||
|
return $"Тройник RAUTITAN настенный с внутренней резьбой {diameters[0]}-Rp{thread}-{diameters[0]}";
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
return $"Тройник RAUTITAN с внутр. резьбой на боков. проходе {diameters[0]}-Rp {thread}-{diameters[0]}";
|
|||
|
}
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
if (diameters[0] < 25)
|
|||
|
{
|
|||
|
return $"Тройник RAUTITAN настенный с внутренней резьбой {diameters[0]}-Rp{thread}-{diameters[1]}";
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
return $"Тройник RAUTITAN с внутр. резьбой на боков. проходе {diameters[0]}-Rp {thread}-{diameters[1]}";
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|