<commit_before>package info.nightscout.androidaps.plugins.pump.medtronic.data.dto

import info.nightscout.androidaps.logging.AAPSLogger
import info.nightscout.androidaps.logging.LTag
import info.nightscout.androidaps.plugins.pump.common.utils.DateTimeUtil
import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.PumpHistoryEntry

class TempBasalProcessDTO constructor(var itemOne: PumpHistoryEntry,
                                      var processOperation: Operation = Operation.None,
                                      var aapsLogger: AAPSLogger,
                                      var objectType: ObjectType = ObjectType.TemporaryBasal) {

    var itemTwo: PumpHistoryEntry? = null
        set(value) {
            field = value
            if (objectType == ObjectType.TemporaryBasal) {
                itemTwoTbr = value!!.getDecodedDataEntry("Object") as TempBasalPair
            }
        }

    var itemOneTbr: TempBasalPair? = null
    var itemTwoTbr: TempBasalPair? = null

    var cancelPresent: Boolean = false

    val atechDateTime: Long
        get() = itemOne.atechDateTime

    val pumpId: Long
        get() = itemOne.pumpId

    val durationAsSeconds: Int
        get() {
            if (objectType == ObjectType.TemporaryBasal) {
                if (itemTwo == null) {
                    if (itemOneTbr != null) {
                        aapsLogger.debug("TemporaryBasalPair - itemOneSingle: $itemOneTbr")
                        return itemOneTbr!!.durationMinutes * 60
                    } else {
                        aapsLogger.error("Couldn't find TempBasalPair in entry: $itemOne")
                        return 0
                    }
                } else {
                    aapsLogger.debug(LTag.PUMP, "Found 2 items for duration: itemOne=$itemOne, itemTwo=$itemTwo")
                    val secondsDiff = DateTimeUtil.getATechDateDiferenceAsSeconds(itemOne.atechDateTime, itemTwo!!.atechDateTime)
                    aapsLogger.debug(LTag.PUMP, "Difference in seconds: $secondsDiff")
                    return secondsDiff
                }
            } else {
                aapsLogger.debug(LTag.PUMP, "Found 2 items for duration (in SuspendMode): itemOne=$itemOne, itemTwo=$itemTwo")<commit_msg>- added additional log line<commit_after>package info.nightscout.androidaps.plugins.pump.medtronic.data.dto

import info.nightscout.androidaps.logging.AAPSLogger
import info.nightscout.androidaps.logging.LTag
import info.nightscout.androidaps.plugins.pump.common.utils.DateTimeUtil
import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.PumpHistoryEntry

class TempBasalProcessDTO constructor(var itemOne: PumpHistoryEntry,
                                      var processOperation: Operation = Operation.None,
                                      var aapsLogger: AAPSLogger,
                                      var objectType: ObjectType = ObjectType.TemporaryBasal) {

    var itemTwo: PumpHistoryEntry? = null
        set(value) {
            field = value
            if (objectType == ObjectType.TemporaryBasal) {
                itemTwoTbr = value!!.getDecodedDataEntry("Object") as TempBasalPair
            }
        }

    var itemOneTbr: TempBasalPair? = null
    var itemTwoTbr: TempBasalPair? = null

    var cancelPresent: Boolean = false

    val atechDateTime: Long
        get() = itemOne.atechDateTime

    val pumpId: Long
        get() = itemOne.pumpId

    val durationAsSeconds: Int
        get() {
            aapsLogger.debug(LTag.PUMP, "durationAsSeconds: [objectType=$objectType]")
            if (objectType == ObjectType.TemporaryBasal) {
                if (itemTwo == null) {
                    if (itemOneTbr != null) {
                        aapsLogger.debug("TemporaryBasalPair - itemOneSingle: $itemOneTbr")
                        return itemOneTbr!!.durationMinutes * 60
                    } else {
                        aapsLogger.error("Couldn't find TempBasalPair in entry: $itemOne")
                        return 0
                    }
                } else {
                    aapsLogger.debug(LTag.PUMP, "Found 2 items for duration: itemOne=$itemOne, itemTwo=$itemTwo")
                    val secondsDiff = DateTimeUtil.getATechDateDiferenceAsSeconds(itemOne.atechDateTime, itemTwo!!.atechDateTime)
                    aapsLogger.debug(LTag.PUMP, "Difference in seconds: $secondsDiff")
                    return secondsDiff
                }
            } else {
                aapsLogger.debug(LTag.PUMP, "Found 2 items for duration (in SuspendMode): itemOne=$itemOne, itemTwo=$itemTwo")
{'fraction_non_alphanumeric': 0.0818044463630477, 'fraction_numerical': 0.002158428663932657, 'mean_word_length': 1.9610223642172524, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1700612', 'n_tokens_mistral': 1290, 'n_tokens_neox': 1220, 'n_words': 248}