Giter Site home page Giter Site logo

maxiv-kitscontrols / lib-maxiv-svgsynoptic Goto Github PK

View Code? Open in Web Editor NEW
6.0 6.0 8.0 515 KB

A library for creating control system synoptics using SVG

License: GNU Lesser General Public License v3.0

Python 20.68% CSS 2.55% JavaScript 74.32% HTML 2.45%

lib-maxiv-svgsynoptic's People

Contributors

13bscsaamjad avatar abartalesi avatar aureocarneiro avatar beenje avatar hardion avatar henquist avatar johanfforsberg avatar julianofjm avatar lzytniak avatar meguiraun avatar mirlin avatar wkitka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

lib-maxiv-svgsynoptic's Issues

Case sensitivity

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.

Full tango name issues

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.

model with DimensionalityError

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,

main layer transform not handled

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.

Color on State of the device

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,

QtWebkit need

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

Thumbnails and Layers attribute in svg

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:

  • main
    • background
      .. zoom0
      .. zoom1
      .. ...
    • ElementsGroup1
      .. zoom0
      .. zoom1
      .. ...
    • ...

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:

  • main
    • background [class: layer]
      .. zoom0 [class: zoom level0]
      .. zoom1 [class: zoom level1]
      .. ...
    • ElementsGroup1 [class: layer selectable]
      .. zoom0 [class: zoom level0]
      .. zoom1 [class: zoom level1]
      .. ...
    • ...

I hope this can help.
Best regards,

Inaccessible devices

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

Can't find variable: Backend when installed from Refactoring branch

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

GUI freezez since serialization change to taurus serial

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.

tests impossible without PyTango

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?

Zoom factor is not constant when resizing the window

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]}};

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.