Kivy simple gauge widget

已查看 1,734 次
跳至第一个未读帖子

J.H

未读,
2013年6月24日 11:44:122013/6/24
收件人 kivy-...@googlegroups.com

Mathieu Virbel

未读,
2013年6月25日 11:32:452013/6/25
收件人 kivy-...@googlegroups.com
Awesome!

Le 24/06/2013 17:44, J.H a �crit :
> --
> You received this message because you are subscribed to the Google
> Groups "Kivy users support" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to kivy-users+...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

J.H

未读,
2013年6月25日 18:31:172013/6/25
收件人 kivy-...@googlegroups.com
Thank you Mathieu.

I corrected the code according to your comments.

I'm trying to built now a 7-segment display widget. I often use this type of widget for visualization projects sensor data, but I'm still not very comfortable with the graphics classes.

In this regard, I would like your opinion designer: to create a sophisticated widget, is it better to use existing widgets or enjoy using the graphics classes?

J.H

Mathieu Virbel

未读,
2013年7月19日 05:36:162013/7/19
收件人 kivy-...@googlegroups.com
It depends.

If the behavior is already implemented as you want, and you just want to changes the graphics, yes.
Otherwise, make your own widget :)


已删除帖子

Phisatho

未读,
2013年9月14日 09:48:262013/9/14
收件人 kivy-...@googlegroups.com
Excellent. Thanks.

However, I have noticed that the gauge does not show outside the garden folder. This is because kivy cannot load the dial and needle graphics.
I have modified the code to load the pngs properly as below:

import os,inspect

class DummyClass: pass

class Gauge(Widget):
    '''
    Gauge class

    '''

    dummy = DummyClass
    unit = NumericProperty(1.8)
    value = BoundedNumericProperty(0, min=0, max=100, errorvalue=0)
    mypath = os.path.dirname(os.path.
abspath(inspect.getsourcefile(dummy)))
    file_gauge = StringProperty(mypath + os.sep + "cadran.png")
    file_needle = StringProperty(mypath + os.sep + "needle.png")

I guess this is not the most efficient way to find the module path. Probably you can improve the code.

Regards,

Shibu

Akshay Arora

未读,
2013年9月21日 15:35:272013/9/21
收件人 kivy-...@googlegroups.com
Hey phisatho you could do a pull request to the garden repo for this guage widget or create your own widget and push it to garden.


Phisatho

未读,
2013年9月29日 12:32:082013/9/29
收件人 kivy-...@googlegroups.com

https://github.com/Phisatho/garden.gauge

I have no idea how to push to  kivy.garden

ZenCODE

未读,
2013年9月29日 14:11:012013/9/29
收件人 kivy-...@googlegroups.com
Greetings

Never done it myself, but I would suggest trying the following.

1. On github, create your own fork of https://github.com/kivy-garden

2. Clone the repo on your local disc.

3. Create a branch for your gauge widget.

4. Push this branch back to your github repo.

5. Submit a pull request for this branch.

That's how I imagine it works? If not, please let me know and I will update the docs accordingly...;-)

Peace out

ZenCODE

未读,
2013年9月29日 22:24:332013/9/29
收件人 kivy-...@googlegroups.com
Seems each item in the Garden is it's own repo, so the process described above should actually start with creating a new repo in the garden. Then that is the one you will fork...

Peace

Akshay Arora

未读,
2013年9月30日 06:38:022013/9/30
收件人 kivy-...@googlegroups.com
read the general development guidelines http://kivy-garden.github.io/


On Mon, Sep 30, 2013 at 7:54 AM, ZenCODE <zenkey....@gmail.com> wrote:
Seems each item in the Garden is it's own repo, so the process described above should actually start with creating a new repo in the garden. Then that is the one you will fork...

Peace

--

ZenCODE

未读,
2013年9月30日 08:58:132013/9/30
收件人 kivy-...@googlegroups.com
Great stuff, thanks qua-non!
回复全部
回复作者
转发
0 个新帖子