Re: [Lazarus] Usage of Serial in a testing program?

2018-09-23 Thread Paul Breneman via Lazarus

On 09/23/2018 02:39 AM, Bo Berglund via Lazarus wrote:
...

Notice that contrary to the wiki example adding a colon to the end
like COM32: does NOT work so that is a wiki error.


If I remember correctly the colon at the end is required for WinCE?
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Usage of Serial in a testing program?

2018-09-23 Thread Bo Berglund via Lazarus
On Sun, 23 Sep 2018 08:39:52 +0200, Bo Berglund via Lazarus
 wrote:

>I have now come as far in my application as I can test the way the
>Serial unit opens and closes com ports.
>It turns out that on Windows there are two port name syntaxes:
>
>Ports 1..9: COM1 to COM9 will work
>Ports 10..255:  Only \\.\COM10 to \\.\COM255 will work
>
>But one does not need to use different naming depending on the port
>number, the second syntax \\.\COMx works also for ports 1..9

Forgot to add a question regarding making this a cross-platform
program:

If I add a check for the platform inside my program, how sghould it
look like to work on both Windows and Linux?

Something like this:

function TWiFiCommTester.ConnectSerial(Port: byte; Baud: integer):
boolean;
var
  ComportName: string;
  Flags: TSerialFlags;
begin
  FLastError := '';
  {$IFDEF WINDOWS}
  ComPortName:= '\\.\COM' + IntToStr(Port);
  {$ENDIF}
  {$IFDEF UNIX}
 //What goes here?
 ComPortName := 
  {$ENDIF}
  FSerial := SerOpen(ComPortName);
  


-- 
Bo Berglund
Developer in Sweden

-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Building help files: the nitty-gritty

2018-09-23 Thread Graeme Geldenhuys via Lazarus
On 18/08/18 18:10, Marco van de Voort via Lazarus wrote:
>> On Tue, Jul 10, 2012 at 05:39:05PM +0100, Graeme Geldenhuys wrote:
>^^^
> 
> Well, that happens, when you try to be modern, and read your mail with mutt
> instead of elm :-)


hahaha... I was about to comment on dredging up such and *old* thread.
The solution to the original question has been solved since a long
time... DocView of course with the help source in IPF format. ;-)


Regards,
  Graeme

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Usage of Serial in a testing program?

2018-09-23 Thread Mark Morgan Lloyd via Lazarus

On 23/09/18 08:15, Bo Berglund via Lazarus wrote:

On Sun, 23 Sep 2018 08:39:52 +0200, Bo Berglund via 
Lazarus wrote:

I have now come as far in my application as I can test the way the>Serial unit opens and closes com 
ports.>It turns out that on Windows there are two port name syntaxes:>>Ports 1..9: COM1 to 
COM9 will work>Ports 10..255:  Only \\.\COM10 to \\.\COM255 will work>>But one does not need 
to use different naming depending on the port>number, the second syntax \\.\COMx works also for 
ports 1..9

Forgot to add a question regarding making this a cross-platformprogram:
If I add a check for the platform inside my program, how sghould itlook like to 
work on both Windows and Linux?
Something like this:
function TWiFiCommTester.ConnectSerial(Port: byte; Baud: integer):boolean;var  
ComportName: string;  Flags: TSerialFlags;begin  FLastError := '';  {$IFDEF 
WINDOWS}  ComPortName:= '\\.\COM' + IntToStr(Port);  {$ENDIF}  {$IFDEF UNIX}
 //What goes here? ComPortName :=   {$ENDIF}  FSerial := 
SerOpen(ComPortName);  


Sorry Bo and Paul, I mailed you directly when I meant to reply here. 
This rolls up the messages from earlier.



> Ports 1..9: COM1 to COM9 will workPorts 10..255:  Only \\.\COM10 
to \\.\COM255 will work


Which is something that I pointed out to you, although in my case I 
think I only tested up to 12 (i.e. with an 8-port card).


What comes after 255: 0 or 1? If 0 which form or name does it require?

> I have yet to complete other parts of the application so I don't 
yetknow if the data flow will wok as expected.


Note that that unit was specifically written to be usable either with or 
without separate communications threads. If you're /not/ using threads 
then there's a callback so that the read-with-timeout functions can 
periodically call Application.ProcessMessages, and that the places that 
it is used are OS-specific. You obviously /don't/ want to use that 
callback if the comms functions are in their own threads, since APM 
should only be called from the main thread.


I'm probably losing this email address on Tuesday, if there's anything 
that you think I can possibly clarify please raise it sooner rather than 
later.


