示例#1
0
  public DynamicEvent addBusFaultEvent(
      String faultBusId,
      SimpleFaultCode code,
      double startTime,
      double durationTime,
      Complex Zlg,
      Complex Zll) {
    // define an event, set the event id and event type.
    DynamicEvent event1 =
        DStabObjectFactory.createDEvent(
            "BusFault_" + code + "@" + faultBusId,
            "Bus Fault @" + faultBusId,
            DynamicEventType.BUS_FAULT,
            dstabNet);
    event1.setStartTimeSec(startTime);
    event1.setDurationSec(durationTime);

    // define a bus fault
    DStabBus faultBus = dstabNet.getDStabBus(faultBusId);
    AcscBusFault fault =
        CoreObjectFactory.createAcscBusFault("Bus Fault 3P@" + faultBusId, dstabNet);
    fault.setBus(faultBus);
    fault.setFaultCode(code);
    fault.setZLGFault(Zlg);
    fault.setZLLFault(Zll);

    // add this fault to the event, must be consist with event type definition before.
    event1.setBusFault(fault);
    return event1;
  }