Lazarus

Programming => General => Topic started by: juanirias on July 12, 2020, 07:20:21 am

Title: trying to compile old source code (Satellite Tracking Software)
Post by: juanirias on July 12, 2020, 07:20:21 am
Hello everyone, here are the codes:

https://www.celestrak.com/software/tskelso-sw.php (https://www.celestrak.com/software/tskelso-sw.php)


they are from a propagator SGP4, I have achieved something by deleting a part of the code but I have error 106 (I cannot progress). Maybe can download and compile it. I'm working on linux, I don't think that's it.

"SGP4 Pascal Library Version 2.65" should be used to compile the "TrakStar Version 2.65", which is that it generates the error.

specifically if the "Look angles" & "Right Ascension / Declination" options are selected in the "Output Type" menu, the error 106 on "trakstar.pas" will be generated just after line # 174.

Thanks
Title: Re: trying to compile old source code (Satellite Tracking Software)
Post by: sstvmaster on July 12, 2020, 02:47:29 pm
Maybe this is usefull, this is from here: https://www.satsignal.eu/software/wxtrack.htm#SGP4
It is based on Dr T S Kelso's Pascal implementation.

See attachment!
Title: Re: trying to compile old source code (Satellite Tracking Software)
Post by: jamie on July 12, 2020, 02:55:57 pm
Hello everyone, here are the codes:

https://www.celestrak.com/software/tskelso-sw.php (https://www.celestrak.com/software/tskelso-sw.php)


they are from a propagator SGP4, I have achieved something by deleting a part of the code but I have error 106 (I cannot progress). Maybe can download and compile it. I'm working on linux, I don't think that's it.

"SGP4 Pascal Library Version 2.65" should be used to compile the "TrakStar Version 2.65", which is that it generates the error.

specifically if the "Look angles" & "Right Ascension / Declination" options are selected in the "Output Type" menu, the error 106 on "trakstar.pas" will be generated just after line # 174.

Thanks

You need to show a few lines of code here of where the error is talking place.

#106 is invalid input..
this could be a lot of things, back format of the file etc..

Being an old program maybe its using the older style PASCAL Io Assign, which has been repurposed for object coding, the correct one would be AssignFIle..

Just a guess.
Title: Re: trying to compile old source code (Satellite Tracking Software)
Post by: Thaddy on July 12, 2020, 04:50:39 pm
the correct one would be AssignFIle..
That is bogus and nonsense at the same time, Jamie.
In mode TP this code should compile.
106 indicates a conversion error, see manual.
The real reason is probably related to real(48) or codepage.

Title: Re: trying to compile old source code (Satellite Tracking Software)
Post by: juanirias on July 12, 2020, 04:58:31 pm
Maybe this is usefull, this is from here: https://www.satsignal.eu/software/wxtrack.htm#SGP4
It is based on Dr T S Kelso's Pascal implementation.

See attachment!

Thanks, but need to get working the OLD code
Title: Re: trying to compile old source code (Satellite Tracking Software)
Post by: juanirias on July 12, 2020, 05:00:21 pm
the correct one would be AssignFIle..
That is bogus and nonsense at the same time, Jamie.
In mode TP this code should compile.
106 indicates a conversion error, see manual.
The real reason is probably related to real(48) or codepage.

Understand, I have the same idea, I will show more images about the error.
Title: Re: trying to compile old source code (Satellite Tracking Software)
Post by: juanirias on July 12, 2020, 05:03:13 pm
Quote

You need to show a few lines of code here of where the error is talking place.


Original source code files
Title: Re: trying to compile old source code (Satellite Tracking Software)
Post by: juanirias on July 12, 2020, 05:07:16 pm

Quote

You need to show a few lines of code here of where the error is talking place.


First error on SUPPORT.PAS
Title: Re: trying to compile old source code (Satellite Tracking Software)
Post by: marcov on July 12, 2020, 05:39:27 pm
That's low level Dos specific code and only will work on dos targets (and for 32-bits dos targets might still require modification if it passes pointers)

See if you can simply leave it out if it is non crucial.
Title: Re: trying to compile old source code (Satellite Tracking Software)
Post by: juanirias on July 12, 2020, 05:44:37 pm
Yes, when I deleted, I can compile...

Code: Pascal  [Select][+][-]
  1.  
  2.  
  3.  
  4. Procedure Cursor_On;
  5.   var
  6.     regs : registers;
  7.   begin
  8.   with regs do
  9.     begin
  10.     ah := $01;
  11.     ch := 0;
  12.     cl := 7;
  13.     end; {with}
  14.   Intr($10,regs);
  15.   end; {Procedure Cursor_On}
  16.  
  17. Procedure Cursor_Off;
  18.   var
  19.     regs : registers;
  20.   begin
  21.   with regs do
  22.     begin
  23.     ah := $01;
  24.     ch := $20;
  25.     cl := $00;
  26.     end; {with}
  27.   Intr($10,regs);
  28.   end; {Procedure Cursor_Off}
  29.  
  30.  
  31.  
Title: Re: trying to compile old source code (Satellite Tracking Software)
Post by: juanirias on July 12, 2020, 05:57:05 pm
This is the menu of  "TRAKSTAR.PAS"  and the original EXEcutable under DOSbox
Title: Re: trying to compile old source code (Satellite Tracking Software)
Post by: juanirias on July 12, 2020, 08:16:27 pm
Dear Friends, I can resolve by put attention to the codding system ISO 8859

Maybe can help me with the cursor procedures


regards, JUAN
Title: Re: trying to compile old source code (Satellite Tracking Software)
Post by: AlexTP on July 12, 2020, 08:43:59 pm
Offtop.
Why are use using Geany editor? CudaText is better (link in signature). It also can run the FPC to compile,
https://wiki.freepascal.org/CudaText#External_Tools
Title: Re: trying to compile old source code (Satellite Tracking Software)
Post by: PascalDragon on July 12, 2020, 09:06:13 pm
Maybe can help me with the cursor procedures

As you're already using the unit Crt you can use the existing CursorOn and CursorOff functions.
Title: Re: trying to compile old source code (Satellite Tracking Software)
Post by: jamie on July 12, 2020, 09:22:26 pm
the correct one would be AssignFIle..
That is bogus and nonsense at the same time, Jamie.
In mode TP this code should compile.
106 indicates a conversion error, see manual.
The real reason is probably related to real(48) or codepage.

Take your antics elsewhere...

 You are pretty ignorant at times Thaddy, actually most of the time.

Being an old program like it is, I used OLD documentation which falls under IO errors, 106 = bad Input..

 cause by incorrect file handling and reading the input data incorrectly..

 Assuming it worked in the past there is no reason why Read and Readln won't still read the numerical values now.

 of course there is always the chance of the wrong line endings being used but I doubt that.

 Like I said, bad File handling due to improper file control..

 and not using the proper Assignfile over assign can cause random issues , I've seen it and obviously you haven't. So much for being so savy in code.

 I am sure you will reply to increment your POST numbers, that seems to be the tool of the trade these days to gain popularity is the POSTed message you have left. Many of them not worth reading.

And btw, I looked at your Safe Pointer code, what a mess, I think I'll overwrite it with proper code that does lard up the CPU.




 


Title: Re: trying to compile old source code (Satellite Tracking Software)
Post by: TRon on July 12, 2020, 09:30:12 pm
Offtop.
Why are use using Geany editor? CudaText is better (link in signature). It also can run the FPC to compile,
https://wiki.freepascal.org/CudaText#External_Tools
Sorry, also off topic.

I have tried on 3 separate occasions to get myself familiar with cuda-text but, I am already lost when looking at the empty editor window  :-[

Maybe it is because I'm used to traditional text editors, but I seem unable to find my way through all options and settings. Quite honestly, the whole editor confuses the hell out of me. Because I have seen some screen-shots of the editor in action, I know it looks pretty cool and is perhaps pretty easy to work with, but I would probably require a brain-wash or other mental reset to be able to make it work for me.
Title: Re: trying to compile old source code (Satellite Tracking Software)
Post by: juanirias on July 12, 2020, 10:49:53 pm
Maybe can help me with the cursor procedures

As you're already using the unit Crt you can use the existing CursorOn and CursorOff functions.

Dont work under linux ?!
Title: Re: trying to compile old source code (Satellite Tracking Software)
Post by: juanirias on July 12, 2020, 10:52:20 pm
Offtop.
Why are use using Geany editor? CudaText is better (link in signature). It also can run the FPC to compile,
https://wiki.freepascal.org/CudaText#External_Tools

I don't have money: my laptop is an used OLD lenovo T61p (2009)...
I use a special linux for OLD machines, the GEANY is optimized for low resources ...

Title: Re: trying to compile old source code (Satellite Tracking Software)
Post by: PascalDragon on July 13, 2020, 09:45:06 am
Being an old program like it is, I used OLD documentation which falls under IO errors, 106 = bad Input..

But juanirias used FPC to compile it, thus it's FPC's documentation (https://www.freepascal.org/docs-html/user/userap4.html) that applies.

Maybe can help me with the cursor procedures

As you're already using the unit Crt you can use the existing CursorOn and CursorOff functions.

Dont work under linux ?!

Then it can be that your terminal does not handle the command or expects a different one.
Title: Re: trying to compile old source code (Satellite Tracking Software)
Post by: juanirias on July 13, 2020, 11:35:17 pm
Yes!
I cannot use https://en.wikipedia.org/wiki/Box-drawing_character  (https://en.wikipedia.org/wiki/Box-drawing_character)
I can use to compile but when execute I see a strange symbols...

greetings, JUAN
Title: Re: trying to compile old source code (Satellite Tracking Software)
Post by: winni on July 13, 2020, 11:47:03 pm
Hi!

Those are the Box Drawing Signs from Turbo Pascal time with IBM-8-Bit -  also called OEM.

Now we all use UTF8.

Just put them as const in your code:

Code: Pascal  [Select][+][-]
  1. const
  2. MyBlock = '╬';
  3.  

Box Drawing in UTF8 are now in range U+2500 .. U+257F

Winni

Title: Re: trying to compile old source code (Satellite Tracking Software)
Post by: jamie on July 13, 2020, 11:50:52 pm
I suppose you can't use CodePage 437 ?

It's needed here in windows if I want to draw those characters .
Title: Re: trying to compile old source code (Satellite Tracking Software)
Post by: jamie on July 14, 2020, 12:01:18 am
I have an old original console program from a college that I was able to write a windows CRT for and get it to show the old style boxes, lines etc. this is all done within a Windows app but it has a CRT form and all console type output is put there. It includes the blinking cursor etc.

 I don't know if this can work in a Linux GUI setup but I will attach the publish part of it here if you wish so you can look at it.
Title: Re: trying to compile old source code (Satellite Tracking Software)
Post by: juanirias on July 14, 2020, 12:03:22 am
Hi!

I attached a picture, you can see I use in the source code, but don't work on terminal....

Title: Re: trying to compile old source code (Satellite Tracking Software)
Post by: juanirias on July 14, 2020, 12:06:12 am
attached with common keyboard symbols, the most pretty that I can do for the moment....
Title: Re: trying to compile old source code (Satellite Tracking Software)
Post by: jamie on July 14, 2020, 12:12:34 am
I do this in the code for the CRTFOrm

Code: Pascal  [Select][+][-]
  1.    LS := lconvEncoding.cp437ToUTF8(S[Z]);  
  2.  

Basically the S is the string for the output message.
This will convert the CodePage437 chars over the UTF8 and thus should print the desired shape
Title: Re: trying to compile old source code (Satellite Tracking Software)
Post by: juanirias on July 14, 2020, 12:20:20 am
They use a string
Code: Pascal  [Select][+][-]
  1.  DFrame : string = '/=\|\/7890-';     {Double-Line Frame Characters}

Because the choose is like a index...

Code: Pascal  [Select][+][-]
  1.  
  2. Procedure FrameWindow(x,y,w,h,color : byte;
  3.                               title : string);
  4.   var
  5.     i : byte;
  6.   begin
  7. {  Window(x,y,x+w+3,y+h+1);}
  8. {  ClrScr; }
  9.   Window(x,y,x+w+3,y+h+2);
  10.   TextColor(color);
  11.   Write(DFrame[1]);
  12.   for i := 1 to w+2 do
  13.     Write(DFrame[2]);
  14.   Write(DFrame[3]);
  15.   for i := 1 to h do
  16.     begin
  17.     GotoXY(1,i+1);
  18.     Write(DFrame[4]);
  19.     GotoXY(w+4,i+1);
  20.     Write(DFrame[4]);
  21.     end; {for i}
  22.   GotoXY(1,h+2);
  23.   Write(DFrame[5]);
  24.   for i := 1 to w+2 do
  25.     Write(DFrame[2]);
  26.   Write(DFrame[6]);
  27.   GotoXY(2,1);
  28.   Write(MFrame[4],Copy(title,1,w),MFrame[6]);
  29.   NormalVideo;
  30.   end; {Procedure FrameWindow}
  31.  
  32.  


Some advice ?

regards, JUAN
Title: Re: trying to compile old source code (Satellite Tracking Software)
Post by: jamie on July 14, 2020, 12:33:17 am
Those characters need to be stored in a RawBytestring so the compiler does not attempt to
convert over to UTF8;

  I think the better choice would be to build a RawBytestring from single character values
or maybe Byte values to reduce the chance of converting it.

  But when you get ready to display it you can index out of this RawBytestring the value you need and then pass it to the iconvEncoding so it will generate a UTF8 output of it.

 So just use the ASCII Extended set values for the images you want and build a RawString instead.
Title: Re: trying to compile old source code (Satellite Tracking Software)
Post by: jamie on July 14, 2020, 12:40:27 am
lconvEncoding

you need that unit in the uses list, forgot sorry..
Title: Re: trying to compile old source code (Satellite Tracking Software)
Post by: winni on July 14, 2020, 12:42:24 am
Hi!

No idea in which  number space they are.
The detailed information for the double line frame in UTF8 is:

U+2551

E29591       //hex
14849425  //decimal
║      // HTML

Goto this page, than select codeblock U+2500 ff and select your signs and replace them in your code.

https://www.utf8-chartable.de/unicode-utf8-table.pl (https://www.utf8-chartable.de/unicode-utf8-table.pl)

Winni






Title: Re: trying to compile old source code (Satellite Tracking Software)
Post by: jamie on July 14, 2020, 12:44:37 am
using the original characters issued in the program he can use the lconvEncoding and it will generate the proper UTF8..
but I guess you can also do it the hard way too  :D
Title: Re: trying to compile old source code (Satellite Tracking Software)
Post by: jamie on July 14, 2020, 01:56:01 am
attached is a program that is meant to run in console mode ..

I made a CRT form to run it in windows..

but you look at the CRTFORM code and other items to see what it looks like. I don't think I used anything that is windows specific but who knows I could of..
Title: Re: trying to compile old source code (Satellite Tracking Software)
Post by: juanirias on July 14, 2020, 03:18:09 am
Thanks!

I cannot compile, because I don't have Graph unit ?!

where I can get ?

regards, JUAN
Title: Re: trying to compile old source code (Satellite Tracking Software)
Post by: jamie on July 14, 2020, 10:57:43 pm
You are on a unix machine. I am windering if this will even work ?

These program is a Wnidows GUI program. The idea was to load up Lazarus and then load this into your system using what ever you use for the Linux port of GUI code.

 But in any case, looking in the files of the compiler I see in the Source/Packages/Graph/Unix
etc

 But I don't think this will be the only error you will encounter since there are more UNITS there that will most likely fail the same way..


 If you look at the code in the WriteString method of the TForm you can then see what I did as for taking a RawByteString to be used as the source for the string output..
 
 each Character which will only be single byte types will get converted to a UTF8 string using the lconvEncoding function. that would be the string you actually print to console.

 In my example I printed it to a TImage which is being used as the SCREEN …
Title: Re: trying to compile old source code (Satellite Tracking Software)
Post by: cai on July 15, 2020, 05:01:22 am
everything is old, so you need the old version FPC. support 16bit
Title: Re: trying to compile old source code (Satellite Tracking Software)
Post by: juanirias on July 15, 2020, 05:19:43 am
Dear jamie,

Thanks for the deference of helping me authentically!

Now the program is working well


Kind regards, JUAN
Title: Re: trying to compile old source code (Satellite Tracking Software)
Post by: Thaddy on July 15, 2020, 08:40:53 am
everything is old, so you need the old version FPC. support 16bit
What do you mean? For FPC the 16 bit version is actually brand new  :D
It is introduced in 3.2.0
https://wiki.freepascal.org/FPC_New_Features_3.2.0#Support_for_the_i8086-win16_.2816-bit_Windows.29_target
Title: Re: trying to compile old source code (Satellite Tracking Software)
Post by: PascalDragon on July 15, 2020, 09:38:26 am
everything is old, so you need the old version FPC. support 16bit
What do you mean? For FPC the 16 bit version is actually brand new  :D
It is introduced in 3.2.0
https://wiki.freepascal.org/FPC_New_Features_3.2.0#Support_for_the_i8086-win16_.2816-bit_Windows.29_target

*sigh* Thaddy, please read that again. Support for Win16 is added in 3.2.0. Support for i8086-msdos (https://wiki.freepascal.org/FPC_New_Features_3.0.0#Support_for_the_16-bit_real_mode_MS-DOS_target) was added in 3.0.0.
Title: Re: trying to compile old source code (Satellite Tracking Software)
Post by: Thaddy on July 15, 2020, 10:16:38 am
@PascalDragon
That support was incomplete at least and has substantially improved.
@cai
I understood you were referring to a windows platform, not plain dos.
TinyPortal © 2005-2018