A simple function to make a default svg icon for the widgets such icons can be replaced later with a good one
(name, view_w=2, view_h=0.6)
| 3 | |
| 4 | |
| 5 | def default_icon(name, view_w=2, view_h=0.6): |
| 6 | """ |
| 7 | A simple function to make a default svg icon for the widgets |
| 8 | such icons can be replaced later with a good one |
| 9 | """ |
| 10 | icon = gui.Svg(width=100,height=30) |
| 11 | icon.set_viewbox(-view_w/2,-view_h/2,view_w,view_h) |
| 12 | text = gui.SvgText(0,0,name) |
| 13 | text.style['font-size'] = "0.2px" |
| 14 | text.style['text-anchor'] = "middle" |
| 15 | stroke_width = 0.01 |
| 16 | rect = gui.SvgRectangle(-view_w/2+stroke_width,-view_h/2+stroke_width,view_w-stroke_width*2,view_h-stroke_width*2) |
| 17 | rect.set_fill("none") |
| 18 | rect.set_stroke(0.01,'black') |
| 19 | icon.append([rect, text]) |
| 20 | return icon |
| 21 | |
| 22 | try: |
| 23 | from .toolbox_EPICS import EPICSBooleanButton, EPICSLed, EPICSValueMeterWidget, EPICSPlotPV, EPICSValueGaugeWidget |
no test coverage detected