Skip to content

Commit

Permalink
Merge branch 'develop' (Taurus 4 compatible)
Browse files Browse the repository at this point in the history
  • Loading branch information
sergirubio committed Sep 22, 2017
2 parents a893dad + bd5b6de commit 83a1d8c
Show file tree
Hide file tree
Showing 20 changed files with 252 additions and 138 deletions.
14 changes: 10 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,17 @@ LINKS / DEPENDENCIES

All dependencies and User Manual are available from www.tango-controls.org:

Tango
PyTango
Taurus
Fandango
* Tango: https://github.com/tango-controls/cppTango
* PyTango: https://github.com/tango-controls/pytango
* Taurus: https://github.com/taurus-org/taurus
* Fandango: https://github.com/tango-controls/fandango

Optional dependencies:

* https://github.com/tango-controls/SimulatorDS
* https://github.com/tango-controls/PANIC
* https://github.com/tango-controls/PyTangoArchiving
* ...
INSTALLING:
===========

Expand Down
2 changes: 1 addition & 1 deletion bin/vaccagui
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash


# # VACuum Control Application for ALBA
Expand Down
2 changes: 1 addition & 1 deletion examples/bl00_eps/bl00.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
except: traceback.print_exc()

try:
from PyQt4 import Qt
from vacca.utils import Qt

except: traceback.print_exc()

Expand Down
37 changes: 26 additions & 11 deletions examples/elinac/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
Execute the ELinac simulation
=============================

PyTango and Taurus must be installed
REQUISITES: PyTango and Taurus must be installed::

> Debian/Ubuntu: sudo apt-get install tango-pytango python-taurus
> OpenSUSE: sudo zypper install tango-pytango python-taurus

In addition, get latest fandango and SimulatorDS::

> git clone https://github.com/tango-controls/fandango fandango.git
> git clone https://github.com/tango-controls/SimulatorDS
> git clone -b develop https://github.com/tango-controls/fandango fandango.git
> git clone -b develop https://github.com/tango-controls/SimulatorDS
Install them using setup.py or just add folders to PATH::

Expand All @@ -16,36 +19,48 @@ Install them using setup.py or just add folders to PATH::

Get Vacca::

> git clone https://github.com/tango-controls/vacca vacca.git
> git clone -b develop https://github.com/tango-controls/vacca vacca.git
> export PATH=$(pwd)/vacca.git/bin:$PATH
> export PYTHONPATH=$(pwd)/vacca.git:$PYTHONPATH
> cd vacca.git/examples/elinac

If you don't have the TangoBox devices, create new simulators using SimulatorDS ::
If you don't have the TangoBox devices, create new simulators
using SimulatorDS ::

> ipython
: import SimulatorDS.gen_simulation as gs
: gs.generate_class_properties(all_rw=True)
: gs.create_simulators('ui_attribute_values.pck',instance='elinac',tango_host='127.0.0.1')
: host = gs.fandango.get_tango_host().split(':')[0]
: gs.create_simulators('ui_attribute_values.pck',instance='elinac',tango_host=host)
# Press "yes" when asked to override properties.
: Ctrl+D

If you have starter, SimulatorDS and fandango/scripts in PATH, let's launch the simulators::
Launch the simulators using DynamicDS script::

> DynamicDS elinac >/dev/null &

Using Starter and fandango/scripts::
Or running the .py script::

> python ../../../fandango.git/fandango/device/DynamicDS.py elinac &
Or using Starter::

> tango_servers start "DynamicDS/elinac*"
To check that they started properly::

Or directly running the .py script::
> tango_servers states DynamicDS/elinac

> python ../../../fandango.git/fandango/device/DynamicDS.py elinac &

Last, launch VACCA::

> vaccagui elinac.py

.. image:: screenshot.png

From this point you can select devices from the tree or synoptic, plot values, interact with attributes/commands or start/stop/reload devices and its properties using the right click menus.
Depending on your OS version you may get some QString exceptions at startup; just click on "Ignore" as these messages will appear only the first time you execute the application.

