Suggestion: Own text variables in other directory

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

Suggestion: Own text variables in other directory

Postby WSLangerak » Fri Feb 26, 2010 7:02 pm

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!

Advertisement



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

Postby z3r0c00l12 » Sat Feb 27, 2010 12:02 am

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

Postby bben95 » Sat Feb 27, 2010 4:00 pm

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

Postby z3r0c00l12 » Sat Feb 27, 2010 6:24 pm

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: 1495
Joined: Sun Jan 04, 2004 1:29 pm

Postby malun » Sun Feb 28, 2010 12:33 pm

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

Postby prutserke » Mon Mar 01, 2010 1:02 pm

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: 1495
Joined: Sun Jan 04, 2004 1:29 pm

Postby malun » Sat Feb 19, 2011 2:57 pm

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

Postby WSLangerak » Sat Feb 19, 2011 4:25 pm

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: 1495
Joined: Sun Jan 04, 2004 1:29 pm

Postby malun » Sat Feb 19, 2011 4:37 pm

Nice!
/malun


Return to “General”

Who is online

Users browsing this forum: Bing [Bot] and 7 guests