Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2010-11

Undefined value in SdpoSerial

10 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bo Berglund

I am working on a serial communications class and I have been adviced to use the 5dpo component.

But when I am writing the initialization part of my class I discovered that there is a field value defined and used that does not get an initialization value...

The flowcontrol is set by FSoftflow and FHardflow but there is no place in the 5dpo code where these fields are initialized to some valid value.
And they are not exposed in a setter or getter either.

Why?

Bo Berglund Developer in Sweden

Reply by email

Paulo Costa
to Bo Berglund
Bo Berglund wrote 6 lines
I am working on a serial communications class and I have been adviced to use the 5dpo component. But when I am writing the initialization part of my class I discovered that there is a field value defined and used that does not get an initialization value...

?
From the source code:

constructor TSdpoSerial.Create(AOwner: TComponent);
begin
   inherited;
   ...
   FHardflow:=false;
   FSoftflow:=false;
   FFlowControl:=fcNone;
   ...
end;
Show quoted text 6 lines
The flowcontrol is set by FSoftflow and FHardflow but there is no place in the 5dpo code where these fields are initialized to some valid value. And they are not exposed in a setter or getter either. Why?
??
     property FlowControl: TFlowControl read FFlowControl write
SetFlowControl;

FSoftflow and FHardflow are set/reset by flowcontrol and it is exposed.

Paulo Costa

Reply by email

Bo Berglund
to Paulo Costa
Paulo Costa wrote 20 lines
On 02/11/2010 07:20, Bo Berglund wrote: > I am working on a serial communications class and I have been adviced > to use the 5dpo component. > > But when I am writing the initialization part of my class I discovered > that there is a field value defined and used that does not get an > initialization value... ? From the source code: constructor TSdpoSerial.Create(AOwner: TComponent); begin inherited; ... FHardflow:=false; FSoftflow:=false; FFlowControl:=fcNone; ... end;

The top line of my file reads:

{ SdpoSerial v0.1.3

Here is the constructor from my file:

constructor TSdpoSerial.Create(AOwner: TComponent);
begin
  inherited;
  //FHandle:=-1;
  ReadThread:=nil;
  FSynSer:=TBlockSerial.Create;
  FSynSer.LinuxLock:=false;
  {$IFDEF LINUX}
  FDevice:='/dev/ttyS0';
  {$ELSE}
  FDevice:='COM1';
  {$ENDIF}
//  FBaudRate:=br115200;
end;

As you can see there is no sig of any flow control setting. And I did not put in the comments...

Show quoted text 15 lines
> The flowcontrol is set by FSoftflow and FHardflow but there is no > place in the 5dpo code where these fields are initialized to some > valid value. > And they are not exposed in a setter or getter either. > > Why? ?? property FlowControl: TFlowControl read FFlowControl write SetFlowControl; FSoftflow and FHardflow are set/reset by flowcontrol and it is exposed.

Again here is from my source file:

  published
    property Active: boolean read FActive write SetActive;
    property BaudRate: TBaudRate read FBaudRate write SetBaudRate; //
default br115200;
    property DataBits: TDataBits read FDataBits write SetDataBits;
    property Parity: TParity read FParity write SetParity;
//    property FlowControl: TFlowControl read FFlowControl write
SetFlowControl;
    property StopBits: TStopBits read FStopBits write SetStopBits;
    property SynSer: TBlockSerial read FSynSer write FSynSer;
    property Device: string read FDevice write FDevice;
    property OnRxData: TNotifyEvent read FOnRxData write FOnRxData;
  end;

As you can see the property FlowControl has been commented out...

The file date is 2010-03-30 and it comes from a download I did some weeks ago. I am trying hard to find it right now...

Bo Berglund Developer in Sweden

Reply by email

Paulo Costa
to Bo Berglund
Bo Berglund wrote 12 lines
On Tue, 02 Nov 2010 18:59:14 +0100, Bo Berglund wrote: > The file date is 2010-03-30 and it comes from a download I did some > weeks ago. I am trying hard to find it right now... > Easy, the downloaded file was version 0.1.7 and it contains the sdposerial version 0.1.3. I got it from SourceForge (http://sourceforge.net/projects/sdpo-cl/) where it is still the one they offer for download.

OK! That solves the confusion. I'm going to see why there is that mismatch.

Paulo Costa

Reply by email

Bo Berglund
to Bo Berglund: On Tue, 02 Nov 2010 18:59:14 +0100, Bo Berglund Easy, the downloaded file was version…
Bo Berglund wrote 13 lines
On Tue, 02 Nov 2010 18:59:14 +0100, Bo Berglund wrote: >The file date is 2010-03-30 and it comes from a download I did some >weeks ago. I am trying hard to find it right now... > Easy, the downloaded file was version 0.1.7 and it contains the sdposerial version 0.1.3. I got it from SourceForge (http://sourceforge.net/projects/sdpo-cl/) where it is still the one they offer for download.

After looking at the 5DPO WIKI page I downloaded and installed an SVN client in order to get the latest version from SVN.

Now that I have received the newest files, what is the proper way to get them into Lazarus?

Do I copy the files over to the C:\Programs\lazarus\components\sdpo folder and overwrite whatever is located there?
Can I have a SVN checkout residing right inside the Lazarus program files?
Do I have to do something else or will Lazarus discover that the component files have changed and start using them immediately?

Obviously I am a newbie with both SVN and Lazarus (old hand at Delphi and CVS though).

Bo Berglund Developer in Sweden

Reply by email

Paulo Costa
to Bo Berglund
Bo Berglund wrote 8 lines
After looking at the 5DPO WIKI page I downloaded and installed an SVN client in order to get the latest version from SVN. Now that I have received the newest files, what is the proper way to get them into Lazarus? Do I copy the files over to the C:\Programs\lazarus\components\sdpo folder and overwrite whatever is located there?

That is possible, but not the best way.

Can I have a SVN checkout residing right inside the Lazarus program files?

That is the best option.

Do I have to do something else or will Lazarus discover that the component files have changed and start using them immediately?

Well, you should recompile the package.

Obviously I am a newbie with both SVN and Lazarus (old hand at Delphi and CVS though).

Not for long (the newbie part)

Paulo Costa

Reply by email

Bo Berglund
to Bo Berglund: On Tue, 02 Nov 2010 19:10:35 +0100, Bo Berglund After looking at the 5DPO WIKI page I…

On Tue, 02 Nov 2010 20:19:48 +0100, Bo Berglund
wrote:

I ended up trying to open the package file from SVN and compile/install, but there were numerous errors preventing this from working so then I tried go back to version 0.1.3.
But that won't work either, now Lazarus complains about a missing file componenttreeview.pas that I have absloutely no idea about....

Now my Lazarus does not have the Sdpo tab at all. :-(

Bo Berglund Developer in Sweden

Reply by email

Bo Berglund
to Paulo Costa: That is possible, but not the best way. That is the best option. Well, you should…
Paulo Costa wrote 28 lines
On 02/11/2010 19:19, Bo Berglund wrote: > After looking at the 5DPO WIKI page I downloaded and installed an SVN > client in order to get the latest version from SVN. > > Now that I have received the newest files, what is the proper way to > get them into Lazarus? > > Do I copy the files over to the C:\Programs\lazarus\components\sdpo > folder and overwrite whatever is located there? That is possible, but not the best way. > Can I have a SVN checkout residing right inside the Lazarus program > files? That is the best option. > Do I have to do something else or will Lazarus discover that the > component files have changed and start using them immediately? Well, you should recompile the package. > Obviously I am a newbie with both SVN and Lazarus (old hand at Delphi > and CVS though). Not for long (the newbie part)

Can I use the SdpoSerial object without actually installing the package into the Lazarus IDE?

Right now it looks like my biggest headaches are centered around the rebuilding of Lazarus itself, which I really do not want to do. The serial comm component is not a visual one so I really just need to create it in code provided it is OK to do. But I want the tooltips showing what properties and methods are available still...

Bo Berglund Developer in Sweden

Reply by email

Mattias Gaertner
to Bo Berglund
Show quoted text 33 lines
On Tue, 02 Nov 2010 21:45:23 +0000, Paulo Costa wrote: >On 02/11/2010 19:19, Bo Berglund wrote: > >> After looking at the 5DPO WIKI page I downloaded and installed an SVN >> client in order to get the latest version from SVN. >> >> Now that I have received the newest files, what is the proper way to >> get them into Lazarus? >> >> Do I copy the files over to the C:\Programs\lazarus\components\sdpo >> folder and overwrite whatever is located there? > >That is possible, but not the best way. > >> Can I have a SVN checkout residing right inside the Lazarus program >> files? > >That is the best option. > >> Do I have to do something else or will Lazarus discover that the >> component files have changed and start using them immediately? > >Well, you should recompile the package. > >> Obviously I am a newbie with both SVN and Lazarus (old hand at Delphi >> and CVS though). > >Not for long (the newbie part) > Can I use the SdpoSerial object without actually installing the package into the Lazarus IDE?

See here:
http://wiki.lazarus.freepascal.org/Lazarus_Packages#FAQ

Show quoted text 5 lines
Right now it looks like my biggest headaches are centered around the rebuilding of Lazarus itself, which I really do not want to do. The serial comm component is not a visual one so I really just need to create it in code provided it is OK to do. But I want the tooltips showing what properties and methods are available still...

Mattias

Reply by email