|
List Info
Thread: hmi_gtk2 demos
|
|
| hmi_gtk2 demos |

|
2006-07-18 20:21:56 |
Hi Juan,
I've downloaded the new hmi_gtk2 module, and demos, and
they work fine.
Thank you. In my attempts of trying to understand the
oven_demo, how you
laid out the graphics in it that is, I (at first) tried
looking at the
original, and couldn't, so this, I thought is my chance,
but looking at
the new graphics, it appears you've done it a bit
differently. It looks
like what you did was take a screen shot of the first demo,
then
overlaid it with widgets to make it functional. Is this
correct? I took
the oven_ss.jpg picture and tryed to "clean" it
up, so that I could put
label widgets to correct some of the labeling in the new
demo (the
Manual SP% and PID out values are reversed, the Belt Speed
FB title is
partially covered by the oven graphic, etc), and there is a
bunch of
"artifacts" around, which after cleaning up
reduced the file size by
about 10k. Call me what you will, but I'm designing for an
embedded
system, with limited resources. And the picture is alot
sharper.
Sure, I could just swap the labels around (done that!), but
when I try
to add labels to the "layout", glade won't let
me. I've tried looking at
the doc's for glade (abysmal!), and any doc's/tutorials on
GTK, not much
on the layout, except "Gee, I don't really understand
this, so, I'm not
gonna talk about it". You on the other hand, have
obviously used it, so
how's it work, how do you add widgets to it? This is
another reason that
I like the Qt toolkit, great doc's and tutorials.
Could you spend a little time to explain the workings of the
layout
widget to me? Another thing I'm wondering about is the use
of the image
widget, is there a way to view it in glade? I think it's a
great way to
display complicated graphics on the ui, but rather hard to
work with for
laying out the other widgets for the interface. How did you
work around
that?
I'm sending you an upgraded hmi_gtk2.glade file for the
oven demo, that
sizes the windows better initially, has
"automatic" scroll bars, etc. ,
minor cosmetic changes, and oh yeah, swaps the Manual SP and
PID out
values on the Oven window and corrects a problem with the
display of the
"actual temp" value on the heater window (the
value I get is 32 and it
never changes). Upload it to the CVS if you feel it is
worthwhile.
Regards,
Bruce
------------------------------------------------------------
-------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the
chance to share your
opinions on IT & business topics through brief surveys
-- and earn cash
http://www.techsay.com/default.
php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
MAT-devel mailing list
MAT-devel lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mat-devel
|
|
| hmi_gtk2 demos |

