Add APU in gauges written on Microsoft visual C++
Hi all
I am new to the forum and I think my approach is a little unusual, but I need your help. I do pilot not on Flight Simulator or else indeed. But my husband Yes. For this reason that I am interested and I help him in certain cases such as configuration, installation....
I want him to do a little surprise. I found in opensource software that unites gauges them ND, PFD and LearJet 45 default written in Microsoft Visual C++ EICAS. They are well. I would like to make changes to be more functional. I already have embezzled to add avionics as "PARKING BRAKE ON / OFF" and other messages.
My problem lies in the APU.
I said in "short"
I took the APURpm offset: 0x0B58
my line is the following: FSUIPC_Read (0x0B58, 4, & APURpm & dwResult);
FSUIPC_Process(&dwResult) APURpm must be a percentage and value max 100. I can't find how to formulate.
The APU is included in the EICAS like this:
glPushMatrix();
glTranslated(.75,-.75,0);
glScaled(.0012,.002,1);
glColor3d(0,1,0);
if(APURpm == -1)
sprintf(Text, "OFF");
else
sprintf(Text,"%.d",APUTemp);
glTranslated(-glutStrokeLength(GLUT_STROKE_MONO_ROMAN, (const unsigned char *)Text),0,0);
glutStrokeString(GLUT_STROKE_MONO_ROMAN, (const unsigned char *)Text);
glPopMatrix();
if(APURpm != -1)
{
glPushMatrix();
glTranslated(0,-.75,0);
glScaled(.0012,.002,1);
glColor3d(1,1,1);
glutStrokeString(GLUT_STROKE_MONO_ROMAN, (const unsigned char *)"%");
glEnd();
glPopMatrix();
glPushMatrix();
glTranslated(-.05,-.75,0);
glScaled(.0012,.002,1);
if(APURpm > 90)
glColor3d(1,1,0);
else
glColor3d(0,1,0);
sprintf(Text,"%.d",APURpm);
glTranslated(-glutStrokeLength(GLUT_STROKE_MONO_ROMAN, (const unsigned char *)Text),0,0);
glutStrokeString(GLUT_STROKE_MONO_ROMAN, (const unsigned char *)Text);
glPopMatrix();
glPushMatrix();
glTranslated(.8,-.75,0);
glScaled(.0012,.002,1);
glColor3d(1,1,1);
glutStrokeString(GLUT_STROKE_MONO_ROMAN, (const unsigned char *)" C");
glLineWidth(1);
glBegin(GL_LINE_LOOP);
Math.DrawArc(-160,100,30,0,360);
glEnd();
glLineWidth(2);
glPopMatrix();
}
I am using FS9 and FSX
I really need help.
Sorry for my english
Lyne
Re: Add APU in gauges written on Microsoft visual C++
Hello Lyne,
According to my doc, APU RMP offset is 0B54 (not B58 !). Perhaps it is the cause of your problem.
Cordialement.
Patrick.
Re: Add APU in gauges written on Microsoft visual C++
Hello Patrick
Thanks for your answers. You're right the good offset in "...54".
But for using it, I am lost. The description is percent , 100=max. How can you write this indication ?
Tank you
Lynne
Re: Add APU in gauges written on Microsoft visual C++
Im not sure I understand what is being asked here but the simplest will be to convert whatever is coming from the offset for APURPM to percentage as the decription is saying, (something like * 100, if the value is a floating nr needed to be converted to %, or *.01 if the value is a percentage to be converted to a floating one)...but again I dont fully understand so excuse my two cent comment :)
Re: Add APU in gauges written on Microsoft visual C++
I saw my error.
APURpm must be define in float and not in short. In Result :
FSUIPC_Process(&dwResult) => DataSource.Aircraft.APURpm = APURpm;
It's working now, but it's stay at 99 % at the end instead of 100 %.
Thanks
Lyne
2 Attachment(s)
Re: Add APU in gauges written on Microsoft visual C++
Attachment 4133 Attachment 4134
Here are the EICAS.
It's working only with FSX
Lyne
Re: Add APU in gauges written on Microsoft visual C++
I get it available free of charge as soon as I finish it
Re: Add APU in gauges written on Microsoft visual C++
Great, nice to know it worked out after all!
Re: Add APU in gauges written on Microsoft visual C++
Hi Lyne,
are these Fs gauges or this is a standalone program?
es ce que ce sont des Fs gauges or c'est un programme seule.
Thanks , Merci
Peter Depoortere
Re: Add APU in gauges written on Microsoft visual C++
Hi,
It's a standalone program. I hope I will finish as soon as possible.
Lyne