Exemplo n.º 1
0
 @Override
 public void addSignalGroupSettings(SignalGroupSettingsData signalGroupSettings) {
   if (this.signalGroupSettingsBySignalGroupId == null) {
     this.signalGroupSettingsBySignalGroupId = new TreeMap<>();
   }
   this.signalGroupSettingsBySignalGroupId.put(
       signalGroupSettings.getSignalGroupId(), signalGroupSettings);
 }
  /**
   * creates signal control for a crossing like node 3,4,5 or 6, which contains 2 signal groups with
   * single signals. this method switches both signals together in the first onset-dropping rhythm.
   *
   * @param signalSystemId
   * @param control
   */
  private void createSignalControlFor2LightCrossing(
      Id<SignalSystem> signalSystemId, SignalControlData control) {

    SignalSystemControllerData controller =
        control.getFactory().createSignalSystemControllerData(signalSystemId);
    control.addSignalSystemControllerData(controller);
    controller.setControllerIdentifier(DefaultPlanbasedSignalSystemController.IDENTIFIER);
    SignalPlanData plan =
        control
            .getFactory()
            .createSignalPlanData(Id.create(signalSystemId.toString() + "P", SignalPlan.class));
    controller.addSignalPlanData(plan);
    plan.setCycleTime(this.cycle);
    plan.setOffset(0);

    SignalGroupSettingsData settings1 =
        control
            .getFactory()
            .createSignalGroupSettingsData(
                Id.create(signalSystemId.toString() + "S1", SignalGroup.class));
    plan.addSignalGroupSettings(settings1);
    settings1.setOnset(this.onset1);
    settings1.setDropping(this.dropping1);

    SignalGroupSettingsData settings2 =
        control
            .getFactory()
            .createSignalGroupSettingsData(
                Id.create(signalSystemId.toString() + "S2", SignalGroup.class));
    plan.addSignalGroupSettings(settings2);
    settings2.setOnset(this.onset1);
    settings2.setDropping(this.dropping1);
  }