Page 6 of 6
Posted: Mon Mar 23, 2009 11:07 pm
by maverickalex
i figured out the crashes anyway.
I was selecting shared from the folderlist, when in reality THAt folder is produced as a result of the fgfs construct tool. it was there from my previous use with the command line.
The only prob i have is the xdistfld not showing the value.
Posted: Tue Mar 24, 2009 8:40 am
by SparkOut
seems to be the wrong line, it's putting the literal "xdistfld" into the variable, not the
contents of the field as it should be
Code: Select all
put field "xdistfld" into txdistfld
HTH!
Posted: Tue Mar 24, 2009 10:17 am
by maverickalex
i couldn't see that for looking........
Thanks, that's working a treat now.
Posted: Tue Mar 24, 2009 11:03 am
by SparkOut
I swear some lines of code play leapfrog when you're looking at a script and trying to figure out what's wrong. They can't always do it the same way for different eyes though, so it's always handy to get someone else to look.

Posted: Wed Mar 25, 2009 3:26 pm
by maverickalex
I have run into a problem with my GUI that prevents one of the tools working properly.
looking back, i think i new there may have been a problem.
In one of my tools
There is a shapefile menu
at the moment i bring the command line togther by selecting the folders and options required etc. which works fine.
I can hilite the required shapefile in the list.
the command line requires the .shp removing which is does fine.
The user creates a folder called "Road" or "Sand" whichever matches the shapefile.
Currently what i get is this
Code: Select all
shape-decode --line-width 10 --continue-on-errors --max-segment 1000 Shapefiles\v0_sand Work\v0_sand
What i need at the end of the command line is the name of the shapefile. with the first character changed to Capitals.
ie
Code: Select all
shape-decode --line-width 10 --continue-on-errors --max-segment 1000 Shapefiles\v0_sand Work\v0_sand Sand (added the last Sand, which could be Stream, Urban, Road etc.)
i have this script
Code: Select all
on mouseUp
local tShellCommand
if field "linewidthfld" is not empty then
put "--line-width" & space & field "linewidthfld" into tlinewidthfld
end if
if field "pointwidthfld" is not empty then
put "--point-width" & field "pointwidthfld" into tpointwidthfld
end if
if field "maxsegfld" is not empty then
put "--max-segment" & space & field "maxsegfld" into tmaxsegfld
end if
if field "startrecfld" is not empty then
put "--start-record" & field "startrecfld" into tstartrecfld
end if
if field "areafld" is not empty then
put field "areafld" into tareafld
end if
if field "shapefilefolderfld" is not empty then
put field "shapefilefolderfld" into tshapefilefolderfld
end if
if field "shapefilefld" is not empty then
put field "shapefilefld" into tshapefilefld
end if
put line (the hilitedline of field "shapefilefld") of field "shapefilefld" into tshapefilefld
replace ".shp" with empty in tshapefilefld
if field"workfolderfld" is not empty then
put field "workfolderfld" into tworkfolderfld
end if
--put space & quote & quote into tShellCommand
--the above line puts an empty pair of quotes to be the
--first parameter passed to the shell command which is
--necessary to act as the dummy console window "title"
--if setHideConsoleWindows is true
--so you will need to uncomment the line when you do that.
put space & "shape-decode" & space after tShellCommand
put space & tlinewidthfld & space after tShellCommand
put space & tpointwidthfld & space after tshellcommand
put "--continue-on-errors" after tshellcommand
put space & tmaxsegfld after tShellCommand
put space & tstartrecfld after tshellcommand
put space & tshapefilefolderfld after tshellcommand
put "\" & tshapefilefld after tshellcommand
put space & tworkfolderfld after tshellcommand
put space & tareafld after tshellcommand
--answer "About to:" && quote & "start" & tShellCommand & quote
get shell ("start" & tShellCommand)
end mouseUp
so to clarify i need to add repeat whatever comes after the "_" and change the first character to a capital letter
which is where i'm at currently.
I think adding the extra part is a bit past my current knowledge base.
Thanks
Posted: Wed Mar 25, 2009 6:52 pm
by mwieder
Code: Select all
set the itemdelimiter to "_"
put item -1 of tshellcommand into tFileName
put upper(char 1 of tFileName) into char 1 of tFileName
put space & tFileName after tshellcommand
Code to generate .hgt files from .btg files
Posted: Fri Apr 24, 2009 10:56 am
by ranjana
I am in need of the code or steps which converts .btg file to .hgt file....Please reply as soon as possible.....Thank you
Posted: Fri Apr 24, 2009 11:37 am
by SparkOut
Sorry, this is a Revolution forum, not a Flightgear forum. I don't think anyone here has the slightest idea what the tools are. We've just been helping Alex wrap up the tools in a Revolution gui to make it simpler to run. You'd be better off asking in a Flightgear / Flight simulator related site.
Thank you
Posted: Sat Apr 25, 2009 10:38 am
by ranjana
Thank you so much