|
2006-07-19 00:00:02 |
Bruce Lytle wrote:
> Hi Juan,
> I've downloaded the new hmi_gtk2 module, and demos,
and they work fine.
> Thank you. In my attempts of trying to understand the
oven_demo, how you
> laid out the graphics in it that is, I (at first) tried
looking at the
> original, and couldn't, so this, I thought is my
chance, but looking at
> the new graphics, it appears you've done it a bit
differently. It looks
> like what you did was take a screen shot of the first
demo, then
> overlaid it with widgets to make it functional. Is this
correct?
Yep. That is exactly what I did. The original oven demo used
the Pixbuf
Widget that was deprecated and it is part of Gnome so it was
part of
what I got rid off on the new hmi_gtk2 module. This Pixbuf
widget had
the feature of scaling the images, but using glade to build
vector
graphics type of images is not fun. My new approach is to
use a better
drawing tool, vector or bitmap based to draw the background
and just
place the widgets on top of this background. It is possible
to place
images with transparency on top of the background, it is
also possible
as demonstrated in the oven demo to switch images according
to the value
of an input, so this is rather flexible.
> I took
> the oven_ss.jpg picture and tryed to
"clean" it up, so that I could put
> label widgets to correct some of the labeling in the
new demo (the
> Manual SP% and PID out values are reversed, the Belt
Speed FB title is
> partially covered by the oven graphic, etc),
Thanks.
> and there is a bunch of
> "artifacts" around, which after cleaning up
reduced the file size by
> about 10k. Call me what you will, but I'm designing
for an embedded
> system, with limited resources. And the picture is alot
sharper.
>
I am too lazy, or busy is a more elegant way of saying it
, to
fix
this things. So thanks again. I do not care if you are being
picky
specially if you are fixing it and sending the corrections.
That is good
Open Source etiquette. Any improvement will always be
welcome.
> Sure, I could just swap the labels around (done that!),
but when I try
> to add labels to the "layout", glade won't
let me. I've tried looking at
> the doc's for glade (abysmal!), and any
doc's/tutorials on GTK, not much
> on the layout, except "Gee, I don't really
understand this, so, I'm not
> gonna talk about it". You on the other hand, have
obviously used it, so
> how's it work, how do you add widgets to it? This is
another reason that
> I like the Qt toolkit, great doc's and tutorials.
>
I think once I clean and isolate the functional parts of
this module we
should be able to aloud the use of Qt too.
> Could you spend a little time to explain the workings
of the layout
> widget to me? Another thing I'm wondering about is the
use of the image
> widget, is there a way to view it in glade?
First your question that if it is possible to see images on
Glade. Yes,
just select the image from the Icon (...) button on the
Image widget
properties and search for the image you want to load and
view in glade.
See the answer to your next question for a quick howto to
build a GUI on
top of a background image using the Layout widget.
> I think it's a great way to
> display complicated graphics on the ui, but rather hard
to work with for
> laying out the other widgets for the interface. How did
you work around
> that?
>
I will outline the procedure and the workaround to place
widgets on top
of other widgets. I already asked about this to the Glade
dev list but
they say that placing widgets on top (inside) of other
widgets is not
supported so I figured out a workaround for this limitation
and it seems
to work fine.
1. Open a new glade project and select non-gnome project.
2. From the GTK+Basic pallete select window to create the
first window
(window1) which will be the main window of the project.
3. From GTK+Additional pallete select Layout widget and
place it
anywhere inside window1. This will make window1 an absolute
coordinate
system widget container. It shows a dotted grid which
represents
absolute positioning mode.
4. From GTK+Basic pallete (again) select the Image widget
and place it
around the middle in the layout widget (or the window1).
Load the
background image using the Icon section as already
explained. Expand the
Image widget so that all of the background image is visible.
Expand the
Window widget so that it is larger than the Image widget
(background
image) so that some of the absolute positioning grid is
visible outside
the background image.
5. The workaround to place another widget on top of the
background image
is: Place the new widget outside of the image first, on the
layout area
that was outside of the background image that we left on the
previous
step. Once the widget is placed "legally"
outside of the other widget
then Glade does aloud us to drag it on top of the other
widget so it is
just a two step process.
Note that Glade has no send to back or bring to front option
for the
widgets so we should be careful to place first the images
that should be
background and later the widgets that will appear on front.
Note2: There is a fixed positions widget on GTK+Basic
pallete but do not
use this for the procedure I just described because on this
widget the
item that is selected goes to the front (as opposed to the
Layout widget
that remembers the order of the widgets). This is a big
problem because
if you click the background by mistake it will go to the
front and hide
all the other widgets.
Qt designer is more advanced and has no problem with this
issues. That
is one of the reasons that I think this module could benefit
from giving
the user a choice of GTK or Qt to develop their interfaces.
But of
course this is after cleaning and isolating the
functionality of the
current module and it is also a fair amount of work to build
it, so
don't hold your breath.
Please note that there are a lot of HMIs that don't need
more that what
is currently available with the hmi_gtk2 module. But we will
try to
cover the more sophisticated uses in the future.
> I'm sending you an upgraded hmi_gtk2.glade file for
the oven demo, that
> sizes the windows better initially, has
"automatic" scroll bars, etc. ,
> minor cosmetic changes, and oh yeah, swaps the Manual
SP and PID out
> values on the Oven window and corrects a problem with
the display of the
> "actual temp" value on the heater window
(the value I get is 32 and it
> never changes). Upload it to the CVS if you feel it is
worthwhile.
>
Of course, as soon as I find time to test it and upload it.
Regards,
--
Juan Carlos Orozco
ACElab Automation
http://www.acelab.com
------------------------------------------------------------
-------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the
chance to share your
opinions on IT & business topics through brief surveys
-- and earn cash
http://www.techsay.com/default.
php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
MAT-devel mailing list
MAT-devel lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mat-devel
|
|
[1-2]
|
|