Initial commit
Some checks failed
Gradle Build / build (push) Has been cancelled

This commit is contained in:
CaiXiang
2024-11-30 18:36:13 +08:00
commit aa56926258
2134 changed files with 232943 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
// SPDX-FileCopyrightText: The openTCS Authors
// SPDX-License-Identifier: MIT
package org.opentcs.customizations;
import com.google.inject.AbstractModule;
/**
* A base class for Guice modules adding or customizing bindings for the kernel application and the
* plant overview application.
*/
public abstract class ConfigurableInjectionModule
extends
AbstractModule {
/**
* A provider for configuration bindings.
*/
private org.opentcs.configuration.ConfigurationBindingProvider configBindingProvider;
/**
* Returns the configuration bindung provider.
*
* @return The configuration binding provider.
*/
public org.opentcs.configuration.ConfigurationBindingProvider getConfigBindingProvider() {
return configBindingProvider;
}
/**
* Sets the configuration binding provider.
*
* @param configBindingProvider The new configuration binding provider.
*/
public void setConfigBindingProvider(
org.opentcs.configuration.ConfigurationBindingProvider configBindingProvider
) {
this.configBindingProvider = configBindingProvider;
}
}

View File

@@ -0,0 +1,67 @@
// SPDX-FileCopyrightText: The openTCS Authors
// SPDX-License-Identifier: MIT
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.
*/
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<ControlCenterPanel> 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<ControlCenterPanel> 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<VehicleCommAdapterPanelFactory> commAdapterPanelFactoryBinder() {
return Multibinder.newSetBinder(binder(), VehicleCommAdapterPanelFactory.class);
}
/**
* Returns a multibinder that can be used to register {@link PeripheralCommAdapterPanelFactory}
* implementations.
*
* @return The multibinder.
*/
protected Multibinder<PeripheralCommAdapterPanelFactory>
peripheralCommAdapterPanelFactoryBinder() {
return Multibinder.newSetBinder(binder(), PeripheralCommAdapterPanelFactory.class);
}
}

View File

@@ -0,0 +1,7 @@
// SPDX-FileCopyrightText: The openTCS Authors
// SPDX-License-Identifier: MIT
/**
* Components supporting extension and customization of the openTCS kernel control center
* application.
*/
package org.opentcs.customizations.controlcenter;

View File

@@ -0,0 +1,170 @@
// SPDX-FileCopyrightText: The openTCS Authors
// SPDX-License-Identifier: MIT
package org.opentcs.customizations.kernel;
import com.google.inject.Singleton;
import com.google.inject.TypeLiteral;
import com.google.inject.multibindings.MapBinder;
import com.google.inject.multibindings.Multibinder;
import org.opentcs.components.kernel.Dispatcher;
import org.opentcs.components.kernel.KernelExtension;
import org.opentcs.components.kernel.OrderSequenceCleanupApproval;
import org.opentcs.components.kernel.PeripheralJobCleanupApproval;
import org.opentcs.components.kernel.PeripheralJobDispatcher;
import org.opentcs.components.kernel.Router;
import org.opentcs.components.kernel.Scheduler;
import org.opentcs.components.kernel.TransportOrderCleanupApproval;
import org.opentcs.components.kernel.routing.EdgeEvaluator;
import org.opentcs.customizations.ConfigurableInjectionModule;
import org.opentcs.drivers.peripherals.PeripheralCommAdapterFactory;
import org.opentcs.drivers.vehicle.VehicleCommAdapterFactory;
import org.opentcs.drivers.vehicle.VehicleDataTransformerFactory;
/**
* A base class for Guice modules adding or customizing bindings for the kernel application.
*/
public abstract class KernelInjectionModule
extends
ConfigurableInjectionModule {
/**
* Sets the scheduler implementation to be used.
*
* @param clazz The implementation.
*/
protected void bindScheduler(Class<? extends Scheduler> clazz) {
bind(Scheduler.class).to(clazz).in(Singleton.class);
}
/**
* Sets the router implementation to be used.
*
* @param clazz The implementation.
*/
protected void bindRouter(Class<? extends Router> clazz) {
bind(Router.class).to(clazz).in(Singleton.class);
}
/**
* Sets the dispatcher implementation to be used.
*
* @param clazz The implementation.
*/
protected void bindDispatcher(Class<? extends Dispatcher> clazz) {
bind(Dispatcher.class).to(clazz).in(Singleton.class);
}
/**
* Sets the peripheral job dispatcher implementation to be used.
*
* @param clazz The implementation.
*/
protected void bindPeripheralJobDispatcher(Class<? extends PeripheralJobDispatcher> clazz) {
bind(PeripheralJobDispatcher.class).to(clazz).in(Singleton.class);
}
/**
* Returns a multibinder that can be used to register kernel extensions for all kernel states.
*
* @return The multibinder.
*/
protected Multibinder<KernelExtension> extensionsBinderAllModes() {
return Multibinder.newSetBinder(binder(), KernelExtension.class, ActiveInAllModes.class);
}
/**
* Returns a multibinder that can be used to register kernel extensions for the kernel's modelling
* state.
*
* @return The multibinder.
*/
protected Multibinder<KernelExtension> extensionsBinderModelling() {
return Multibinder.newSetBinder(binder(), KernelExtension.class, ActiveInModellingMode.class);
}
/**
* Returns a multibinder that can be used to register kernel extensions for the kernel's operating
* state.
*
* @return The multibinder.
*/
protected Multibinder<KernelExtension> extensionsBinderOperating() {
return Multibinder.newSetBinder(binder(), KernelExtension.class, ActiveInOperatingMode.class);
}
/**
* Returns a multibinder that can be used to register vehicle communication adapter factories.
*
* @return The multibinder.
*/
protected Multibinder<VehicleCommAdapterFactory> vehicleCommAdaptersBinder() {
return Multibinder.newSetBinder(binder(), VehicleCommAdapterFactory.class);
}
/**
* Returns a multibinder that can be used to register vehicle data transformer factories.
*
* @return The multibinder.
*/
protected Multibinder<VehicleDataTransformerFactory> vehicleDataTransformersBinder() {
return Multibinder.newSetBinder(binder(), VehicleDataTransformerFactory.class);
}
/**
* Returns a multibinder that can be used to register peripheral communication adapter factories.
*
* @return The multibinder.
*/
protected Multibinder<PeripheralCommAdapterFactory> peripheralCommAdaptersBinder() {
return Multibinder.newSetBinder(binder(), PeripheralCommAdapterFactory.class);
}
/**
* Returns a multibinder that can be used to register transport order cleanup approvals.
*
* @return The multibinder.
*/
protected Multibinder<TransportOrderCleanupApproval> transportOrderCleanupApprovalBinder() {
return Multibinder.newSetBinder(binder(), TransportOrderCleanupApproval.class);
}
/**
* Returns a multibinder that can be used to register order sequence cleanup approvals.
*
* @return The multibinder.
*/
protected Multibinder<OrderSequenceCleanupApproval> orderSequenceCleanupApprovalBinder() {
return Multibinder.newSetBinder(binder(), OrderSequenceCleanupApproval.class);
}
/**
* Returns a multibinder that can be used to register peripheral job cleanup approvals.
*
* @return The multibinder.
*/
protected Multibinder<PeripheralJobCleanupApproval> peripheralJobCleanupApprovalBinder() {
return Multibinder.newSetBinder(binder(), PeripheralJobCleanupApproval.class);
}
/**
* Returns a multibinder that can be used to register scheduler modules.
*
* @return The multibinder.
*/
protected Multibinder<Scheduler.Module> schedulerModuleBinder() {
return Multibinder.newSetBinder(binder(), Scheduler.Module.class);
}
/**
* Returns a mapbinder that can be used to register edge evaluators.
*
* @return The mapbinder.
*/
protected MapBinder<String, EdgeEvaluator> edgeEvaluatorBinder() {
return MapBinder.newMapBinder(
binder(),
TypeLiteral.get(String.class),
TypeLiteral.get(EdgeEvaluator.class)
);
}
}