From this point you can select devices from the tree or synoptic, plot values, interact with attributes/commands or start/stop/reload devices and its properties using the right click menus. You can use the properties panel to edit the values of the attributes as you wish; use right-click or the updateDynamicAttributes command to update the simulated values.

If panic and PyTangoArchiving are available, the AlarmGUI and ArchivingBrowser widgets can be added to the perspective for a richer functionality.

Expand Down
6 changes: 3 additions & 3 deletions examples/elinac/linac.jdw
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ background:208,231,252 }
JDGroup {
summit:419.975,34.25,448.025,59
origin:166.675,28.375
name:"taco:elin/v-ip/bunch"
name:"tango:elin/v-ip/bunch"
extensions:{
className:"atkpanel.MainPanel"
classParam:""
Expand Down Expand Up @@ -581,7 +581,7 @@ background:208,231,252 }
JDGroup {
summit:440.975,226.25,469.025,251
origin:164.725,41.375
name:"taco:elin/v-ip/kly1"
name:"tango:elin/v-ip/kly1"
extensions:{
className:"atkpanel.MainPanel"
classParam:""
Expand Down Expand Up @@ -703,7 +703,7 @@ background:208,231,252 }
JDGroup {
summit:752.975,226.25,781.025,251
origin:214.925,41.375
name:"taco:elin/v-ip/kly2"
name:"tango:elin/v-ip/kly2"
extensions:{
className:"atkpanel.MainPanel"
classParam:""
Expand Down
6 changes: 3 additions & 3 deletions examples/elinac/linac.jdw-simu
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ background:208,231,252 }
JDGroup {
summit:419.975,34.25,448.025,59
origin:166.675,28.375
name:"taco:elin/v-ip/bunch"
name:"tango:elin/v-ip/bunch"
extensions:{
className:"atkpanel.MainPanel"
classParam:""
Expand Down Expand Up @@ -581,7 +581,7 @@ background:208,231,252 }
JDGroup {
summit:440.975,226.25,469.025,251
origin:164.725,41.375
name:"taco:elin/v-ip/kly1"
name:"tango:elin/v-ip/kly1"
extensions:{
className:"atkpanel.MainPanel"
classParam:""
Expand Down Expand Up @@ -703,7 +703,7 @@ background:208,231,252 }
JDGroup {
summit:752.975,226.25,781.025,251
origin:214.925,41.375
name:"taco:elin/v-ip/kly2"
name:"tango:elin/v-ip/kly2"
extensions:{
className:"atkpanel.MainPanel"
classParam:""
Expand Down
6 changes: 3 additions & 3 deletions examples/elinac/linac.jdw.axis
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ background:208,231,252 }
JDGroup {
summit:419.975,34.25,448.025,59
origin:166.675,28.375
name:"taco:elin/v-ip/bunch"
name:"tango:elin/v-ip/bunch"
extensions:{
className:"atkpanel.MainPanel"
classParam:""
Expand Down Expand Up @@ -581,7 +581,7 @@ background:208,231,252 }
JDGroup {
summit:440.975,226.25,469.025,251
origin:164.725,41.375
name:"taco:elin/v-ip/kly1"
name:"tango:elin/v-ip/kly1"
extensions:{
className:"atkpanel.MainPanel"
classParam:""
Expand Down Expand Up @@ -703,7 +703,7 @@ background:208,231,252 }
JDGroup {
summit:752.975,226.25,781.025,251
origin:214.925,41.375
name:"taco:elin/v-ip/kly2"
name:"tango:elin/v-ip/kly2"
extensions:{
className:"atkpanel.MainPanel"
classParam:""
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ def getter(s,d,files,remove='vaccagui'):
#print package_data


import pickle
pickle.dump(package_data,open('data.pck','w'))
#import pickle
#pickle.dump(package_data,open('data.pck','w'))

packages = package_dir.keys()

Expand Down
2 changes: 1 addition & 1 deletion vacca/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.4.0
4.5.2
8 changes: 5 additions & 3 deletions vacca/alarms.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
##
#############################################################################

import fandango,vacca,traceback
import os,fandango,vacca,traceback
from vacca.utils import vpath,wdir
#from panic.gui import AlarmGUI
from taurus.qt.qtgui.taurusgui.utils import PanelDescription
Expand Down Expand Up @@ -58,12 +58,14 @@ def getDefaultIcon():
"""
:return: The Default Icon Path.
"""
path = vpath('image/icons/panic.gif')
path = fandango.objects.findModule('panic')+'/gui/icon/panic-6.png'
print('VaccaPanic.getDefaultIcon():%s'%path)
#path = vpath('image/icons/panic.gif')
return path

@classmethod
def __test__(klass,arg=None):
from PyQt4 import Qt
from vacca.utils import Qt
qapp = Qt.QApplication([])
i = klass()
print i
Expand Down
26 changes: 18 additions & 8 deletions vacca/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@
# unless you know what you are doing

import time,os,sys,traceback,imp,inspect
from PyQt4.QtCore import SIGNAL
import fandango as fn,taurus
import vacca,vacca.utils
from .doc import get_autodoc,get_vars_docs
from fandango import partial,FakeLogger as FL
from taurus.qt import Qt
from taurus.external.qt import Qt
from taurus.external.qt.Qt import SIGNAL
from taurus.qt.qtgui.taurusgui.utils import \
PanelDescription, ExternalApp, ToolBarDescription, AppletDescription
from vacca.panel import VaccaAction,VaccaSplash
Expand Down Expand Up @@ -175,8 +175,19 @@

if CONFIG:
print('\n%s Config Options:\n'%VACCA_CONFIG)

#Check renamed variables
if getattr(CONFIG,'EXTRA_DEVICES',[]) and not getattr(CONFIG,'DEVICES',None):
CONFIG.DEVICES = CONFIG.EXTRA_DEVICES
if not getattr(CONFIG,'DEVICE',None) and getattr(CONFIG,'COMPOSER',None):
CONFIG.DEVICE = CONFIG.COMPOSER

varpatch = lambda old,new: (
setattr(CONFIG,new,getattr(CONFIG,old))
if getattr(CONFIG,old,None) and not getattr(CONFIG,new,None)
else none)

#Variable replacement
#Variable replacement (update config -> update default -> load default)
for op in OPTIONS:
limit = 800
if 'VACCA_'+op in os.environ:
Expand All @@ -191,9 +202,6 @@
v = replace_env(getattr(CONFIG,op))
print('\t%s: \t%s = %s'%(CONFIG.__name__,op,str(v).replace('\n',',')[:limit]))
setattr(default,op,v)

if not getattr(CONFIG,'DEVICE',None) and getattr(CONFIG,'COMPOSER',None):
default.DEVICE = default.COMPOSER

#Adding all variables to Namespace where taurusgui can found them
try:
Expand Down Expand Up @@ -252,6 +260,7 @@

#: USE_DEVICE_TREE: True or False, To Show by default the Device_Tree
USE_DEVICE_TREE = USE_DEVICE_TREE
#print('\t>>> Parsing DEVICES: %s ...'%(str(DEVICES)[:80]))

try:
DEVICES = expand_device_list(DEVICES)
Expand All @@ -260,6 +269,7 @@
DEVICES.append(DEVICE.lower())
if DEVICES and not DEVICE:
DEVICE = DEVICES[0]
DEVICES = sorted(set(DEVICES))
except:
traceback.print_exc()

Expand Down Expand Up @@ -308,7 +318,8 @@ def filterMatching(a,dct=AttributeFilters,p=printf):
if USE_DEVICE_PANEL:
print('\t>>> Loading Device panel (%s)...' % DEVICE)
from vacca.panel import VaccaPanel
panel = VaccaPanel.getPanelDescription('Device',model=DEVICE or None)
m = DEVICE if DEVICE and fn.check_device(DEVICE) else None
panel = VaccaPanel.getPanelDescription('Device',model=m)

from vacca.panel import VaccaPanel
if AttributeFilters: VaccaPanel.setAttributeFilters(AttributeFilters)
Expand Down Expand Up @@ -521,7 +532,6 @@ def get_panel(i):
#===============================================================================

#:
from PyQt4 import Qt

#Forcing nesting of dock widgets
if app:
Expand Down
Loading

0 comments on commit 83a1d8c

Please sign in to comment.