Exporting Tasks to LK8000

Moderator: BOD1

User avatar
JBlyth
Posts: 183
Joined: Thu Apr 23, 2020 12:10 pm

Re: Exporting Tasks to LK8000

Post by JBlyth » Fri May 15, 2020 9:23 am

Thanks Bre901,

I tested it with the \Documents\Condor blank, and it worked wonderfully well.

Cheers
John

User avatar
Bre901
Posts: 1790
Joined: Tue Nov 22, 2016 8:57 pm
Location: Annecy (France)
Contact:

Re: Exporting Tasks to LK8000

Post by Bre901 » Fri May 15, 2020 10:50 am

Bre901 wrote:
Fri May 15, 2020 7:36 am
JBlyth wrote:
Fri May 15, 2020 2:57 am
With the benefit of hind-sight, I think it would be good to have an option to write the Configuration, Polar, and Task file to the standard defaults, DEFAULT_PROFILE.prf, DEFAULT_AIRCRAFT.acf and the Default.lkt in the _Tasks folder.
It could been done. I'll take a look at that next week
I took a quick look at it, it was so straightforward that I decided to do it this morning, while the engine was still warm :wink:

Beta3 version (hopefully RC, when I update the manual) : https://drive.google.com/open?id=17k73k ... ubX4BOra3C

The .ini file will be updated on first run, then set :

Code: Select all

# Default Files (0/1)
# XCSoar: copy task to Default.tsk - LK8000: overwrite all default files
Write Default Files=1
CN: MPT — CondorUTill webpage: https://condorutill.fr/

User avatar
ybuqc
Posts: 608
Joined: Sat Oct 14, 2006 11:41 pm
Location: France

Re: Exporting Tasks to LK8000

Post by ybuqc » Fri May 15, 2020 1:23 pm

:D Excellent tool !

Would it be possible to add an option to always output files as 'Condor.*' (.lkt, .prf and .acf)' ?
The reason why I'm asking is that I'm using a script to FTP the file to my phone, so I don't have to plug/unplug it from the computer.
With this feature, the script only has to copy three files that are always named the same: condor.prf, condor.lkt and condor.acf

If anyone is interested in the script, here we go:

Code: Select all

@echo off
set HOST_IP=192.168.1.25
set HOST_PORT=8309
set LK8000_DEVICE_PATH=device/LK8000
set LK8000_WINDOWS_PATH=e:\Games\CondorTools\LK8000
set LK8000_PROFILE=condor.prf
set LK8000_AIRCRAFT=condor.acf
set LK8000_TASK=condor.lkt

pushd .
cd /d %LK8000_WINDOWS_PATH%

echo open %HOST_IP% %HOST_PORT% >> ftp_script.txt
echo anonymous >> ftp_script.txt
echo cd %LK8000_DEVICE_PATH% >> ftp_script.txt

echo cd _Configuration >> ftp_script.txt
echo lcd _Configuration >> ftp_script.txt
echo put %LK8000_PROFILE% >> ftp_script.txt
echo put %LK8000_AIRCRAFT% >> ftp_script.txt

echo cd ..\_Tasks >> ftp_script.txt
echo lcd ..\_Tasks >> ftp_script.txt
echo put %LK8000_TASK% >> ftp_script.txt

echo quit >> ftp_script.txt

ftp -s:ftp_script.txt

del ftp_script.txt

popd
You may need to update the first part of the script to adapt it to your own device.
FYI: I'm using 'Cx File explorer'' from Google Store that has a nice ftp server mode.

Next step, integrate this script into CoTaCo :P :D :roll:
Image

User avatar
Bre901
Posts: 1790
Joined: Tue Nov 22, 2016 8:57 pm
Location: Annecy (France)
Contact:

Re: Exporting Tasks to LK8000

Post by Bre901 » Fri May 15, 2020 3:26 pm

ybuqc wrote:
Fri May 15, 2020 1:23 pm
Would it be possible to add an option to always output files as 'Condor.*' (.lkt, .prf and .acf)' ?
The reason why I'm asking is that I'm using a script to FTP the file to my phone, so I don't have to plug/unplug it from the computer.
With this feature, the script only has to copy three files that are always named the same: condor.prf, condor.lkt and condor.acf
How about something like that ?

Code: Select all

# destination folder (or filename) for the converted tasks
Destination Folder=E:\CondorUTill\CoTaCoV3-tests\_Tasks\Condor.lkt

# Default Files 
# XCSoar: copy task to Default.tsk (0/1)
# LK8000: (0/1/2) 1=overwrite all default files, 2=write all files with specified outfile name
Write Default Files=2
Next step, integrate this script into CoTaCo :P :D :roll:
I guess the script will depend very much on local configurations, but it would be very easy to add one more field in the .ini file to specify the script and to execute it before exiting.

I guess XCSoar users might be interested as well :mrgreen:
CN: MPT — CondorUTill webpage: https://condorutill.fr/

User avatar
ybuqc
Posts: 608
Joined: Sat Oct 14, 2006 11:41 pm
Location: France

Re: Exporting Tasks to LK8000

Post by ybuqc » Fri May 15, 2020 3:38 pm

Something like:

Code: Select all

# Default Files 
# XCSoar: copy task to Default.tsk (0/1)
# LK8000: (0/1/2) 1=overwrite all default files, 2=write all files with specified outfile name
Write Default Files=2
# name if the write default files is set to 2
Output name=condor
That should be nice.

And another like ...

Code: Select all

# script to run once the task conversion has been processed.
# default: no script
Post run script=my_transfert_script.bat
:roll:
Image

mikkieg42
Posts: 14
Joined: Tue Nov 29, 2011 3:28 pm

Re: Exporting Tasks to LK8000

Post by mikkieg42 » Fri May 15, 2020 7:44 pm

Thanks for doing this for LK8000, will be very useful. I've done a few quick tests and seems to work ok except:-

LK8000 crashes if there's a 270deg sector, prob because the lkt file is missing the "sector type" bit. LK8000 doesn't do 270 sectors anyhow and all sectors have to be the same, unless you select an AAT, when a task can have different types.

Setting the LK8000 home airport - it doesn't seem to remember this but this could be due to me not having any actual turnpoints selected, just the flightplan task, so an LK8000 feature I think.

User avatar
Bre901
Posts: 1790
Joined: Tue Nov 22, 2016 8:57 pm
Location: Annecy (France)
Contact:

Re: Exporting Tasks to LK8000

Post by Bre901 » Fri May 15, 2020 8:43 pm

mikkieg42 wrote:
Fri May 15, 2020 7:44 pm
Thanks for doing this for LK8000, will be very useful. I've done a few quick tests and seems to work ok except:-

LK8000 crashes if there's a 270deg sector, prob because the lkt file is missing the "sector type" bit. LK8000 doesn't do 270 sectors anyhow and all sectors have to be the same, unless you select an AAT, when a task can have different types.
could you please post your FPL (either in code: [</>] in the menubar, or attach as zip)
Setting the LK8000 home airport - it doesn't seem to remember this but this could be due to me not having any actual turnpoints selected, just the flightplan task, so an LK8000 feature I think.
I'm not familiar at all with LK8000 at all, where does it store that info ?
CN: MPT — CondorUTill webpage: https://condorutill.fr/

User avatar
JBlyth
Posts: 183
Joined: Thu Apr 23, 2020 12:10 pm

Re: Exporting Tasks to LK8000

Post by JBlyth » Sat May 16, 2020 10:48 am

I think the Home Waypoint is reliant on it being set from a .cup file on the device. I am sure that when you change a .cup file, the "remembered" Home location is lost....

The updated program is working very nicely for me, Bre901. And if anyone can break it - it will be me ;-)

Cheers
John in Sunny Carnarvon - Western Australia

User avatar
JBlyth
Posts: 183
Joined: Thu Apr 23, 2020 12:10 pm

Re: Exporting Tasks to LK8000

Post by JBlyth » Sat May 16, 2020 11:04 am

I found where the Home waypoint is stored in LK8000...

It's in the Runtime.log as an entry created on exit (I think)...

. HomeWaypoint set to <Springfield> wpnum=655

Cheers
John in Sunny Carnarvon - Western Australia

User avatar
ybuqc
Posts: 608
Joined: Sat Oct 14, 2006 11:41 pm
Location: France

Re: Exporting Tasks to LK8000

Post by ybuqc » Sat May 16, 2020 1:46 pm

The index mentioned by JBlyth is linked to the number of waypoints loaded by LK8000. So based on your cup files, it may change :/

It may be added in the flags from the waypoints file also: see LK8000/Common/Source/SaveLoadTask/CTashFileHelper.cpp:621

And the flag information is defined in

Code: Select all

LK8000/Common/Header/MapWindow.h:53
#define AIRPORT		0x01
#define TURNPOINT	0x02
#define LANDPOINT	0x04
#define HOME		0x08
#define START		0x10
#define FINISH		0x20
#define RESTRICTED	0x40
#define WAYPOINTFLAG	0x80
So settings the correct flags value within the task file in the <waypoints> section should do the trick.

The function SetHome() is called at startup or whenever the waypoint / airfield files are changed.
See LK8000/Common/Source/lk8000.cpp:455 and LK8000/Common/Source/Settings.cpp:91.

The home is mainly used for the best alternate computation, and of course for the distance to home information ;)
I'm not really conviced by the advantages of having this included for Condor when performing tasks...
Image

User avatar
Bre901
Posts: 1790
Joined: Tue Nov 22, 2016 8:57 pm
Location: Annecy (France)
Contact:

Re: Exporting Tasks to LK8000

Post by Bre901 » Sat May 16, 2020 4:36 pm

ybuqc wrote:
Fri May 15, 2020 3:38 pm
Something like:

Code: Select all

# Default Files 
# XCSoar: copy task to Default.tsk (0/1)
# LK8000: (0/1/2) 1=overwrite all default files, 2=write all files with specified outfile name
Write Default Files=2
# name if the write default files is set to 2
Output name=condor
That should be nice.
I'll stick with :

Code: Select all

# destination folder (or filename) for the converted tasks
Destination Folder=E:\CondorUTill\CoTaCoV3-tests\_Tasks\Condor.lkt

# Default Files 
# XCSoar: copy task to Default.tsk (0/1)
# LK8000: (0/1/2) 1=overwrite all default files, 2=write all files with specified outfile name
Write Default Files=2
because the path part is already coded and it works (if it ain't broke, don't fix it :wink: :roll: )
And another like ...

Code: Select all

# script to run once the task conversion has been processed.
# default: no script
Post run script=my_transfert_script.bat
No problem for that one
I'm rather busy this weekend, more next week
CN: MPT — CondorUTill webpage: https://condorutill.fr/

User avatar
Bre901
Posts: 1790
Joined: Tue Nov 22, 2016 8:57 pm
Location: Annecy (France)
Contact:

Re: Exporting Tasks to LK8000

Post by Bre901 » Sat May 16, 2020 4:45 pm

mikkieg42 wrote:
Fri May 15, 2020 7:44 pm
Thanks for doing this for LK8000, will be very useful. I've done a few quick tests and seems to work ok except:-
LK8000 crashes if there's a 270deg sector, prob because the lkt file is missing the "sector type" bit. LK8000 doesn't do 270 sectors anyhow and all sectors have to be the same, unless you select an AAT, when a task can have different types.
Is it a start/end sector or a Waypoint ?

I mus confess that I forgot to consider that in the code :oops:
As a tasksetter, I never use this kind of sector :roll:
... just like a lot of junk stuff, it's not because something exists and is available that you must buy or use it

The waypoint type in LK8000 is currently set according to the first waypoint after start in the FPL file (if there is none before finish : sector/radius=3000)

Open question to LK8000 users : what should we do with 270° WPS -> line, sector or circle ?

I'd go for the circle, but as I'm not a LK8000 user, my opinion should have very little weight :wink:

I'll fix it in the next version.
CN: MPT — CondorUTill webpage: https://condorutill.fr/

User avatar
JBlyth
Posts: 183
Joined: Thu Apr 23, 2020 12:10 pm

Re: Exporting Tasks to LK8000

Post by JBlyth » Sun May 17, 2020 7:46 am

In the current LK8000 7.1 beta, choices for task turnpoints are:-
Sector1.png
Sector2.png

By the way, I used CoTaCo today for the US Late Night Competition, and it worked wonderfully well!

Cheers
John in Sunny Carnarvon - Western Australia
You do not have the required permissions to view the files attached to this post.

User avatar
JBlyth
Posts: 183
Joined: Thu Apr 23, 2020 12:10 pm

Re: Exporting Tasks to LK8000

Post by JBlyth » Mon May 18, 2020 1:24 pm

Just a thought, Bre901,

Microsoft OneDrive now has the option for a user to keep their "local" documents folder in the cloud. This gave me a fright when I tried it as all my "Local" Documents folders disappeared to OneDrive, but happily, Condor and other programs still point correctly to the main local-sort of/OneDrive/Documents/cloud folder.

I have two laptops, but Condor is only used on one.

My question is:-
Is there any need for CaTaCo to actually look for a Condor installation as long as the correct pointers to the Documents folders etc are in the .ini file.

It would be nice if I could use CaTaCo from my non-Condor-installed laptop as all the needed Flight Plan folders are now "clouded".....

Cheers
John in Sunny Carnarvon - Western Australia

User avatar
Bre901
Posts: 1790
Joined: Tue Nov 22, 2016 8:57 pm
Location: Annecy (France)
Contact:

Re: Exporting Tasks to LK8000

Post by Bre901 » Mon May 18, 2020 1:39 pm

JBlyth wrote:
Mon May 18, 2020 1:24 pm
My question is:
Is there any need for CaTaCo to actually look for a Condor installation as long as the correct pointers to the Documents folders etc are in the .ini file.
My answer is:
Yes
Because CoTaCo needs to read :
- the .trn file in order to initialise the coordinates conversion routines
- and/or the .apt and .cup files in order to read the airport/waypoint informations and/or

[nitpicker]
BTW the name is CoTaCo (Condor Task Converter) :wink:
[/nitpicker]
CN: MPT — CondorUTill webpage: https://condorutill.fr/

Post Reply