Hi guys
I have got the temperature working which capture from the board and now i want to make thermometer capture from the temperature.
How do i do it?
any idea how and can you provide me a code aswel thanks
PLEASE HELP
from
bhav
12 2648 DeMan 1,806
Top Contributor
Please post more detail. It is not clear from the post, what you are trying to acheive and where you need help.
You are also unlikely to get full code, although we are more than happy to work you through any difficulties you might find....
Please post more detail. It is not clear from the post, what you are trying to acheive and where you need help.
You are also unlikely to get full code, although we are more than happy to work you through any difficulties you might find....
well basically,
my coding is too big to send it here..
well what i done.. is that.. i have managed to get the temperature working which capture from the can motor board. and now i want to make a thermometer capture from the temperature showing excatly % as the temperature (showing graphically .. you know like when you have thermomenter in ur mouth checking ur pressure like in hospital showing the red colour rising LOL) like that
i dont know if i have explain it clearly
DeMan 1,806
Top Contributor
So you have a method qhich gets a temperature (since it works, we don't need to know from where) and you want a graphical bar to be displayed to show how high this temperature is. Is that roughly correct?
Have you ever programmed GUI projects before?
So you have a method qhich gets a temperature (since it works, we don't need to know from where) and you want a graphical bar to be displayed to show how high this temperature is. Is that roughly correct?
Have you ever programmed GUI projects before?
hi..
yes that right i want a graphical bar to be displayed to show how high this temperature is. e.g. if the temperature is 23% then the graphical bar should show 23%
yes i have done.. gui project.. in c programming.
like in my programming for the temperature buffer to capture from the board
-------------------------------------------------------------------------------------------------------------
unsigned char temperature_buff[120];
//display temp in % in temperature box
sprintf(temperature_buff,"%2.2d",data[2]);
moveto(521,90);
outtext(temperature_buff);
//display % next to temperature buffer
moveto(545,90);
outtext("%");
---------------------------------------------------------------------------------------------------------------
so any1 knows how i can make the graphical bar please help me
thanks
horace1 1,510
Recognized Expert Top Contributor
I assume your PC is connected to the canbus network and you are collecting data and wish to display it graphically. What compiler/operating system are you using? Many compilers come with a graphics library which you can use to draw a bargraph or you could use something like the GNU plotutils
http://www.gnu.org/software/plotutils/
I assume your PC is connected to the canbus network and you are collecting data and wish to display it graphically. What compiler/operating system are you using? Many compilers come with a graphics library which you can use to draw a bargraph or you could use something like the GNU plotutils
http://www.gnu.org/software/plotutils/
hi
yes you right im using the pc which is connected to canbus board network and collecting data from the board to my c progreamming. and now i want to collect the temperature number into bar graphs
i have managed to make a box just need to capture temp into bar graphic
any idea how i can do it..
any1 can help me please
thanks
horace1 1,510
Recognized Expert Top Contributor
any1 can help me please
thanks
what compiler are you using
what compiler are you using
well im using old program turbo c version 2
DeMan 1,806
Top Contributor
You have made a box (which I assume represents 100%), so you could add a box (filled in a different colour), with one dimension scaled down to 23% (or x%), as one solution. I'm pretty sure that because GUI programming tends to be event driven, updating this picture on a regular basis is no big deal.
horace1 1,510
Recognized Expert Top Contributor
well im using old program turbo c version 2
turbo c V2.0 has the graphics library <graphics.h> whih contains functions to draw rectangles and fill areas- see the help system.
try this program which draws a rectange and fills it -
#include <graphics.h>
-
#include <stdlib.h>
-
#include <stdio.h>
-
#include <conio.h>
-
-
int main(void)
-
{
-
/* request auto detection */
-
int gdriver = DETECT, gmode, errorcode;
-
int maxx, maxy;
-
-
/* initialize graphics, local variables
-
*/
-
initgraph(&gdriver, &gmode, "c:\\tc\\bgi");
-
-
/* read result of initialization */
-
errorcode = graphresult();
-
if (errorcode != grOk)
-
/* an error occurred */
-
{
-
printf("Graphics error: %s\n", grapherrormsg(errorcode));
-
printf("Press any key to halt:");
-
getch();
-
exit(1);
-
/* terminate with an error code */
-
}
-
-
maxx = getmaxx();
-
maxy = getmaxy();
-
-
/* select drawing color */
-
setcolor(getmaxcolor());
-
-
/* select fill color */
-
setfillstyle(SOLID_FILL, getmaxcolor());
-
-
/* draw a border around the screen */
-
rectangle(20, 20, 100, 100);
-
-
-
/* fill in bounded region */
-
floodfill(50, 50, getmaxcolor());
-
-
/* clean up */
-
getch();
-
closegraph();
-
return 0;
-
}
turbo c V2.0 has the graphics library <graphics.h> whih contains functions to draw rectangles and fill areas- see the help system.
try this program which draws a rectange and fills it -
#include <graphics.h>
-
#include <stdlib.h>
-
#include <stdio.h>
-
#include <conio.h>
-
-
int main(void)
-
{
-
/* request auto detection */
-
int gdriver = DETECT, gmode, errorcode;
-
int maxx, maxy;
-
-
/* initialize graphics, local variables
-
*/
-
initgraph(&gdriver, &gmode, "c:\\tc\\bgi");
-
-
/* read result of initialization */
-
errorcode = graphresult();
-
if (errorcode != grOk)
-
/* an error occurred */
-
{
-
printf("Graphics error: %s\n", grapherrormsg(errorcode));
-
printf("Press any key to halt:");
-
getch();
-
exit(1);
-
/* terminate with an error code */
-
}
-
-
maxx = getmaxx();
-
maxy = getmaxy();
-
-
/* select drawing color */
-
setcolor(getmaxcolor());
-
-
/* select fill color */
-
setfillstyle(SOLID_FILL, getmaxcolor());
-
-
/* draw a border around the screen */
-
rectangle(20, 20, 100, 100);
-
-
-
/* fill in bounded region */
-
floodfill(50, 50, getmaxcolor());
-
-
/* clean up */
-
getch();
-
closegraph();
-
return 0;
-
}
hey mate.. thanks for the codes.. but how do i capture the temperature buffer to get the themometer graphics up and down e.g. if the temp is 24 then the themometer shud b 24 how can i do that
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Alex Stevens |
last post by:
Hi All,
On my site we are about to run a fundraising scheme.
I would like to display on there a thermometer to show how far we have got
to reach our total........
Does anybody know of a free...
|
by: Mark Barinstein |
last post by:
Hello.
W2K, db2 v7, FP10a.
Before now our replication worked properly. But some days ago capture
suddenly stopped loggin and filling cd tables without any messages. The last
message was like...
|
by: Joe A |
last post by:
I'm using Access 2002 on Windows XP PC, 500 megs ram, Front end/back
end app.
I have a simple form that draws a thermometer to indicate progress of
code that is running. The thermometer form...
|
by: Jose |
last post by:
There's something for me to learn with this example, i'm sure :)
Given this text:
"....."
and my first attempt at capture the groups:
"(?:\)"
RegExTest gives me what i expect: 6 captured...
|
by: VM |
last post by:
I'm working on a web form that displays the temperature of a certain room
and I'd like to display the temperature as a thermometer where I send it the
value (eg. 78 degrees F) and the thermometer...
| |
by: Inafuddle |
last post by:
I have the same question as Alex Stevens:
We are also about to run a fundraising scheme.
I would like to display on there a thermometer to show how far we have got
to reach our total........
...
|
by: j101 |
last post by:
I am attempting to set up Q Capture on RH Linux (x86_64) using DB2 9 fp2, but
there seems to be a general problem loading a specify MQ shared library
"/opt/mqm/lib/libmqm_r.so". I have MQ v6...
|
by: pampululu |
last post by:
hello, I try to use directx.capture in my web application, I use
visual studio web developper 2005 express with c# for code behind.
I can list the webcam available on computer, no probem,
my...
|
by: sangith |
last post by:
Hi,
I tried the packet capture module program.
I did a file transfer using ftp from this host to another server.
But when I ran the program, it was just hanging off and it did not print the...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |