package info.nightscout.androidaps.data;

import android.content.Context;

import org.json.JSONObject;

import java.util.Date;

import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.db.CareportalEvent;
import info.nightscout.androidaps.db.Source;
import info.nightscout.androidaps.interfaces.InsulinInterface;

/**
 * Created by mike on 29.05.2017.
 */

public class DetailedBolusInfo {
    public long date = System.currentTimeMillis();
    public String eventType = CareportalEvent.MEALBOLUS;
    public double insulin = 0;
    public double carbs = 0;
    public int source = Source.NONE;
    public boolean isValid = true;
    public double glucose = 0;             // Bg value in current units
    public String glucoseType = "";        // NS values: Manual, Finger, Sensor
    public int carbTime = 0;               // time shift of carbs in minutes
    public JSONObject boluscalc = null;    // additional bolus wizard info
    public Context context = null;         // context for progress dialog
    public long pumpId = 0;                // id of record if comming from pump history (not a newly created treatment)
    public boolean isSMB = false;          // is a Super-MicroBolus

    @Override
    public String toString() {
        return new Date(date).toLocaleString() +
                " insulin: " + insulin +
                " carbs: " + carbs +
                " isValid: " + isValid +
                " carbTime: " + carbTime +
                " isSMB: " + isSMB;
    }
}

@@ -125,51 +125,8 @@
 e;%0A%0A
-import info.nightscout.androidaps.MainApp;%0A
 impo
@@ -223,71 +223,8 @@
 rce;
-%0Aimport info.nightscout.androidaps.interfaces.InsulinInterface;
 %0A%0A/*
@@ -295,16 +295,37 @@
 lusInfo 
+implements Cloneable 
 %7B%0A    pu
@@ -1125,16 +1125,621 @@
 oBolus%0A%0A
+    public DetailedBolusInfo copy() %7B%0A        DetailedBolusInfo copy = new DetailedBolusInfo();%0A        copy.date = this.date;%0A        copy.eventType = this.eventType;%0A        copy.insulin = this.insulin;%0A        copy.carbs = this.carbs;%0A        copy.source = this.source;%0A        copy.isValid = this.isValid;%0A        copy.glucose = this.glucose;%0A        copy.glucoseType = this.glucoseType;%0A        copy.carbTime = this.carbTime;%0A        copy.boluscalc = this.boluscalc;%0A        copy.context = this.context;%0A        copy.pumpId = this.pumpId;%0A        copy.isSMB = this.isSMB;%0A        return copy;%0A    %7D%0A%0A
     @Ove

Add DetailedBolusInfo.copy() method.