From 4c2efd06600fe04b202eeaffdfd607b8c7af7dae Mon Sep 17 00:00:00 2001 From: "Dr. Martin Goik" <goik@hdm-stuttgart.de> Date: Tue, 15 May 2018 23:31:27 +0200 Subject: [PATCH] Describing weather forecast project --- Doc/Sd1/appendix.xml | 99 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) diff --git a/Doc/Sd1/appendix.xml b/Doc/Sd1/appendix.xml index fe829bffc..323252cd6 100644 --- a/Doc/Sd1/appendix.xml +++ b/Doc/Sd1/appendix.xml @@ -378,6 +378,105 @@ public void test_400() { <para>The following sections contain both the current and archived project propositions.</para> + <section xml:id="sd1_sect_projectWeatherForecast"> + <title>Weather forecast</title> + + <para>In this project you'll implement a terminal based weather forecast + application. Consider the following invocation:</para> + + <figure xml:id="sd1_weather_fig_invocationExample"> + <title>Sample forecast invocation</title> + + <screen>goik@goiki target> java -jar weather-1.0.jar <emphasis + role="red">Stuttgart</emphasis> <co + linkends="sd1_weather_fig_invocationExample-1.2" + xml:id="sd1_weather_fig_invocationExample-1.2-co"/> +1 = Stadtkreis Stuttgart <co + linkends="sd1_weather_fig_invocationExample-2.2" + xml:id="sd1_weather_fig_invocationExample-2.2-co"/> +<emphasis role="red">2 = Regierungsbezirk Stuttgart</emphasis> +3 = Stuttgart +4 = Stuttgart Feuerbach +5 = Stuttgart Muehlhausen + +Bitte gültige Auswahl 1 bis 5 treffen:<emphasis role="red">2</emphasis> <co + linkends="sd1_weather_fig_invocationExample-3" + xml:id="sd1_weather_fig_invocationExample-3-co"/> +Vorhersage für <emphasis role="red">Regierungsbezirk Stuttgart</emphasis> <co + linkends="sd1_weather_fig_invocationExample-4" + xml:id="sd1_weather_fig_invocationExample-4-co"/> +Dienstag, 15.05 + 23:00: 11°C, Leichter Regen +Mittwoch, 16.05 + 02:00: 10°C, Leichter Regen + 05:00: 10°C, Leichter Regen + 08:00: 11°C, Leichter Regen + ...</screen> + </figure> + + <calloutlist> + <callout arearefs="sd1_weather_fig_invocationExample-1.2-co" + xml:id="sd1_weather_fig_invocationExample-1.2"> + <para>Command line argument <emphasis + role="red">Stuttgart</emphasis> acting as a search filter.</para> + </callout> + + <callout arearefs="sd1_weather_fig_invocationExample-2.2-co" + xml:id="sd1_weather_fig_invocationExample-2.2"> + <para>The filter <emphasis role="red">Stuttgart</emphasis> yields + five matching towns / regions.</para> + </callout> + + <callout arearefs="sd1_weather_fig_invocationExample-3-co" + xml:id="sd1_weather_fig_invocationExample-3"> + <para>User choosing second match.</para> + </callout> + + <callout arearefs="sd1_weather_fig_invocationExample-4-co" + xml:id="sd1_weather_fig_invocationExample-4"> + <para>Forecast corresponding to <emphasis + role="red">Regierungsbezirk Stuttgart</emphasis>.</para> + </callout> + </calloutlist> + + <figure xml:id="sd1_weather_fig_underlyingData"> + <title>Underlying data provider</title> + + <screen>https://api.openweathermap.org/data/2.5/forecast?lang=de& <co + linkends="sd1_weather_fig_underlyingData-1" + xml:id="sd1_weather_fig_underlyingData-1-co"/> +APPID=7cufdhdcgdhsgdhgfcgsdss67b3&units=metric&<emphasis role="red">id=3214105</emphasis> + + +{"cod":"200","message":0.0042,"cnt":40,"list":[ <co + linkends="sd1_weather_fig_underlyingData-2" + xml:id="sd1_weather_fig_underlyingData-2-co"/> + {"dt":1526428800,"main":{"temp":10.29,"temp_min":10.29, +"temp_max":12.45,"pressure":985.75,"sea_level":1027.48, +"grnd_level":985.75,"humidity":80,"temp_kf":-2.16}, +"weather":[{"id":500,"main":"Rain", +"description":"Leichter Regen","icon":"10n"}],"clouds": +{"all":88},"wind":{"speed":1.59,"deg":313.503},"rain": +{"3h":0.315},"sys":{"pod":"n"},"dt_txt":"2018-05-16 00:00:00"}, +{"dt":1526439600,"main": ...</screen> + + <calloutlist> + <callout arearefs="sd1_weather_fig_underlyingData-1-co" + xml:id="sd1_weather_fig_underlyingData-1"> + <para>An <xref linkend="glo_URL"/> containing an id value + corresponding to a uniquely defined town or region.</para> + </callout> + + <callout arearefs="sd1_weather_fig_underlyingData-2-co" + xml:id="sd1_weather_fig_underlyingData-2"> + <para><uri + xlink:href="https://api.openweathermap.org">https://api.openweathermap.org</uri>'s + reply providing <abbrev>JSON</abbrev> based weather data.</para> + </callout> + </calloutlist> + </figure> + </section> + <section xml:id="sd1_sect_projectRpnCalculator"> <title>Reverse Polish notation (<abbrev><abbrev xlink:href="https://en.wikipedia.org/wiki/Reverse_Polish_notation">RPN</abbrev></abbrev>) -- GitLab