44 lines
2.4 KiB
C#
44 lines
2.4 KiB
C#
using System;
|
|
using System.Linq;
|
|
using CtrEditor.ObjetosSim.HydraulicComponents;
|
|
|
|
namespace CtrEditor.Test
|
|
{
|
|
class FilterDebugTest
|
|
{
|
|
static void TestHydraulicComponentDetection()
|
|
{
|
|
// Test hydraulic component detection logic like in osVisFilter
|
|
var tankType = typeof(osHydTank);
|
|
var pipeType = typeof(osHydPipe);
|
|
|
|
Console.WriteLine("=== Tank Type Analysis ===");
|
|
Console.WriteLine($"Tank Type: {tankType.FullName}");
|
|
Console.WriteLine($"Tank Namespace: {tankType.Namespace}");
|
|
Console.WriteLine($"Has HydraulicComponents in namespace: {tankType.Namespace?.Contains("HydraulicComponents")}");
|
|
Console.WriteLine($"Tank Interfaces: {string.Join(", ", tankType.GetInterfaces().Select(i => i.Name))}");
|
|
Console.WriteLine($"Has Hydraulic interface: {tankType.GetInterfaces().Any(i => i.Name.Contains("Hydraulic"))}");
|
|
|
|
Console.WriteLine("\n=== Pipe Type Analysis ===");
|
|
Console.WriteLine($"Pipe Type: {pipeType.FullName}");
|
|
Console.WriteLine($"Pipe Namespace: {pipeType.Namespace}");
|
|
Console.WriteLine($"Has HydraulicComponents in namespace: {pipeType.Namespace?.Contains("HydraulicComponents")}");
|
|
Console.WriteLine($"Pipe Interfaces: {string.Join(", ", pipeType.GetInterfaces().Select(i => i.Name))}");
|
|
Console.WriteLine($"Has Hydraulic interface: {pipeType.GetInterfaces().Any(i => i.Name.Contains("Hydraulic"))}");
|
|
|
|
// Test the exact logic from IsHydraulicComponentType
|
|
Console.WriteLine("\n=== IsHydraulicComponentType Logic Test ===");
|
|
bool tankIsHydraulic = tankType.Namespace != null &&
|
|
(tankType.Namespace.Contains("HydraulicComponents") ||
|
|
tankType.GetInterfaces().Any(i => i.Name.Contains("Hydraulic")));
|
|
|
|
bool pipeIsHydraulic = pipeType.Namespace != null &&
|
|
(pipeType.Namespace.Contains("HydraulicComponents") ||
|
|
pipeType.GetInterfaces().Any(i => i.Name.Contains("Hydraulic")));
|
|
|
|
Console.WriteLine($"Tank IsHydraulicComponentType: {tankIsHydraulic}");
|
|
Console.WriteLine($"Pipe IsHydraulicComponentType: {pipeIsHydraulic}");
|
|
}
|
|
}
|
|
}
|