예제 #1
0
 public int PropagationHorizonUpdate(PropagationHorizonDesignator hor, ELEVATIONMODEL model)
 {
     System.Data.SQLite.SQLiteDatabase db = GetPropagationDatabase(model);
     lock (db.DBCommand)
     {
         db.DBCommand.CommandText = "UPDATE " + PropagationHorizonDesignator.TableName + " SET Lat = @Lat, Lon = @Lon, h = @h, Dist = @Dist, QRG = @QRG, Radius = @Radius, F1_Clearance = @F1_Clearance, @StepWidth = @StepWidth, Horizon = @Horizon, LastUpdated = @LastUpdated WHERE Lat = @Lat AND Lon = @Lon AND h = @h AND Dist = @Dist AND QRG = @QRG AND Radius = @Radius AND F1_Clearance = @F1_Clearance AND StepWidth = @StepWidth";
         db.DBCommand.Parameters.Clear();
         db.DBCommand.Parameters.Add(hor.AsDouble("Lat"));
         db.DBCommand.Parameters.Add(hor.AsDouble("Lon"));
         db.DBCommand.Parameters.Add(hor.AsDouble("h"));
         db.DBCommand.Parameters.Add(hor.AsDouble("Dist"));
         db.DBCommand.Parameters.Add(hor.AsDouble("QRG"));
         db.DBCommand.Parameters.Add(hor.AsDouble("Radius"));
         db.DBCommand.Parameters.Add(hor.AsDouble("F1_Clearance"));
         db.DBCommand.Parameters.Add(hor.AsDouble("StepWidth"));
         db.DBCommand.Parameters.Add(hor.AsBinary("Horizon"));
         db.DBCommand.Parameters.Add(hor.AsUNIXTime("LastUpdated"));
         return(db.ExecuteNonQuery(db.DBCommand));
     }
 }
예제 #2
0
 public int PropagationHorizonInsert(PropagationHorizonDesignator hor, ELEVATIONMODEL model)
 {
     System.Data.SQLite.SQLiteDatabase db = GetPropagationDatabase(model);
     lock (db.DBCommand)
     {
         db.DBCommand.CommandText = "INSERT INTO " + PropagationHorizonDesignator.TableName + " (Lat, Lon, h, Dist, QRG, Radius, F1_Clearance, StepWidth, Horizon, LastUpdated) VALUES (@Lat, @Lon, @h, @Dist, @QRG, @Radius, @F1_Clearance, @StepWidth, @Horizon, @LastUpdated)";
         db.DBCommand.Parameters.Clear();
         db.DBCommand.Parameters.Add(hor.AsDouble("Lat"));
         db.DBCommand.Parameters.Add(hor.AsDouble("Lon"));
         db.DBCommand.Parameters.Add(hor.AsDouble("h"));
         db.DBCommand.Parameters.Add(hor.AsDouble("Dist"));
         db.DBCommand.Parameters.Add(hor.AsDouble("QRG"));
         db.DBCommand.Parameters.Add(hor.AsDouble("Radius"));
         db.DBCommand.Parameters.Add(hor.AsDouble("F1_Clearance"));
         db.DBCommand.Parameters.Add(hor.AsDouble("StepWidth"));
         db.DBCommand.Parameters.Add(hor.AsBinary("Horizon"));
         db.DBCommand.Parameters.Add(hor.AsUNIXTime("LastUpdated"));
         return(db.ExecuteNonQuery(db.DBCommand));
     }
 }