public static ForceSensorImpulse SelectImpulse(bool dbconOpened) { openIfNeeded(dbconOpened); dbcmd.CommandText = "SELECT * FROM " + table + " WHERE code == \"I\""; LogB.SQL(dbcmd.CommandText.ToString()); dbcmd.ExecuteNonQuery(); SqliteDataReader reader = dbcmd.ExecuteReader(); ForceSensorImpulse impulse = null; while (reader.Read()) { impulse = new ForceSensorImpulse( Util.IntToBool(Convert.ToInt32(reader[1])), //active (ForceSensorImpulse.Functions)Enum.Parse( typeof(ForceSensorImpulse.Functions), reader[2].ToString()), //function (ForceSensorImpulse.Types)Enum.Parse( typeof(ForceSensorImpulse.Types), reader[3].ToString()), //type Convert.ToInt32(reader[4]), //num1 Convert.ToInt32(reader[5]) //num2 ); } reader.Close(); closeIfNeeded(dbconOpened); return(impulse); }
public static void InsertImpulse(bool dbconOpened, ForceSensorImpulse impulse) { openIfNeeded(dbconOpened); dbcmd.CommandText = "INSERT INTO " + table + " (code, active, function, type, num1, num2) VALUES (" + impulse.ToSQLInsertString() + ")"; LogB.SQL(dbcmd.CommandText.ToString()); dbcmd.ExecuteNonQuery(); closeIfNeeded(dbconOpened); }
public bool Changed(ForceSensorImpulse newImpulse) { if ( active == newImpulse.active && function == newImpulse.function && type == newImpulse.type && num1 == newImpulse.num1 && num2 == newImpulse.num2) { return(false); } return(true); }
public ForceSensorGraph(List <ForceSensorRFD> rfdList, ForceSensorImpulse impulse, int testLength, string title) { this.rfdList = rfdList; this.impulse = impulse; this.testLength = testLength; this.title = title; averageLength = 0.1; percentChange = 5; vlineT0 = false; vline50fmax_raw = false; vline50fmax_fitted = false; hline50fmax_raw = false; hline50fmax_fitted = false; }
public static void UpdateImpulse(bool dbconOpened, ForceSensorImpulse impulse) { openIfNeeded(dbconOpened); dbcmd.CommandText = "UPDATE " + table + " SET " + " active = " + Util.BoolToInt(impulse.active).ToString() + "," + " function = \"" + impulse.function.ToString() + "\"" + "," + " type = \"" + impulse.type.ToString() + "\"" + "," + " num1 = " + impulse.num1.ToString() + "," + " num2 = " + impulse.num2.ToString() + " WHERE code = \"" + impulse.code + "\""; LogB.SQL(dbcmd.CommandText.ToString()); dbcmd.ExecuteNonQuery(); closeIfNeeded(dbconOpened); }