maxiv-kitscontrols / lib-maxiv-svgsynoptic Goto Github PK
View Code? Open in Web Editor NEWA library for creating control system synoptics using SVG
License: GNU Lesser General Public License v3.0
A library for creating control system synoptics using SVG
License: GNU Lesser General Public License v3.0
After update from qt-4.8.5-15.el7_4
to qt-4.8.7-2.el7
and from qt-x11-4.8.5-15.el7_4
to qt-x11-4.8.7-2.el7
moving or zooming the view is very slow and laggy.
I'm using CentOS 7
Does anyone meet same thing?
There are some issues with the case of e.g. attribute names; if the synoptic model does not use the "default" case it may not receive events correctly. It should be completely case insentitive.
If the device contains the fully qualified tango name (eg. tango:b-v-xxxx:10000/sys/tg_test/1) the synoptic fails to find the device class
.....
classname = db.get_class_for_device(device)
PyTango.DevFailed: DevFailed[
DevError[
desc = Class not found for tango://b-v-cry-csdb-0:10000/g-a101130/cry/spv-16
origin = DataBase::db_get_class_for_device()
reason = DB_IncorrectArguments
severity = ERR]
The device exists and it is accessible.
Hi everybody,
I am trying to understand the library. First of all thanks for developing it, but it miss a more precise documentation (see the next issues).
My problem for this issue is there is no information on how to use models and the condition to use it. For now I am trying to display a motor position in the svg. But I have a taurus error on dimension this the trace I got:
TimerLoop 1 ERROR 2020-11-19 18:10:53,928 TaurusPollingTimer[3000]: poll_reply error DimensionalityError()
TaurusTSP.W001 ERROR 2020-11-19 18:10:53,957 TaurusManager.TaurusTSP.TaurusTSP.W001: Uncaught exception running job 'poll' called from thread Dummy-1:
File "/x-data/home/xline-user1/anaconda3/envs/py3.7TaurusPyQt5/lib/python3.8/site-packages/python_svgsynoptic2-4.0.0-py3.8.egg/svgsynoptic2/taurusregistry.py", line 59, in run
self._update(attributes)
File "/x-data/home/xline-user1/anaconda3/envs/py3.7TaurusPyQt5/lib/python3.8/site-packages/python_svgsynoptic2-4.0.0-py3.8.egg/svgsynoptic2/taurusregistry.py", line 127, in _update
self._add_listener(attr)
File "/x-data/home/xline-user1/anaconda3/envs/py3.7TaurusPyQt5/lib/python3.8/site-packages/python_svgsynoptic2-4.0.0-py3.8.egg/svgsynoptic2/taurusregistry.py", line 144, in _add_listener
listener.addListener(self.handle_event)
File "/x-data/home/xline-user1/anaconda3/envs/py3.7TaurusPyQt5/lib/python3.8/site-packages/taurus/core/tango/tangoattribute.py", line 628, in addListener
self._subscribeChangeEvents()
File "/x-data/home/xline-user1/anaconda3/envs/py3.7TaurusPyQt5/lib/python3.8/site-packages/taurus/core/tango/tangoattribute.py", line 710, in _subscribeChangeEvents
self._activatePolling()
File "/x-data/home/xline-user1/anaconda3/envs/py3.7TaurusPyQt5/lib/python3.8/site-packages/taurus/core/taurusattribute.py", line 227, in _activatePolling
self.factory().addAttributeToPolling(self, self.getPollingPeriod())
File "/x-data/home/xline-user1/anaconda3/envs/py3.7TaurusPyQt5/lib/python3.8/site-packages/taurus/core/taurusfactory.py", line 350, in addAttributeToPolling
tmr.addAttribute(attribute, self.isPollingEnabled())
File "/x-data/home/xline-user1/anaconda3/envs/py3.7TaurusPyQt5/lib/python3.8/site-packages/taurus/core/tauruspollingtimer.py", line 111, in addAttribute
taurus.Manager().enqueueJob(attribute.poll)
File "/x-data/home/xline-user1/anaconda3/envs/py3.7TaurusPyQt5/lib/python3.8/site-packages/taurus/core/taurusmanager.py", line 165, in enqueueJob
self._sthread_pool.add(job, callback, *job_args, **job_kwargs)
Traceback (most recent call last):
File "/x-data/home/xline-user1/anaconda3/envs/py3.7TaurusPyQt5/lib/python3.8/site-packages/taurus/core/util/threadpool.py", line 147, in run
cmd(*args, **kw)
File "/x-data/home/xline-user1/anaconda3/envs/py3.7TaurusPyQt5/lib/python3.8/site-packages/taurus/core/tango/tangoattribute.py", line 519, in poll
self.fireEvent(TaurusEventType.Periodic, self.__attr_value)
File "/x-data/home/xline-user1/anaconda3/envs/py3.7TaurusPyQt5/lib/python3.8/site-packages/taurus/core/taurusmodel.py", line 297, in fireEvent
l(self, event_type, event_value)
File "/x-data/home/xline-user1/anaconda3/envs/py3.7TaurusPyQt5/lib/python3.8/site-packages/python_svgsynoptic2-4.0.0-py3.8.egg/svgsynoptic2/taurusregistry.py", line 104, in handle_event
self.event_callback(model, evt_src, *args)
File "/x-data/home/xline-user1/anaconda3/envs/py3.7TaurusPyQt5/lib/python3.8/site-packages/python_svgsynoptic2-4.0.0-py3.8.egg/svgsynoptic2/taurussynopticwidget.py", line 232, in attribute_listener
value = fmt % value # taurus4 issue: values without format
File "/x-data/home/xline-user1/anaconda3/envs/py3.7TaurusPyQt5/lib/python3.8/site-packages/pint/quantity.py", line 834, in float
raise DimensionalityError(self._units, "dimensionless")
pint.errors.DimensionalityError: Cannot convert from 'millimeter' to 'dimensionless'
Do you know how to overcome or resolve this problem ? The DS I am trying to read is an IcePapController.
thank you very much.
best regards,
If there is a transform on the main layer itself it will not be used which may cause the whole image to be offset and drawn outside of the view.
Hi everybody,
this is just for information. In contrary to what is written in the ReadMe Tutorial, if you want a filling color change as the State attribute of your device, you have to defined a filling color of your drawing element. And of course add the model to the "desc" node of this drawing element.
I encountered this problem when I had tried to change color of a group element. This is not directly possible (I do not find the solution), to overcome this problem you have to add to the group a form you can fill with color and link it to the model.
best regards,
The widget does not set up subscriptions until there is a zoom or pan event.
Dear all,
trying to install, I got an issue concerning QtWebkit :
MainThread INFO 2019-04-25 10:49:27,170 TaurusRootLogger: Using PyQt4 (v4.12.1 , with Qt 4.8.7)
MainThread INFO 2019-04-25 10:49:27,200 taurus.qt.qtgui.icon.icon: Setting Tango icon theme (from /usr/local/lib/python2.7/dist-packages/taurus/qt/qtgui/icon/)
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/home/guler/TANGO/MaXIV/lib-maxiv-svgsynoptic/examples/simple/__main__.py", line 12, in <module>
from svgsynoptic2.synopticwidget import SynopticWidget
File "/home/guler/.local/lib/python2.7/site-packages/svgsynoptic2/__init__.py", line 1, in <module>
from svgsynoptic2.synopticwidget import SynopticWidget
File "/home/guler/.local/lib/python2.7/site-packages/svgsynoptic2/synopticwidget.py", line 12, in <module>
from PyQt4.QtWebKit import QWebPage, QWebView, QWebSettings, QWebInspector
ImportError: No module named QtWebKit
thx for the feedback and installation tips
Hayg
Hi everybody,
this a post to inform of problem on synoptics that embedded thumbnails. This is not documented in the ReadMe Tutorial and can cause more problem than only the Thumbnails.
So the structure require for the svg layers is:
But especially in inkscape when you name the different layers, it miss almost one import information. You have to add manually "class" attribute for layers (cited above). The attribute should appear in the xml of the svg file. These are the value you should defined if you want the synoptic works well:
I hope this can help.
Best regards,
taurus4 get the values without format (the read value from the tango attribute, not the value with format).
in /usr/lib/python2.7/site-packages/svgsynoptic2/taurusregistry.py
trying to add listener to an inaccessible device crashes during the _update
method. So, the listeners to the next attributes will not be created.
Adding:
except TypeError as e:
print "Failed to setup listener for", attr, e
here, helps at least on the subscription for the next devices.
PS: the exception I was getting: cannot create weak reference to 'NoneType' object
See issue on the tango doc: tango-controls/tango-doc#171
I tried to test Refactoring branch but I met this error when I was running synoptic. I think, it is based on Max IV's Finest.
/usr/bin/python2.7 /home/tango/Projects/app-solaris-peem/scripts/ctpeemsynoptic
MainThread INFO 2017-09-08 05:17:53,518 TaurusRootLogger: Using "PyQt4" for Qt
set_url /home/tango/Projects/app-solaris-peem/peemsynoptic/index.html
JsConsole(file:///usr/lib/python2.7/site-packages/python_svgsynoptic2-2.3-py2.7.egg/svgsynoptic2/web/js/main.js:69):
load /home/tango/Projects/app-solaris-peem/peemsynoptic/peem_synoptic.svg
JsConsole(file:///usr/lib/python2.7/site-packages/python_svgsynoptic2-2.3-py2.7.egg/svgsynoptic2/web/js/main.js:135):
zoom level
JsConsole(file:///usr/lib/python2.7/site-packages/python_svgsynoptic2-2.3-py2.7.egg/svgsynoptic2/web/js/main.js:135):
zoom level
JsConsole(file:///usr/lib/python2.7/site-packages/python_svgsynoptic2-2.3-py2.7.egg/svgsynoptic2/web/js/main.js:135):
zoom level
JsConsole(file:///usr/lib/python2.7/site-packages/python_svgsynoptic2-2.3-py2.7.egg/svgsynoptic2/web/js/main.js:135):
zoom level
JsConsole(file:///usr/lib/python2.7/site-packages/python_svgsynoptic2-2.3-py2.7.egg/svgsynoptic2/web/js/main.js:135):
zoom level
JsConsole(file:///usr/lib/python2.7/site-packages/python_svgsynoptic2-2.3-py2.7.egg/svgsynoptic2/web/js/main.js:135):
zoom level
JsConsole(file:///usr/lib/python2.7/site-packages/python_svgsynoptic2-2.3-py2.7.egg/svgsynoptic2/web/js/main.js:135):
zoom level
JsConsole(file:///usr/lib/python2.7/site-packages/python_svgsynoptic2-2.3-py2.7.egg/svgsynoptic2/web/js/main.js:14):
config {}
JsConsole(file:///usr/lib/python2.7/site-packages/python_svgsynoptic2-2.3-py2.7.egg/svgsynoptic2/web/js/view.js:96):
[object HTMLDivElement]
JsConsole(file:///usr/lib/python2.7/site-packages/python_svgsynoptic2-2.3-py2.7.egg/svgsynoptic2/web/js/view.js:9):
fisk 800,600,6000,2000
JsConsole(file:///usr/lib/python2.7/site-packages/python_svgsynoptic2-2.3-py2.7.egg/svgsynoptic2/web/js/layers.js:21):
asdf
JsConsole(file:///usr/lib/python2.7/site-packages/python_svgsynoptic2-2.3-py2.7.egg/svgsynoptic2/web/js/layers.js:21):
undulator
JsConsole(file:///usr/lib/python2.7/site-packages/python_svgsynoptic2-2.3-py2.7.egg/svgsynoptic2/web/js/layers.js:21):
DIA
JsConsole(file:///usr/lib/python2.7/site-packages/python_svgsynoptic2-2.3-py2.7.egg/svgsynoptic2/web/js/layers.js:21):
Ventilation
JsConsole(file:///usr/lib/python2.7/site-packages/python_svgsynoptic2-2.3-py2.7.egg/svgsynoptic2/web/js/layers.js:21):
Cooling
JsConsole(file:///usr/lib/python2.7/site-packages/python_svgsynoptic2-2.3-py2.7.egg/svgsynoptic2/web/js/layers.js:21):
GAS
JsConsole(file:///usr/lib/python2.7/site-packages/python_svgsynoptic2-2.3-py2.7.egg/svgsynoptic2/web/js/layers.js:21):
vacuum
JsConsole(file:///usr/lib/python2.7/site-packages/python_svgsynoptic2-2.3-py2.7.egg/svgsynoptic2/web/js/layers.js:21):
optics
JsConsole(file:///usr/lib/python2.7/site-packages/python_svgsynoptic2-2.3-py2.7.egg/svgsynoptic2/web/js/main.js:17):
synoptic [object Object]
JsConsole(file:///usr/lib/python2.7/site-packages/python_svgsynoptic2-2.3-py2.7.egg/svgsynoptic2/web/js/main.js:20):
ReferenceError: Can't find variable: Backend
When I'm starting new synoptic, the view goes somewhere around and after clicking it is going even worse.
It is since 03c03ea commit.
I haven't tried yet with Refactoring branch.
Serialization has been changed to Taurus serial.
This mode cause freezing of the GUI if you have a lot of attributes. I think it is worse if you can't move view, especially when you zoom to the new section and it needs to subscribe to all new attributes.
Hi,
In my understanding, the package should be possible to test without PyTango installed.
At least the example simple
should be runnable without tango, shouldn't it?
Layer name with whitespaces and dots are unclickable, so the objects cannot be unseen.
I'm not very into js so I'm not even sure is it possible to handle. :(
I noticed the zoom factor is almost but not constant when resizing the window. This can cause an unexpected switch of the zoom layers. Typically, starting a synoptic then going fullscreen might trigger a transition from layer 0 to layer 1. An easy hack is to configure the first zoom step to 1.1 instead of 1:
// disabling zoom by only allowing one step
var config = {view: {zoomSteps: [1.1, 4]}};
When there are multiple items with the same model there can be cases where all the items are "hidden" if any of them are off screen.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.