diff --git a/README.md b/README.md index 60024b7..8711c9b 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,39 @@ It shows the estimated energy production for the next hours and up to 16 days. +## Parameters + +#### Latitude [°] +Latitude specifies the north–south position of your solar power plant. It ranges from –90° at the south pole to 90° at the north pole. + +#### Longitude [°] +Longitude specifies the east–west position of your solar power plant. The prime meridian defines 0° longitude. Positive longitudes are east of the prime meridian, negative ones are west. + +#### Azimuth [°] +Azimuth is the horizontal direction of your solar power plant. 0° equals North, 90° equals East, 180° equals South, 270° equals West. + +#### Tilt [°] +Tilt is the vertical direction of your solar power plant. 0° means it points up towards the the sky, 90° means it has a vertical orientation and points towards the horizon. + +#### Cells max power [W] +Maximum power your solar cells can deliver. + +#### Cells efficiency [%] +Portion of energy in the form of sunlight that can be converted into electricity by the solar cell. + +#### Cell area [m\u00b2] +Size of the active area your solar panel. + +#### Diffuse radiation efficiency [%] +Efficiency of your solar power plant for diffuse radiation. When pointing up it should be around 100%, when pointing to the horizon it may be around 50%. +Also depends on reflections etc. + +#### Inverter power [W] +Maximum power of your inverter. If it is lower than the maximum power of your panels the output power of your system will be limited by this parameter. + +#### Inverter efficiency [%] +Efficiency of your inverter. + ## License This app is licensed under the GPLv3. diff --git a/app/src/main/java/org/woheller69/weather/SolarPowerPlant.java b/app/src/main/java/org/woheller69/weather/SolarPowerPlant.java index 6f4b7c3..c90dd57 100644 --- a/app/src/main/java/org/woheller69/weather/SolarPowerPlant.java +++ b/app/src/main/java/org/woheller69/weather/SolarPowerPlant.java @@ -15,22 +15,22 @@ public class SolarPowerPlant { double cellsArea; double cellsEfficiency; double diffuseEfficiency; - double converterPowerLimit; - double converterEfficiency; + double inverterPowerLimit; + double inverterEfficiency; double azimuthAngle; - double elevationAngle; + double tiltAngle; - public SolarPowerPlant(double latitude, double longitude, double cellsMaxPower, double cellsArea, double cellsEfficiency, double diffuseEfficiency, double converterPowerLimit, double converterEfficiency, double azimuthAngle, double elevationAngle) { + public SolarPowerPlant(double latitude, double longitude, double cellsMaxPower, double cellsArea, double cellsEfficiency, double diffuseEfficiency, double inverterPowerLimit, double inverterEfficiency, double azimuthAngle, double tiltAngle) { this.latitude = latitude; this.longitude = longitude; this.cellsMaxPower = cellsMaxPower; this.cellsArea = cellsArea; this.cellsEfficiency = cellsEfficiency / 100; this.diffuseEfficiency = diffuseEfficiency / 100; - this.converterPowerLimit = converterPowerLimit; - this.converterEfficiency = converterEfficiency / 100; + this.inverterPowerLimit = inverterPowerLimit; + this.inverterEfficiency = inverterEfficiency / 100; this.azimuthAngle = azimuthAngle; - this.elevationAngle = elevationAngle; + this.tiltAngle = tiltAngle; } @@ -48,7 +48,7 @@ public class SolarPowerPlant { double solarElevation = 90 - position.getZenithAngle(); Double[] directionSun = {Math.sin(solarAzimuth / 180 * Math.PI) * Math.cos(solarElevation / 180 * Math.PI), Math.cos(solarAzimuth / 180 * Math.PI) * Math.cos(solarElevation / 180 * Math.PI), Math.sin(solarElevation / 180 * Math.PI)}; - Double[] normalPanel = {Math.sin(azimuthAngle / 180 * Math.PI) * Math.cos((90 - elevationAngle) / 180 * Math.PI), Math.cos(azimuthAngle / 180 * Math.PI) * Math.cos((90 - elevationAngle) / 180 * Math.PI), Math.sin((90 - elevationAngle) / 180 * Math.PI)}; + Double[] normalPanel = {Math.sin(azimuthAngle / 180 * Math.PI) * Math.cos((90 - tiltAngle) / 180 * Math.PI), Math.cos(azimuthAngle / 180 * Math.PI) * Math.cos((90 - tiltAngle) / 180 * Math.PI), Math.sin((90 - tiltAngle) / 180 * Math.PI)}; double efficiency = 0; //calculate scalar product of sunDirection and normalPanel vectors for (int j = 0; j < directionSun.length; j++) { @@ -61,7 +61,7 @@ public class SolarPowerPlant { double dcPower = (solarPowerNormal * efficiency + solarPowerDiffuse * diffuseEfficiency )* cellsEfficiency * cellsArea; - double acPower = Math.min(dcPower * converterEfficiency, converterPowerLimit); + double acPower = Math.min(dcPower * inverterEfficiency, inverterPowerLimit); return (float) acPower; } diff --git a/app/src/main/java/org/woheller69/weather/activities/ManageLocationsActivity.java b/app/src/main/java/org/woheller69/weather/activities/ManageLocationsActivity.java index 42adf6b..e3b1cc0 100644 --- a/app/src/main/java/org/woheller69/weather/activities/ManageLocationsActivity.java +++ b/app/src/main/java/org/woheller69/weather/activities/ManageLocationsActivity.java @@ -122,26 +122,26 @@ public class ManageLocationsActivity extends NavigationActivity { EditText editLongitude = (EditText) dialogView.findViewById(R.id.EditLocation_Lon); EditText editCity = (EditText) dialogView.findViewById(R.id.EditLocation_Name); EditText editAzimuth = (EditText) dialogView.findViewById(R.id.EditLocation_Azimuth); - EditText editElevation = (EditText) dialogView.findViewById(R.id.EditLocation_Elevation); + EditText editTilt = (EditText) dialogView.findViewById(R.id.EditLocation_Tilt); EditText editCellsMaxPower = (EditText) dialogView.findViewById(R.id.EditLocation_Cell_Max_Power); EditText editCellsArea = (EditText) dialogView.findViewById(R.id.EditLocation_Cells_Area); EditText editCellsEfficiency = (EditText) dialogView.findViewById(R.id.EditLocation_Cell_Efficiency); EditText editDiffuseEfficiency = (EditText) dialogView.findViewById(R.id.EditLocation_Diffuse_Efficiency); - EditText editConverterPowerLimit = (EditText) dialogView.findViewById(R.id.EditLocation_Converter_Power_Limit); - EditText editConverterEfficiency = (EditText) dialogView.findViewById(R.id.EditLocation_Converter_Efficiency); + EditText editInverterPowerLimit = (EditText) dialogView.findViewById(R.id.EditLocation_Inverter_Power_Limit); + EditText editInverterEfficiency = (EditText) dialogView.findViewById(R.id.EditLocation_Inverter_Efficiency); editCity.setText(city.getCityName()); editLatitude.setText(Float.toString(city.getLatitude())); editLongitude.setText(Float.toString(city.getLongitude())); editAzimuth.setText(Float.toString(city.getAzimuthAngle())); - editElevation.setText(Float.toString(city.getElevationAngle())); + editTilt.setText(Float.toString(city.getTiltAngle())); editCellsMaxPower.setText(Float.toString(city.getCellsMaxPower())); editCellsArea.setText(Float.toString(city.getCellsArea())); editCellsEfficiency.setText(Float.toString(city.getCellsEfficiency())); editDiffuseEfficiency.setText(Float.toString(city.getDiffuseEfficiency())); - editConverterPowerLimit.setText(Float.toString(city.getConverterPowerLimit())); - editConverterEfficiency.setText(Float.toString(city.getConverterEfficiency())); - editElevation.addTextChangedListener(new TextWatcher() { + editInverterPowerLimit.setText(Float.toString(city.getInverterPowerLimit())); + editInverterEfficiency.setText(Float.toString(city.getInverterEfficiency())); + editTilt.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { } @Override @@ -149,8 +149,8 @@ public class ManageLocationsActivity extends NavigationActivity { @Override public void afterTextChanged(Editable editable) { - float elevation = Float.parseFloat("0"+editElevation.getText().toString()); - int diffuseEfficiency = (int) (100-50 * elevation/90); + float tilt = Float.parseFloat("0"+editTilt.getText().toString()); + int diffuseEfficiency = (int) (100-50 * tilt/90); editDiffuseEfficiency.setText(Float.toString((float) diffuseEfficiency)); } }); @@ -160,13 +160,13 @@ public class ManageLocationsActivity extends NavigationActivity { Float.parseFloat("0"+editLatitude.getText().toString()), Float.parseFloat("0"+editLongitude.getText().toString()), Float.parseFloat("0"+editAzimuth.getText().toString()), - Float.parseFloat("0"+editElevation.getText().toString()), + Float.parseFloat("0"+editTilt.getText().toString()), Float.parseFloat("0"+editCellsMaxPower.getText().toString()), Float.parseFloat("0"+editCellsArea.getText().toString()), Float.parseFloat("0"+editCellsEfficiency.getText().toString()), Float.parseFloat("0"+editDiffuseEfficiency.getText().toString()), - Float.parseFloat("0"+editConverterPowerLimit.getText().toString()), - Float.parseFloat("0"+editConverterEfficiency.getText().toString()) + Float.parseFloat("0"+editInverterPowerLimit.getText().toString()), + Float.parseFloat("0"+editInverterEfficiency.getText().toString()) ); }); alert.setNegativeButton(getString(R.string.dialog_add_close_button), (dialog, whichButton) -> { diff --git a/app/src/main/java/org/woheller69/weather/database/CityToWatch.java b/app/src/main/java/org/woheller69/weather/database/CityToWatch.java index 2d0a5e0..506fb19 100644 --- a/app/src/main/java/org/woheller69/weather/database/CityToWatch.java +++ b/app/src/main/java/org/woheller69/weather/database/CityToWatch.java @@ -16,10 +16,10 @@ public class CityToWatch { private float cellsArea; private float cellsEfficiency; private float diffuseEfficiency; - private float converterPowerLimit; - private float converterEfficiency; + private float inverterPowerLimit; + private float inverterEfficiency; private float azimuthAngle; - private float elevationAngle; + private float tiltAngle; private int rank; public CityToWatch() { @@ -36,10 +36,10 @@ public class CityToWatch { this.cellsArea=3.18f; this.cellsEfficiency=19.3f; this.diffuseEfficiency=40; - this.converterPowerLimit=600; - this.converterEfficiency=95; + this.inverterPowerLimit =600; + this.inverterEfficiency =95; this.azimuthAngle=170; - this.elevationAngle=90; + this.tiltAngle =90; } @@ -103,16 +103,16 @@ public class CityToWatch { return diffuseEfficiency; } - public float getConverterEfficiency() { - return converterEfficiency; + public float getInverterEfficiency() { + return inverterEfficiency; } - public float getConverterPowerLimit() { - return converterPowerLimit; + public float getInverterPowerLimit() { + return inverterPowerLimit; } - public float getElevationAngle() { - return elevationAngle; + public float getTiltAngle() { + return tiltAngle; } public void setCellsMaxPower(float cellsMaxPower) { @@ -131,19 +131,19 @@ public class CityToWatch { this.cellsEfficiency = cellsEfficiency; } - public void setConverterEfficiency(float converterEfficiency) { - this.converterEfficiency = converterEfficiency; + public void setInverterEfficiency(float inverterEfficiency) { + this.inverterEfficiency = inverterEfficiency; } - public void setConverterPowerLimit(float converterPowerLimit) { - this.converterPowerLimit = converterPowerLimit; + public void setInverterPowerLimit(float inverterPowerLimit) { + this.inverterPowerLimit = inverterPowerLimit; } public void setDiffuseEfficiency(float diffuseEfficiency) { this.diffuseEfficiency = diffuseEfficiency; } - public void setElevationAngle(float elevationAngle) { - this.elevationAngle = elevationAngle; + public void setTiltAngle(float tiltAngle) { + this.tiltAngle = tiltAngle; } } \ No newline at end of file diff --git a/app/src/main/java/org/woheller69/weather/database/SQLiteHelper.java b/app/src/main/java/org/woheller69/weather/database/SQLiteHelper.java index 840612d..6e2f712 100644 --- a/app/src/main/java/org/woheller69/weather/database/SQLiteHelper.java +++ b/app/src/main/java/org/woheller69/weather/database/SQLiteHelper.java @@ -47,10 +47,10 @@ public class SQLiteHelper extends SQLiteOpenHelper { private static final String CITIES_TO_WATCH_CELLS_AREA = "cells_area"; private static final String CITIES_TO_WATCH_CELLS_EFFICIENCY = "cells_efficiency"; private static final String CITIES_TO_WATCH_DIFFUSE_EFFICIENCY = "diffuse_efficiency"; - private static final String CITIES_TO_WATCH_CONVERTER_POWER_LIMIT = "converter_power_limit"; - private static final String CITIES_TO_WATCH_CONVERTER_EFFICIENCY = "converter_efficiency"; + private static final String CITIES_TO_WATCH_INVERTER_POWER_LIMIT = "inverter_power_limit"; + private static final String CITIES_TO_WATCH_INVERTER_EFFICIENCY = "inverter_efficiency"; private static final String CITIES_TO_WATCH_AZIMUTH_ANGLE = "azimuth_angle"; - private static final String CITIES_TO_WATCH_ELEVATION_ANGLE = "elevation_angle"; + private static final String CITIES_TO_WATCH_TILT_ANGLE = "tilt_angle"; //Names of columns in TABLE_FORECAST private static final String FORECAST_ID = "forecast_id"; @@ -128,10 +128,10 @@ public class SQLiteHelper extends SQLiteOpenHelper { CITIES_TO_WATCH_CELLS_AREA + " REAL NOT NULL," + CITIES_TO_WATCH_CELLS_EFFICIENCY + " REAL NOT NULL," + CITIES_TO_WATCH_DIFFUSE_EFFICIENCY + " REAL NOT NULL," + - CITIES_TO_WATCH_CONVERTER_POWER_LIMIT + " REAL NOT NULL," + - CITIES_TO_WATCH_CONVERTER_EFFICIENCY + " REAL NOT NULL," + + CITIES_TO_WATCH_INVERTER_POWER_LIMIT + " REAL NOT NULL," + + CITIES_TO_WATCH_INVERTER_EFFICIENCY + " REAL NOT NULL," + CITIES_TO_WATCH_AZIMUTH_ANGLE + " REAL NOT NULL," + - CITIES_TO_WATCH_ELEVATION_ANGLE + " REAL NOT NULL)"; + CITIES_TO_WATCH_TILT_ANGLE + " REAL NOT NULL)"; public static SQLiteHelper getInstance(Context context) { if (instance == null && context != null) { @@ -175,10 +175,10 @@ public class SQLiteHelper extends SQLiteOpenHelper { values.put(CITIES_TO_WATCH_CELLS_AREA,city.getCellsArea()); values.put(CITIES_TO_WATCH_CELLS_EFFICIENCY,city.getCellsEfficiency()); values.put(CITIES_TO_WATCH_DIFFUSE_EFFICIENCY,city.getDiffuseEfficiency()); - values.put(CITIES_TO_WATCH_CONVERTER_POWER_LIMIT,city.getConverterPowerLimit()); - values.put(CITIES_TO_WATCH_CONVERTER_EFFICIENCY,city.getConverterEfficiency()); + values.put(CITIES_TO_WATCH_INVERTER_POWER_LIMIT,city.getInverterPowerLimit()); + values.put(CITIES_TO_WATCH_INVERTER_EFFICIENCY,city.getInverterEfficiency()); values.put(CITIES_TO_WATCH_AZIMUTH_ANGLE,city.getAzimuthAngle()); - values.put(CITIES_TO_WATCH_ELEVATION_ANGLE,city.getElevationAngle()); + values.put(CITIES_TO_WATCH_TILT_ANGLE,city.getTiltAngle()); long id=database.insert(TABLE_CITIES_TO_WATCH, null, values); @@ -206,10 +206,10 @@ public class SQLiteHelper extends SQLiteOpenHelper { ", " + CITIES_TO_WATCH_CELLS_AREA + ", " + CITIES_TO_WATCH_CELLS_EFFICIENCY + ", " + CITIES_TO_WATCH_DIFFUSE_EFFICIENCY + - ", " + CITIES_TO_WATCH_CONVERTER_POWER_LIMIT + - ", " + CITIES_TO_WATCH_CONVERTER_EFFICIENCY + + ", " + CITIES_TO_WATCH_INVERTER_POWER_LIMIT + + ", " + CITIES_TO_WATCH_INVERTER_EFFICIENCY + ", " + CITIES_TO_WATCH_AZIMUTH_ANGLE + - ", " + CITIES_TO_WATCH_ELEVATION_ANGLE + + ", " + CITIES_TO_WATCH_TILT_ANGLE + ", " + CITIES_TO_WATCH_COLUMN_RANK + " FROM " + TABLE_CITIES_TO_WATCH + " WHERE " + CITIES_TO_WATCH_CITY_ID + " = ?", arguments); @@ -226,10 +226,10 @@ public class SQLiteHelper extends SQLiteOpenHelper { cityToWatch.setCellsArea(Float.parseFloat(cursor.getString(6))); cityToWatch.setCellsEfficiency(Float.parseFloat(cursor.getString(7))); cityToWatch.setDiffuseEfficiency(Float.parseFloat(cursor.getString(8))); - cityToWatch.setConverterPowerLimit(Float.parseFloat(cursor.getString(9))); - cityToWatch.setConverterEfficiency(Float.parseFloat(cursor.getString(10))); + cityToWatch.setInverterPowerLimit(Float.parseFloat(cursor.getString(9))); + cityToWatch.setInverterEfficiency(Float.parseFloat(cursor.getString(10))); cityToWatch.setAzimuthAngle(Float.parseFloat(cursor.getString(11))); - cityToWatch.setElevationAngle(Float.parseFloat(cursor.getString(12))); + cityToWatch.setTiltAngle(Float.parseFloat(cursor.getString(12))); cityToWatch.setRank(Integer.parseInt(cursor.getString(13))); cursor.close(); @@ -255,10 +255,10 @@ public class SQLiteHelper extends SQLiteOpenHelper { ", " + CITIES_TO_WATCH_CELLS_AREA + ", " + CITIES_TO_WATCH_CELLS_EFFICIENCY + ", " + CITIES_TO_WATCH_DIFFUSE_EFFICIENCY + - ", " + CITIES_TO_WATCH_CONVERTER_POWER_LIMIT + - ", " + CITIES_TO_WATCH_CONVERTER_EFFICIENCY + + ", " + CITIES_TO_WATCH_INVERTER_POWER_LIMIT + + ", " + CITIES_TO_WATCH_INVERTER_EFFICIENCY + ", " + CITIES_TO_WATCH_AZIMUTH_ANGLE + - ", " + CITIES_TO_WATCH_ELEVATION_ANGLE + + ", " + CITIES_TO_WATCH_TILT_ANGLE + ", " + CITIES_TO_WATCH_COLUMN_RANK + " FROM " + TABLE_CITIES_TO_WATCH , new String[]{}); @@ -277,10 +277,10 @@ public class SQLiteHelper extends SQLiteOpenHelper { cityToWatch.setCellsArea(Float.parseFloat(cursor.getString(6))); cityToWatch.setCellsEfficiency(Float.parseFloat(cursor.getString(7))); cityToWatch.setDiffuseEfficiency(Float.parseFloat(cursor.getString(8))); - cityToWatch.setConverterPowerLimit(Float.parseFloat(cursor.getString(9))); - cityToWatch.setConverterEfficiency(Float.parseFloat(cursor.getString(10))); + cityToWatch.setInverterPowerLimit(Float.parseFloat(cursor.getString(9))); + cityToWatch.setInverterEfficiency(Float.parseFloat(cursor.getString(10))); cityToWatch.setAzimuthAngle(Float.parseFloat(cursor.getString(11))); - cityToWatch.setElevationAngle(Float.parseFloat(cursor.getString(12))); + cityToWatch.setTiltAngle(Float.parseFloat(cursor.getString(12))); cityToWatch.setRank(Integer.parseInt(cursor.getString(13))); cityToWatchList.add(cityToWatch); @@ -305,10 +305,10 @@ public class SQLiteHelper extends SQLiteOpenHelper { values.put(CITIES_TO_WATCH_CELLS_AREA,cityToWatch.getCellsArea()); values.put(CITIES_TO_WATCH_CELLS_EFFICIENCY,cityToWatch.getCellsEfficiency()); values.put(CITIES_TO_WATCH_DIFFUSE_EFFICIENCY,cityToWatch.getDiffuseEfficiency()); - values.put(CITIES_TO_WATCH_CONVERTER_POWER_LIMIT,cityToWatch.getConverterPowerLimit()); - values.put(CITIES_TO_WATCH_CONVERTER_EFFICIENCY,cityToWatch.getConverterEfficiency()); + values.put(CITIES_TO_WATCH_INVERTER_POWER_LIMIT,cityToWatch.getInverterPowerLimit()); + values.put(CITIES_TO_WATCH_INVERTER_EFFICIENCY,cityToWatch.getInverterEfficiency()); values.put(CITIES_TO_WATCH_AZIMUTH_ANGLE,cityToWatch.getAzimuthAngle()); - values.put(CITIES_TO_WATCH_ELEVATION_ANGLE,cityToWatch.getElevationAngle()); + values.put(CITIES_TO_WATCH_TILT_ANGLE,cityToWatch.getTiltAngle()); database.update(TABLE_CITIES_TO_WATCH, values, CITIES_TO_WATCH_ID + " = ?", new String[]{String.valueOf(cityToWatch.getId())}); diff --git a/app/src/main/java/org/woheller69/weather/preferences/AppPreferencesManager.java b/app/src/main/java/org/woheller69/weather/preferences/AppPreferencesManager.java index a5f290a..6a7be00 100644 --- a/app/src/main/java/org/woheller69/weather/preferences/AppPreferencesManager.java +++ b/app/src/main/java/org/woheller69/weather/preferences/AppPreferencesManager.java @@ -40,105 +40,6 @@ public class AppPreferencesManager { return result; } - /** - * This method converts a given temperature value into the unit that was set in the preferences. - * - * @param temperature The temperature to convert into the unit that is set in the preferences. - * Make sure to pass a value in celsius. - * @return Returns the converted temperature. - ** - */ - public float convertTemperatureFromCelsius(float temperature) { - // 1 = Celsius (fallback), 2 = Fahrenheit - int prefValue = Integer.parseInt(preferences.getString("temperatureUnit", "1")); - if (prefValue == 1) { - return temperature; - } else { - return (((temperature * 9) / 5) + 32); - } - } - - /** - * This method converts a given distance value into the unit that was set in the preferences. - * - * @param kilometers The kilometers to convert into the unit that is set in the preferences. - * Make sure to pass a value in kilometers. - * @return Returns the converted distance. - */ - public float convertDistanceFromKilometers(float kilometers) { - // 1 = kilometers, 2 = miles - int prefValue = Integer.parseInt(preferences.getString("distanceUnit", "1")); - if (prefValue == 1) { - return kilometers; - } else { - return convertKmInMiles(kilometers); - } - } - - /** - * @return Returns true if kilometers was set as distance unit in the preferences else false. - */ - public boolean isDistanceUnitKilometers() { - int prefValue = Integer.parseInt(preferences.getString("distanceUnit", "0")); - return (prefValue == 1); - } - - /** - * @return Returns true if miles was set as distance unit in the preferences else false. - */ - public boolean isDistanceUnitMiles() { - int prefValue = Integer.parseInt(preferences.getString("distanceUnit", "0")); - return (prefValue == 2); - } - - /** - * Converts a kilometer value in miles. - * - * @param km The value to convert to miles. - * @return Returns the converted value. - */ - public float convertKmInMiles(float km) { - // TODO: Is this the right class for the function??? - return (float) (km / 1.609344); - } - - /** - * Converts a miles value in kilometers. - * - * @param miles The value to convert to kilometers. - * @return Returns the converted value. - */ - public float convertMilesInKm(float miles) { - // TODO: Is this the right class for the function??? - return (float) (miles * 1.609344); - } - - /** - * @return Returns "°C" in case Celsius is set and "°F" if Fahrenheit was selected. - */ - public String getTemperatureUnit() { - int prefValue = Integer.parseInt(preferences.getString("temperatureUnit", "1")); - if (prefValue == 1) { - return "°C"; - } else { - return "°F"; - } - } - - /** - * @return Returns "km" in case kilometer is set and "mi" if miles was selected. - * @param applicationContext - */ - public String getDistanceUnit(Context applicationContext) { - int prefValue = Integer.parseInt(preferences.getString("distanceUnit", "1")); - if (prefValue == 1) { - return applicationContext.getString(R.string.units_km); - } else { - return "mi"; - } - } - - public boolean showStarDialog(Context context) { int versionCode = preferences.getInt("versionCode",BuildConfig.VERSION_CODE); boolean askForStar=preferences.getBoolean("askForStar",true); diff --git a/app/src/main/java/org/woheller69/weather/ui/RecycleList/ItemViewHolder.java b/app/src/main/java/org/woheller69/weather/ui/RecycleList/ItemViewHolder.java index 338cc39..c92586d 100644 --- a/app/src/main/java/org/woheller69/weather/ui/RecycleList/ItemViewHolder.java +++ b/app/src/main/java/org/woheller69/weather/ui/RecycleList/ItemViewHolder.java @@ -18,14 +18,14 @@ public class ItemViewHolder extends RecyclerView.ViewHolder { * Member variables */ public TextView cityName; - public TextView elevationAngle; + public TextView tiltAngle; public TextView azimuthAngle; public TextView cellsMaxPower; public TextView cellsArea; public TextView cellsEfficiency; public TextView diffuseEfficiency; - public TextView converterPowerLimit; - public TextView converterEfficiency; + public TextView inverterPowerLimit; + public TextView inverterEfficiency; /** @@ -36,14 +36,14 @@ public class ItemViewHolder extends RecyclerView.ViewHolder { public ItemViewHolder(View itemView) { super(itemView); this.cityName = (TextView) itemView.findViewById(R.id.city_overview_list_item_text); - this.elevationAngle = (TextView) itemView.findViewById(R.id.city_elevation_angle); + this.tiltAngle = (TextView) itemView.findViewById(R.id.city_tilt_angle); this.azimuthAngle = (TextView) itemView.findViewById(R.id.city_azimuth_angle); this.cellsMaxPower = (TextView) itemView.findViewById(R.id.city_cells_max_power); this.cellsArea = (TextView) itemView.findViewById(R.id.city_cells_area); this.cellsEfficiency = (TextView) itemView.findViewById(R.id.city_cells_efficiency); this.diffuseEfficiency = (TextView) itemView.findViewById(R.id.city_diffuse_efficiency); - this.converterPowerLimit = (TextView) itemView.findViewById(R.id.city_converter_power_limit); - this.converterEfficiency = (TextView) itemView.findViewById(R.id.city_converter_efficiency); + this.inverterPowerLimit = (TextView) itemView.findViewById(R.id.city_inverter_power_limit); + this.inverterEfficiency = (TextView) itemView.findViewById(R.id.city_inverter_efficiency); } diff --git a/app/src/main/java/org/woheller69/weather/ui/RecycleList/RecyclerOverviewListAdapter.java b/app/src/main/java/org/woheller69/weather/ui/RecycleList/RecyclerOverviewListAdapter.java index 3d83370..d80f82b 100644 --- a/app/src/main/java/org/woheller69/weather/ui/RecycleList/RecyclerOverviewListAdapter.java +++ b/app/src/main/java/org/woheller69/weather/ui/RecycleList/RecyclerOverviewListAdapter.java @@ -2,15 +2,11 @@ package org.woheller69.weather.ui.RecycleList; import android.content.Context; -import androidx.appcompat.app.AlertDialog; import androidx.recyclerview.widget.RecyclerView; -import android.util.Log; -import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.widget.EditText; import org.woheller69.weather.R; import org.woheller69.weather.database.CityToWatch; @@ -64,13 +60,13 @@ public class RecyclerOverviewListAdapter extends RecyclerView.Adapter + android:hint="@string/edit_location_hint_tilt"/> + android:hint="@string/edit_location_hint_tilt"/> + android:hint="@string/edit_location_hint_inverter_power_limit"/> + android:hint="@string/edit_location_hint_inverter_power_limit"/> + android:hint="@string/edit_location_hint_inverter_efficiency"/> + android:hint="@string/edit_location_hint_inverter_efficiency"/> \ No newline at end of file diff --git a/app/src/main/res/layout/list_item_city_list.xml b/app/src/main/res/layout/list_item_city_list.xml index 108c490..ead72e8 100644 --- a/app/src/main/res/layout/list_item_city_list.xml +++ b/app/src/main/res/layout/list_item_city_list.xml @@ -54,11 +54,11 @@ tools:visibility="visible" /> @@ -100,20 +100,20 @@ tools:visibility="visible" /> diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index ebbaf47..94a1fad 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -117,13 +117,13 @@ Breitengrad [°] Längengrad [°] Azimuth [°] - Neigung [°] + Neigung [°] Maximalleistung Zelle [W] Wirkungsgrad Zelle [%] Fläche Zelle [m\u00b2] Effizienz diffuse Strahlung [%] - Leistung Wechselrichter [W] - Effizienz Wechselrichter [%] + Leistung Wechselrichter [W] + Effizienz Wechselrichter [%] Wh Ort bearbeiten diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 7b4ba0c..4732a7d 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -119,13 +119,13 @@ Latitude [°] Longitude [°] Azimuth [°] - Elevation [°] + Tilt [°] Cells max power [W] Cells efficiency [%] Cell area [m\u00b2] Diffuse radiation efficiency [%] - Converter power [W] - Converter efficiency [%] + Inverter power [W] + Inverter efficiency [%] Wh Edit location diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/03.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/03.png index 57f7bc7..0ef9add 100644 Binary files a/fastlane/metadata/android/en-US/images/phoneScreenshots/03.png and b/fastlane/metadata/android/en-US/images/phoneScreenshots/03.png differ