Merge pull request #1643 from Andries-Smit/chore/remove-extra-newline-kotlin

chore: remove triple new lines
This commit is contained in:
Milos Kozak 2022-04-19 15:08:06 +02:00 committed by GitHub
commit a6ff3293a7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
44 changed files with 30 additions and 108 deletions

View file

@ -169,7 +169,6 @@ class HistoryBrowseActivity : NoSplashAppCompatActivity() {
else
windowManager.defaultDisplay.getMetrics(dm)
axisWidth = if (dm.densityDpi <= 120) 3 else if (dm.densityDpi <= 160) 10 else if (dm.densityDpi <= 320) 35 else if (dm.densityDpi <= 420) 50 else if (dm.densityDpi <= 560) 70 else 80
binding.bgGraph.gridLabelRenderer?.gridColor = rh.gac(this, R.attr.graphgrid)
binding.bgGraph.gridLabelRenderer?.reloadStyles()

View file

@ -130,7 +130,6 @@ class ProfileFunctionImplementation @Inject constructor(
}
}
return null
}

View file

@ -80,7 +80,6 @@ class VersionCheckerPlugin @Inject constructor(
return
}
if (isOldVersion(gracePeriod.warning.daysToMillis()) && shouldWarnAgain()) {
// store last notification time
sp.putLong(R.string.key_last_versionchecker_plugin_warning, now)

View file

@ -179,7 +179,6 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
carbAnimation?.setEnterFadeDuration(1200)
carbAnimation?.setExitFadeDuration(1200)
binding.graphsLayout.bgGraph.setOnLongClickListener {
overviewData.rangeToDisplay += 6
overviewData.rangeToDisplay = if (overviewData.rangeToDisplay > 24) 6 else overviewData.rangeToDisplay

View file

@ -34,7 +34,6 @@ class BolusDataPoint @Inject constructor(
else if (data.isValid) rh.gac(context, R.attr.bolusDataPointColor)
else rh.gac(context, R.attr.alarmColor)
override fun setY(y: Double) {
yValue = y
}

View file

@ -16,7 +16,6 @@ class Session(val authHeader: String?,
@Volatile
internal var iterations: Int = 0
fun populateHeaders(headers: Headers) {
if (this.token == null) {
this.token = headers.get(sessionTokenHeader)

View file

@ -95,5 +95,3 @@ class ProfileElement(ps: EffectiveProfileSwitch, serialNumber: String, dateUtil:
internal var amount: Double
)
}

View file

@ -1,6 +1,5 @@
package info.nightscout.androidaps.plugins.general.tidepool.messages
class DatasetReplyMessage {
internal var data: Data? = null

View file

@ -28,7 +28,6 @@ open class DataReceiver : DaggerBroadcastReceiver() {
val bundle = intent.extras ?: return
aapsLogger.debug(LTag.DATABASE, "onReceive ${intent.action} ${BundleLogger.log(bundle)}")
when (intent.action) {
Intents.ACTION_NEW_BG_ESTIMATE ->
OneTimeWorkRequest.Builder(XdripPlugin.XdripWorker::class.java)

View file

@ -299,7 +299,6 @@ class CommandQueueImplementationTest : TestBaseWithProfile() {
Assert.assertFalse(commandQueue.isCustomCommandRunning(CustomCommand2::class.java))
Assert.assertFalse(commandQueue.isCustomCommandRunning(CustomCommand3::class.java))
Assert.assertEquals(1, commandQueue.size())
}

View file

@ -38,7 +38,6 @@ class ActionCarePortalEvent(injector: HasAndroidInjector) : Action(injector) {
@Inject lateinit var glucoseStatusProvider: GlucoseStatusProvider
@Inject lateinit var uel: UserEntryLogger
private val disposable = CompositeDisposable()
var note = InputString()

View file

@ -41,7 +41,6 @@ open class TestBase {
return uninitialized()
}
fun <T> eqObject(expected: T): T {
Mockito.eq<T>(expected)
return uninitialized()

View file

@ -8,7 +8,6 @@ import info.nightscout.androidaps.utils.locale.LocaleHelper
import io.reactivex.rxjava3.disposables.CompositeDisposable
import javax.inject.Inject
open class NoSplashAppCompatActivity : DaggerAppCompatActivityWithResult() {
@Inject lateinit var rxBus: RxBus

View file

@ -118,7 +118,6 @@ class IobTotal(val time: Long) : DataPointWithLabelInterface {
return color
}
fun setColor(color: Int): IobTotal {
this.color = color
return this

View file

@ -1,6 +1,5 @@
package info.nightscout.androidaps.extensions
@Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN", "NOTHING_TO_INLINE")
inline fun Any.wait() = (this as Object).wait()

View file

@ -49,7 +49,6 @@ fun effectiveProfileSwitchFromJson(jsonObject: JSONObject, dateUtil: DateUtil):
val pureProfile = pureProfileFromJson(JSONObject(profileJson), dateUtil) ?: return null
val profileSealed = ProfileSealed.Pure(pureProfile)
return EffectiveProfileSwitch(
timestamp = timestamp,
basalBlocks = profileSealed.basalBlocks,

View file

@ -44,5 +44,3 @@ fun JSONObject.storeBoolean(@StringRes key: Int, sp: SP, rh: ResourceHelper): JS
if (has(rh.gs(key))) sp.putString(key, getBoolean(rh.gs(key)).toString())
return this
}

View file

@ -49,7 +49,6 @@ fun offlineEventFromJson(jsonObject: JSONObject): OfflineEvent? {
val reason = OfflineEvent.Reason.fromString(JsonHelper.safeGetString(jsonObject, "reason", OfflineEvent.Reason.OTHER.name))
return OfflineEvent(
timestamp = timestamp,
duration = durationInMilliseconds ?: T.mins(duration).msecs(),
@ -62,5 +61,3 @@ fun offlineEventFromJson(jsonObject: JSONObject): OfflineEvent? {
it.interfaceIDs.pumpSerial = pumpSerial
}
}

View file

@ -84,7 +84,6 @@ fun profileSwitchFromJson(jsonObject: JSONObject, dateUtil: DateUtil, activePlug
} else pureProfileFromJson(JSONObject(profileJson), dateUtil) ?: return null
val profileSealed = ProfileSealed.Pure(pureProfile)
return ProfileSwitch(
timestamp = timestamp,
basalBlocks = profileSealed.basalBlocks,
@ -155,5 +154,3 @@ fun ProfileSwitch.getCustomizedName(): String {
fun ProfileSwitch.GlucoseUnit.Companion.fromConstant(units: GlucoseUnit): ProfileSwitch.GlucoseUnit =
if (units == GlucoseUnit.MGDL) ProfileSwitch.GlucoseUnit.MGDL
else ProfileSwitch.GlucoseUnit.MMOL

View file

@ -123,5 +123,3 @@ fun List<TherapyEvent>.isTherapyEventEvent5minBack(time: Long): Boolean {
}
return false
}

View file

@ -11,7 +11,6 @@ import javax.inject.Singleton
@Singleton
class WarnColors @Inject constructor(val rh: ResourceHelper) {
fun setColor(view: TextView?, value: Double, warnLevel: Double, urgentLevel: Double) =
view?.setTextColor( rh.gac( view.context ,when {
value >= urgentLevel -> R.attr.urgentColor

View file

@ -14,7 +14,6 @@ class MsgCheckValue_v2(
injector: HasAndroidInjector
) : MessageBase(injector) {
init {
setCommand(0xF0F1)
aapsLogger.debug(LTag.PUMPCOMM, "New message")

View file

@ -7,7 +7,6 @@ class MsgSettingUserOptions(
injector: HasAndroidInjector
) : MessageBase(injector) {
init {
setCommand(0x320B)
aapsLogger.debug(LTag.PUMPCOMM, "New message")

View file

@ -139,7 +139,6 @@ class DiaconnG8Plugin @Inject constructor(
override fun isConnecting(): Boolean = diaconnG8Service?.isConnecting ?: false
override fun isHandshakeInProgress(): Boolean = false
override fun disconnect(reason: String) {
aapsLogger.debug(LTag.PUMP, "Diaconn G8 disconnect from: $reason")
diaconnG8Service?.disconnect(reason)
@ -248,7 +247,6 @@ class DiaconnG8Plugin @Inject constructor(
override val batteryLevel: Int
get() = diaconnG8Pump.systemRemainBattery
@Synchronized
override fun deliverTreatment(detailedBolusInfo: DetailedBolusInfo): PumpEnactResult {
detailedBolusInfo.insulin = constraintChecker.applyBolusConstraints(Constraint(detailedBolusInfo.insulin)).value()

View file

@ -1,6 +1,5 @@
package info.nightscout.androidaps.diaconn
import info.nightscout.androidaps.interfaces.Profile
import info.nightscout.androidaps.interfaces.PumpSync
import info.nightscout.shared.logging.AAPSLogger
@ -54,12 +53,10 @@ class DiaconnG8Pump @Inject constructor(
var basalStep = 0.01
var iob = 0.0
var bolusBlocked = false
var lastBolusTime: Long = 0
var lastBolusAmount = 0.0
/*
* TEMP BASALS
*/
@ -233,7 +230,6 @@ class DiaconnG8Pump @Inject constructor(
var minute = 0 // 분 (0~59)
var second = 0 // 초 (0~59)
// 4. pump system info
var country = 0 // 생산국(K, C), ASCII
var productType = 0 // 제품종류(A ~ Z), ASCII
@ -269,7 +265,6 @@ class DiaconnG8Pump @Inject constructor(
var baseAmount = 0.0 // 주입설정량(량*100, 23.25->2325, 15.2->1520)
var baseInjAmount = 0.0 // 현재주입량(량*100, 23.25->2325, 15.2->1520)
// 9. meal bolus status
var mealKind = 0 // 주입종류(1=아침,2=점심,3=저녁)
var mealStartTime = 0 // 식사주입 시작시간(time_t)
@ -278,14 +273,12 @@ class DiaconnG8Pump @Inject constructor(
var mealInjAmount = 0.0 // 현재주입량(량*100, 23.25->2325, 15.2->1520)
var mealSpeed = 0 // 주입속도(1~8)
// 10. snack bolus status
var snackStatus = 0 // 주입상태(1=주입중,2=주입상태아님)
var snackAmount = 0.0 // 주입설정량(량*100, 23.25->2325, 15.2->1520)
var snackInjAmount = 0.0 // 현재주입량(량*100, 23.25->2325, 15.2->1520)
var snackSpeed = 0 // 주입속도(1~8)
// 11. square(extended) bolus status
var squareStatus = 0 // 주입상태
var squareTime = 0 // 설정 주입시간(10~300분)
@ -293,7 +286,6 @@ class DiaconnG8Pump @Inject constructor(
var squareAmount = 0.0 // 주입 설정량
var squareInjAmount = 0.0 // 현재 주입량
// 12. daul bolus status
var dualStatus = 0 // 주입상태
var dualAmount = 0.0 // 일반주입 설정량
@ -303,7 +295,6 @@ class DiaconnG8Pump @Inject constructor(
var dualSquareAmount = 0.0 // 스퀘어주입 설정량
var dualInjSquareAmount = 0.0 // 스퀘어주입량
// 13. last injection status
var recentKind1 = 0 // 최근-1 주입 종류(1=식사, 2=일반간식, 3=스퀘어회식, 4=더블회식)
var recentTime1 = 0 // 최근-1 주입 시간
@ -312,13 +303,11 @@ class DiaconnG8Pump @Inject constructor(
var recentTime2 = 0 // 최근-2 주입 시간
var recentAmount2 = 0.0 // 최근-2 주입량
// 14. daily injection status
var todayBaseAmount = 0.0 // 기저주입 총량
var todayMealAmount = 0.0 // 식사주입 총량
var todaySnackAmount = 0.0 // 회식주입 총량
// 15. meat setting status
var morningHour = 0 // 아침 개시 시간(0~23)
var morningAmount = 0.0 // 아침 식전량
@ -327,14 +316,12 @@ class DiaconnG8Pump @Inject constructor(
var dinnerHour = 0 // 저녁 개시 시간(0~23)
var dinnerAmount = 0.0 // 저녁 식전량
// 16. basal injection status at this hour
var currentBasePattern = 0 // 패턴 종류 (1=기본, 2=생활1, 3=생활2, 4=생활3, 5=닥터1, 6=닥터2)
var currentBaseHour = 0 // 현재주입시간(0~23)
var currentBaseTbBeforeAmount = 0.0 // 해당시간의 임시기저 계산 전 기저주입량: 기저주입막힘 발생 시 기저주입 막힘량 제외, 기저정지로 인해 주입되지 않은 량 제외, 리셋으로 인해 주입되지 않은 량 제외(47.5=4750)
var currentBaseTbAfterAmount = 0.0 // 해당시간의 임시기저 계산 후 기저주입량: 기저주입막힘 발생 시 기저주입 막힘량 제외, 기저정지로 인해 주입되지 않은 량 제외, 리셋으로 인해 주입되지 않은 량 제외(47.5=4750)
// 17. saved basal pattern status
var baseAmount1 = 0.00// 주입량 1(량*100, 23.25->2325, 15.2->1520)
var baseAmount2 = 0.0// 주입량 2(량*100, 23.25->2325, 15.2->1520)

View file

@ -79,5 +79,4 @@ abstract class DiaconnG8PacketModule {
@ContributesAndroidInjector abstract fun contributesBigAPSMainInfoInquireResponsePacket(): BigAPSMainInfoInquireResponsePacket
}

View file

@ -37,7 +37,6 @@ class AppCancelSettingResponsePacket(
aapsLogger.debug(LTag.PUMPCOMM, "Result --> ${result}")
}
override fun getFriendlyName(): String {
return "PUMP_APP_CANCEL_SETTING_RESPONSE"
}

View file

@ -449,7 +449,6 @@ class BigLogInquireResponsePacket(
aapsLogger.debug(LTag.PUMPCOMM, (if (newRecord) "**NEW** " else "") + "EVENT TUBECHANGE(" + pumplogKind + ") " + dateUtil.dateAndTimeString(logDateTime) + " (" + logDateTime + ")" + " Amount: " + logItem.primeAmount / 100.0 + "U")
}
diaconnG8HistoryRecord.code = RecordTypes.RECORD_TYPE_REFILL
diaconnG8HistoryRecord.timestamp = logDateTime
diaconnG8HistoryRecord.value = logItem.remainAmount / 100.0
@ -549,7 +548,6 @@ class BigLogInquireResponsePacket(
// diaconnG8Pump.serialNo.toString()
// )
status = "DAILYBASAL " + dateUtil.timeString(logDateTime)
}
@ -635,7 +633,6 @@ class BigLogInquireResponsePacket(
pumpSerial = diaconnG8Pump.serialNo.toString())
aapsLogger.debug(LTag.PUMPCOMM, (if (newRecord) "**NEW** " else "") + "EVENT TEMPSTOP (" + pumplogKind + ") " + dateUtil.dateAndTimeString(logDateTime) + " (" + logDateTime + ")")
diaconnG8HistoryRecord.code = RecordTypes.RECORD_TYPE_TB
diaconnG8HistoryRecord.timestamp = logDateTime
diaconnG8HistoryRecord.value = absoluteRate

View file

@ -35,7 +35,6 @@ class DiaconnG8ResponseMessageHashTable @Inject constructor(val injector: HasAnd
put(DisplayTimeInquireResponsePacket(injector))
put(LanguageInquireResponsePacket(injector))
// Report Packet
put(BasalPauseReportPacket(injector))
put(BasalSettingReportPacket(injector))

View file

@ -34,7 +34,6 @@ class DisplayTimeInquireResponsePacket(injector: HasAndroidInjector) : DiaconnG8
diaconnG8Pump.lcdOnTimeSec = getByteToInt(bufferData)
aapsLogger.debug(LTag.PUMPCOMM, "Result --> ${diaconnG8Pump.result}")
aapsLogger.debug(LTag.PUMPCOMM, "lcdOnTimeSec --> ${diaconnG8Pump.lcdOnTimeSec}")
}

View file

@ -33,7 +33,6 @@ class LanguageInquireResponsePacket(injector: HasAndroidInjector) : DiaconnG8Pac
}
diaconnG8Pump.selectedLanguage = getByteToInt(bufferData)
aapsLogger.debug(LTag.PUMPCOMM, "Result --> ${diaconnG8Pump.result}")
aapsLogger.debug(LTag.PUMPCOMM, "selectedLanguage --> ${diaconnG8Pump.selectedLanguage}")
}

View file

@ -35,7 +35,6 @@ class SneckLimitInquireResponsePacket(injector: HasAndroidInjector) : DiaconnG8P
diaconnG8Pump.maxBolus = getShortToInt(bufferData).toDouble() / 100
diaconnG8Pump.maxBolusePerDay = getShortToInt(bufferData).toDouble() / 100
aapsLogger.debug(LTag.PUMPCOMM, "Result --> ${diaconnG8Pump.result}")
aapsLogger.debug(LTag.PUMPCOMM, "maxBolusePerDay --> ${diaconnG8Pump.maxBolusePerDay}")
aapsLogger.debug(LTag.PUMPCOMM, "maxBolus --> ${diaconnG8Pump.maxBolus}")

View file

@ -35,7 +35,6 @@ class SoundInquireResponsePacket(injector: HasAndroidInjector) : DiaconnG8Packet
diaconnG8Pump.beepAndAlarm = getByteToInt(bufferData) -1
diaconnG8Pump.alarmIntesity = getByteToInt(bufferData) -1
aapsLogger.debug(LTag.PUMPCOMM, "Result --> ${diaconnG8Pump.result}")
aapsLogger.debug(LTag.PUMPCOMM, "beepAndAlarm --> ${diaconnG8Pump.beepAndAlarm}")
aapsLogger.debug(LTag.PUMPCOMM, "alarmIntesity --> ${diaconnG8Pump.alarmIntesity}")

View file

@ -48,7 +48,6 @@ class BLECommonService @Inject internal constructor(
private var connectDeviceName: String? = null
private var bluetoothGatt: BluetoothGatt? = null
var isConnected = false
var isConnecting = false
private var uartIndicate: BluetoothGattCharacteristic? = null

View file

@ -534,7 +534,6 @@ class MedtronicCommunicationManager // This empty constructor must be kept, oth
errorResponse = check
}
aapsLogger.debug(LTag.PUMPCOMM, "End Response: {}", ByteUtil.getHex(data))
val basalProfile: BasalProfile? = medtronicConverter.decodeBasalProfile(medtronicPumpPlugin.pumpDescription.pumpType, data)

View file

@ -641,7 +641,6 @@ class MedtronicHistoryData @Inject constructor(
"pumpId=${tempBasalProcessDTO.pumpId}, pumpType=${medtronicPumpStatus.pumpType}, " +
"pumpSerial=${medtronicPumpStatus.serialNumber}]")
if (tempBasalProcessDTO.durationAsSeconds <= 0) {
rxBus.send(EventNewNotification(Notification(Notification.MDT_INVALID_HISTORY_DATA, rh.gs(R.string.invalid_history_data), Notification.URGENT)))
aapsLogger.debug(LTag.PUMP, "syncTemporaryBasalWithPumpId - Skipped")
@ -799,7 +798,6 @@ class MedtronicHistoryData @Inject constructor(
return processList
}
fun isTBRActive(dbEntry: PumpDbEntryTBR): Boolean {
return isTBRActive(
startTimestamp = dbEntry.date,

View file

@ -64,5 +64,4 @@ class BasalProfileEntry {
startTime = LocalTime(startTimeByte / 2, startTimeByte % 2 * 30)
}
}

View file

@ -16,7 +16,6 @@ class BatteryStatusDTO {
var extendedDataReceived = false
fun getCalculatedPercent(batteryType: BatteryType): Int {
if (voltage == null || batteryType === BatteryType.None) {
return if (batteryStatusType == BatteryStatusType.Low || batteryStatusType == BatteryStatusType.Unknown) 18 else 70
@ -28,7 +27,6 @@ class BatteryStatusDTO {
return percentInt
}
override fun toString(): String {
return String.format(Locale.ENGLISH, "BatteryStatusDTO [voltage=%.2f, alkaline=%d, lithium=%d, niZn=%d, nimh=%d]",
if (voltage == null) 0.0f else voltage,

View file

@ -21,7 +21,6 @@ class BolusWizardDTO : PumpTimeStampedRecord() {
var foodEstimate = 0.0f
var unabsorbedInsulin = 0.0f//
val value: String
get() = String.format(Locale.ENGLISH, "BG=%d;CH=%d;CH_UNIT=%s;CH_INS_RATIO=%5.3f;BG_INS_RATIO=%5.3f;"
+ "BG_TARGET_LOW=%d;BG_TARGET_HIGH=%d;BOLUS_TOTAL=%5.3f;"

View file

@ -62,7 +62,6 @@ class MedtronicPumpHistoryDecoderUTest : TestBase() {
}
// @Test
public void decodeLowAmount() {
byte[] data = new byte[] { 52, -12, 22, -81, 46, 3, 19 };
@ -81,7 +80,6 @@ class MedtronicPumpHistoryDecoderUTest : TestBase() {
}
// @Test
public void decodeDailyTotals522() {
// PumpHistoryRecord [type=DailyTotals522 [109, 0x6D], DT: 01.11.2018 00:00:00, length=1,2,41(44), data={Raw
@ -105,7 +103,6 @@ class MedtronicPumpHistoryDecoderUTest : TestBase() {
}
// @Test
public void decodeDailyTotals515() {
@ -126,7 +123,6 @@ class MedtronicPumpHistoryDecoderUTest : TestBase() {
}
// @Test
public void decodeDailyTotals523() {
@ -149,7 +145,6 @@ class MedtronicPumpHistoryDecoderUTest : TestBase() {
}
private void testRecord(byte[] data) {
// byte[] data = new byte[] { 0x07, 0x00, 0x00, 0x05, (byte)0xFA, (byte)0xBF, 0x12 };

View file

@ -34,7 +34,6 @@ class MedtronicHistoryDataUTest : TestBase() {
@Mock lateinit var rh: ResourceHelper
@Mock lateinit var rxBus: RxBus
private val packetInjector = HasAndroidInjector {
AndroidInjector {
@ -42,7 +41,6 @@ class MedtronicHistoryDataUTest : TestBase() {
}
@Test
fun createTBRProcessList() {
@ -52,7 +50,6 @@ class MedtronicHistoryDataUTest : TestBase() {
pumpSync,
pumpSyncStorage)
val gson = Gson()
val fileText = ClassLoader.getSystemResource("tbr_data.json").readText()
@ -85,7 +82,6 @@ class MedtronicHistoryDataUTest : TestBase() {
}
@Test
fun createTBRProcessList_SpecialCase() {
@ -95,7 +91,6 @@ class MedtronicHistoryDataUTest : TestBase() {
pumpSync,
pumpSyncStorage)
val gson = Gson()
val fileText = ClassLoader.getSystemResource("tbr_data_special.json").readText()
@ -128,5 +123,4 @@ class MedtronicHistoryDataUTest : TestBase() {
}
}

View file

@ -74,5 +74,3 @@ abstract class OmnipodWizardModule {
internal abstract fun contributesPodDiscardedFragment(): PodDiscardedFragment
}

View file

@ -40,7 +40,6 @@ import info.nightscout.androidaps.plugins.pump.common.defs.PumpType
//
// }
interface PumpDbEntry {
var temporaryId: Long
var date: Long
@ -50,7 +49,6 @@ interface PumpDbEntry {
}
data class PumpDbEntryBolus(override var temporaryId: Long,
override var date: Long,
override var pumpType: PumpType,

View file

@ -144,7 +144,6 @@ class RileyLinkBLEConfigActivity : DaggerAppCompatActivity() {
}
}
override fun onOptionsItemSelected(item: MenuItem): Boolean =
when (item.itemId) {
android.R.id.home -> {
@ -304,4 +303,5 @@ class RileyLinkBLEConfigActivity : DaggerAppCompatActivity() {
private const val SCAN_PERIOD_MILLIS: Long = 15000
}
}