Page 1 of 1

Suggestion: Own text variables in other directory

Posted: Fri Feb 26, 2010 7:02 pm
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!

Posted: Sat Feb 27, 2010 12:02 am
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

Posted: Sat Feb 27, 2010 4:00 pm
by bben95
but then dosen't he need to leave the cmd window open at all times?

Posted: Sat Feb 27, 2010 6:24 pm
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

Posted: Sun Feb 28, 2010 12:33 pm
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

Posted: Mon Mar 01, 2010 1:02 pm
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.

Posted: Sat Feb 19, 2011 2:57 pm
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

Posted: Sat Feb 19, 2011 4:25 pm
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!

Posted: Sat Feb 19, 2011 4:37 pm
by malun
Nice!
/malun