params can be:
serial port communication: serial,dir,hz,device,baud,protocol
socket communication: socket,dir,hz,machine,port,style,protocol
- output to a file: file,dir,hz,filename,protocol
+ i/o to a file: file,dir,hz,filename,protocol[,repeat]
See README.protocol for how to define a generic protocol.
--native=file,in,10,flight1.fgfs --fdm=external
+ You can make the replay from a file loop back to the beginning
+ when it reaches the end of the file with the "repeat" flag:
+
+ --generic=file,in,20,flight.out,playback,repeat
+
Moving Map Example:
FGRUL *rul = new FGRUL;
io = rul;
} else if ( protocol == "generic" ) {
- int n = 6;
- if (tokens[1] == "socket") n++;
- else if (tokens[1] == "file") n--;
- FGGeneric *generic = new FGGeneric( tokens[n] );
+ int configToken;
+ if (tokens[1] == "socket")
+ configToken = 7;
+ else if (tokens[1] == "file")
+ configToken = 5;
+ else
+ configToken = 6;
+ FGGeneric *generic = new FGGeneric( tokens[configToken] );
io = generic;
} else if ( protocol == "multiplay" ) {
if ( tokens.size() != 5 ) {
string file = tokens[4];
SG_LOG( SG_IO, SG_INFO, " file name = " << file );
-
- SGFile *ch = new SGFile( file );
+ bool repeat = false;
+ if (tokens.size() >= 7 && tokens[6] == "repeat")
+ repeat = true;
+ SGFile *ch = new SGFile( file, repeat );
io->set_io_channel( ch );
} else if ( medium == "socket" ) {
if ( tokens.size() < 6) {