Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Spacecraft.prototype.updateState = function () {
- var timestamp = Date.now();
- var self = this;
- sql = util.format(
- "SELECT `timestamp`, `obsw_timestamp`, `gps_satellite_count`, `gps_altitude`, `gps_altitude_measure_unit`, `gps_latitude`, `gps_latitude_hemisphere`, `gps_longitude`, `gps_longitude_hemisphere`, `gps_timestamp`, `si1145_ambient_light`, `si1145_ir_index`, `si1145_uv_index`, `htu21d_humidity`, `htu21d_temperature`, `guva_uv_index`, `mpu_temperature`, `mpu_acceleration_X`, `mpu_acceleration_Y`, `mpu_acceleration_Z`, `mpu_gyro_X`, `mpu_gyro_Y`, `mpu_gyro_Z`, `mpu_magnetic_field_X`, `mpu_magnetic_field_Y`, `mpu_magnetic_field_Z`, `ms5611_altitude`, `ms5611_pressure`, `ms5611_temperature` FROM %s where timestamp > '%s'",
- self.tablename,
- datetime.create(timestamp).format("Y-m-d H:M:S"))
- console.log(sql);
- self.con.query(sql, function (err, result) {
- if (err) throw err;
- console.log("Result: " + JSON.stringify(result, null, 4));
- self.state["prop.temp"] = result[0]["mpu_temperature"];
- });
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement