Commit 1cfc6667 authored by Gino Tosti's avatar Gino Tosti
Browse files

updated templates

parent 70457468
Loading
Loading
Loading
Loading

.gitignore

0 → 100644
+138 −0
Original line number Diff line number Diff line
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
#  Usually these files are written by a python script from a template
#  before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
#   For a library or package, you might want to ignore these files since the code is
#   intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
#   According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
#   However, in case of collaboration, if having platform-specific dependencies or dependencies
#   having no cross-platform support, pipenv may install dependencies that don't work, or not
#   install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/
+7 −4
Original line number Diff line number Diff line
from GenDevice.acsUtils import *

import shutil
managerxml="""<?xml version="1.0" encoding="ISO-8859-1"?>
<Manager   xmlns:cdb="urn:schemas-cosylab-com:CDB:1.0" 
           xmlns="urn:schemas-cosylab-com:Manager:1.0" 
@@ -64,8 +64,6 @@ javacontXml = """<?xml version="1.0" encoding="ISO-8859-1"?>
 """




def setCDBEnvVar(dirname):
	os.environ["ACS_CDB"]=dirname
	pwd = os.getcwd()
@@ -105,6 +103,7 @@ def createCBDBaseDir(dirname):

def createCDBDirs():
	basedir=os.environ["ACS_CDB"]
	templatedir=os.environ["PYGEN"]+"/templates/Alarms"
	print (basedir)
	if basedir=="":
	   print ("ACS_CDB variable is not defined")
@@ -132,7 +131,11 @@ def createCDBDirs():
			print ("directory:"+managerdir+" created")
		else: 
			print ("error creting directory:"+managerdir)
	   
		alarmdir=basedir+"/CDB/Alarms"
		if os.path.exists(alarmdir):
			print ("dir:",alarmdir," already exists")
		else:
			shutil.copytree(templatedir,alarmdir)	   
def createManagerXml():
	basedir=os.environ["ACS_CDB"]
	managerdir = basedir+"/CDB/MACI/Managers/Manager"
+0 −1
Original line number Diff line number Diff line
@@ -29,7 +29,6 @@ class excelIcd:
			print("File does not exist")
		except ecc.InvalidFileException:
			print(" openpyxl does not support the old .xls file format\n","Trying with xlrd")
		finally:
			self.book = pd.ExcelFile(self.bookfile)
		self.nsheets = len(self.book.sheet_names)
		if(self.debug):
+1 −43
Original line number Diff line number Diff line
@@ -51,49 +51,7 @@ module $module {

    // BACI Properties

  #if $x.GetSheet["NRows"]>=1
    #for $idx in $range(0,$x.GetSheet["NRows"])
    #silent L.append($x.GetSheet["Short name"][$idx])
    #if ($x.GetSheet["OPC UA Data type"][$idx]).upper()[-1]==']' ## test for arrays
      #set $type=($x.GetSheet["OPC UA Data type"][$idx].upper()).split("[")[0]+"[]"
    #else
      #set $type=$x.GetSheet["OPC UA Data type"][$idx].upper()
    #end if
readonly attribute ACS::RO${y[$type][0]} $x.GetSheet["Short name"][$idx];
    #end for
  #end if

  #if $x.SetSheet["NRows"]>=1
    #for $idx in $range(0,$x.SetSheet["NRows"])
    #silent L.append($x.SetSheet["Short name"][$idx])
    #if ($x.SetSheet["OPC UA Data type"][$idx]).upper()[-1]==']' ## test for arrays
      #set $type=($x.SetSheet["OPC UA Data type"][$idx].upper()).split("[")[0]+"[]"
    #else
      #set $type=$x.SetSheet["OPC UA Data type"][$idx].upper()
    #end if
readonly attribute ACS::RW${y[$type][0]} $x.SetSheet["Short name"][$idx];
    #end for
  #end if

  #if $x.ModeSheet["NRows"]>=1
  #for $idx in $range(0,$x.ModeSheet["NRows"])
    #set $name=($x.ModeSheet["OPC_UA node"][$idx].split(";")[1]).split("=")[1].replace(".","_")
    #if not $name in L
    readonly attribute ACS::RW${y[$x.ModeSheet["OPC UA Data type"][$idx].upper()][0]} $name;
    #silent L.append($name)
    #end if
  #end for
  #end if

  #if $x.CmdSheet["NRows"]>=1
  #for $idx in $range(0,$x.CmdSheet["NRows"])
    #set $name=($x.CmdSheet["OPC_UA node"][$idx].split(";")[1]).split("=")[1].replace(".","_")
    #if not $name in L
    readonly attribute ACS::RW${y[$x.CmdSheet["OPC UA Data type"][$idx].upper()][0]} $name;
    #silent L.append($name)
    #end if
  #end for
  #end if

    // GET commands

@@ -146,7 +104,7 @@ ${y[$type][5]} G${x.SetSheet["Name of command"][$idx][1:]}(out ACS::Time timesta
               TCSControlExceptions::IllegalParameterErrorEx);

  #end for
    void connectToDevice(in string opc_url);
  
    };
};
\#endif
+155 −609

File changed.

Preview size limit exceeded, changes collapsed.

Loading