Help needed to drawing a schematic

45 views
Skip to first unread message

David Aldrich

unread,
Jul 3, 2015, 1:00:51 PM7/3/15
to kivy-...@googlegroups.com
Hi

I would be really grateful for some help with a desktop app I am writing.

I've tried to capture what I'm doing in a small example program.

The Python code is here: http://paste.ubuntu.com/11816408/


My basic requirements are:

1) Display a simple schematic diagram of boxes connected by arrowed lines.

2) Each box contains one or more led indicators that indicate an alarm state (flashing red / steady green led) and a numeric value; these indicate realtime values of a system

3) I want to be able to 'dim' (i.e. disable) some of the graphical elements, according to the realtime state of the system

Each box is defined by class CMyBox.  The led indicator widget is defined by class CMyIndicator,which contains two Labels: one for drawing the led on, the other for the numeric value.

You'll see that I have done some of the graphics in Python. This goes against the 'graphics -> kv' rule, but I think its justified because I need the graphics to be dynamic.

Here are the problems I am having:

1) At main.py line 47, I should clear the canvas but that erases my boxes that are drawn in kv.

2) My 'led' circle doesn't appear. And how could I address it by id and change it's colour easily?

3) The boxes contain an identical number of CMyIndicator objects and they are all the same. How can I dynamically assign CMyIndicator objects to CMyBox objects, and address each one?

Quite complicated, I know. Any help would be much appreciated.

Best regards

David


David Aldrich

unread,
Jul 6, 2015, 4:37:00 AM7/6/15
to kivy-...@googlegroups.com
Hi

No replies yet. Was my post too complicated?  Would it help if I made the sample code smaller?

BR

David

David Aldrich

unread,
Jul 6, 2015, 6:48:49 AM7/6/15
to kivy-...@googlegroups.com
Hi 

This is what I am trying to achieve:


David

ZenCODE

unread,
Jul 6, 2015, 4:01:22 PM7/6/15
to kivy-...@googlegroups.com
Personally, yes, it's a bit too detailed.They don't strike one as Kivy questions, but general design questions that require a detailed understanding of what you are trying to do. A forum like this is typically more specific. But anywayz ;-)

When I try and run your stuff, I just get a black screen. Perhaps you could make it self contained and runnable?

Cheers

David Aldrich

unread,
Jul 7, 2015, 3:41:44 AM7/7/15
to kivy-...@googlegroups.com
Thanks for your reply. I have made some progress, so things are not so bad now. I'll try to ask more specific Kivy questions in future. Sorry that my code didn't run.

David

ZenCODE

unread,
Jul 7, 2015, 4:39:25 AM7/7/15
to kivy-...@googlegroups.com
No worries :-) We want to help, but it can be intimidating when there are multiple questions and the context is complex. As a genral guideline, I'd suggest:
a. Try to make examples self contained and runanble
b. Try to ask one question per post with a meaningful title. It helps others find it if they have the same issue and makes it more likely to be answered.

Good luck!

David Aldrich

unread,
Jul 7, 2015, 5:03:45 AM7/7/15
to kivy-...@googlegroups.com
Ok, thanks.

David
Reply all
Reply to author
Forward
0 new messages