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

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -0,0 +1,2 @@
# SPDX-FileCopyrightText: The openTCS Authors
# SPDX-License-Identifier: CC-BY-4.0

View File

@@ -0,0 +1,70 @@
# SPDX-FileCopyrightText: The openTCS Authors
# SPDX-License-Identifier: CC-BY-4.0
############################################################
# Default Logging Configuration File
#
# You can use a different file by specifying a filename
# with the java.util.logging.config.file system property.
# For example java -Djava.util.logging.config.file=myfile
############################################################
############################################################
# Global properties
############################################################
# "handlers" specifies a comma separated list of log Handler
# classes. These handlers will be installed during VM startup.
# Note that these classes must be on the system classpath.
# By default we only configure a ConsoleHandler, which will only
# show messages at the INFO and above levels.
#handlers= java.util.logging.ConsoleHandler
# To also add the FileHandler, use the following line instead.
handlers= java.util.logging.FileHandler, java.util.logging.ConsoleHandler
# Default global logging level.
# This specifies which kinds of events are logged across
# all loggers. For any given facility this global level
# can be overriden by a facility specific level
# Note that the ConsoleHandler also has a separate level
# setting to limit messages printed to the console.
.level= INFO
############################################################
# Handler specific properties.
# Describes specific configuration info for Handlers.
############################################################
# default file output is in user's home directory.
java.util.logging.FileHandler.pattern = ./log/opentcs-kernel.%g.log
java.util.logging.FileHandler.limit = 500000
java.util.logging.FileHandler.count = 10
#java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter
java.util.logging.FileHandler.formatter = org.opentcs.util.logging.SingleLineFormatter
java.util.logging.FileHandler.append = true
java.util.logging.FileHandler.level = FINE
# Limit the message that are printed on the console to INFO and above.
java.util.logging.ConsoleHandler.level = FINE
#java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
java.util.logging.ConsoleHandler.formatter = org.opentcs.util.logging.SingleLineFormatter
# Our own handler for the GUI:
#org.opentcs.kernel.controlcenter.ControlCenterInfoHandler.level = WARNING
############################################################
# Facility specific properties.
# Provides extra control for each logger.
############################################################
# For example, set the com.xyz.foo logger to only log SEVERE
# messages:
#com.xyz.foo.level = SEVERE
# Logging configuration for single classes. Remember that you might also have to
# adjust handler levels!
#org.opentcs.strategies.basic.dispatching.DefaultDispatcher.level = FINE
#org.opentcs.kernel.KernelStateOperating.level = FINE

View File

@@ -0,0 +1,2 @@
# SPDX-FileCopyrightText: The openTCS Authors
# SPDX-License-Identifier: CC-BY-4.0

View File

@@ -0,0 +1,62 @@
@echo off
rem SPDX-FileCopyrightText: The openTCS Authors
rem SPDX-License-Identifier: MIT
rem
rem Start SSL keystore and truststore generation.
rem
rem Don't export variables to the parent shell.
setlocal
rem Set the path to where keytool is located. Keytool comes with the Java JRE.
set KEYTOOL_PATH="keytool"
rem Try to execute keytool
%KEYTOOL_PATH% 2>nul
if %ERRORLEVEL% neq 0 (
if %KEYTOOL_PATH% equ "keytool" (
echo Error: Could not find keytool in PATH.
) else (
echo Error: Could not find keytool in %KEYTOOL_PATH%.
)
exit /B %ERRORLEVEL%
)
rem Set base directory names.
set OPENTCS_HOME=.
set OPENTCS_CONFIGDIR=%OPENTCS_HOME%\config
set OUTPUTDIR=%OPENTCS_CONFIGDIR%
rem Set paths to generate files at.
set KEYSTORE_FILEPATH=%OUTPUTDIR%\keystore.p12
set TRUSTSTORE_FILEPATH=%OUTPUTDIR%\truststore.p12
set CERTIFICATE_FILEPATH=%OUTPUTDIR%\certificate.cer
rem Set the password used for generating the stores.
set PASSWORD=password
echo Deleting previously generated keystore and truststore...
del %KEYSTORE_FILEPATH% 2>nul
del %TRUSTSTORE_FILEPATH% 2>nul
del %CERTIFICATE_FILEPATH% 2>nul
rem Generates a keypair wrapped in a self-signed (X.509) certificate.
rem Some defaults of the -genkeypair command: -alias "mykey" -keyalg "DSA" -keysize 1024 -validity 90
echo Generating a new keystore in %KEYSTORE_FILEPATH%...
%KEYTOOL_PATH% -genkeypair -alias openTCS -keyalg RSA -dname "c=DE" -storepass %PASSWORD% -keypass %PASSWORD% -validity 365 -storetype PKCS12 -keystore %KEYSTORE_FILEPATH%
rem Exports the (wrapping) self-signed certificate from the generated keypair.
rem '-rfc' - Output the certificate in a printable encoding format (by default the -export command outputs a certificate in binary encoding)
rem '2>nul' - Suppress output of this command
%KEYTOOL_PATH% -exportcert -alias openTCS -file %CERTIFICATE_FILEPATH% -keystore %KEYSTORE_FILEPATH% -storepass %PASSWORD% -rfc 2>nul
rem Adds the exported certificate to a new keystore and its trusted certificates.
echo Generating a new truststore in %TRUSTSTORE_FILEPATH%...
%KEYTOOL_PATH% -importcert -alias openTCS -file %CERTIFICATE_FILEPATH% -storepass %PASSWORD% -storetype PKCS12 -keystore %TRUSTSTORE_FILEPATH% -noprompt 2>nul
rem Delete the exported certificate since it's not really needed.
del %CERTIFICATE_FILEPATH%
echo Copy the generated truststore to the openTCS PlantOverview's \config folder or a corresponding location of your application.
pause

