The A2A Simulations Community

"Come share your passion for flight"
It is currently Sat May 18, 2013 11:23 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: COTS data file save
PostPosted: Wed Jul 20, 2011 2:18 pm 
Offline
Airman First Class

Joined: Sun Mar 15, 2009 2:51 pm
Posts: 82
Hi,
With FSUIPC there is an option which can save your flight data periodically. There is an additional possibility of saving another file which you can select. Would it be possible to save the COTS data file. If it is feasible, it could allow us to restart a flight after a computer crash without losing the COTS data.
What do you think?


Top
 Profile  
 
 Post subject: Re: COTS data file save
PostPosted: Wed Jul 20, 2011 4:47 pm 
Offline
Senior Airman

Joined: Sun Jun 19, 2011 1:11 pm
Posts: 106
Location: Midlands, UK
If FSUIPC is triggering the in-built FSX flight saving routine, the COTS data should be saved in parallel with this. This is done automatically every time you save a flight, so I don't see why a FSUIPC-initiated save should be any different to a standard save.

Obviously someone please correct me if I am wrong!


Top
 Profile  
 
 Post subject: Re: COTS data file save
PostPosted: Thu Jul 21, 2011 12:42 am 
Offline
A2A Master Mechanic
User avatar

Joined: Sat Aug 02, 2008 5:04 pm
Posts: 1973
Location: San Francisco
I believe Mustang is correct. However I THINK what will happen is if you load the
FSUIPC-saved flight, the A2A code will most likely read the DAT file from the
regular location. I say this because I had some strange issue when I reloaded
a flight several times tonight and all of a sudden I had "0 hours" on everything.
This was my B-17G. I then loaded a FSUIPC autosave filght from a few hours
previous to this event and though it put me where I had been then, the hours
were not restored.

EDIT: I tried doing the procedure below and it did not work. I could not
find any dat file being saved. What's more, looking at the .B377 file
that is autosaved and the dat file in Hex editors, I couldn't see any
correlation.


The answer to the question is, One could add the line in the FSUIPC INI file:

AlsoManage1=C:\Documents and Settings\<user>\My Documents\A2A\FSX\B377\*.dat

If you already have AlsoManage entries there, add this but make the number after the AlsoManage_ the
next in sequance.

This will insure you have a recent backup of the dat file available. Several, actually, depending upon
how often you have the Autosave function set and how many "saves" to keep.

I wish this question had been posted two days ago. I was on a long MP hop in my B-17G that I had been
keeping a separate dat file for when I had a BSOD.

I rejoined the MP session inflight but for some reason I was unable to get the engines restarted and
wound up PORKING all 4 engines. I had no choice but to do a complete overhaul of the engines
that wiped out 120+ hours on them and they were still "Excellent condition"!

I hadn't saved the dat file at the end of my previous hop of 6 hours so instead of ending the recent
hop with 122+ hours on the engines, I had 4.7 and 122 on the airframe.

My backup dat file reverted me to 110 hours on airframe and engine :(

So, I have just decided to make the above entry in my FSUIPC INI file and see how it goes.

_________________
Paul
Image
Image
i5-2500K @4.3Ghz OC - GA-P67A-UD7-B3 - 8GB Corsair 1600mHz


Top
 Profile  
 
 Post subject: Re: COTS data file save
PostPosted: Thu Jul 21, 2011 1:21 pm 
Offline
Airman First Class

Joined: Sun Mar 15, 2009 2:51 pm
Posts: 82
In an other thread, I think it was Scott who said that when there is a computer crash, the flight is lost. I would like to try the FSUIPC option but in which file are the cots data saved?
Thank you


Top
 Profile  
 
 Post subject: Re: COTS data file save
PostPosted: Thu Jul 21, 2011 5:49 pm 
Offline
Master Sergeant

Joined: Sat Nov 14, 2009 1:25 am
Posts: 1018
Vista/7:

C:\Users\<USERNAME>\Documents\A2A\FSX\377

Best regards,
Robin.

_________________
A2A/AccuSim. 'nuff said!


Top
 Profile  
 
 Post subject: Re: COTS data file save
PostPosted: Thu Jul 21, 2011 6:05 pm 
Offline
A2A Master Mechanic
User avatar

Joined: Sat Aug 02, 2008 5:04 pm
Posts: 1973
Location: San Francisco
yankeegolf wrote:
In an other thread, I think it was Scott who said that when there is a computer crash, the flight is lost. I would like to try the FSUIPC option but in which file are the cots data saved?
Thank you


I have not had any success in getting FSUIPC4 to "AlsoManage" the B17.dat file or the B377 dat files.

I have tried the path form listed above by Vulcan and the more verbose path form that I listed above.
Neither works. I may try is later in my WinXP setup and see if perhaps there is some issue with Win7
not allowing FSUIPC4 to get and save those files but I just can't imaging what it may be.

Paul


Top
 Profile  
 
 Post subject: Re: COTS data file save
PostPosted: Fri Jul 22, 2011 11:51 am 
Offline
Airman First Class

Joined: Sun Mar 15, 2009 2:51 pm
Posts: 82
so it means that there is no solution. it is a pity . Maybe A2A could find a solution because it is very frustrating to loose a long flight. With FSX, the probability of a computer crash is far from being nil


Top
 Profile  
 
 Post subject: Re: COTS data file save
PostPosted: Fri Jul 22, 2011 8:23 pm 
Offline
A2A Master Mechanic
User avatar

Joined: Sat Aug 02, 2008 5:04 pm
Posts: 1973
Location: San Francisco
yankeegolf wrote:
so it means that there is no solution. it is a pity . Maybe A2A could find a solution because it is very frustrating to loose a long flight. With FSX, the probability of a computer crash is far from being nil



The only thing I could think of at the moment would be an external program that
periodically copied the current dat file to a backup file on some timed basis.

I was thinking of looking into writing a batch file to attempt this but I'm afraid
I just do not have the time now as I leave for an extended vacation in a few days.

I dug through the FSUIPC and Lua documentation again this morning and concluded
that there is nothing there to do what is desired.

EDIT

OK...revisiting this.

First off, you can cause FSUIPC to save the state of the B377, B17, P47, etc.
Just add these lines to your FSUIPC4.ini file under the "[AutoSave]" section:

AlsoManage1=C:\Documents and Settings\<user name>\My Documents\Flight Simulator X Files\*.377
AlsoManage2=C:\Documents and Settings\<user name>\My Documents\Flight Simulator X Files\*.P47
AlsoManage3=C:\Documents and Settings\<user name>\My Documents\Flight Simulator X Files\*.PJ3
AlsoManage4=C:\Documents and Settings\<user name>\My Documents\Flight Simulator X Files\*.B17
AlsoManage5=C:\Documents and Settings\<user name>\My Documents\Flight Simulator X Files\*.ipcbin

Of course, add YOUR user name in the field "<user name>".

Additionally, the B377 "B377log.dat" file is automatically backed up in the A2A\B377 directory.
There you will find 5 BAK copies.
What isn't backed up is the B377.dat file. I don't know exactly what this contains.

I am currently testing a batch file to backup the B377 and B17 files. If I get it to run as
I want it to, it can be scheduled to run periodically using the Windows Task Scheduler
in the Control Panel.
More later, as time permits.

Paul


Top
 Profile  
 
 Post subject: Re: COTS data file save
PostPosted: Sat Jul 23, 2011 12:47 am 
Offline
A2A Master Mechanic
User avatar

Joined: Sat Aug 02, 2008 5:04 pm
Posts: 1973
Location: San Francisco
OK, I have created three files that will automatically backup the
dat files for the A2A B377 COTS and B17G on a timed basis.

There are two vbs script files. One to start the backup batch file
and one to terminate the batch file.

You will need to edit the batch file and the vbs script that starts the batch file
to replace MY path names with yours.

First, the "Readme" file:
Code:
The three files here are used to backup the A2A B377 COTS and B17
dat files periodically. The period is set in the "DAT_BAK.bat
file with the "sleep" statement. Currently set to 600 seconds.

SET FOR YOUR SYSTEM:

The bat file must be edited to change the file path to match
your system setup. It may only be necessary to edit the
user name field by changing "Gypsy Baron" to your user name.
NOTE: right-click on the file name and select "Edit"

The RUN_DAT.vbs file must be edited to change the path to
the "DAT_BAK.bat file". Replace the file path below:
"Z:\FSX_COMMON\BACKUP_A2A\DAT_BAK.bat"  with your path.

RUNNING THE BACKUP BATCH FILE:

Prior to starting FSX, run the "RUN_DAT_BAK.vbs" script by
double-clicking on it. This script will start the batch file
in the background without a Command Prompt window opening
when the batch file executes.

After exiting FSX, or if you wish to stop the batch file,
double-click on the "Kill_BAT.vbs" script. This script will
kill ALL instances of "cmd.exe" that are currently running.
In my case, the only instance is the one running the batch file.

 Paul 'Gypsy Baron' Strogen  22 July 2011


Next, the batch file. Copy and paste this code into Notepad.
Be sure to edit the path statement aznd then save it as "DAT_BAK.bat".
Code:
@echo off
REM This file is run from the "RUN_DAT_BAK.vbs" to insure that
REM it runs in the background and doesn't open a Command Prompt window.
REM This batch file copies the A2A B17 and B377 dat files to
REM a folder valled "Backup" in the same folder as the dat files.
REM Once started this batch file will run forever.
REM To kill the process, run the "Kill_BAT.vbs" script file

C:

:start

REM Remove the following two lines if you do not have the A2A B17

CD C:\Documents and Settings\Gypsy Baron\My Documents\A2A\FSX\B17

xcopy *.dat Backup\*.dat /c /q /d /m /y

REM Remove the following two lines if you do not have the A2A B377 COTS

CD C:\Documents and Settings\Gypsy Baron\My Documents\A2A\FSX\377

xcopy *.dat Backup\*.dat /c /q /d /m /y

REM This will save the dat files every 10 minutes ( sleep time in seconds)

sleep 600

goto start

exit


Next, copy and paste this code into Notepad and edit the path.
Then save the file as "RUN_DAT_BAK.vbs".
Code:
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run chr(34) & "Z:\FSX_COMMON\BACKUP_A2A\DAT_BAK.bat" & Chr(34), 0
Set WshShell = Nothing


Finally, copy and paste this code into Notepad and then save the
file as "Kill_BAT.vbs"
Code:
' Killer.VBS
' This script kills all processes with name cmd.exe

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colProcessList = objWMIService.ExecQuery _
    ("SELECT * FROM Win32_Process WHERE Name = 'cmd.exe'")
For Each objProcess in colProcessList
    objProcess.Terminate()
Next


At some later date I may revise this whole quick & dirty operation to
utilize a single VBS script but I do not have time to do that now.

I tested this with both my WinXP Pro and Win7 Pro X64 setups.

_________________
Paul
Image
Image
i5-2500K @4.3Ghz OC - GA-P67A-UD7-B3 - 8GB Corsair 1600mHz


Top
 Profile  
 
 Post subject: Re: COTS data file save
PostPosted: Sun Jul 24, 2011 1:14 pm 
Offline
Airman First Class

Joined: Sun Mar 15, 2009 2:51 pm
Posts: 82
hi Paul
thank you for your effort. I am looking forward to your software which looks promising and will be very helpful to many simmers. in the meantime, I cannot use your first release because I am not a computer genius like you and I am always cautious when it comes to modifying files.


Top
 Profile  
 
 Post subject: Re: COTS data file save
PostPosted: Mon Aug 01, 2011 2:30 am 
Offline
Senior Airman

Joined: Sat Jun 30, 2007 1:01 pm
Posts: 140
Wouldn't AutoHotKey be an easier scripting tool to use?

Also check LUA, as within LUA you can do just about anything (up to opening a TCP/IP socket if you wanted to), with the advantage of running inside FSUIPC.

Cheers,

- jahman.


Top
 Profile  
 
 Post subject: Re: COTS data file save
PostPosted: Mon Aug 01, 2011 11:15 am 
Offline
A2A Master Mechanic
User avatar

Joined: Sat Aug 02, 2008 5:04 pm
Posts: 1973
Location: San Francisco
jahman wrote:
Wouldn't AutoHotKey be an easier scripting tool to use?

Also check LUA, as within LUA you can do just about anything (up to opening a TCP/IP socket if you wanted to), with the advantage of running inside FSUIPC.

Cheers,



- jahman.


I am unfamiliar with "AutoHotKey" and as far as Lua is concerned, I only
use it to the extent that it is defined in the FSUIPC Lua Library documentation.
I use it for many things but did not see any means of copying files within
that realm. Basically all you need is file copy functions and really don't
need to run within any FSX/FSUIPC framework. One could use the "loaded
aircraft" data from one of the offsets to select the files to copy but that is
farther that I wanted to go for the above solution, given that I was leaving
my sim computer for an extended time the day after I made that post above :)

I tend to use tools that I am either already familiar with or those that are
well documented in a "language" that I can relate too (I am an old assembly
language hardware engineer!).

The full Lua documentation, not that provided in FSUIPC documents, is far
to lengthy to digest and not easy to navigate for the casual user.

Paul


Top
 Profile  
 
 Post subject: Re: COTS data file save
PostPosted: Mon Aug 01, 2011 7:26 pm 
Offline
Senior Airman

Joined: Sat Jun 30, 2007 1:01 pm
Posts: 140
Of you're referring to LUA sockets, that has been specifically implemented in FSUIPC.

The advantage of a LUA solution would of course be transparent automation.

Cheers,

- jahman.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group