Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • silecs/opensilecs
  • k.fugiel/opensilecs
  • s.kupiecki/opensilecs
3 results
Show changes
Showing
with 1867 additions and 1859 deletions
#!/bin/sh
set -e
PARAM_FILE=/common/home/bel/schwinn/lnx/workspace-silecs-neon/SiemensTestDU/generated/client/tsts7001.silecsparam
BLOCK=MyAcquisitionBlock
DEVICE=MyDevice1
# config for SiemensTestDU
ARGUMENTS="-f $PARAM_FILE -b $BLOCK -d $DEVICE -m GET_BLOCK -c"
COMMAND="$BINARY $ARGUMENTS"
$COMMAND
#!/bin/sh
set -e
\ No newline at end of file
set -e
PARAM_FILE=/common/home/bel/schwinn/lnx/workspace-silecs-neon/SiemensTestDU/generated/client/tsts7001.silecsparam
DEVICE=MyDevice1
# config for SiemensTestDU
ARGUMENTS="-f $PARAM_FILE -d $DEVICE -m GET_DEVICE"
COMMAND="$BINARY $ARGUMENTS"
$COMMAND
#!/bin/sh
set -e
CPU="x86_64"
SCRIPT=$(readlink -f "$0")
SCRIPTPATH=$(dirname "$SCRIPT") # path where this script is located in
SNAP7_PATH=${SCRIPTPATH}/../../../git/snap7/snap7-full/build/bin/${CPU}-linux
BINARY="${SCRIPTPATH}/../build/bin/${CPU}/silecs-cli-client"
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SNAP7_PATH
echo "##### LD_LIBRARY_PATH: ######"
echo "$LD_LIBRARY_PATH"
echo "###################################################################"
PARAM_FILE=/common/home/bel/schwinn/lnx/workspace-silecs-neon/SiemensTestDU/generated/client/tsts7001.silecsparam
REGISTER=DQ_Anlog00
DEVICE=MyDevice1
DELAY_MICRO_SEC=100000
# config for SiemensTestDU
$BINARY -f $PARAM_FILE -p 1000 -d MyDevice1 -r DQ_Anlog00 -m GET_REGISTER
ARGUMENTS="-f $PARAM_FILE -p $DELAY_MICRO_SEC -d $DEVICE -r $REGISTER -m GET_REGISTER"
COMMAND="$BINARY $ARGUMENTS"
$COMMAND
#!/bin/sh
set -e
\ No newline at end of file
set -e
PARAM_FILE=/common/home/bel/schwinn/lnx/workspace-silecs-neon/SiemensTestDU/generated/client/tsts7001.silecsparam
# config for SiemensTestDU
ARGUMENTS="-f $PARAM_FILE -i -c"
COMMAND="$BINARY $ARGUMENTS"
$COMMAND
#!/bin/sh
set -e
INSTALL_DIR=$1
SCRIPT=$(readlink -f "$0")
SCRIPTPATH=$(dirname "$SCRIPT") # path where this script is located in
mkdir -p ${INSTALL_DIR}
cp -r ${SCRIPTPATH}/build/bin ${INSTALL_DIR}
\ No newline at end of file
**/*.pyc
**/*__pycache__
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?eclipse-pydev version="1.0"?><pydev_project>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.7</pydev_property>
</pydev_project>
cmake_minimum_required(VERSION 3.20.2)
project(silecs-codegen)
find_package(Python COMPONENTS Interpreter)
add_test (NAME codegen-tests
COMMAND ${Python_EXECUTABLE} -m unittest
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/src/xml/
)
install (
DIRECTORY ${PROJECT_SOURCE_DIR}/src/xml
DESTINATION ${CMAKE_PROJECT_VERSION}/${PROJECT_NAME}
FILES_MATCHING PATTERN "*.py*")
This diff is collapsed.
# silecs-codegen
This component of the SILECS PLC-framework generates FESA and stand-alone C++ code from an existing silecs-project in order to ease the usage of the package silecs-communication-cpp
This component of the opensilecs PLC-framework generates FESA and stand-alone C++ code from an existing silecs-project in order to ease the usage of the package silecs-communication-cpp
## Getting Started
## Tests
Please check the lab-specific SILECS-Wikis for more information:
In [test](src/xml/test/) directory there are files with {test_name} which contain unit tests written using `unittest` framework. Tests conserning the migration tools are in their own corresponding folders inside [migration](src/xml/migration/).
[CERN SILECS Wiki Page][CERN_Wiki]
[GSI SILECS Wiki Page][GSI_Wiki]
## License
Licensed under the GNU GENERAL PUBLIC LICENSE Version 3. See the [LICENSE file][license] for details.
[license]: LICENSE
[CERN_Wiki]: https://wikis.cern.ch/display/SIL/SILECs+Home
[GSI_Wiki]: https://www-acc.gsi.de/wiki/Frontend/SILECS
All tests can be run together using following command from inside [src/xml](src/xml/):
```
python3 -m unittest
```
#!/bin/sh
set -e
INSTALL_DIR=$1
SCRIPT=$(readlink -f "$0")
SCRIPTPATH=$(dirname "$SCRIPT") # path where this script is located in
mkdir -p ${INSTALL_DIR}
cp -r ${SCRIPTPATH}/src/xml ${INSTALL_DIR}
\ No newline at end of file
#!/usr/bin/python
# Copyright 2016 CERN and GSI
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
global MEM_TYPE
global DI_TYPE
global DO_TYPE
global AI_TYPE
global AO_TYPE
global mappin2String
MEM_TYPE = 0
DI_TYPE = 1
DO_TYPE = 2
AI_TYPE = 3
AO_TYPE = 4
mappingType2String = { MEM_TYPE: "MEM", DI_TYPE: "DI", DO_TYPE: "DO", AI_TYPE: "AI", AO_TYPE: "AO" }
class Mapping(object):
def __init__(self,controllerAddress, type):
self.classBaseAddress = controllerAddress # start-address of the data per area type (MEM, DI,DO, AI,AO) for the given class
self.nbBlock = 0 # number of block per area type (MEM, DI,DO, AI,AO)
self.deviceDataSize = 0 # global size of one class instance (sum of block size per area type)
self.usedData = "" # data size summary per class and per area type#
self.instanceAddress = -1 # start-address of the device data
self.isDefined = False # True if the object related base-address has been defined
self.type = type # mapping-type (MEM, DI, DO,AI,AO )
self.blockDataSize = 0
self.blockAddress = 0
if controllerAddress != -1:
self.instanceAddress = 0
self.isDefined = True
def clearInstanceAddressIfDefined(self):
if self.isDefined:
self.instanceAddress = 0
\ No newline at end of file
......@@ -33,9 +33,9 @@ from iecommon import *
# Generates two Makefile.specific, one for the class design
# and another for the deploy unit
#-------------------------------------------------------------------------
def genMakefileClass(projectPath, centralMakefilePath, logTopics={'errorlog': True} ):
def genMakefileClass(projectPath, logTopics={'errorlog': True} ):
# Generate makefile for class design
source = fesaTemplates.genMakeDesign(centralMakefilePath)
source = fesaTemplates.genMakeDesign()
makefile = projectPath + "/" + "Makefile.specific"
if os.path.isfile(makefile): #dont overwrite
return
......@@ -44,9 +44,9 @@ def genMakefileClass(projectPath, centralMakefilePath, logTopics={'errorlog': Tr
fdesc.write(source)
fdesc.close()
def genMakefileDU(projectPath, silecsBasePath, snap7BasePath, logTopics={'errorlog': True}):
def genMakefileDU(projectPath, logTopics={'errorlog': True}):
# Generate makefile for class design
source = fesaTemplates.genMakeDeploy(silecsBasePath,snap7BasePath)
source = fesaTemplates.genMakeDeploy()
# Write file and save
makefile = projectPath + "/" + "Makefile.specific"
if os.path.isfile(makefile): #dont overwrite
......
......@@ -16,11 +16,11 @@
import fesa.fesa_3_0_0.generateBuildEnvironment
def genMakefileClass(projectPath, centralMakefilePath, logTopics={'errorlog': True} ):
return fesa.fesa_3_0_0.generateBuildEnvironment.genMakefileClass(projectPath, centralMakefilePath, logTopics )
def genMakefileClass(projectPath, logTopics={'errorlog': True} ):
return fesa.fesa_3_0_0.generateBuildEnvironment.genMakefileClass(projectPath, logTopics )
def genMakefileDU(projectPath, silecsBasePath, snap7BasePath, logTopics={'errorlog': True}):
return fesa.fesa_3_0_0.generateBuildEnvironment.genMakefileDU(projectPath, silecsBasePath, snap7BasePath, logTopics )
def genMakefileDU(projectPath, logTopics={'errorlog': True}):
return fesa.fesa_3_0_0.generateBuildEnvironment.genMakefileDU(projectPath, logTopics )
def genCProjectFile(projectPath, logTopics={'errorlog': True}):
return fesa.fesa_3_0_0.generateBuildEnvironment.genCProjectFile(projectPath, logTopics )