Skip to content

Commit

Permalink
Merge branch 'v1.2.9' into 'master'
Browse files Browse the repository at this point in the history
[1.2.9] The PüMa Release

See merge request monica/lora-map/lora-map!2
  • Loading branch information
blubbfish committed Aug 30, 2019
2 parents 3542b87 + 10f9e32 commit f192cc7
Show file tree
Hide file tree
Showing 27 changed files with 1,856 additions and 849 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Changelogs

## 1.2.9
### New Features
* Add setting model to code
* #19 grid automatisch generieren
* #24 Add information about weather/warning
* #28 Fightdedection Plygon on Map
* #27 Draw Camera-Desity bock on map
* #16 filter nach kategorien/tracker einbauen
* #15 suche nach st�nden einbauen
### Bugfixes
* Add Correct Dispose Handling
* TimeCalculation now handle negative values correct
### Changes
* Refactoring of all JS
* Make only one request per second instead of four per AJAX
* Refactoring adminpannel and add settings.json
* New function in TimeCalculation, so you can not have negative Timespans

## 1.2.8
### New Features
* Implement #12 Make icon transparent if there is no data update
Expand Down
62 changes: 62 additions & 0 deletions Lora-Map/Lib/WebRequests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
using System;
using System.IO;
using System.Net;

using BlubbFish.Utils;

using LitJson;

namespace Fraunhofer.Fit.IoT.LoraMap.Lib {
public class WebRequests {
private static readonly Object getLock = new Object();
public JsonData GetJson(String url) {
String text = null;
for(Int32 i = 0; i < 3; i++) {
try {
text = this.GetString(url);
break;
} catch(Exception e) {
Helper.WriteError(e.Message);
if(i == 2) {
throw;
}
System.Threading.Thread.Sleep(30000);
}
}
if(text == null) {
return new JsonData();
}
try {
return JsonMapper.ToObject(text);
} catch(Exception) {
return new JsonData();
}
}

private String GetString(String url, Boolean withoutput = true) {
String ret = null;
lock(getLock) {
HttpWebRequest request = WebRequest.CreateHttp(url);
request.Timeout = 10000;
//request.Headers.Add(HttpRequestHeader.Authorization, this.auth);
try {
using(HttpWebResponse response = (HttpWebResponse)request.GetResponse()) {
if(response.StatusCode == HttpStatusCode.Unauthorized) {
Console.Error.WriteLine("Benutzer oder Passwort falsch!");
throw new Exception("Benutzer oder Passwort falsch!");
}
if(withoutput) {
StreamReader reader = new StreamReader(response.GetResponseStream());
ret = reader.ReadToEnd();
}
}
} catch(Exception e) {
//Helper.WriteError("Konnte keine Verbindung zum Razzbery Server herstellen. Resource: \"" + this.server + v + "\" Fehler: " + e.Message);
//return null;
throw new Exception("Konnte keine Verbindung zum Server herstellen: " + e.Message);
}
}
return ret;
}
}
}
20 changes: 17 additions & 3 deletions Lora-Map/Lora-Map.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,17 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Lib\WebRequests.cs" />
<Compile Include="Model\Admin\AdminModel.cs" />
<Compile Include="Model\Admin\AdminSession.cs" />
<Compile Include="Model\Camera.cs" />
<Compile Include="Model\Crowd.cs" />
<Compile Include="Model\Fight.cs" />
<Compile Include="Model\Marker.cs" />
<Compile Include="Model\AlarmItem.cs" />
<Compile Include="Model\Settings.cs" />
<Compile Include="Model\UTMData.cs" />
<Compile Include="Model\WeatherWarnings.cs" />
<Compile Include="Server.cs" />
<Compile Include="Model\PositionItem.cs" />
<Compile Include="Program.cs" />
Expand Down Expand Up @@ -98,12 +102,24 @@
<Content Include="resources\css\icons\failtile.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="resources\css\icons\filter.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="resources\css\icons\information.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="resources\css\icons\placeholder.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="resources\css\icons\search.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="resources\css\icons\storm-ac.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="resources\css\icons\storm-in.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="resources\icons\akku\0-4.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Expand Down Expand Up @@ -236,8 +252,6 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<Folder Include="Helper\" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
Loading

0 comments on commit f192cc7

Please sign in to comment.