View File

@@ -0,0 +1,57 @@
#!/bin/sh
# SPDX-FileCopyrightText: The openTCS Authors
# SPDX-License-Identifier: MIT
#
# Start SSL keystore and truststore generation.
#
# Set the path to where keytool is located. Keytool comes with the Java JRE.
export KEYTOOL_PATH="keytool"
# Try to execute keytool
${KEYTOOL_PATH} 2>/dev/null
if [ $? -ne 0 ]; then
if [ "${KEYTOOL_PATH}" = "keytool" ]; then
echo Error: Could not find keytool in PATH.
else
echo Error: Could not find keytool in ${KEYTOOL_PATH}.
fi
exit $?
fi
# Set base directory names.
export OPENTCS_HOME=.
export OPENTCS_CONFIGDIR="${OPENTCS_HOME}/config"
export OUTPUTDIR="${OPENTCS_CONFIGDIR}"
# Set paths to generate files at.
export KEYSTORE_FILEPATH="${OUTPUTDIR}/keystore.p12"
export TRUSTSTORE_FILEPATH="${OUTPUTDIR}/truststore.p12"
export CERTIFICATE_FILEPATH="${OUTPUTDIR}/certificate.cer"
# Set the password used for generating the stores.
export PASSWORD=password
echo Deleting previously generated keystore and truststore...
rm ${KEYSTORE_FILEPATH} 2>/dev/null
rm ${TRUSTSTORE_FILEPATH} 2>/dev/null
rm ${CERTIFICATE_FILEPATH} 2>/dev/null
# Generates a keypair wrapped in a self-signed (X.509) certificate.
# Some defaults of the -genkeypair command: -alias "mykey" -keyalg "DSA" -keysize 1024 -validity 90
echo Generating a new keystore in ${KEYSTORE_FILEPATH}...
${KEYTOOL_PATH} -genkeypair -alias openTCS -keyalg RSA -dname "c=DE" -storepass ${PASSWORD} -keypass ${PASSWORD} -validity 365 -storetype PKCS12 -keystore ${KEYSTORE_FILEPATH}
# Exports the (wrapping) self-signed certificate from the generated keypair.
# '-rfc' - Output the certificate in a printable encoding format (by default the -export command outputs a certificate in binary encoding)
# '2>nul' - Suppress output of this command
${KEYTOOL_PATH} -exportcert -alias openTCS -file ${CERTIFICATE_FILEPATH} -keystore ${KEYSTORE_FILEPATH} -storepass ${PASSWORD} -rfc 2>/dev/null
# Adds the exported certificate to a new keystore and its trusted certificates.
echo Generating a new truststore in ${TRUSTSTORE_FILEPATH}...
${KEYTOOL_PATH} -importcert -alias openTCS -file ${CERTIFICATE_FILEPATH} -storepass ${PASSWORD} -storetype PKCS12 -keystore ${TRUSTSTORE_FILEPATH} -noprompt 2>/dev/null
# Delete the exported certificate since it's not really needed.
rm ${CERTIFICATE_FILEPATH}
echo Copy the generated truststore to the openTCS PlantOverview\'s /config folder or a corresponding location of your application.

View File

View File

View File

