Recent

Author Topic: UnTerminal, Unit for Console process control  (Read 17816 times)

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: UnTerminal, Unit for Console process control
« Reply #15 on: September 11, 2014, 09:18:16 am »
Maybe one day (if God lends me life) I could make a chess GUI using UnTerminal.  :)
Well... you could have a look at http://wiki.lazarus.freepascal.org/Lazarus_Application_Gallery#Simple_Chess which is a GUI without engine so that sounds quite suitable...
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

Roland57

  • Sr. Member
  • ****
  • Posts: 421
    • msegui.net
Re: UnTerminal, Unit for Console process control
« Reply #16 on: September 11, 2014, 04:14:53 pm »
@BigChimp

Thank you for the link. I will look at that project.

« Last Edit: September 12, 2014, 06:24:10 am by Roland Chastain »
My projects are on Gitlab and on Codeberg.

Edson

  • Hero Member
  • *****
  • Posts: 1301
Re: UnTerminal, Unit for Console process control
« Reply #17 on: September 13, 2014, 05:56:14 pm »
@Roland

Probably this library could help: https://github.com/t-edson/ogEditGraf
It's a graphical editor engine, for managing visual objects.
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

Edson

  • Hero Member
  • *****
  • Posts: 1301
Re: UnTerminal, Unit for Console process control
« Reply #18 on: September 13, 2014, 06:29:08 pm »
Version 0.6 released:
https://github.com/t-edson/UnTerminal

News:
* New events OnReadData() and OnLineCompleted(), implemented.
* Event OnInitLines() replaced by OnInitScreen().
* New Property 'ClearOnOpen'.
* Fixed Prompt detection when using "prmAtEnd".
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

Roland57

  • Sr. Member
  • ****
  • Posts: 421
    • msegui.net
Re: UnTerminal, Unit for Console process control
« Reply #19 on: September 14, 2014, 05:43:05 pm »
@Edson

Thank you for the link to the graphical library. I downloaded it.

Congratulations for the new version of UnTerminal.
My projects are on Gitlab and on Codeberg.

Roland57

  • Sr. Member
  • ****
  • Posts: 421
    • msegui.net
Re: UnTerminal, Unit for Console process control
« Reply #20 on: September 17, 2014, 07:38:51 am »
Hello Edson!

It seems that you forgot to update the example in your latest release: I don't manage to compile it.

Quote
E:\Atelier\Lazarus\UnTerminal\UnTerminal.pas(809,8) Error: identifier idents no member "OnScrollLines"
E:\Atelier\Lazarus\UnTerminal\UnTerminal.pas(810,8) Error: identifier idents no member "OnLineCompleted"

« Last Edit: September 17, 2014, 12:25:35 pm by Roland Chastain »
My projects are on Gitlab and on Codeberg.

Edson

  • Hero Member
  • *****
  • Posts: 1301
Re: UnTerminal, Unit for Console process control
« Reply #21 on: September 17, 2014, 05:15:39 pm »
I have verified, and it doesn't compile like you said.

But, the example is correct. And, if you can see the properties OnScrollLines and OnLineCompleted, exist and are public.  %)

In my local copy, it compiles OK.

I'll try to find the problem.
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

Edson

  • Hero Member
  • *****
  • Posts: 1301
Re: UnTerminal, Unit for Console process control
« Reply #22 on: September 17, 2014, 05:26:35 pm »
It's solved.

It is my fault. There was an old copy of TermVT on the example folder.

Thanks for checking.
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

Roland57

  • Sr. Member
  • ****
  • Posts: 421
    • msegui.net
Re: UnTerminal, Unit for Console process control
« Reply #23 on: September 17, 2014, 06:39:58 pm »
Yes, it works now. Thank you!

My projects are on Gitlab and on Codeberg.

Edson

  • Hero Member
  • *****
  • Posts: 1301
Re: UnTerminal, Unit for Console process control
« Reply #24 on: November 08, 2014, 04:10:51 pm »
UnTerminal 0.7 is released.

https://github.com/t-edson/UnTerminal

News: Some events have been changed and It has been defined several ways (documented) for to capture the output of the processes.
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

Edson

  • Hero Member
  • *****
  • Posts: 1301
Re: UnTerminal, Unit for Console process control
« Reply #25 on: November 16, 2016, 02:49:47 am »
UnTerminal 0.9 released.

https://github.com/t-edson/UnTerminal

'Unterminal' is a library for implementing Control of Console Process  in Lazarus, with Prompt Detection.

Some News:
New methods created, to use the process in a Loop.
Capability for changing the properties of the process, before to Run.
Included 3 types of Line Delimiters to Send, and 4 types of Line Delimiters to receive.
Tested in Linux.
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

Roland57

  • Sr. Member
  • ****
  • Posts: 421
    • msegui.net
Re: UnTerminal, Unit for Console process control
« Reply #26 on: November 16, 2016, 06:53:30 am »
Hello! Thank you for that new version. Tested successfully under Windows.  :)

I had to comment out a line in the second demo project:

Code: Pascal  [Select][+][-]
  1. procedure TForm1.FormCreate(Sender: TObject);
  2. begin
  3.   proc:= TConsoleProc.Create(nil);
  4.   //proc.LineDelim := TTL_CRLF;

I could compile also my UCI protocol demo, with one modification:

Code: Pascal  [Select][+][-]
  1. procedure TForm1.FormCreate(Sender: TObject);
  2. begin
  3.   proc := TConsoleProc.Create(nil);
  4.   //proc.sendCRLF := true;

http://www.eschecs.fr/fichiers/LazUCIDemo.zip
My projects are on Gitlab and on Codeberg.

Edson

  • Hero Member
  • *****
  • Posts: 1301
Re: UnTerminal, Unit for Console process control
« Reply #27 on: November 16, 2016, 04:18:26 pm »
I had to comment out a line in the second demo project:

Code: Pascal  [Select][+][-]
  1. procedure TForm1.FormCreate(Sender: TObject);
  2. begin
  3.   proc:= TConsoleProc.Create(nil);
  4.   //proc.LineDelim := TTL_CRLF;


Sorry. I forgot to update this code. It's updated now.

The correct line is:

Code: Pascal  [Select][+][-]
  1.   proc.LineDelimSend := LDS_CRLF;
  2.  

It's because now UnTerminal have 3 ways to send line ending to the process (before, there was 2):
   LDS_CRLF -> Send CRLF
   LDS_CR -> Send only CR
   LDS_LF -> Send Only LF

Now the equivalent for:
Code: Pascal  [Select][+][-]
  1.   proc.sendCRLF := true;

Is
Code: Pascal  [Select][+][-]
  1.   proc.LineDelimSend := LDS_CRLF;
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

Roland57

  • Sr. Member
  • ****
  • Posts: 421
    • msegui.net
Re: UnTerminal, Unit for Console process control
« Reply #28 on: November 16, 2016, 07:49:59 pm »
@Edson

Thank you.
My projects are on Gitlab and on Codeberg.

Edson

  • Hero Member
  • *****
  • Posts: 1301
Re: UnTerminal, Unit for Console process control
« Reply #29 on: October 03, 2020, 06:58:56 pm »
UnTerminal has been updated: https://github.com/t-edson/UnTerminal

- A new simplified way to execute external programs.
- Tested in Linux and Windows.
- Sample projects are updated.
- English translation is advanced.
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

 

TinyPortal © 2005-2018