> On 09/23/2018 02:39 AM, Bo Berglund via Lazarus wrote:...> Notice 
that contrary to the wiki example adding a colon to the end> like COM32: 
does NOT work so that is a wiki error.

> If I remember correctly the colon at the end is required for WinCE?--

OK, but this is something that the application programmer needs to be 
aware of. I suppose it would be possible to modify the unit so that if 
it sees a trailing : it changes it to a leading \\.\ if there isn't one 
there already, but since the exact names are OS-specific and since we're 
already insisting that the application programmer or user puts in /dev/ 
for unix I'm not sure that's justifiable.


In any event I'm not in a position to do any mods right now and am 
probably about to lose access to Solaris (which is probably still worth 
testing against) permanently.


(* If there are no serial ports on the system then return NIL, otherwise 
a  *)
(* TStringList. 
   *)
(* 
   *)
(* This returns an object, it is the caller's (eventual) responsibility 
to free *)
(* this. 
   *)

//
FUNCTION EnumeratePorts: TStringList;

(* On a Linux system with udev or similar the /dev directory will only 
contain  *)
(* devices which have been detected as being present. On an older system 
it *)
(* will probably contain all possible devices so we need to restrict the 
list   *)
(* to what's reasonable; the user should still be able to enter a device 
name   *)
(* manually if necessary, e.g. where a machine with 2x standard ports 
plus a*)
(* 2-port card insists that it's got ttyS0, ttyS1, ttyS45 and ttyS46. 
   *)


CONST   countTtyS= 12;  (* Main board plus an 8-port 
card   *)
countTtyUSB= 8; (* Four dual-port adapters 
*)
countTtyI= 4;   (* A single 4-port ISDN card. 
*)


VAR searchRec: TSearchRec;
counter: INTEGER;

BEGIN
  RESULT:= TStringList.Create;
  RESULT.Sorted:= TRUE;
  counter:= countTtyS;
  IF FindFirst('/dev/ttyS*', faSysFile, searchRec) = 0 THEN
REPEAT
  RESULT.Append('/dev/' + searchRec.Name);
  DEC(counter)
UNTIL (FindNext(searchRec) <> 0) OR (counter <= 0);
  FindClose(searchRec);
  counter:= countTtyUSB;
  IF FindFirst('/dev/ttyUSB*', faSysFile, searchRec) = 0 THEN
REPEAT
  RESULT.Append('/dev/' + searchRec.Name);
  DEC(counter)
UNTIL (FindNext(searchRec) <> 0) OR (counter <= 0);
  FindClose(searchRec);
  counter:= countTtyI;
  IF FindFirst('/dev/ttyI*', faSysFile, searchRec) = 0 THEN
REPEAT
  RESULT.Append('/dev/' + searchRec.Name);
  DEC(counter)
UNTIL (FindNext(searchRec) <> 0) OR (counter <= 0);
  FindClose(searchRec);
  IF Result.Count = 0 THEN
FreeAndNil(RESULT)
END { EnumeratePorts } ;

--
Mar

Re: [Lazarus] Lazarus Release Candidate 1 of 2.0

2018-09-23 Thread Mark Morgan Lloyd via Lazarus
Please could somebody (Martin?) review the final patch at 
https://bugs.freepascal.org/view.php?id=33935 which limits a hack I put 
in to certain widget sets (Qt will print a $00 character, GTK2 won't).


I'm off-list in a couple of days time, I'll probably be able to get to 
Mantis before I have a replacement email address.


I'm not cancelling this account's subscription so that my colleagues 
have access.


--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] IDE Spotter

2018-09-23 Thread Michael Van Canneyt via Lazarus


Hello,

I've polished something that was started during the Lazarus Pro conference
in Bonn the last days, the IDE Spotter (this is a "Working Title").

The idea is to have a command box such as it exists in Atom or Visual code
studio.

Press ALt-Shift-P (or Meta-Shift-P on Mac) to access it.

Type the command you wish (e.g. open), navigate with arrows or click on the
correct match. The command will be executed. You can type multiple words.
all parts must be matched (and are colorized).

You can find the package under 'components/idespotter' in SVN.
It should also work under 1.8.4/2.0rc1 for those that want to try it.

There are some options under Tools - Options - Environment - IDE Spotter.

Ideas for improvements are currently:
- Shrink window list if the match list is "small".
- Search in recent files (projects/units/packages)
- ... ?

Please testdrive it. 
Ideas for improvements/comments/bugreports welcome (well, the latter not so much ;)).


Thanks go to James Ralston for pitching the idea, and Mattias for including it 
in SVN !

Michael.
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] IDE Spotter

2018-09-23 Thread Florian Klämpfl via Lazarus
Am 23.09.2018 um 13:16 schrieb Michael Van Canneyt via Lazarus:
> 
> Please testdrive it. Ideas for improvements/comments/bugreports welcome 
> (well, the latter not so much ;)).

Unit IDESpotterOptions missing in svn?
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] IDE Spotter

2018-09-23 Thread Michael Van Canneyt via Lazarus



On Sun, 23 Sep 2018, Florian Klämpfl via Lazarus wrote:


Am 23.09.2018 um 13:16 schrieb Michael Van Canneyt via Lazarus:


Please testdrive it. Ideas for improvements/comments/bugreports welcome (well, 
the latter not so much ;)).


Unit IDESpotterOptions missing in svn?


Ahaha The infamous 'forgot to add units' problem in SVN :)

I added them, thanks !

Michael.-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] IDE Spotter

2018-09-23 Thread Florian Klämpfl via Lazarus
Am 23.09.2018 um 15:27 schrieb Michael Van Canneyt:
> 
> 
> On Sun, 23 Sep 2018, Florian Klämpfl via Lazarus wrote:
> 
>> Am 23.09.2018 um 13:16 schrieb Michael Van Canneyt via Lazarus:
>>>
>>> Please testdrive it. Ideas for improvements/comments/bugreports welcome 
>>> (well, the latter not so much ;)).
>>
>> Unit IDESpotterOptions missing in svn?
> 
> Ahaha The infamous 'forgot to add units' problem in SVN :)
> 
> I added them, thanks !

Seems not work on windows though, even after I assigned another shortcut.

-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] IDE Spotter

2018-09-23 Thread Michael Van Canneyt via Lazarus



On Sun, 23 Sep 2018, Florian Klämpfl via Lazarus wrote:


Am 23.09.2018 um 15:27 schrieb Michael Van Canneyt:



On Sun, 23 Sep 2018, Florian Klämpfl via Lazarus wrote:


Am 23.09.2018 um 13:16 schrieb Michael Van Canneyt via Lazarus:


Please testdrive it. Ideas for improvements/comments/bugreports welcome (well, 
the latter not so much ;)).


Unit IDESpotterOptions missing in svn?


Ahaha The infamous 'forgot to add units' problem in SVN :)

I added them, thanks !


Seems not work on windows though, even after I assigned another shortcut.


Hm. What does not work, showing the form ?

It's also in the menu under View - IDE internals - IDE spotter.
Does it work then ?

Strange, I tested both Mac and Linux.

Michael.-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] IDE Spotter

2018-09-23 Thread Mattias Gaertner via Lazarus
On Sun, 23 Sep 2018 17:23:46 +0200
Florian Klämpfl via Lazarus  wrote:

> Am 23.09.2018 um 15:27 schrieb Michael Van Canneyt:
> > 
> > 
> > On Sun, 23 Sep 2018, Florian Klämpfl via Lazarus wrote:
> >   
> >> Am 23.09.2018 um 13:16 schrieb Michael Van Canneyt via Lazarus:  
> >>>
> >>> Please testdrive it. Ideas for improvements/comments/bugreports welcome 
> >>> (well, the latter not so much ;)).  
> >>
> >> Unit IDESpotterOptions missing in svn?  
> > 
> > Ahaha The infamous 'forgot to add units' problem in SVN :)
> > 
> > I added them, thanks !  
> 
> Seems not work on windows though, even after I assigned another shortcut.

If you are using a docked IDE, I just fixed positioning the spotter
for that case.

Mattias
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] IDE Spotter

2018-09-23 Thread Florian Klämpfl via Lazarus
Am 23.09.2018 um 18:27 schrieb Mattias Gaertner via Lazarus:
> On Sun, 23 Sep 2018 17:23:46 +0200
> Florian Klämpfl via Lazarus  wrote:
> 
>> Am 23.09.2018 um 15:27 schrieb Michael Van Canneyt:
>>>
>>>
>>> On Sun, 23 Sep 2018, Florian Klämpfl via Lazarus wrote:
>>>   
 Am 23.09.2018 um 13:16 schrieb Michael Van Canneyt via Lazarus:  
>
> Please testdrive it. Ideas for improvements/comments/bugreports welcome 
> (well, the latter not so much ;)).  

 Unit IDESpotterOptions missing in svn?  
>>>
>>> Ahaha The infamous 'forgot to add units' problem in SVN :)
>>>
>>> I added them, thanks !  
>>
>> Seems not work on windows though, even after I assigned another shortcut.
> 
> If you are using a docked IDE, I just fixed positioning the spotter
> for that case.

Indeed, this fixed it, thanks.

-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] IDE Spotter

2018-09-23 Thread Michael Van Canneyt via Lazarus



On Sun, 23 Sep 2018, Mattias Gaertner via Lazarus wrote:


On Sun, 23 Sep 2018 17:23:46 +0200
Florian Klämpfl via Lazarus  wrote:


Am 23.09.2018 um 15:27 schrieb Michael Van Canneyt:
> 
> 
> On Sun, 23 Sep 2018, Florian Klämpfl via Lazarus wrote:
> 
>> Am 23.09.2018 um 13:16 schrieb Michael Van Canneyt via Lazarus: 
>>>
>>> Please testdrive it. Ideas for improvements/comments/bugreports welcome (well, the latter not so much ;)). 
>>
>> Unit IDESpotterOptions missing in svn? 
> 
> Ahaha The infamous 'forgot to add units' problem in SVN :)
> 
> I added them, thanks ! 


Seems not work on windows though, even after I assigned another shortcut.


If you are using a docked IDE, I just fixed positioning the spotter
for that case.


Ah. That's what your change meant...

Good you left a comment now, many thanks! :)

(I guess everyone now guessed, I don't use the docking IDE...)

Michael.-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] IDE Spotter

2018-09-23 Thread Marcos Douglas B. Santos via Lazarus
On Sun, Sep 23, 2018 at 2:28 PM Michael Van Canneyt via Lazarus
 wrote:
>
> (I guess everyone now guessed, I don't u

I thought that I was the last one not using a docked IDE :)

Marcos Douglas
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] IDE Spotter

2018-09-23 Thread Ralf Quint via Lazarus

On 9/23/2018 11:38 AM, Marcos Douglas B. Santos via Lazarus wrote:

On Sun, Sep 23, 2018 at 2:28 PM Michael Van Canneyt via Lazarus
 wrote:

(I guess everyone now guessed, I don't u

I thought that I was the last one not using a docked IDE :)
Docked IDE (unless the term is used differently from how I understand 
it) doesn't make much sense if you have a multi-screen setup, IMHO...


Ralf

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] IDE Spotter

2018-09-23 Thread Sven Barth via Lazarus

Am 24.09.2018 um 02:42 schrieb Ralf Quint via Lazarus:

On 9/23/2018 11:38 AM, Marcos Douglas B. Santos via Lazarus wrote:

On Sun, Sep 23, 2018 at 2:28 PM Michael Van Canneyt via Lazarus
 wrote:

(I guess everyone now guessed, I don't u

I thought that I was the last one not using a docked IDE :)
Docked IDE (unless the term is used differently from how I understand 
it) doesn't make much sense if you have a multi-screen setup, IMHO...
It does if the second screen is not mainly for development. E.g. I 
myself use both Lazarus and Visual Studio on my primary monitor while I 
have the browser open on the other. And sometimes if I need to look at 
two documents at once I can open a new editor window in both IDEs and 
move it to the second screen to better compare them or whatever I need 
to do. :)


Regards,
Sven
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] IDE Spotter

2018-09-23 Thread Ralf Quint via Lazarus

On 9/23/2018 10:39 PM, Sven Barth via Lazarus wrote:

Am 24.09.2018 um 02:42 schrieb Ralf Quint via Lazarus:

On 9/23/2018 11:38 AM, Marcos Douglas B. Santos via Lazarus wrote:

On Sun, Sep 23, 2018 at 2:28 PM Michael Van Canneyt via Lazarus
 wrote:

(I guess everyone now guessed, I don't u

I thought that I was the last one not using a docked IDE :)
Docked IDE (unless the term is used differently from how I understand 
it) doesn't make much sense if you have a multi-screen setup, IMHO...
It does if the second screen is not mainly for development. E.g. I 
myself use both Lazarus and Visual Studio on my primary monitor while 
I have the browser open on the other. And sometimes if I need to look 
at two documents at once I can open a new editor window in both IDEs 
and move it to the second screen to better compare them or whatever I 
need to do. :) 
Well, I just like to move the separate windows across the screens, basic 
IDE with project info on the default screen, usually the 
debugging.messaging stuff on it as well, and the editor windows on the 
second one. For a time, I even had a 3 screen setup, with the 
application output (or research browser, depending on the development 
stage) on the third screen...


Ralf

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus