Suggestion: Own text variables in other directory

Questions? Suggestions? Need help? Talk about anything related to Yawcam...
Post Reply
WSLangerak
Posts: 3
Joined: Wed Feb 24, 2010 10:34 pm

Suggestion: Own text variables in other directory

Post by WSLangerak »

Would it be possible to create the ability to change the directory from which Yawcam reads the own created text-variables?
Now only possible to read from the "extravars" directory.

This because I have a weather application running which can only save txt-files to one directory (it's own) also.

Thanks!
z3r0c00l12
Moderator
Posts: 1210
Joined: Wed Jan 14, 2009 3:50 am

Post by z3r0c00l12 »

Can't you just write a simple batch script that copies and overwrites the file at the desired interval? This way you don't need to modify your weather application, nor yawcam, and both will be happy.

Having you write this small script, will get you the job done very quickly and gives you the control of the interval. Waiting for a programmer to modify their application to suit your needs can take a very long time. I'm not saying this will not be implemented though, this seems like a small task for a programmer since all he has to do is set a new variable, and add the option to select the folder. But this would still take lots of time, and in the mean time, your script would be the perfect workaround.

A batch script can be easily done.

1) Create a new text document and rename it to script.bat or (anything).bat
2) Open the .bat file with notepad
3) enter the following code :

Code: Select all

@echo off
:Start
echo Copying Files...
xcopy /C /Q /Y "C:\program files\weatherapp\varsfolder\" "C:\program files\Yawcam\extravars\"
if ERRORLEVEL 0 goto PAUSE
echo Error Copying Files...
pause
goto Start
:pause
Echo Pausing 30 seconds...
ping -n 1 -w 30000 1.1.1.1 >>null
goto start
4) save the file and run it.

z3r0c00l12
bben95
Moderator
Posts: 39
Joined: Thu Feb 04, 2010 2:40 pm

Post by bben95 »

but then dosen't he need to leave the cmd window open at all times?
z3r0c00l12
Moderator
Posts: 1210
Joined: Wed Jan 14, 2009 3:50 am

Post by z3r0c00l12 »

There are plenty of methods to either make this run as a service, or run it as a background process. My favorite would be to compile the .bat file using iExpress, which is a tool natively installed in windows, you just click Start -> Run -> iexpress ->ok -> then follow the wizard, when prompted, check the hidden window button and when you run the compiled .exe, you won't see the cmd window, but you can see the process in task manager...

If you do this though, I suggest you edit the script a little so that it logs what it does to a txt file, so you know when it's working or not...

z3r0c00l12
malun
Site Admin
Posts: 1589
Joined: Sun Jan 04, 2004 1:29 pm

Post by malun »

I can do a text file hack for this option.
It will work like this:
Create a text file containing the path to the folder where you have your extra variables.
Put this file into the <.yawcam> directory.

If the file exists the alternate path will be used, otherwise the default path will be used.

Can't say when this will be done at the moment...

/malun
prutserke
Posts: 11
Joined: Mon Feb 01, 2010 12:00 pm

Post by prutserke »

z3r0c00l12 wrote:My favorite would be to compile the .bat file using iExpress, which is a tool natively installed in windows, you just click Start -> Run -> iexpress ->ok -> then follow the wizard, when prompted, check the hidden window button and when you run the compiled .exe, you won't see the cmd window, but you can see the process in task manager...

If you do this though, I suggest you edit the script a little so that it logs what it does to a txt file, so you know when it's working or not...

z3r0c00l12
Thanks for the tip.
malun
Site Admin
Posts: 1589
Joined: Sun Jan 04, 2004 1:29 pm

Post by malun »

It's now possible to use the new overlay variable {file:xxx} in Yawcam 0.3.5.
The variable will be replaced with the contents of the file you enter in the variable. For example the variable: {file:c:\info\wind.txt} will be replaced with the content of the file located at c:\info\wind.txt

This means that you can include overlays from files located anywhere and not just from the "extravars" directory.

/malun
WSLangerak
Posts: 3
Joined: Wed Feb 24, 2010 10:34 pm

Post by WSLangerak »

I just installed and tried this new feature: it works a treat!

This was one of my suggestions, so thank you very much Malun!

8)

Here is an example!
malun
Site Admin
Posts: 1589
Joined: Sun Jan 04, 2004 1:29 pm

Post by malun »

Nice!
/malun
Post Reply