Commit e871bbe7 authored by Manuel Broseta's avatar Manuel Broseta

Version 1.2 added to git repo

parent e2f21ddc
v1.0, 15/10/2015 -- Initial release.
v1.1, 19/10/2015 -- Alin driver, files names and tools structure and location revised.
\ No newline at end of file
recursive-include resources *
recursive-include tools *
include alin_docconfig
......@@ -7,32 +7,9 @@ Typical usage often looks like this::
#!/usr/bin/env python
from alindrv import *
from alindev import *
from alin import *
al = alinSDB()
al.SDB_writeAddress(0x3100,0x01)
...
Paragraphs are separated by blank lines. *Italics*, **bold**,
and ``monospace`` look like this.
A Section
=========
Lists look like this:
* First
* Second. Can be multiple lines
but must be indented properly.
A Sub-Section
-------------
Numbered lists look like you'd expect:
1. hi there
2. must be going
Urls are http://like.this and links can be
written `like this <http://www.example.com/foo/bar>`_.
\ No newline at end of file
[Dolphin]
SortOrder=1
Timestamp=2015,10,15,15,19,9
Timestamp=2015,10,19,16,5,17
Version=3
ViewMode=1
from alindrv import alinSDB
from alindev import alinDevice
from alin import alinSDB
from alin import alinDevice
This diff is collapsed.
This diff is collapsed.
[Dolphin]
Timestamp=2015,10,15,15,13,34
Timestamp=2015,10,21,18,20,27
Version=3
ViewMode=2
ViewMode=1
This diff is collapsed.
This diff is collapsed.
#!/usr/bin/python
import logging
import os, logging
import logging.handlers
import time
from alin import *
......@@ -8,7 +8,7 @@ from alin import *
from datetime import datetime
dev = alinDevice('a1ba:608')
dev = alinDevice('ADC_CORE')
try:
try:
......@@ -23,11 +23,15 @@ try:
if n_cycles < 0: n_cycles = 1
if delay < 0: delay = 1
LOGS_FOLDER = '/home/projects/alba-em/logs/'
if len(Log_file)<=0:
data = time.strftime("%Y%m%d_%H%M%S")
LOG_FILENAME = '/home/projects/alba-em/logs/Current_'+data+'.csv'
LOG_FILENAME = LOGS_FOLDER+'Current_'+data+'.csv'
else:
LOG_FILENAME = '/home/projects/alba-em/logs/'+Log_file+'.csv'
LOG_FILENAME = LOGS_FOLDER+Log_file+'.csv'
if not os.path.exists(LOGS_FOLDER):
os.makedirs(LOGS_FOLDER)
my_logger = logging.getLogger('Alba Em#')
my_logger.setLevel(logging.DEBUG)
......@@ -56,10 +60,12 @@ try:
def getChannel(ch):
#readch = s.SDB_readAddress(ch)
readch = dev.readAttribute(ch)
if readch is not None:
if readch>0x7fffffff:
readch-=0x100000000
readch = (readch*10)/131072.
return readch
return 0
ch1 = getChannel('ADC_CH1')
ch2 = getChannel('ADC_CH2')
......
This diff is collapsed.
[Dolphin]
Timestamp=2015,10,15,15,27,23
Version=3
ViewMode=2
#!/usr/bin/sh
cd /usr/lib/alin
python alininfo.py $@
if [ -z "$ALINPATH" ]; then
echo "ALINPATH var is unset"
else
python $ALINPATH/tools/alininfo.py $@
fi
#!/usr/bin/sh
screen -dmS ALINECHO python /usr/lib/alin/tools/telnet/echo_server.py
if [ -z "$ALINPATH" ]; then
echo "ALINPATH var is unset"
else
screen -dmS ALINECHO python $ALINPATH/tools/telnet/echo_server.py
fi
#!/usr/bin/sh
cd /usr/lib/alin
python alingen.py $@
if [ -z "$ALINPATH" ]; then
echo "ALINPATH var is unset"
else
python $ALINPATH/tools/alingen.py $@
fi
......@@ -3,4 +3,11 @@ modprobe i2c-dev
pkill -f panel_off.py
screen -dmS ALINPANEL python /usr/lib/alin/tools/panel/panel.py
if [ -z "$ALINPATH" ]; then
echo "ALINPATH var is unset"
else
screen -dmS ALINPANEL python $ALINPATH/tools/panel/panel.py
fi
......@@ -4,4 +4,9 @@ pkill -f ALINPANEL
#screen -dm python /home/projects/Panel/panel_off.py
python /usr/lib/alin/tools/panel/paneloff.py
if [ -z "$ALINPATH" ]; then
echo "ALINPATH var is unset"
else
python $ALINPATH/tools/panel/paneloff.py
fi
#!/usr/bin/sh
cd /usr/lib/alin
python alinsave.py $@
if [ -z "$ALINPATH" ]; then
echo "ALINPATH var is unset"
else
python $ALINPATH/tools/alinsave.py
fi
#!/usr/bin/env python
import os, site
import os
import subprocess
from setuptools import setup
from setuptools.command.install import install
from distutils.sysconfig import get_python_lib
class alin_install(install):
def run(self):
install.run(self)
......@@ -11,17 +14,35 @@ class alin_install(install):
# This portion of the code has not the expected result. The environment variable created is not kept for always.
# it is just created on the python sessions where this is lanched.
# TODO: imporve this in the future.
#py_folder = site.getsitepackages()
py_folder = get_python_lib()
alin_folder = py_folder+"/alin"
res = os.environ.get('ALINPATH', 'Not Set')
if res == 'Not Set':
os.environ['ALINPATH'] = alin_folder
# Generate environment profile for ALINPAT
profile_folder = '/etc/profile.d/'
profile_name = "alin.sh"
with open(profile_folder+profile_name,"w") as f:
f.write("export ALINPATH="+alin_folder)
subprocess.call(profile_name, shell=True)
# Generate documentation
if os.path.isfile("alin_docconfig"):
os.system("doxygen alin_docconfig")
# Move generated doc folder to its porper location together witht the python module
os.system("cp -rf doc/man/man10 /usr/share/man/")
os.system("mandb")
cmd = "cp -rf doc/ "+alin_folder+"/doc"
os.system(cmd)
#res = os.environ.get('PYTHONPATH', 'Not Set')
#if res == 'Not Set':
#os.environ['PYTHONPATH'] = ''
#for fol in py_folder:
#os.environ['PYTHONPATH'] += ":"+fol
#else:
#for fol in py_folder:
#if fol not in res.split(":"):
#os.environ['PYTHONPATH'] += fol+":"
print "\nInstallation completed!!!\n\n*** PLEASE restart session to apply changes ***\n"
def main():
......@@ -29,13 +50,13 @@ def main():
system_folder = '/lib/modules/'+uname_folder+'/extra'
setup(name='AlIn',
version='1.0',
version='1.2',
description='Alba Instrument',
author='Manolo Broseta',
author_email='mbroseta@cells.es',
url='git@gitcomputing.cells.es:electronics/em2.git',
cmdclass={'install': alin_install},
packages=['alin'],
packages=['alin', 'alin.tools','alin.tools.panel','alin.tools.telnet'],
scripts = ['scripts/alin',
'scripts/alinecho',
'scripts/alingen',
......@@ -55,9 +76,10 @@ def main():
'resources/kernel/fmc-write-eeprom.ko',
'resources/kernel/wr-nic.ko'
]),
('/usr/lib/alin', ['tools/alininfo.py','tools/alingen.py','tools/alinsave.py']),
('/usr/lib/alin/panel', ['tools/panel/image_res.py','tools/panel/panel.py','tools/panel/paneldrv.py','tools/panel/paneloff.py']),
('/usr/lib/alin/telnet', ['tools/telnet/echo_client.py','tools/telnet/echo_server.py'])]
#('/usr/lib/alin', ['tools/alininfo.py','tools/alingen.py','tools/alinsave.py']),
#('/usr/lib/alin/panel', ['tools/panel/image_res.py','tools/panel/panel.py','tools/panel/paneldrv.py','tools/panel/paneloff.py']),
#('/usr/lib/alin/telnet', ['tools/telnet/echo_client.py','tools/telnet/echo_server.py'])
]
)
if __name__ == "__main__":
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment