-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XCSoar (.CUP) and Winpilot (.DAT) file processing now works #90
base: master
Are you sure you want to change the base?
Conversation
# cherrypy.log('in for loop: wpnum = %s line = %s' %(wpnum, line)) | ||
# cherrypy.log(f'for loop row {wpnum}: {line}') | ||
|
||
#check for blank lines or comments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lots of debugging code. We don't really want that in the code base.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Congrats on figuring out the basic problem. :)
Can you please make a change that is as minimal as possible to fix the cup parsing issue and make a commit for it? No Test files or commented out debug code please, also no excessive logging which isn´t needed for operation.
Let me get my Linux laptop back out and I'll do the changes you requested ;) |
Regarding the .CUP file encoding issue, I checked both the Slovenia3.cup and the Slovenia3.cup, and it appears the Slovenia3.cup file is corrupted - at least in my Landscapes/Slovenia3 folder. I did see that Slovenia3.cup is encoded in UTF-8 as you stated, but for some reason the Slovenia2.cup file is encoded as 'ANSI'. In any case I'll change back to UTF-8, but what to do about the corrupted lines in Slovenia3.cup? Can you check Slovenia3.cup on your end? Here is my line for 'Amzs Koa' (which isn't in the Slovenia2.cup file) "Amzs Ko├Ã",Amzs Koì,4539.139N,01450.914E,470.0m,1,,,, |
for more information, see https://pre-commit.ci
commit 2abe1a4 (HEAD -> master)
|
I also have condor3 and i see the same issue in the Slovenia3.cup file. So its really corrupted. |
lib/xcsoar/mapgen/server/server.py
Outdated
cherrypy.config.update( | ||
{ | ||
"log.screen": True, # Log to stdout | ||
"log.error_file": "error.log", # Log errors to a file | ||
"log.access_file": "access.log", # Log access to a file | ||
} | ||
) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normally this runs in a container. The Filesystem is usually readonly. Please remove this configuration.
Removed another couple of logging code lines, and added Slovenia3.cup/dat to .gtignore |
for more information, see https://pre-commit.ci
# line = __CSVLine(line) | ||
CSVline = __CSVLine(line) | ||
# cherrypy.log(f'row {wpnum}: line = __CSVLine(line) ->> {line}') | ||
|
||
# while line.has_next(): | ||
# fields.append(next(line)) | ||
|
||
while CSVline.has_next(): | ||
fields.append(next(CSVline)) | ||
|
||
|
||
#display fields for this line | ||
# cherrypy.log('extracted fields for line = %s' %wpnum) | ||
# idx = 0 | ||
# for field in fields: | ||
# cherrypy.log(f' field[{idx}] = {field}') | ||
# idx += 1 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in general. no commented out code please. :-)
#gfp 241210: modified to wait for header line before processing | ||
#gfp 241210: added 'ISO-8859-2' decoding for correct cherrypy logging display | ||
|
||
#gfp 241208 added to print out all lines in selected .CUP file | ||
# wpnum = 0 | ||
# for byteline in lines: | ||
# wpnum = wpnum + 1 | ||
# line = byteline.decode('ISO-8859-2') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove
lib/xcsoar/mapgen/server/server.py
Outdated
cherrypy.log(f'in server.py: {filename} bounds: left = {desc.bounds.left:.3f}, right: {desc.bounds.right:.3f}, top: {desc.bounds.top:.3f}, bot {desc.bounds.bottom:.3f}') | ||
return view.render(error=f"left: {desc.bounds.left:.3f}, right: {desc.bounds.right:.3f}, top: {desc.bounds.top:.3f}, bot {desc.bounds.bottom:.3f}")| HTMLFormFiller(data=params) | ||
# return view.render(error="left")| HTMLFormFiller(data=params) | ||
time.sleep(9) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why sleep?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we are getting there. 👍
Please remove any unessential changes.
No unnecessary newlines, indention changes,
Please delete Slovenia* from the code tree
also still some cherrypy.log entries which are just debug outputs
Regards,
- Folken
One comment line removed from server.py, Slovenia* removed. |
XCSoar (.CUP) and Winpilot (.DAT) file processing now works properly. Unfortunately I couldn't figure out how to get the left/right/top/bottom bounds values to show up in the corresponding web page windows, so the map still isn't generated automatically.
As a workaround the calculated bounds are displayed in the 'error' window, and the user can manually transcribe the values to the bounds entry fields and then select the 'select map bounds by hand' option.