The online racing simulator
Searching in All forums
(75 results)
Radekteam
Demo licensed
I don't know VB but maybe you should try this
if Flags AND 256 = NOT 0 //og_redline is on

Radekteam
Demo licensed
Merry X-mass and a happy New Year for all fans and devs of LFS.
:huepfenic

Wesołych Świąt i szczęśliwego Nowego Roku.
Radekteam
Demo licensed
ebrake it's HANDBRAKE It is in controls section.
Radekteam
Demo licensed
I see now, you want to put odometer on dashboard of your car. Now it is impossible. Maybe further the LFS devs will put this function to dashboard
Radekteam
Demo licensed
Sorry but i don't understand what do you want to do?

You can't get mileage of any car in game. Unless you will write for yourself some kind of application.
Radekteam
Demo licensed
Sorry, but i don't have MSN. But if you have questions for me you always can write to me an e-mail: [email protected]
Radekteam
Demo licensed
I think that it will be posssible but you must find some info how to "drive" your LCD through the USB, i'd never done something like that on my own expect using HD44780 LCD, but it was "driven" by LPT port. Search for some info about programming your lcd and you can use code for lcd with this code for lfs to display it on your lcd

Here are some demo screens running yet on LFS X:

Last edited by Radekteam, . Reason : add some info
Radekteam
Demo licensed
If it will be connected to your graphic card, just using my code you can create own application in any dimensions that you want. if not, you must make some hardware, and write software drivers to use it. Could you precise how it will be connected?
Radekteam
Demo licensed
You're welcome
Radekteam
Demo licensed
Quote from Hollywood :Cool... I like it!

Too bad it brings back bad memories of Delphi and COM.

Have you got any bad memories with Delphi? I like Delphi very much
Greets.
Radekteam
Demo licensed
Quote from TrIpLe M :file doesn't exist

It's exist - i checked it
Radekteam
Demo licensed
Quote from misiek08 :Dobra robota Radek.
EN:
Good work Radek.

Dzięki
EN:
Thanks

Quote from Gegry1992 :i now buy(nono) delphi7 coz not work with indy10 in delphi codegear 2007

its works with delphi 7 personal

You're right. This it the reason why I use Delphi 7 Personal, also there is many components for it on the web
Radekteam
Demo licensed
Quote from Gegry1992 :its now work with lfs z?

i saw work but i always get memory adress error if complie and inject(startlfslbabla and need to work) in CodeGear™ Delphi® :S

Yes, it's work with lfs z too. You must just instal the newest indy10 components. The older indy component is the reason why the compiler throws you this error.
Radekteam
Demo licensed
Quote from SilverFox_cz :my modified version can you make it with analog gauge ?

I think I can, but I must find component for analog gauges or write it myself( and it's not easy). BTW Nice device
Radekteam
Demo licensed
Quote from papu24ar :hi men... i have some problems with delphi 7... whats delphi version are you use ?... i compiling your source code and have errors =S

Screenshot:
http://img247.imageshack.us/img247/2849/dibujogz3.jpg

Sorry MY BAD English.. I From Argentina..

I'm using Delphi 7 Personal. You should try to install the newest indy 10 components. This maybe the reason why your delphi throws you this error
Radekteam
Demo licensed
Yes, kingfag you've got right. It should be working in delphi too.
Radekteam
Demo licensed
Oh yea, in declared packet you have variable called Flags - here are summed the values of all OG_ - you just must know how to decode it - if you want i can tell you how to decode it but it's complicated to explain in one post
Radekteam
Demo licensed
You're welcome
Radekteam
Demo licensed
I'm working now on LCD SMARTIE PLUGIN for LFS. It's almost finished. In few days (maybe Saturday) i will release it.
Radekteam
Demo licensed
Quote from Nadeo4441 :Its very nice, but i have a question, how to control shiftlight & others?

Shift lights can be controled by reading RPM. Others? What others? Could you precise your question?
Radekteam
Demo licensed
It's only a tutorial code. I have in plans to display those data on HD 44780 lcd ,but now i've put it here for anyone who need help with outgauge in Delphi. It may be usefull Thanks for comments
Last edited by Radekteam, .
Delphi outgauge
Radekteam
Demo licensed
Try my Source Code. It's in Delphi.
http://www.lfsforum.net/showthread.php?p=721349
My first Out Gauge application in Delphi
Radekteam
Demo licensed
NEW VERSION FOR Z25:







Download here


Important!!!
Delphi 7 doesn't know TByte type as Adata in IdUDPServer1UDPRead
so i changed it to TStream, and it's work but compiler sometimes throw you this message:





Just click NO button



The Source Code:

{
******************************************************************************
In ENGLISH: (sorry for any mistakes;) )
Outgauge example for "Live for Speed" written by Radek Szewczyk
Contact: [email protected]
GG: 1480359
Myspace: myspace.com/deejayradzio

If you've got any problems with this code just contact me. I try to help you ;)
Thanks to 4programmers.net users for any help.

Important: This program uses Indy10 Components for Delphi 7.
******************************************************************************


******************************************************************************
Po POLSKU:
Przyklad Outgauge dla "Live for Speed" napisany przez Radka Szewczyka
Kontakt: [email protected]
GG: 1480359
Myspace: myspace.com/deejayradzio

Jezeli masz jakiekolwiek problemy z tym kodem poprostu sie ze mna skontaktuj.
Postaram sie Ci pomoc.
Podziekowania dla uzytkownikow 4programmers.net za wszelka pomoc.

Wazne: Ten program uzywa komponentow Indy10 dla Delphi 7.
******************************************************************************
}



unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, IdBaseComponent, IdComponent, IdUDPBase, IdUDPServer,IdSocketHandle, StdCtrls,
ComCtrls, ExtCtrls, Gauges;

type
TPacket = record
Time: longint; // time in milliseconds (to check order)
Car: array[0..3] of char; // Car name
Flags: word; // OG_FLAGS
Gear: byte; // Reverse:0, Neutral:1, First:2...
SpareB: byte;
Speed: single; // M/S
RPM: single; // RPM
Turbo: single; // BAR
EngTemp: single; // C
Fuel: single; // 0 to 1
OilPress: single; // BAR
OilTemp: single; // C
DashLights: longint; // Dash lights available
ShowLights: longint; // Dash lights currently switched on
Throttle: single; // 0 to 1
Brake: single; // 0 to 1
Clutch: single; // 0 to 1
Display1: array[0..15] of char; // Usually Fuel
Display2: array[0..15] of char; // Usually Settings
ID: integer; // optional - only if GameID is specified
end;

TForm1 = class(TForm)
Label1: TLabel;
IdUDPServer1: TIdUDPServer;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
Label10: TLabel;
Label11: TLabel;
Label12: TLabel;
Label13: TLabel;
Label14: TLabel;
Label15: TLabel;
Label16: TLabel;
Label17: TLabel;
Label19: TLabel;
Image1: TImage;
Gauge1: TGauge;
Gauge2: TGauge;
Gauge3: TGauge;
GroupBox1: TGroupBox;
CheckBox1: TCheckBox;
CheckBox2: TCheckBox;
CheckBox3: TCheckBox;
CheckBox4: TCheckBox;
CheckBox5: TCheckBox;
CheckBox6: TCheckBox;
CheckBox7: TCheckBox;
CheckBox8: TCheckBox;
CheckBox9: TCheckBox;
CheckBox10: TCheckBox;
CheckBox11: TCheckBox;
CheckBox12: TCheckBox;
CheckBox13: TCheckBox;
CheckBox14: TCheckBox;
CheckBox15: TCheckBox;
CheckBox16: TCheckBox;
GroupBox2: TGroupBox;
GroupBox3: TGroupBox;
Memo1: TMemo;
Memo2: TMemo;
Label18: TLabel;
Label20: TLabel;
Label21: TLabel;
Label22: TLabel;
Label23: TLabel;
Label24: TLabel;
procedure IdUDPServer1UDPRead(Sender: TObject; AData: TStream;
ABinding: TIdSocketHandle);
procedure Button1Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;
paczka: Tpacket;
gear_tmp:string;

const
// values for each light

DL_SHIFT = 1 ; // bit 0 - shift light
DL_FULLBEAM = 2 ; // bit 1 - full beam
DL_HANDBRAKE = 4 ; // bit 2 - handbrake
DL_PITSPEED = 8 ; // bit 3 - pit speed limiter
DL_TC = 16 ; // bit 4 - TC active or switched off
DL_SIGNAL_L = 32 ; // bit 5 - left turn signal
DL_SIGNAL_R = 64 ; // bit 6 - right turn signal
DL_SIGNAL_ANY = 128 ; // bit 7 - shared turn signal
DL_OILWARN = 256 ; // bit 8 - oil pressure warning
DL_BATTERY = 512 ; // bit 9 - battery warning
DL_ABS = 1024 ; // bit 10 - ABS active or switched off
DL_SPARE = 2048 ; // bit 11
DL_NUM = 4096 ; //noinfo
OG_TURBO = 8192 ; // show turbo gauge
OG_KM = 16384 ; // if 0 set - user prefers MILES
OG_BAR = 32768 ; // if 0 set - user prefers PSI

implementation

{$R *.dfm}

procedure TForm1.IdUDPServer1UDPRead(Sender: TObject; AData: TStream;
ABinding: TIdSocketHandle);
begin
Adata.Read(paczka, sizeof(paczka));
label6.Caption :=paczka.Car;
gear_tmp:=intToStr(paczka.gear-1); //
if paczka.gear=1 then gear_tmp:= 'N'; // change gear values 0 and 1 to R and N
if paczka.gear=0 then gear_tmp:= 'R'; //
label12.Caption:=gear_tmp;
label7.Caption := FloatToStr(trunc(paczka.Speed / 0.27777778)) + ' Km/h';
label8.Caption := FloatToStr(trunc(paczka.RPM));
label9.Caption := FloatToStr(trunc(paczka.Turbo*100)) + ' BAR';
label10.Caption := FloatToStr(trunc(paczka.Fuel*100))+'.'+FloatToStr(trunc(paczka.Fuel*10000) - trunc(paczka.Fuel*100)*100 ) + ' %';
Gauge1.Progress:= trunc(paczka.Clutch*100);
Gauge2.Progress:= trunc(paczka.Brake*100);
Gauge3.Progress:= trunc(paczka.Throttle*100);
Label20.Caption:= FloatToStr(paczka.EngTemp) +' °C';
Label23.Caption:= FloatToStr(paczka.OilPress) +' BAR';
Label24.Caption:= FloatToStr(paczka.OilTemp) +' °C';
//////Flags//////

//-----------------------------------------------------//
//if shift light is switched on//
if (paczka.ShowLights AND DL_SHIFT) <> 0 then
CheckBox1.Checked:= True
else
CheckBox1.Checked:= False;

//if shift light is available on dash//
if (paczka.DashLights AND DL_SHIFT) <> 0 then
CheckBox1.Enabled:= True
else
CheckBox1.Enabled:= False;

//-----------------------------------------------------//
//if fullbeam is switched on//
if (paczka.ShowLights AND DL_FULLBEAM) <> 0 then
CheckBox2.Checked:= True
else
CheckBox2.Checked:= False;

//if fullbeam is available on dash//
if (paczka.DashLights AND DL_FULLBEAM) <> 0 then
CheckBox2.Enabled:= True
else
CheckBox2.Enabled:= False;

//-----------------------------------------------------//
//if handbrake is switched on//
if (paczka.ShowLights AND DL_HANDBRAKE) <> 0 then
CheckBox3.Checked:= True
else
CheckBox3.Checked:= False;

//if handbrake is available on dash//
if (paczka.DashLights AND DL_HANDBRAKE) <> 0 then
CheckBox3.Enabled:= True
else
CheckBox3.Enabled:= False;

//-----------------------------------------------------//
//if pit speed limiter is switched on//
if (paczka.ShowLights AND DL_PITSPEED) <> 0 then
CheckBox4.Checked:= True
else
CheckBox4.Checked:= False;

//if pit speed limiter is available on dash//
if (paczka.DashLights AND DL_PITSPEED) <> 0 then
CheckBox4.Enabled:= True
else
CheckBox4.Enabled:= False;

//-----------------------------------------------------//
//if Traction Control is switched on//
if (paczka.ShowLights AND DL_TC) <> 0 then
CheckBox5.Checked:= True
else
CheckBox5.Checked:= False;

//if Traction Control is available on dash//
if (paczka.DashLights AND DL_TC) <> 0 then
CheckBox5.Enabled:= True
else
CheckBox5.Enabled:= False;

//-----------------------------------------------------//
//if left turn signal is switched on//
if (paczka.ShowLights AND DL_SIGNAL_L) <> 0 then
CheckBox6.Checked:= True
else
CheckBox6.Checked:= False;

//if left turn signal is available on dash//
if (paczka.DashLights AND DL_SIGNAL_L) <> 0 then
CheckBox6.Enabled:= True
else
CheckBox6.Enabled:= False;

//-----------------------------------------------------//
//if right turn signal is switched on//
if (paczka.ShowLights AND DL_SIGNAL_R) <> 0 then
CheckBox7.Checked:= True
else
CheckBox7.Checked:= False;

//if right turn signal is available on dash//
if (paczka.DashLights AND DL_SIGNAL_R) <> 0 then
CheckBox7.Enabled:= True
else
CheckBox7.Enabled:= False;

//-----------------------------------------------------//
//if any turn signal is switched on//
if (paczka.ShowLights AND DL_SIGNAL_ANY) <> 0 then
CheckBox8.Checked:= True
else
CheckBox8.Checked:= False;

//if any turn signal is available on dash//
// if (paczka.DashLights AND DL_SIGNAL_ANY) <> 0 then
// CheckBox8.Enabled:= True
// else
// CheckBox8.Enabled:= False;

//-----------------------------------------------------//
//if oil pressure warning is switched on//
if (paczka.ShowLights AND DL_OILWARN) <> 0 then
CheckBox9.Checked:= True
else
CheckBox9.Checked:= False;

//if oil pressure warning is available on dash//
if (paczka.DashLights AND DL_OILWARN) <> 0 then
CheckBox9.Enabled:= True
else
CheckBox9.Enabled:= False;

//-----------------------------------------------------//
//if battery warning is switched on//
if (paczka.ShowLights AND DL_BATTERY) <> 0 then
CheckBox10.Checked:= True
else
CheckBox10.Checked:= False;

//if battery warning is available on dash//
if (paczka.DashLights AND DL_BATTERY) <> 0 then
CheckBox10.Enabled:= True
else
CheckBox10.Enabled:= False;

//-----------------------------------------------------//
//if ABS is switched on//
if (paczka.ShowLights AND DL_ABS) <> 0 then
CheckBox11.Checked:= True
else
CheckBox11.Checked:= False;

//if ABS is available on dash//
if (paczka.DashLights AND DL_ABS) <> 0 then
CheckBox11.Enabled:= True
else
CheckBox11.Enabled:= False;


//-----------------------------------------------------//
//if Turbo Gauge is available//
if (paczka.Flags AND 8192) <> 0 then //show Turbo Gauge
CheckBox14.Checked:= True
else
CheckBox14.Checked:= False;

//-----------------------------------------------------//
//if KM is set//
if (paczka.Flags AND 16384) <> 0 then //users prefers km
CheckBox15.Checked:= True
else
CheckBox15.Checked:= False;
//-----------------------------------------------------//
//if BAR is set//
if (paczka.Flags AND 32768) <> 0 then //users prefers bar
CheckBox16.Checked:= True
else
CheckBox16.Checked:= False;

memo1.Text:=paczka.Display1;
memo2.Text:=paczka.Display2;

end;

procedure TForm1.Button1Click(Sender: TObject);
begin
IdUDPServer1.DefaultPort := 11111;
IdUDPServer1.Active := true;
end;

procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
IdUDPServer1.Active:=False;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
IdUDPServer1.DefaultPort := 11111;
IdUDPServer1.Active := true;
end;

end.


I hope that it will be helpful for someone
Last edited by Radekteam, . Reason : new version
FGED GREDG RDFGDR GSFDG