Hi In development languages I'm used to defining various constants values in the files, but I couldn't find such in Therion Have you considered adding this feature? For example I use the cave name in several places in the .th and .thc files. Then for the next cave I usually copy the template and change the name in all the places it is mentioned. This will be easier to do with a constant value that is changed only in one place. Something like this: === in TH files === DEFINE %NAME%='My cave name' survey %NAME% -title "%NAME% cave located somewhereПещера %NAME%..." ... input %NAME%.th2 endsurvey === in THC files === layout ZZZ map-comment "The %NAME% is a very nice cave, etc, etc" endlayout export map -projection extended -output %NAME%-xelev.pdf export map -projection plan -output %NAME%-plan.pdf So you can change the DEFINE %NAME% only at the begining of the file and the value will be reflected when compiling in every place the %NAME% is used. Or am I too picky Vladimir ------------------------------------- Mail.BG: Безплатен e-mail адрес. Най-добрите характеристики на българския пазар - 20 GB пощенска кутия, 1 GB прикрепен файл, безплатен POP3, мобилна версия, SMS известяване и други. http://mail.bg
Search/replace. Any one plain text editor will do it including text editor from Therion M. Odesláno z iPhonu 27. 12. 2014 v 13:28, vladimirg@mail.bg:
Hi
In development languages I'm used to defining various constants values in the files, but I couldn't find such in Therion Have you considered adding this feature?
For example I use the cave name in several places in the .th and .thc files. Then for the next cave I usually copy the template and change the name in all the places it is mentioned. This will be easier to do with a constant value that is changed only in one place.
Something like this:
=== in TH files === DEFINE %NAME%='My cave name'
survey %NAME% -title "%NAME% cave<br> located somewhere<lang:bg>Пещера %NAME%<br>..." ... input %NAME%.th2 endsurvey
=== in THC files === layout ZZZ map-comment "The %NAME% is a very nice cave, etc, etc" endlayout export map -projection extended -output %NAME%-xelev.pdf export map -projection plan -output %NAME%-plan.pdf
So you can change the DEFINE %NAME% only at the begining of the file and the value will be reflected when compiling in every place the %NAME% is used.
Or am I too picky
Vladimir
------------------------------------- Mail.BG: Безплатен e-mail адрес. Най-добрите характеристики на българския пазар - 20 GB пощенска кутия, 1 GB прикрепен файл, безплатен POP3, мобилна версия, SMS известяване и други. _______________________________________________ Therion mailing list Therion@speleo.sk http://mailman.speleo.sk/mailman/listinfo/therion
I agree with Vladimir on this one. A way to define constants which then flow through all of the files during a compilation would be really nice. Search/replace is OK when you have only one file to deal with. In a large cave map there could be hundreds of files. Bill Gee On Saturday, December 27, 2014 14:56:14 Martin Sluka wrote:
Search/replace. Any one plain text editor will do it including text editor from Therion
M.
Odesláno z iPhonu
27. 12. 2014 v 13:28, vladimirg@mail.bg:
Hi
In development languages I'm used to defining various constants values in the files, but I couldn't find such in Therion Have you considered adding this feature?
For example I use the cave name in several places in the .th and .thc files. Then for the next cave I usually copy the template and change the name in all the places it is mentioned. This will be easier to do with a constant value that is changed only in one place.
Something like this:
=== in TH files === DEFINE %NAME%='My cave name'
survey %NAME% -title "%NAME% cave<br> located somewhere<lang:bg>Пещера %NAME%<br>..." ...
input %NAME%.th2
endsurvey
=== in THC files === layout ZZZ
map-comment "The %NAME% is a very nice cave, etc, etc"
endlayout export map -projection extended -output %NAME%-xelev.pdf export map -projection plan -output %NAME%-plan.pdf
So you can change the DEFINE %NAME% only at the begining of the file and the value will be reflected when compiling in every place the %NAME% is used.
Or am I too picky
Vladimir
------------------------------------- Mail.BG: Безплатен e-mail адрес. Най-добрите характеристики на българския пазар - 20 GB пощенска кутия, 1 GB прикрепен файл, безплатен POP3, мобилна версия, SMS известяване и други. _______________________________________________ Therion mailing list Therion@speleo.sk http://mailman.speleo.sk/mailman/listinfo/therion
Hi Vasily - I am not familiar with this. Can you provide a few additional details? Thanks - Bill Gee On Saturday, December 27, 2014 23:22:13 Vasily Vl. Suhachev wrote:
Hello
I am using the external macro processor for such job
27.12.2014 22:38, Bill Gee пишет:
Search/replace is OK when you have only one file to deal with. In a large cave map there could be hundreds of files.
Well, yes, search and replace is an option. Notepad++ and many others can do a replace in multiple files too, but a macro or a constant would still be a nice feature. But if its not planned or easy to do, I can live without it Vladimir ----- Цитат от Bill Gee (bgee@campercaver.net), на 27.12.2014 в 19:14 ----- Hi Vasily - I am not familiar with this. Can you provide a few additional details? Thanks - Bill Gee On Saturday, December 27, 2014 23:22:13 Vasily Vl. Suhachev wrote: Hello I am using the external macro processor for such job 27.12.2014 22:38, Bill Gee пишет: Search/replace is OK when you have only one file to deal with. In a large cave map there could be hundreds of files. _______________________________________________ Therion mailing list Therion@speleo.sk http://mailman.speleo.sk/mailman/listinfo/therion ------------------------------------- Mail.BG: Безплатен e-mail адрес. Най-добрите характеристики на българския пазар - 20 GB пощенска кутия, 1 GB прикрепен файл, безплатен POP3, мобилна версия, SMS известяване и други. http://mail.bg
28.12.2014 00:14, Bill Gee пишет:
I am not familiar with this. Can you provide a few additional details?
I am using a software build system Rake to make a whole map of cave from ~120 survey files. The build system get each survey from 'SRC' folder, run some scripts on it and save result in '.CL' folder. This scripts transform the contents of survey files. Therion's thconfig compiles maps from files located in '.CL' (the build system is used to run therion compilation too) For simple replace %CAVENAME% with real name is possible to use sed unix utility. For more complicated cases you may using macro processor (m4 for example) or write your own script. In my case the legacy surveys has data which is not covered by therion directly. Then I generated some additional shots by script to utilize it -- WBR, Vasily
Hi Vasily - I suspected you might be using some sort of script wrapper around sed. That is certainly an option, though it seems to me a fair bit of work to accomplish what should be fairly simple. One problem I see is that the preprocessor would have to run through all files before submitting to therion. When additional files are added to a project, there may be some confusion regarding which replacements have already been processed. There is also the matter of file portability. Once someone invents their own naming scheme and shell scripts to process the expansion, then those source files are not usable on any other Therion system. Hmmm..... I wonder how much of this could be done with make? Food for thought! As Vladimir noted, this is a "nice to have" feature request. I think there are other changes that should have higher priority, such as area joins. Still, if we never make a request then it will never get on the list of things to do. Regards - Bill Gee On Sunday, December 28, 2014 01:25:30 Vasily Vl. Suhachev wrote:
28.12.2014 00:14, Bill Gee пишет:
I am not familiar with this. Can you provide a few additional details?
I am using a software build system Rake to make a whole map of cave from ~120 survey files.
The build system get each survey from 'SRC' folder, run some scripts on it and save result in '.CL' folder. This scripts transform the contents of survey files.
Therion's thconfig compiles maps from files located in '.CL' (the build system is used to run therion compilation too)
For simple replace %CAVENAME% with real name is possible to use sed unix utility. For more complicated cases you may using macro processor (m4 for example) or write your own script.
In my case the legacy surveys has data which is not covered by therion directly. Then I generated some additional shots by script to utilize it
You right, the reproduceable compilation is main weakness of this aproach. But complicated problem has a complicated solution. In my case - Rake is a piece of ruby lang ecosystem. Ruby has its own powerful package/deploy manager and reproduce environment is easy 28.12.2014 01:59, Bill Gee пишет:
There is also the matter of file portability. Once someone invents their own naming scheme and shell scripts to process the expansion, then those source files are not usable on any other Therion system.
-- WBR, Vasily
participants (4)
-
Bill Gee -
Martin Sluka -
Vasily Vl. Suhachev -
vladimirg@mail.bg