Merge pull request #18 from MilosKozak/master

update from milos master
This commit is contained in:
AdrianLxM 2016-11-21 23:57:51 +01:00 committed by GitHub
commit 9e47b9aeb8
6 changed files with 58 additions and 11 deletions

View file

@ -6,7 +6,7 @@
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- daily rollover. Make sure the path matches the one in the file element or else
the rollover logs are placed in the working directory. -->
<fileNamePattern>${EXT_FILES_DIR}/AndroidAPS._%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<fileNamePattern>${EXT_FILES_DIR}/AndroidAPS._%d{yyyy-MM-dd}.%i.zip</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>5MB</maxFileSize>

View file

@ -242,6 +242,9 @@ public class CircadianPercentageProfileFragment extends Fragment implements Frag
sb.append("</h3>");
sb.append("<h4>");
sb.append(getString(R.string.nsprofileview_basal_label));
sb.append( " ( ∑");
sb.append(DecimalFormatter.to2Decimal(circadianPercentageProfilePlugin.percentageBasalSum()));
sb.append("U )");
sb.append("</h4> " + circadianPercentageProfilePlugin.basalString());
sb.append("<h4>");
sb.append(getString(R.string.nsprofileview_ic_label));
@ -251,7 +254,7 @@ public class CircadianPercentageProfileFragment extends Fragment implements Frag
sb.append("</h4> " + circadianPercentageProfilePlugin.isfString());
profileView.setText(Html.fromHtml(sb.toString()));
baseprofileBasal.setText(Html.fromHtml("<h3>" + getString(R.string.base_profile_label) + "</h3>" +
baseprofileBasal.setText(Html.fromHtml("<h3>" + getString(R.string.base_profile_label) + " ( ∑" + DecimalFormatter.to2Decimal(circadianPercentageProfilePlugin.baseBasalSum()) + "U )</h3>" +
"<h4>" + getString(R.string.nsprofileview_basal_label) + "</h4>" + circadianPercentageProfilePlugin.baseBasalString()));
baseprofileIC.setText(Html.fromHtml("<h4>" + getString(R.string.nsprofileview_ic_label) + "</h4>" + circadianPercentageProfilePlugin.baseIcString()));
baseprofileISF.setText(Html.fromHtml("<h4>" + getString(R.string.nsprofileview_isf_label) + "</h4>" + circadianPercentageProfilePlugin.baseIsfString()));

View file

@ -207,11 +207,7 @@ public class CircadianPercentageProfilePlugin implements PluginBase, ProfileInte
JSONObject profile = new JSONObject();
StringBuilder stringBuilder = new StringBuilder();
double sum = 0d;
for (int i = 0; i < 24; i++) {
sum += basebasal[i];
}
stringBuilder.append(DecimalFormatter.to2Decimal(sum));
stringBuilder.append(DecimalFormatter.to2Decimal(sum(basebasal)));
stringBuilder.append("U@");
stringBuilder.append(percentage);
stringBuilder.append("%>");
@ -298,6 +294,27 @@ public class CircadianPercentageProfilePlugin implements PluginBase, ProfileInte
String baseBasalString() {return profileString(basebasal, 0, 100, true);}
public double baseBasalSum(){
return sum(basebasal);
}
public double percentageBasalSum(){
double result = 0;
for (int i = 0; i < basebasal.length; i++) {
result += SafeParse.stringToDouble(DecimalFormatter.to2Decimal(basebasal[i] * percentage / 100d));
}
return result;
}
public static double sum(double values[]){
double result = 0;
for (int i = 0; i < values.length; i++) {
result += values[i];
}
return result;
}
private static String profileString(double[] values, int timeshift, int percentage, boolean inc) {
timeshift = -(timeshift % 24) + 24;

View file

@ -54,11 +54,10 @@ public class BolusProgressDialog extends DialogFragment implements View.OnClickL
statusView = (TextView) view.findViewById(R.id.overview_bolusprogress_status);
stopPressedView = (TextView) view.findViewById(R.id.overview_bolusprogress_stoppressed);
progressBar = (ProgressBar) view.findViewById(R.id.overview_bolusprogress_progressbar);
stopButton.setOnClickListener(this);
progressBar.setMax(100);
statusView.setText(MainApp.sResources.getString(R.string.waitingforpump));
setCancelable(false);
return view;
}

View file

@ -199,7 +199,7 @@ public class WizardDialog extends DialogFragment implements OnClickListener {
confirmMessage += "\n" + getString(R.string.bolus) + ": " + formatNumber2decimalplaces.format(insulinAfterConstraints) + "U";
confirmMessage += "\n" + getString(R.string.carbs) + ": " + carbsAfterConstraints + "g";
if (insulinAfterConstraints - calculatedTotalInsulin != 0 || carbsAfterConstraints != calculatedCarbs) {
if (insulinAfterConstraints - calculatedTotalInsulin != 0 || !carbsAfterConstraints.equals(calculatedCarbs)) {
AlertDialog.Builder builder = new AlertDialog.Builder(parentContext);
builder.setTitle(MainApp.sResources.getString(R.string.treatmentdeliveryerror));
builder.setMessage(getString(R.string.constraints_violation) + "\n" + getString(R.string.changeyourinput));

View file

@ -306,7 +306,7 @@
<string name="overview_editquickwizard_valid">Валидно:</string>
<string name="overview_editquickwizardlistactivity_add">Добави</string>
<string name="overview_quickwizard_item_edit_button">Редактирай</string>
<string name="overview_quickwizard_item_remove_button">Прехахни</string>
<string name="overview_quickwizard_item_remove_button">Премахни</string>
<string name="quickwizard">Бърз болус</string>
<string name="quickwizardsettings">Настройки за бърз болус</string>
<string name="remotebasalnotallowed">Не са позволени отдалечени настройки</string>
@ -323,4 +323,32 @@
<string name="smscommunicator_tempbasalset" formatted="false">Temp basal %.2fU/h for %d min started successfully</string>
<string name="smscommunicator_unknowncommand">Uknonwn command or wrong reply</string>
<string name="mealbolus">Болус за хранене</string>
<string name="actions">Действия</string>
<string name="androidaps_start">Стартиран AndroidAPS</string>
<string name="base_profile_label">Базов профил</string>
<string name="button1">Бутон 1</string>
<string name="button2">Бутон 2</string>
<string name="button3">Бутон 3</string>
<string name="circadian_percentage_profile">Процентен профил</string>
<string name="send_to_pump">Изпрати към помпата</string>
<string name="edit_base_basal">Редактирай базални стойности</string>
<string name="dia">"DIA "</string>
<string name="edit_base_ic">Редактирай Инс./ВХ</string>
<string name="edit_base_isf">Редактирай Инс. чувствителност</string>
<string name="fillbolus_title">Fill/Prime стандарта стойност</string>
<string name="fillwarning">Моля, уверете се, че стойността съответсва на вашият сет! Този инсулин не се включва в IOB!</string>
<string name="mgdl">mg/dl</string>
<string name="mmol">mmol/l</string>
<string name="othersettings_title">Друго:</string>
<string name="percentagefactor_hint">% с който базовият профил ще бъде променен.</string>
<string name="primefill">Prime/Fill</string>
<string name="pumpNotInitialized">Помпата не е инициализирана!</string>
<string name="reset_db_confirm">Наистина ли искате да нулиратe базата данни?</string>
<string name="target_range">Целеви диапазон:</string>
<string name="timeshift_hint">Брой часове, с които ще бъде преместен профила!</string>
<string name="units">Мерни единици:</string>
<string name="ns_upload_only">NS upload only (изключва синхронизацията)</string>
<string name="ns_upload_only_enabled">Моля изключете "NS upload only" за да използвате това.</string>
<string name="ns_upload_only_summary">NS upload only. Not effective on SGV unless a local source like xDrip is selected. Not effective on Profiles while NS-Profiles is used.</string>
<string name="absorption_rate">Усвояване на ВХ (ч):</string>
</resources>