public static void newTransmitterDataEntry(String action, Model obj) { if(!Pref.getBooleanDefaultFalse("mongo_load_transmitter_data")) { return; } newEntry(action, obj); }
public static void newTransmitterDataEntry(String action, Model obj) { if(!Pref.getBooleanDefaultFalse("mongo_load_transmitter_data")) { return; } newEntry(action, obj); }
public static void addToQueue(Calibration calibration, Context context) { // TODO support for various insert/update/delete functions // CalibrationSendQueue calibrationSendQueue = new CalibrationSendQueue(); // calibrationSendQueue.calibration = calibration; // calibrationSendQueue.success = false; // calibrationSendQueue.mongo_success = false; // calibrationSendQueue.save(); UploaderQueue.newEntry("create", calibration); Log.i(TAG, "calling SensorSendQueue.SendToFollower"); SensorSendQueue.SendToFollower(Sensor.getByUuid(calibration.sensor_uuid)); }
public static void addToQueue(Calibration calibration, Context context) { // TODO support for various insert/update/delete functions // CalibrationSendQueue calibrationSendQueue = new CalibrationSendQueue(); // calibrationSendQueue.calibration = calibration; // calibrationSendQueue.success = false; // calibrationSendQueue.mongo_success = false; // calibrationSendQueue.save(); UploaderQueue.newEntry("create", calibration); Log.i(TAG, "calling SensorSendQueue.SendToFollower"); SensorSendQueue.SendToFollower(Sensor.getByUuid(calibration.sensor_uuid)); }
public static Treatments delete_last(boolean from_interactive) { Treatments thistreat = last(); if (thistreat != null) { if (from_interactive) { GcmActivity.push_delete_treatment(thistreat); //GoogleDriveInterface gdrive = new GoogleDriveInterface(); //gdrive.deleteTreatmentAtRemote(thistreat.uuid); } UploaderQueue.newEntry("delete",thistreat); thistreat.delete(); } return null; }
public static Treatments delete_last(boolean from_interactive) { Treatments thistreat = last(); if (thistreat != null) { if (from_interactive) { GcmActivity.push_delete_treatment(thistreat); //GoogleDriveInterface gdrive = new GoogleDriveInterface(); //gdrive.deleteTreatmentAtRemote(thistreat.uuid); } UploaderQueue.newEntry("delete",thistreat); thistreat.delete(); } return null; }
public static void delete_by_uuid(String uuid, boolean from_interactive) { Treatments thistreat = byuuid(uuid); if (thistreat != null) { UploaderQueue.newEntry("delete", thistreat); if (from_interactive) { GcmActivity.push_delete_treatment(thistreat); SyncService.startSyncService(3000); // sync in 3 seconds } thistreat.delete(); Home.staticRefreshBGCharts(); } }
public static void delete_by_uuid(String uuid, boolean from_interactive) { Treatments thistreat = byuuid(uuid); if (thistreat != null) { UploaderQueue.newEntry("delete", thistreat); if (from_interactive) { GcmActivity.push_delete_treatment(thistreat); SyncService.startSyncService(3000); // sync in 3 seconds } thistreat.delete(); Home.staticRefreshBGCharts(); } }
private static void pushTreatmentSync(Treatments treatment, boolean is_new, String suggested_uuid) {; if (Home.get_master_or_follower()) GcmActivity.pushTreatmentAsync(treatment); if (!(Pref.getBoolean("cloud_storage_api_enable", false) || Pref.getBoolean("cloud_storage_mongodb_enable", false))) { NSClientChat.pushTreatmentAsync(treatment); } else { Log.d(TAG, "Skipping NSClient treatment broadcast as nightscout direct sync is enabled"); } if (suggested_uuid == null) { // only sync to nightscout if source of change was not from nightscout if (UploaderQueue.newEntry(is_new ? "insert" : "update", treatment) != null) { SyncService.startSyncService(3000); // sync in 3 seconds } } }
private static void pushTreatmentSync(Treatments treatment, boolean is_new, String suggested_uuid) {; if (Home.get_master_or_follower()) GcmActivity.pushTreatmentAsync(treatment); if (!(Pref.getBoolean("cloud_storage_api_enable", false) || Pref.getBoolean("cloud_storage_mongodb_enable", false))) { NSClientChat.pushTreatmentAsync(treatment); } else { Log.d(TAG, "Skipping NSClient treatment broadcast as nightscout direct sync is enabled"); } if (suggested_uuid == null) { // only sync to nightscout if source of change was not from nightscout if (UploaderQueue.newEntry(is_new ? "insert" : "update", treatment) != null) { SyncService.startSyncService(3000); // sync in 3 seconds } } }
UploaderQueue.newEntry(operation_type, bgReading);
bt.source = source; bt.saveit(); if (UploaderQueue.newEntry("insert", bt) != null) { SyncService.startSyncService(3000); // sync in 3 seconds
bt.source = source; bt.saveit(); if (UploaderQueue.newEntry("insert", bt) != null) { SyncService.startSyncService(3000); // sync in 3 seconds
UploaderQueue.newEntry(operation_type, bgReading);
if (UploaderQueue.newEntry(is_new ? "insert" : "update", bt) != null) { if (JoH.quietratelimit("start-sync-service", 5)) { SyncService.startSyncService(3000); // sync in 3 seconds
if (UploaderQueue.newEntry(is_new ? "insert" : "update", bt) != null) { if (JoH.quietratelimit("start-sync-service", 5)) { SyncService.startSyncService(3000); // sync in 3 seconds