Shop OBEX P1 Docs P2 Docs Learn Events
Graphical widgets — Parallax Forums

Graphical widgets

Graham StablerGraham Stabler Posts: 2,507
edited 2007-10-13 00:45 in Propeller 1
I'm using graphics.spin for the menu system of my all purpose experiment controller, this unit triggers cameras, rotates stepper motors and generally does all the things required in a number of experiments/instruments.

For one of the experiments an object is rotated and pictures are taken of it at a variety of angles, so I made a little vector sprite of a pointer and a tick, the program now shows a pointer rotating around past the ticks that are located every 10 degrees or so. It struck me the functionality could be generalized into a function that draws a clock and adds the pointer at the required position.

Such generalized functions could form a set of useful graphical widgets to be incorporated into programs, things like progress bars are very simple and there are many other possibilities.

Anyone else done anything like this?

Graham

Comments

  • Ken PetersonKen Peterson Posts: 806
    edited 2007-10-12 15:08
    @Graham: I was going to start working on a graphics widget library to be used with a touch screen GUI, but I ran out of memory for the application. So I had to scale back the GUI to use the built-in characters. I might pick up on that again if I end up doing a dual-propeller solution with one propeller dedicated to the graphics.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    The more I know, the more I know I don't know.· Is this what they call Wisdom?
  • RaymanRayman Posts: 14,162
    edited 2007-10-12 15:12
    This is a good idea.· The ~$5,000 NI control system we have uses LabView.· This has a ton of built-in widgets.· It would be nice to have a similar (if more primitive) thing here...

    I think "Graphics" uses a lot of resources though.· It may be better to do it as 4-color tiles.· Still, it would be difficult to do an analog meter or clock face with tiles...
  • RaymanRayman Posts: 14,162
    edited 2007-10-12 15:42
    Actually, now that I think about it... I wonder if NI has considered making a Labview driver for the Propeller. They already do it for the Lego Mindstorms thing, I saw. The propeller seems like a very similar thing, although more flexible.

    Also, M$ has some kind of Robotics SDK that I was looking at a while ago. I think this was geared toward the Lego Mindstorms, but it could also probably be applied the the Propeller I think...

    Using one of these tools, one could make a Propeller based control system that intefaces with a PC in a more advanced way...
  • Sparks-R-FunSparks-R-Fun Posts: 388
    edited 2007-10-12 18:29
    Graham,

    I like the idea. I hope you and others will share premade GUI widgets with us.


    Ken,

    What touch screen are you using?


    - Sparks
  • Graham StablerGraham Stabler Posts: 2,507
    edited 2007-10-12 18:36
    Rayman, graphics does use a cog but apart from that it is very efficient for creating graphical elements because they can be made from vectors, a box is just two co-ordinates for example and can be scaled at will. The creation of widgets as functions means that there is good reuse of code too.

    Graham
  • Ken PetersonKen Peterson Posts: 806
    edited 2007-10-12 19:31
    @Sparks: Just any resistive touch screen.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    The more I know, the more I know I don't know.· Is this what they call Wisdom?
  • RaymanRayman Posts: 14,162
    edited 2007-10-12 23:58
    Graham: I think it also uses 16 longs for every 16x16 tile of the graphics window, right? This could use up a lot of memory for a large display...
  • Graham StablerGraham Stabler Posts: 2,507
    edited 2007-10-13 00:45
    Well those that don't want to have a truly graphical display can find other means, for me I still have plenty of memory left for my applications.

    Graham
Sign In or Register to comment.