예제 #1
0
 private com.relteq.sirius.jaxb.Route restoreRoute(Routes db_route) throws TorqueException {
   com.relteq.sirius.jaxb.Route route = factory.createRoute();
   route.setId(id2str(db_route.getId()));
   route.setName(db_route.getName());
   com.relteq.sirius.jaxb.LinkReferences lrs = factory.createLinkReferences();
   Criteria crit = new Criteria();
   crit.addAscendingOrderByColumn(RouteLinksPeer.ORDINAL);
   @SuppressWarnings("unchecked")
   List<RouteLinks> db_rl_l = db_route.getRouteLinkss(crit);
   for (RouteLinks db_rl : db_rl_l) {
     com.relteq.sirius.jaxb.LinkReference lr = factory.createLinkReference();
     lr.setId(id2str(db_rl.getLinkId()));
     lrs.getLinkReference().add(lr);
   }
   route.setLinkReferences(lrs);
   return route;
 }
예제 #2
0
 private com.relteq.sirius.jaxb.Sensor restoreSensor(Sensors db_sensor) throws TorqueException {
   com.relteq.sirius.jaxb.Sensor sensor = factory.createSensor();
   sensor.setId(id2str(db_sensor.getId()));
   sensor.setLinkPosition(db_sensor.getLinkPosition());
   sensor.setType(db_sensor.getType());
   sensor.setOriginalId(db_sensor.getOriginalId());
   if (null != db_sensor.getLaneNumber())
     sensor.setLaneNumber(BigInteger.valueOf(db_sensor.getLaneNumber().longValue()));
   sensor.setHealthStatus(db_sensor.getHealthStatus());
   sensor.setDisplayPosition(restorePosition(db_sensor.getDisplayGeometry()));
   if (null != db_sensor.getLinkId()) {
     com.relteq.sirius.jaxb.LinkReference lr = factory.createLinkReference();
     lr.setId(id2str(db_sensor.getLinkId()));
     sensor.setLinkReference(lr);
   }
   sensor.setParameters(restoreParameters(db_sensor));
   List<com.relteq.sirius.jaxb.Table> table_l = restoreTables(db_sensor);
   if (null != table_l && !table_l.isEmpty()) {
     sensor.setTable(table_l.get(0));
     if (1 < table_l.size())
       logger.warn("Sensor " + db_sensor.getId() + " has " + table_l.size() + " tables");
   }
   return sensor;
 }
예제 #3
0
  protected final void populateFromJaxb(
      Scenario myScenario, com.relteq.sirius.jaxb.Phase jaxbPhase) {

    int numlinks = jaxbPhase.getLinks().getLinkReference().size();
    this.targetlinks = new Link[numlinks];
    for (int i = 0; i < numlinks; i++) {
      com.relteq.sirius.jaxb.LinkReference linkref = jaxbPhase.getLinks().getLinkReference().get(i);
      targetlinks[i] = myScenario.getLinkWithId(linkref.getId());
    }

    if (jaxbPhase.getNema() != null) myNEMA = Signal.String2NEMA(jaxbPhase.getNema().toString());
    else myNEMA = Signal.NEMA.NULL;

    if (jaxbPhase.getMinGreenTime() != null)
      this.mingreen = jaxbPhase.getMinGreenTime().floatValue();
    else this.mingreen = Defaults.mingreen;

    if (jaxbPhase.getRedClearTime() != null)
      this.redcleartime = jaxbPhase.getRedClearTime().floatValue();
    else this.redcleartime = Defaults.redcleartime;

    if (jaxbPhase.getYellowTime() != null) this.yellowtime = jaxbPhase.getYellowTime().floatValue();
    else this.yellowtime = Defaults.yellowtime;

    this.lag = jaxbPhase.isLag();
    this.permissive = jaxbPhase.isPermissive();
    this.protectd = jaxbPhase.isProtected();
    this.recall = jaxbPhase.isRecall();

    // actual yellow and red clear times
    this.actualyellowtime = yellowtime;
    this.actualredcleartime = redcleartime;

    // dual ring structure: opposingPhase, isthrough, myRingGroup
    switch (myNEMA) {
      case _1:
        opposingPhase = mySignal.getPhaseForNEMA(NEMA._2);
        isthrough = false;
        myRingGroup = 0;
        break;
      case _2:
        opposingPhase = mySignal.getPhaseForNEMA(NEMA._1);
        isthrough = true;
        myRingGroup = 0;
        break;
      case _3:
        opposingPhase = mySignal.getPhaseForNEMA(NEMA._4);
        isthrough = false;
        myRingGroup = 1;
        break;
      case _4:
        opposingPhase = mySignal.getPhaseForNEMA(NEMA._3);
        isthrough = true;
        myRingGroup = 1;
        break;
      case _5:
        opposingPhase = mySignal.getPhaseForNEMA(NEMA._6);
        isthrough = false;
        myRingGroup = 0;
        break;
      case _6:
        opposingPhase = mySignal.getPhaseForNEMA(NEMA._5);
        isthrough = true;
        myRingGroup = 0;
        break;
      case _7:
        opposingPhase = mySignal.getPhaseForNEMA(NEMA._8);
        isthrough = false;
        myRingGroup = 1;
        break;
      case _8:
        opposingPhase = mySignal.getPhaseForNEMA(NEMA._7);
        isthrough = true;
        myRingGroup = 1;
        break;
    }
  }
예제 #4
0
 private com.relteq.sirius.jaxb.LinkReference restoreDestinationNetworkLinks(
     DestinationNetworkLinks db_dnl) {
   com.relteq.sirius.jaxb.LinkReference linkref = factory.createLinkReference();
   linkref.setId(id2str(db_dnl.getLinkId()));
   return linkref;
 }
예제 #5
0
 private com.relteq.sirius.jaxb.LinkReference restorePhaseLink(PhaseLinks db_phl) {
   com.relteq.sirius.jaxb.LinkReference lr = factory.createLinkReference();
   lr.setId(id2str(db_phl.getLinkId()));
   return lr;
 }