View File

@@ -0,0 +1,6 @@
// SPDX-FileCopyrightText: The openTCS Authors
// SPDX-License-Identifier: MIT
/**
* Components supporting extension and customization of the openTCS kernel application.
*/
package org.opentcs.customizations.kernel;

View File

@@ -0,0 +1,6 @@
// SPDX-FileCopyrightText: The openTCS Authors
// SPDX-License-Identifier: MIT
/**
* Classes utilized for extending and customizing openTCS applications.
*/
package org.opentcs.customizations;

View File

@@ -0,0 +1,74 @@
// SPDX-FileCopyrightText: The openTCS Authors
// SPDX-License-Identifier: MIT
package org.opentcs.customizations.plantoverview;
import com.google.inject.multibindings.Multibinder;
import org.opentcs.components.plantoverview.ObjectHistoryEntryFormatter;
import org.opentcs.components.plantoverview.OrderTypeSuggestions;
import org.opentcs.components.plantoverview.PlantModelExporter;
import org.opentcs.components.plantoverview.PlantModelImporter;
import org.opentcs.components.plantoverview.PluggablePanelFactory;
import org.opentcs.components.plantoverview.PropertySuggestions;
import org.opentcs.customizations.ConfigurableInjectionModule;
/**
* A base class for Guice modules adding or customizing bindings for the plant overview application.
*/
public abstract class PlantOverviewInjectionModule
extends
ConfigurableInjectionModule {
/**
* Returns a multibinder that can be used to register plant model importers.
*
* @return The multibinder.
*/
protected Multibinder<PlantModelImporter> plantModelImporterBinder() {
return Multibinder.newSetBinder(binder(), PlantModelImporter.class);
}
/**
* Returns a multibinder that can be used to register plant model exporters.
*
* @return The multibinder.
*/
protected Multibinder<PlantModelExporter> plantModelExporterBinder() {
return Multibinder.newSetBinder(binder(), PlantModelExporter.class);
}
/**
* Returns a multibinder that can be used to register factories for pluggable panels.
*
* @return The multibinder.
*/
protected Multibinder<PluggablePanelFactory> pluggablePanelFactoryBinder() {
return Multibinder.newSetBinder(binder(), PluggablePanelFactory.class);
}
/**
* Returns a multibinder that can be used to register classes that provide suggested properties.
*
* @return The multibinder.
*/
protected Multibinder<PropertySuggestions> propertySuggestionsBinder() {
return Multibinder.newSetBinder(binder(), PropertySuggestions.class);
}
/**
* Returns a multibinder that can be used to register classes that provide suggested order types.
*
* @return The multibinder.
*/
protected Multibinder<OrderTypeSuggestions> orderTypeSuggestionsBinder() {
return Multibinder.newSetBinder(binder(), OrderTypeSuggestions.class);
}
/**
* Returns a multibinder that can be used to register {@link ObjectHistoryEntryFormatter}s.
*
* @return The multibinder.
*/
protected Multibinder<ObjectHistoryEntryFormatter> objectHistoryEntryFormatterBinder() {
return Multibinder.newSetBinder(binder(), ObjectHistoryEntryFormatter.class);
}
}

View File

@@ -0,0 +1,6 @@
// SPDX-FileCopyrightText: The openTCS Authors
// SPDX-License-Identifier: MIT
/**
* Components supporting extension and customization of the openTCS plant overview application.
*/
package org.opentcs.customizations.plantoverview;

View File

@@ -0,0 +1,17 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--
SPDX-FileCopyrightText: The openTCS Authors
SPDX-License-Identifier: CC-BY-4.0
-->
<html>
<body>
This is the description of the openTCS injection API.
<p>
Tutorials/code examples can be found in the developer's guide that is also part of the
openTCS distribution.
</p>
</body>
</html>