@@ -0,0 +1,20 @@
@echo off
rem SPDX-FileCopyrightText: The openTCS Authors
rem SPDX-License-Identifier: MIT
rem
rem Shut down the openTCS kernel.
rem
rem Don't export variables to the parent shell
setlocal
rem Set base directory names.
set OPENTCS_BASE=.
set OPENTCS_LIBDIR=%OPENTCS_BASE%\lib
rem Set the class path
set OPENTCS_CP=%OPENTCS_LIBDIR%\*;
set OPENTCS_CP=%OPENTCS_CP%;%OPENTCS_LIBDIR%\openTCS-extensions\*;
java -classpath "%OPENTCS_CP%" ^
org.opentcs.kernel.ShutdownKernel localhost 55100

View File

@@ -0,0 +1,24 @@
#!/bin/sh
# SPDX-FileCopyrightText: The openTCS Authors
# SPDX-License-Identifier: MIT
#
# Shut down the openTCS kernel.
#
# Set base directory names.
export OPENTCS_BASE=.
export OPENTCS_LIBDIR="${OPENTCS_BASE}/lib"
# Set the class path
export OPENTCS_CP="${OPENTCS_LIBDIR}/*"
export OPENTCS_CP="${OPENTCS_CP}:${OPENTCS_LIBDIR}/openTCS-extensions/*"
if [ -n "${OPENTCS_JAVAVM}" ]; then
export JAVA="${OPENTCS_JAVAVM}"
else
# XXX Be a bit more clever to find out the name of the JVM runtime.
export JAVA="java"
fi
${JAVA} -classpath "${OPENTCS_CP}" \
org.opentcs.kernel.ShutdownKernel localhost 55100

36
opentcs-kernel/src/dist/startKernel.bat vendored Normal file
View File

@@ -0,0 +1,36 @@
@echo off
rem SPDX-FileCopyrightText: The openTCS Authors
rem SPDX-License-Identifier: MIT
rem
rem Start the openTCS kernel.
rem
rem Set window title
title Kernel (openTCS)
rem Don't export variables to the parent shell
setlocal
rem Set base directory names.
set OPENTCS_BASE=.
set OPENTCS_HOME=.
set OPENTCS_CONFIGDIR=%OPENTCS_HOME%\config
set OPENTCS_LIBDIR=%OPENTCS_BASE%\lib
rem Set the class path
set OPENTCS_CP=%OPENTCS_LIBDIR%\*;
set OPENTCS_CP=%OPENTCS_CP%;%OPENTCS_LIBDIR%\openTCS-extensions\*;
rem XXX Be a bit more clever to find out the name of the JVM runtime.
set JAVA=java
rem Start kernel
%JAVA% -enableassertions ^
-Dopentcs.base="%OPENTCS_BASE%" ^
-Dopentcs.home="%OPENTCS_HOME%" ^
-Dopentcs.configuration.provider=gestalt ^
-Dopentcs.configuration.reload.interval=10000 ^
-Djava.util.logging.config.file="%OPENTCS_CONFIGDIR%\logging.config" ^
-XX:-OmitStackTraceInFastThrow ^
-classpath "%OPENTCS_CP%" ^
org.opentcs.kernel.RunKernel

34
opentcs-kernel/src/dist/startKernel.sh vendored Normal file
View File

@@ -0,0 +1,34 @@
#!/bin/sh
# SPDX-FileCopyrightText: The openTCS Authors
# SPDX-License-Identifier: MIT
#
# Start the openTCS kernel.
#
# Set base directory names.
export OPENTCS_BASE=.
export OPENTCS_HOME=.
export OPENTCS_CONFIGDIR="${OPENTCS_HOME}/config"
export OPENTCS_LIBDIR="${OPENTCS_BASE}/lib"
# Set the class path
export OPENTCS_CP="${OPENTCS_LIBDIR}/*"
export OPENTCS_CP="${OPENTCS_CP}:${OPENTCS_LIBDIR}/openTCS-extensions/*"
if [ -n "${OPENTCS_JAVAVM}" ]; then
export JAVA="${OPENTCS_JAVAVM}"
else
# XXX Be a bit more clever to find out the name of the JVM runtime.
export JAVA="java"
fi
# Start kernel
${JAVA} -enableassertions \
-Dopentcs.base="${OPENTCS_BASE}" \
-Dopentcs.home="${OPENTCS_HOME}" \
-Dopentcs.configuration.provider=gestalt \
-Dopentcs.configuration.reload.interval=10000 \
-Djava.util.logging.config.file=${OPENTCS_CONFIGDIR}/logging.config \
-XX:-OmitStackTraceInFastThrow \
-classpath "${OPENTCS_CP}" \
org.opentcs.kernel.RunKernel