public DateTime PropagationPathFindLastUpdated(PropagationPathDesignator path, ELEVATIONMODEL model) { System.Data.SQLite.SQLiteDatabase db = GetPropagationDatabase(model); lock (db.DBCommand) { db.DBCommand.CommandText = "SELECT LastUpdated FROM " + PropagationPathDesignator.TableName + " 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")); object result = db.ExecuteScalar(db.DBCommand); if (result != null) { return(SQLiteEntry.UNIXTimeToDateTime((int)result)); } } return(DateTime.MinValue); }
public long PropagationHorizonCount(ELEVATIONMODEL model) { System.Data.SQLite.SQLiteDatabase db = GetPropagationDatabase(model); long count = (long)db.ExecuteScalar("SELECT COUNT(*) FROM " + PropagationHorizonDesignator.TableName); if (count <= 0) { return(0); } return(count); }
public DateTime PropagationHorizonFindLastUpdated(PropagationHorizonDesignator hor, ELEVATIONMODEL model) { System.Data.SQLite.SQLiteDatabase db = GetPropagationDatabase(model); lock (db.DBCommand) { db.DBCommand.CommandText = "SELECT LastUpdated FROM " + PropagationHorizonDesignator.TableName + " 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")); object result = db.ExecuteScalar(db.DBCommand); if (result != null) { return(SQLiteEntry.UNIXTimeToDateTime((int)result)); } } return(DateTime.MinValue); }