Constants -> kt
This commit is contained in:
parent
dad81a7322
commit
bce36033b5
2 changed files with 104 additions and 110 deletions
|
@ -1,110 +0,0 @@
|
||||||
package info.nightscout.androidaps;
|
|
||||||
|
|
||||||
import info.nightscout.androidaps.database.entities.ValueWithUnit;
|
|
||||||
import info.nightscout.androidaps.utils.T;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by mike on 07.06.2016.
|
|
||||||
*/
|
|
||||||
public class Constants {
|
|
||||||
public static final String MGDL = ValueWithUnit.MGDL; // This is Nightscout's representation
|
|
||||||
public static final String MMOL = ValueWithUnit.MMOL;
|
|
||||||
|
|
||||||
public static final double MMOLL_TO_MGDL = 18; // 18.0182;
|
|
||||||
public static final double MGDL_TO_MMOLL = 1 / MMOLL_TO_MGDL;
|
|
||||||
|
|
||||||
public static final double defaultDIA = 5d;
|
|
||||||
|
|
||||||
public static final Double REALLYHIGHBASALRATE = 1111111d;
|
|
||||||
public static final Integer REALLYHIGHPERCENTBASALRATE = 1111111;
|
|
||||||
public static final double REALLYHIGHBOLUS = 1111111d;
|
|
||||||
public static final Integer REALLYHIGHCARBS = 1111111;
|
|
||||||
public static final double REALLYHIGHIOB = 1111111d;
|
|
||||||
|
|
||||||
public static final Integer notificationID = 556677;
|
|
||||||
|
|
||||||
// SMS COMMUNICATOR
|
|
||||||
public static final long remoteBolusMinDistance = 15 * 60 * 1000L;
|
|
||||||
|
|
||||||
// Circadian Percentage Profile
|
|
||||||
public static final int CPP_MIN_PERCENTAGE = 30;
|
|
||||||
public static final int CPP_MAX_PERCENTAGE = 250;
|
|
||||||
public static final int CPP_MIN_TIMESHIFT = -6;
|
|
||||||
public static final int CPP_MAX_TIMESHIFT = 23;
|
|
||||||
|
|
||||||
public static final double MAX_PROFILE_SWITCH_DURATION = 7 * 24 * 60; // [min] ~ 7 days
|
|
||||||
|
|
||||||
//DanaR
|
|
||||||
public static final double dailyLimitWarning = 0.95d;
|
|
||||||
|
|
||||||
// Temp targets
|
|
||||||
public static final int defaultActivityTTDuration = 90; // min
|
|
||||||
public static final double defaultActivityTTmgdl = 140d;
|
|
||||||
public static final double defaultActivityTTmmol = 8d;
|
|
||||||
public static final int defaultEatingSoonTTDuration = 45; // min
|
|
||||||
public static final double defaultEatingSoonTTmgdl = 90d;
|
|
||||||
public static final double defaultEatingSoonTTmmol = 5d;
|
|
||||||
public static final int defaultHypoTTDuration = 60; // min
|
|
||||||
public static final double defaultHypoTTmgdl = 160d;
|
|
||||||
public static final double defaultHypoTTmmol = 8d;
|
|
||||||
|
|
||||||
public static final double MIN_TT_MGDL = 72d;
|
|
||||||
public static final double MAX_TT_MGDL = 180d;
|
|
||||||
public static final double MIN_TT_MMOL = 4d;
|
|
||||||
public static final double MAX_TT_MMOL = 10d;
|
|
||||||
|
|
||||||
//NSClientInternal
|
|
||||||
public static final int MAX_LOG_LINES = 30;
|
|
||||||
|
|
||||||
//Screen: Threshold for width/height to go into small width/height layout
|
|
||||||
public static final int SMALL_WIDTH = 320;
|
|
||||||
public static final int SMALL_HEIGHT = 480;
|
|
||||||
|
|
||||||
//Autosens
|
|
||||||
public static final double DEVIATION_TO_BE_EQUAL = 2.0;
|
|
||||||
public static final double DEFAULT_MAX_ABSORPTION_TIME = 6.0;
|
|
||||||
|
|
||||||
// Pump
|
|
||||||
public static final int PUMP_MAX_CONNECTION_TIME_IN_SECONDS = 120 - 1;
|
|
||||||
public static final int MIN_WATCHDOG_INTERVAL_IN_SECONDS = 12 * 60;
|
|
||||||
|
|
||||||
//SMS Communicator
|
|
||||||
public static final long SMS_CONFIRM_TIMEOUT = T.Companion.mins(5L).msecs();
|
|
||||||
|
|
||||||
//Storage [MB]
|
|
||||||
public static final long MINIMUM_FREE_SPACE = 200;
|
|
||||||
|
|
||||||
// Overview
|
|
||||||
public static final double LOWMARK = 76.0;
|
|
||||||
public static final double HIGHMARK = 180.0;
|
|
||||||
|
|
||||||
// STATISTICS
|
|
||||||
public static final double STATS_TARGET_LOW_MMOL = 3.9;
|
|
||||||
public static final double STATS_TARGET_HIGH_MMOL = 7.8;
|
|
||||||
public static final double STATS_RANGE_LOW_MMOL = 3.9;
|
|
||||||
public static final double STATS_RANGE_HIGH_MMOL = 10.0;
|
|
||||||
|
|
||||||
// Local profile
|
|
||||||
public static final String LOCAL_PROFILE = "LocalProfile";
|
|
||||||
|
|
||||||
// Local Alerts
|
|
||||||
public static final int DEFAULT_PUMP_UNREACHABLE_THRESHOLD_MINUTES = 30;
|
|
||||||
public static final int DEFAULT_MISSED_BG_READINGS_THRESHOLD_MINUTES = 30;
|
|
||||||
|
|
||||||
// One Time Password
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Size of generated key for TOTP Authenticator token, in bits
|
|
||||||
* rfc6238 suggest at least 160 for SHA1 based TOTP, but it ts too weak
|
|
||||||
* with 512 generated QRCode to provision authenticator is too detailed
|
|
||||||
* 256 is chosen as both secure enough and small enough for easy-scannable QRCode
|
|
||||||
*/
|
|
||||||
public static final int OTP_GENERATED_KEY_LENGTH_BITS = 256;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* How many old TOTP tokens still accept.
|
|
||||||
* Each token is 30s valid, but copying and SMS transmission of it can take additional seconds,
|
|
||||||
* so we add leeway to still accept given amount of older tokens
|
|
||||||
*/
|
|
||||||
public static final int OTP_ACCEPT_OLD_TOKENS_COUNT = 1;
|
|
||||||
}
|
|
104
core/src/main/java/info/nightscout/androidaps/Constants.kt
Normal file
104
core/src/main/java/info/nightscout/androidaps/Constants.kt
Normal file
|
@ -0,0 +1,104 @@
|
||||||
|
package info.nightscout.androidaps
|
||||||
|
|
||||||
|
import info.nightscout.androidaps.database.entities.ValueWithUnit
|
||||||
|
import info.nightscout.androidaps.utils.T.Companion.mins
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by mike on 07.06.2016.
|
||||||
|
*/
|
||||||
|
object Constants {
|
||||||
|
|
||||||
|
const val MGDL = ValueWithUnit.MGDL // This is Nightscout's representation
|
||||||
|
const val MMOL = ValueWithUnit.MMOL
|
||||||
|
const val MMOLL_TO_MGDL = 18.0 // 18.0182;
|
||||||
|
const val MGDL_TO_MMOLL = 1 / MMOLL_TO_MGDL
|
||||||
|
const val defaultDIA = 5.0
|
||||||
|
const val REALLYHIGHBASALRATE = 1111111.0
|
||||||
|
const val REALLYHIGHPERCENTBASALRATE = 1111111
|
||||||
|
const val REALLYHIGHBOLUS = 1111111.0
|
||||||
|
const val REALLYHIGHCARBS = 1111111
|
||||||
|
const val REALLYHIGHIOB = 1111111.0
|
||||||
|
const val notificationID = 556677
|
||||||
|
|
||||||
|
// SMS COMMUNICATOR
|
||||||
|
const val remoteBolusMinDistance = 15 * 60 * 1000L
|
||||||
|
|
||||||
|
// Circadian Percentage Profile
|
||||||
|
const val CPP_MIN_PERCENTAGE = 30
|
||||||
|
const val CPP_MAX_PERCENTAGE = 250
|
||||||
|
const val CPP_MIN_TIMESHIFT = -6
|
||||||
|
const val CPP_MAX_TIMESHIFT = 23
|
||||||
|
const val MAX_PROFILE_SWITCH_DURATION = (7 * 24 * 60 // [min] ~ 7 days
|
||||||
|
).toDouble()
|
||||||
|
|
||||||
|
//DanaR
|
||||||
|
const val dailyLimitWarning = 0.95
|
||||||
|
|
||||||
|
// Temp targets
|
||||||
|
const val defaultActivityTTDuration = 90 // min
|
||||||
|
const val defaultActivityTTmgdl = 140.0
|
||||||
|
const val defaultActivityTTmmol = 8.0
|
||||||
|
const val defaultEatingSoonTTDuration = 45 // min
|
||||||
|
const val defaultEatingSoonTTmgdl = 90.0
|
||||||
|
const val defaultEatingSoonTTmmol = 5.0
|
||||||
|
const val defaultHypoTTDuration = 60 // min
|
||||||
|
const val defaultHypoTTmgdl = 160.0
|
||||||
|
const val defaultHypoTTmmol = 8.0
|
||||||
|
const val MIN_TT_MGDL = 72.0
|
||||||
|
const val MAX_TT_MGDL = 180.0
|
||||||
|
const val MIN_TT_MMOL = 4.0
|
||||||
|
const val MAX_TT_MMOL = 10.0
|
||||||
|
|
||||||
|
//NSClientInternal
|
||||||
|
const val MAX_LOG_LINES = 30
|
||||||
|
|
||||||
|
//Screen: Threshold for width/height to go into small width/height layout
|
||||||
|
const val SMALL_WIDTH = 320
|
||||||
|
const val SMALL_HEIGHT = 480
|
||||||
|
|
||||||
|
//Autosens
|
||||||
|
const val DEVIATION_TO_BE_EQUAL = 2.0
|
||||||
|
const val DEFAULT_MAX_ABSORPTION_TIME = 6.0
|
||||||
|
|
||||||
|
// Pump
|
||||||
|
const val PUMP_MAX_CONNECTION_TIME_IN_SECONDS = 120 - 1
|
||||||
|
const val MIN_WATCHDOG_INTERVAL_IN_SECONDS = 12 * 60
|
||||||
|
|
||||||
|
//SMS Communicator
|
||||||
|
val SMS_CONFIRM_TIMEOUT = mins(5L).msecs()
|
||||||
|
|
||||||
|
//Storage [MB]
|
||||||
|
const val MINIMUM_FREE_SPACE: Long = 200
|
||||||
|
|
||||||
|
// Overview
|
||||||
|
const val LOWMARK = 76.0
|
||||||
|
const val HIGHMARK = 180.0
|
||||||
|
|
||||||
|
// STATISTICS
|
||||||
|
const val STATS_TARGET_LOW_MMOL = 3.9
|
||||||
|
const val STATS_TARGET_HIGH_MMOL = 7.8
|
||||||
|
const val STATS_RANGE_LOW_MMOL = 3.9
|
||||||
|
const val STATS_RANGE_HIGH_MMOL = 10.0
|
||||||
|
|
||||||
|
// Local profile
|
||||||
|
const val LOCAL_PROFILE = "LocalProfile"
|
||||||
|
|
||||||
|
// Local Alerts
|
||||||
|
const val DEFAULT_PUMP_UNREACHABLE_THRESHOLD_MINUTES = 30
|
||||||
|
const val DEFAULT_MISSED_BG_READINGS_THRESHOLD_MINUTES = 30
|
||||||
|
// One Time Password
|
||||||
|
/**
|
||||||
|
* Size of generated key for TOTP Authenticator token, in bits
|
||||||
|
* rfc6238 suggest at least 160 for SHA1 based TOTP, but it ts too weak
|
||||||
|
* with 512 generated QRCode to provision authenticator is too detailed
|
||||||
|
* 256 is chosen as both secure enough and small enough for easy-scannable QRCode
|
||||||
|
*/
|
||||||
|
const val OTP_GENERATED_KEY_LENGTH_BITS = 256
|
||||||
|
|
||||||
|
/**
|
||||||
|
* How many old TOTP tokens still accept.
|
||||||
|
* Each token is 30s valid, but copying and SMS transmission of it can take additional seconds,
|
||||||
|
* so we add leeway to still accept given amount of older tokens
|
||||||
|
*/
|
||||||
|
const val OTP_ACCEPT_OLD_TOKENS_COUNT = 1
|
||||||
|
}
|
Loading…
Reference in a new issue