Exemplo n.º 1
0
 public override ElectricStatus BreakDownTest(IMedia media, ElectricStatus elecStatus, WireStatus status, double voltage, out double current)
 {
     if (media.GetId() == _id)
     {
         switch (elecStatus)
         {
             case ElectricStatus.Resistence:
                 current = Defines.Clamp(voltage, 1e4);
                 return elecStatus;
             default:
                 break;
         }
     }
     else if (media.GetId() == MediaId.M_AIR)
     {
         voltage *= 0.01;
         switch (elecStatus)
         {
             case ElectricStatus.Resistence:
                 current = Defines.Clamp(voltage, 0.01);
                 if (Math.Abs(voltage) > 200)
                 {
                     return ElectricStatus.Ionization;
                 }
                 else
                 {
                     return elecStatus;
                 }
             case ElectricStatus.Ionization:
                 if (Math.Abs(voltage) > 500)
                 {
                     current = Defines.Clamp(voltage, 1e6);
                     return ElectricStatus.Conduction;
                 }
                 if (Math.Abs(voltage) > 200)
                 {
                     current = Defines.Clamp(voltage, 1e4);
                     return ElectricStatus.Ionization;
                 }
                 break;
             case ElectricStatus.Conduction:
                 if (Math.Abs(voltage) > 60)
                 {
                     current = Defines.Clamp(voltage, 1e6);
                     return ElectricStatus.Conduction;
                 }
                 else
                 {
                     current = Defines.Clamp(voltage, 1e6);
                     return ElectricStatus.Ionization;
                 }
             default:
                 break;
         }
     }
     return base.BreakDownTest(media, elecStatus, status, voltage, out current);
 }