Пример #1
0
 public int PropagationPathUpdate(PropagationPathDesignator path, ELEVATIONMODEL model)
 {
     System.Data.SQLite.SQLiteDatabase db = GetPropagationDatabase(model);
     lock (db.DBCommand)
     {
         db.DBCommand.CommandText = "UPDATE " + PropagationPathDesignator.TableName + " SET Lat1 = @Lat1, Lon1 = @Lon1, h1 = @h1, Lat2 = @Lat2, Lon2 = @Lon2, h2 = @h2, QRG = @QRG, Radius = @Radius, F1_Clearance = @F1_Clearance, @StepWidth = @StepWidth, Eps1_Min = @Eps1_Min, Eps2_Min = @Eps2_Min, LastUpdated = @LastUpdated WHERE Lat1 = @Lat1 AND Lon1 = @Lon1 AND h1 = @h1 AND Lat2 = @Lat2 AND Lon2 = @Lon2 AND h2 = @h2 AND QRG = @QRG AND Radius = @Radius AND F1_Clearance = @F1_Clearance AND StepWidth = @StepWidth";
         db.DBCommand.Parameters.Clear();
         db.DBCommand.Parameters.Add(path.AsDouble("Lat1"));
         db.DBCommand.Parameters.Add(path.AsDouble("Lon1"));
         db.DBCommand.Parameters.Add(path.AsDouble("h1"));
         db.DBCommand.Parameters.Add(path.AsDouble("Lat2"));
         db.DBCommand.Parameters.Add(path.AsDouble("Lon2"));
         db.DBCommand.Parameters.Add(path.AsDouble("h2"));
         db.DBCommand.Parameters.Add(path.AsDouble("QRG"));
         db.DBCommand.Parameters.Add(path.AsDouble("Radius"));
         db.DBCommand.Parameters.Add(path.AsDouble("F1_Clearance"));
         db.DBCommand.Parameters.Add(path.AsDouble("StepWidth"));
         db.DBCommand.Parameters.Add(path.AsDouble("Eps1_Min"));
         db.DBCommand.Parameters.Add(path.AsDouble("Eps2_Min"));
         db.DBCommand.Parameters.Add(path.AsUNIXTime("LastUpdated"));
         return(db.ExecuteNonQuery(db.DBCommand));
     }
 }
Пример #2
0
 public int PropagationPathInsert(PropagationPathDesignator path, ELEVATIONMODEL model)
 {
     System.Data.SQLite.SQLiteDatabase db = GetPropagationDatabase(model);
     lock (db.DBCommand)
     {
         db.DBCommand.CommandText = "INSERT INTO " + PropagationPathDesignator.TableName + " (Lat1, Lon1, h1, Lat2, Lon2, h2, QRG, Radius, F1_Clearance, StepWidth, Eps1_Min, Eps2_Min, LastUpdated) VALUES (@Lat1, @Lon1, @h1, @Lat2, @Lon2, @h2, @QRG, @Radius, @F1_Clearance, @StepWidth, @Eps1_Min, @Eps2_Min, @LastUpdated)";
         db.DBCommand.Parameters.Clear();
         db.DBCommand.Parameters.Add(path.AsDouble("Lat1"));
         db.DBCommand.Parameters.Add(path.AsDouble("Lon1"));
         db.DBCommand.Parameters.Add(path.AsDouble("h1"));
         db.DBCommand.Parameters.Add(path.AsDouble("Lat2"));
         db.DBCommand.Parameters.Add(path.AsDouble("Lon2"));
         db.DBCommand.Parameters.Add(path.AsDouble("h2"));
         db.DBCommand.Parameters.Add(path.AsDouble("QRG"));
         db.DBCommand.Parameters.Add(path.AsDouble("Radius"));
         db.DBCommand.Parameters.Add(path.AsDouble("F1_Clearance"));
         db.DBCommand.Parameters.Add(path.AsDouble("StepWidth"));
         db.DBCommand.Parameters.Add(path.AsDouble("Eps1_Min"));
         db.DBCommand.Parameters.Add(path.AsDouble("Eps2_Min"));
         db.DBCommand.Parameters.Add(path.AsUNIXTime("LastUpdated"));
         return(db.ExecuteNonQuery(db.DBCommand));
     }
 }