Exemplo n.º 1
0
 public bool SaveFDR(string filename, FDR fdr)
 {
     try{
         Stream          stream     = File.Open(filename, FileMode.Create);
         BinaryFormatter bFormatter = new BinaryFormatter();
         bFormatter.Serialize(stream, fdr);
         stream.Close();
         return(true);
     } catch (Exception) {
         return(false);
     }
 }
Exemplo n.º 2
0
        public static string SaveFDR()
        {
            FDR fdr = new FDR();

            fdr.FlightEvents = flightEvents;
            fdr.FlightInit   = flightInit;
            fdr.Pilot        = pilot;

            Serializer serializer = new Serializer();
            string     filename   = "fdr/fdr_" + Logger.timeBase + ".fdr";
            bool       result     = serializer.SaveFDR(filename, fdr);

            if (result)
            {
                return(filename);
            }
            else
            {
                return("");
            }
        }