All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.opentcs.customizations.controlcenter.ControlCenterInjectionModule Maven / Gradle / Ivy

/**
 * Copyright (c) The openTCS Authors.
 *
 * This program is free software and subject to the MIT license. (For details,
 * see the licensing information (LICENSE.txt) you should have received with
 * this copy of the software.)
 */
package org.opentcs.customizations.controlcenter;

import com.google.inject.multibindings.Multibinder;
import org.opentcs.components.kernelcontrolcenter.ControlCenterPanel;
import org.opentcs.customizations.ConfigurableInjectionModule;
import org.opentcs.drivers.peripherals.management.PeripheralCommAdapterPanelFactory;
import org.opentcs.drivers.vehicle.management.VehicleCommAdapterPanelFactory;

/**
 * A base class for Guice modules adding or customizing bindings for the kernel control center
 * application.
 *
 * @author Martin Grzenia (Fraunhofer IML)
 */
public abstract class ControlCenterInjectionModule
    extends ConfigurableInjectionModule {

  /**
   * Returns a multibinder that can be used to register {@link ControlCenterPanel} implementations
   * for the kernel's modelling mode.
   *
   * @return The multibinder.
   */
  protected Multibinder controlCenterPanelBinderModelling() {
    return Multibinder.newSetBinder(binder(),
                                    ControlCenterPanel.class,
                                    ActiveInModellingMode.class);
  }

  /**
   * Returns a multibinder that can be used to register {@link ControlCenterPanel} implementations
   * for the kernel's operating mode.
   *
   * @return The multibinder.
   */
  protected Multibinder controlCenterPanelBinderOperating() {
    return Multibinder.newSetBinder(binder(),
                                    ControlCenterPanel.class,
                                    ActiveInOperatingMode.class);
  }

  /**
   * Returns a multibinder that can be used to register {@link VehicleCommAdapterPanelFactory}
   * implementations.
   *
   * @return The multibinder.
   */
  protected Multibinder commAdapterPanelFactoryBinder() {
    return Multibinder.newSetBinder(binder(), VehicleCommAdapterPanelFactory.class);
  }

  /**
   * Returns a multibinder that can be used to register {@link PeripheralCommAdapterPanelFactory}
   * implementations.
   *
   * @return The multibinder.
   */
  protected Multibinder peripheralCommAdapterPanelFactoryBinder() {
    return Multibinder.newSetBinder(binder(), PeripheralCommAdapterPanelFactory.class);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy