├── .gitattributes
├── M2Mqtt.Mono.dll
├── M2Mqtt.Net.dll
├── .gitignore
├── CSScriptLibrary.dll
├── DesktopApp
├── Landroid.ico
├── Images
│ ├── home16.png
│ ├── play16.png
│ ├── rssi_0.png
│ ├── rssi_1.png
│ ├── rssi_2.png
│ ├── rssi_3.png
│ ├── stop16.png
│ ├── pause16.png
│ ├── right16.png
│ ├── tooltip.png
│ ├── bt_charging.png
│ ├── marker_blue.png
│ ├── refresh16.png
│ ├── bt_background.png
│ ├── wt_background.png
│ ├── Landroid-S-Icon.png
│ ├── Landroid-S-Plan.png
│ ├── Landroid-S-Side.png
│ └── landroid_icon_big.png
├── DeskApp.command
├── EstimatedTimes.json
├── Properties
│ ├── Settings.settings
│ ├── Settings.Designer.cs
│ ├── Resources.Designer.cs
│ └── Resources.resx
├── Program.cs
├── FormChoice.cs
├── AssemblyInfo.cs
├── PluginCsvLogWriter.cs
├── App.config
├── Ressource.cs
├── PluginMowOutsideArea.cs
├── PluginHomeBorderCut.cs
├── FormChoice.Designer.cs
├── strings.da.xml
├── strings.en.xml
├── strings.nl.xml
├── strings.sk.xml
├── strings.fr.xml
├── strings.it.xml
├── strings.de.xml
├── FormChoice.resx
├── DesktopApp.Mono.csproj
├── AppRes.Designer.cs
├── DesktopApp.Net.csproj
├── AppRes.resx
└── LsClient.cs
├── Cleanup.ps1
├── Desktop App.Mono.userprefs
├── README.md
├── MqttJson
├── AssemblyInfo.cs
├── MqttJson.csproj
└── MqttJson.cs
├── Desktop App.Net.sln
├── Desktop App.Mono.sln
└── LICENSE
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
--------------------------------------------------------------------------------
/M2Mqtt.Mono.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EishaV/Desktop-App-2x/HEAD/M2Mqtt.Mono.dll
--------------------------------------------------------------------------------
/M2Mqtt.Net.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EishaV/Desktop-App-2x/HEAD/M2Mqtt.Net.dll
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .vs/
2 | obj/
3 | bin/
4 | mobj/
5 | mono/
6 | *.user
7 | *.json
8 | *.userprefs
9 |
--------------------------------------------------------------------------------
/CSScriptLibrary.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EishaV/Desktop-App-2x/HEAD/CSScriptLibrary.dll
--------------------------------------------------------------------------------
/DesktopApp/Landroid.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EishaV/Desktop-App-2x/HEAD/DesktopApp/Landroid.ico
--------------------------------------------------------------------------------
/DesktopApp/Images/home16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EishaV/Desktop-App-2x/HEAD/DesktopApp/Images/home16.png
--------------------------------------------------------------------------------
/DesktopApp/Images/play16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EishaV/Desktop-App-2x/HEAD/DesktopApp/Images/play16.png
--------------------------------------------------------------------------------
/DesktopApp/Images/rssi_0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EishaV/Desktop-App-2x/HEAD/DesktopApp/Images/rssi_0.png
--------------------------------------------------------------------------------
/DesktopApp/Images/rssi_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EishaV/Desktop-App-2x/HEAD/DesktopApp/Images/rssi_1.png
--------------------------------------------------------------------------------
/DesktopApp/Images/rssi_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EishaV/Desktop-App-2x/HEAD/DesktopApp/Images/rssi_2.png
--------------------------------------------------------------------------------
/DesktopApp/Images/rssi_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EishaV/Desktop-App-2x/HEAD/DesktopApp/Images/rssi_3.png
--------------------------------------------------------------------------------
/DesktopApp/Images/stop16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EishaV/Desktop-App-2x/HEAD/DesktopApp/Images/stop16.png
--------------------------------------------------------------------------------
/DesktopApp/Images/pause16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EishaV/Desktop-App-2x/HEAD/DesktopApp/Images/pause16.png
--------------------------------------------------------------------------------
/DesktopApp/Images/right16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EishaV/Desktop-App-2x/HEAD/DesktopApp/Images/right16.png
--------------------------------------------------------------------------------
/DesktopApp/Images/tooltip.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EishaV/Desktop-App-2x/HEAD/DesktopApp/Images/tooltip.png
--------------------------------------------------------------------------------
/DesktopApp/Images/bt_charging.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EishaV/Desktop-App-2x/HEAD/DesktopApp/Images/bt_charging.png
--------------------------------------------------------------------------------
/DesktopApp/Images/marker_blue.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EishaV/Desktop-App-2x/HEAD/DesktopApp/Images/marker_blue.png
--------------------------------------------------------------------------------
/DesktopApp/Images/refresh16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EishaV/Desktop-App-2x/HEAD/DesktopApp/Images/refresh16.png
--------------------------------------------------------------------------------
/DesktopApp/Images/bt_background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EishaV/Desktop-App-2x/HEAD/DesktopApp/Images/bt_background.png
--------------------------------------------------------------------------------
/DesktopApp/Images/wt_background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EishaV/Desktop-App-2x/HEAD/DesktopApp/Images/wt_background.png
--------------------------------------------------------------------------------
/DesktopApp/DeskApp.command:
--------------------------------------------------------------------------------
1 | mono --arch=32 "${0%command}exe"
2 | #"$(echo -n $0 | sed -e 's/command/exe/g')"
3 | #killall Terminal
--------------------------------------------------------------------------------
/DesktopApp/Images/Landroid-S-Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EishaV/Desktop-App-2x/HEAD/DesktopApp/Images/Landroid-S-Icon.png
--------------------------------------------------------------------------------
/DesktopApp/Images/Landroid-S-Plan.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EishaV/Desktop-App-2x/HEAD/DesktopApp/Images/Landroid-S-Plan.png
--------------------------------------------------------------------------------
/DesktopApp/Images/Landroid-S-Side.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EishaV/Desktop-App-2x/HEAD/DesktopApp/Images/Landroid-S-Side.png
--------------------------------------------------------------------------------
/DesktopApp/Images/landroid_icon_big.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EishaV/Desktop-App-2x/HEAD/DesktopApp/Images/landroid_icon_big.png
--------------------------------------------------------------------------------
/DesktopApp/EstimatedTimes.json:
--------------------------------------------------------------------------------
1 | {
2 | "home_0": {"beg":20.2,"end":19.2,"vpm":0.007},
3 | "home_1": {"beg":16.5,"end":20.5,"vpm":0.060},
4 | "mowing": {"beg":20.2,"end":17.1,"vpm":0.050}
5 | }
--------------------------------------------------------------------------------
/DesktopApp/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Cleanup.ps1:
--------------------------------------------------------------------------------
1 | $lst = "obj", "bin", "mobj", "mono"
2 |
3 | foreach( $dir in dir -Directory -Path $PSScriptRoot ) {
4 | #Write-Output $dir.FullName
5 |
6 | foreach( $sub in $lst ) {
7 | $del = $dir.FullName + "\" + $sub
8 | if( Test-Path -Path $del ) {
9 | Remove-Item $del -Recurse
10 | Write-Output "$del deleted"
11 | }
12 | }
13 | }
--------------------------------------------------------------------------------
/Desktop App.Mono.userprefs:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/DesktopApp/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using System.Windows.Forms;
6 |
7 | namespace DesktopApp
8 | {
9 | static class Program
10 | {
11 | ///
12 | /// The main entry point for the application.
13 | ///
14 | [STAThread]
15 | static void Main()
16 | {
17 | Application.EnableVisualStyles();
18 | Application.SetCompatibleTextRenderingDefault(false);
19 | Application.Run(new FormMain());
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/DesktopApp/FormChoice.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Windows.Forms;
3 |
4 | namespace DesktopApp {
5 | public partial class FormChoice : Form {
6 | public FormChoice() {
7 | InitializeComponent();
8 | }
9 |
10 | public FormChoice(List pis) {
11 | InitializeComponent();
12 |
13 | foreach( LsProductItem pi in pis ) {
14 | ListViewItem lvi = listView.Items.Add(pi.Name);
15 |
16 | lvi.SubItems.Add(pi.MacAdr);
17 | lvi.Tag = pi;
18 | }
19 | listView.Columns[0].Width = -1;
20 | listView.Columns[1].Width = -2;
21 | listView.Items[0].Selected = true;
22 | }
23 |
24 | public int SelectedIndex {
25 | get { return listView.SelectedIndices.Count == 1 ? listView.SelectedIndices[0] : -1; }
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Desktop Applikation (Windows, Linux, MAC OS) für Worx Landroid und Kress Mission
2 |
3 | Diese Applikation erlaubt, ähnlich der Mobilen Apps, eine Steuerung und Parametrierung des Mähroboters über die IoT-Platform.
4 | Weiterhin ist eine Plugin-Schnittstelle zur Integration eigener Code-Schnipsel vorhanden.
5 |
6 | ## Verwendung
7 | Die Applikation ist portable, d.h. sollte in einem durch den Anwender schreibbaren Ordner abgelegt werden,
8 | da die Einstellungen direkt neben der Anwendung in der Datei "Config.json" abgelegt werden.
9 | Es gibt zwei Ausführungen:
10 | - .Net basierend auf dem Microsoft .Net Framework 4.6
11 | - .Mono basierend auf Mono Framework 4.5
12 |
13 | ## Einstellungen
14 | Bei Email und Kennwort müssen die Daten eingeben werden, die man in der mobilen App eingegeben hat.
15 | Danach kann die Anmeldung erfolgen und falls mehr als ein Mäher registriert ist wird der zu verbindene Name abgefragt.
16 | Beim nächsten Start erfolgt eine automatische Verbindung mit den gespeicherten Daten.
17 |
--------------------------------------------------------------------------------
/DesktopApp/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace DesktopApp.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/MqttJson/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("MqttJson")]
9 | [assembly: AssemblyDescription("Plugin Interface")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Desktop App")]
13 | [assembly: AssemblyCopyright("Copyright © EishaV 2017-2021")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("56063287-2f56-4797-8a1e-c898a87258a3")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("0.0.27.*")]
36 | [assembly: AssemblyFileVersion("0.0.27")]
37 |
--------------------------------------------------------------------------------
/DesktopApp/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Desktop App")]
9 | [assembly: AssemblyDescription("Desktop App Landroid / Mission / Landxcape")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Desktop App")]
13 | [assembly: AssemblyCopyright("Copyright © EishaV 2017-2021")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("3d305ac2-c506-42ad-b087-01b43862d638")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("0.0.28.*")]
36 | [assembly: AssemblyFileVersion("0.0.28")]
37 |
--------------------------------------------------------------------------------
/DesktopApp/PluginCsvLogWriter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using System.Globalization;
4 |
5 | using MqttJson;
6 |
7 | public class PluginCsvLogWriter : IPlugin {
8 | private void Write(PluginData pd) {
9 | string fn = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, pd.Name + ".csv");
10 | string dts = string.Format("{0} {1}", pd.Config.Date, pd.Config.Time); // parsable DateTime string
11 | DateTime dt = DateTime.ParseExact(dts, "dd/MM/yyyy HH:mm:ss", CultureInfo.InvariantCulture);
12 | bool nf = !File.Exists(fn); // write column header only on new file
13 |
14 | using (StreamWriter sw = new StreamWriter(fn, true)) {
15 | Data d = pd.Data;
16 | Battery b = d.Battery;
17 | Statistic s = d.Statistic;
18 |
19 | if( nf ) sw.WriteLine("dt tm;ls;le;lz;lk;bt.t;bt.v;bt.p;bt.c;st.b;st.d;st.wt;dmp0;dmp1;dmp2;rsi");
20 | sw.Write(string.Format("{0};", dt));
21 | sw.Write(string.Format("{0};{1};{2};{3};", d.LastState, d.LastError, d.LastZone, d.Lock));
22 | sw.Write(string.Format("{0};{1};{2};{3};", b.Temp, b.Volt, b.Perc, b.Charging));
23 | sw.Write(string.Format("{0};{1};{2};", s.Blade, s.Distance, s.WorkTime));
24 | sw.Write(string.Format("{0};{1};{2};{3}", d.Orient[0], d.Orient[1], d.Orient[2], d.RecvSignal));
25 | sw.WriteLine();
26 | }
27 | }
28 |
29 | string IPlugin.Desc {
30 | get { return "Write Landroid S data to CSV file: .csv"; }
31 | }
32 | object IPlugin.Options {
33 | get { return null; } // there no options at moment for CsvLogWriter
34 | }
35 | bool IPlugin.Doit(PluginData pd) {
36 | Write(pd);
37 | return true;
38 | }
39 | bool IPlugin.Todo(PluginData pd) {
40 | Write(pd);
41 | return true;
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/Desktop App.Net.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 14
4 | VisualStudioVersion = 14.0.25420.1
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MqttJson", "MqttJson\MqttJson.csproj", "{56063287-2F56-4797-8A1E-C898A87258A3}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DesktopApp.Net", "DesktopApp\DesktopApp.Net.csproj", "{3D305AC2-C506-42AD-B087-01B43862D638}"
9 | ProjectSection(ProjectDependencies) = postProject
10 | {56063287-2F56-4797-8A1E-C898A87258A3} = {56063287-2F56-4797-8A1E-C898A87258A3}
11 | EndProjectSection
12 | EndProject
13 | Global
14 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
15 | Debug|Any CPU = Debug|Any CPU
16 | Release|Any CPU = Release|Any CPU
17 | EndGlobalSection
18 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
19 | {56063287-2F56-4797-8A1E-C898A87258A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
20 | {56063287-2F56-4797-8A1E-C898A87258A3}.Debug|Any CPU.Build.0 = Debug|Any CPU
21 | {56063287-2F56-4797-8A1E-C898A87258A3}.Release|Any CPU.ActiveCfg = Release|Any CPU
22 | {56063287-2F56-4797-8A1E-C898A87258A3}.Release|Any CPU.Build.0 = Release|Any CPU
23 | {3D305AC2-C506-42AD-B087-01B43862D638}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
24 | {3D305AC2-C506-42AD-B087-01B43862D638}.Debug|Any CPU.Build.0 = Debug|Any CPU
25 | {3D305AC2-C506-42AD-B087-01B43862D638}.Release|Any CPU.ActiveCfg = Release|Any CPU
26 | {3D305AC2-C506-42AD-B087-01B43862D638}.Release|Any CPU.Build.0 = Release|Any CPU
27 | EndGlobalSection
28 | GlobalSection(SolutionProperties) = preSolution
29 | HideSolutionNode = FALSE
30 | EndGlobalSection
31 | GlobalSection(ExtensibilityGlobals) = postSolution
32 | SolutionGuid = {F10D7E93-9B8D-439E-8C8C-C022631C6748}
33 | EndGlobalSection
34 | EndGlobal
35 |
--------------------------------------------------------------------------------
/DesktopApp/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/DesktopApp/Ressource.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Diagnostics;
4 | using System.Globalization;
5 | using System.IO;
6 | using System.Linq;
7 | using System.Xml;
8 | using System.Xml.Serialization;
9 | using System.Text;
10 |
11 | namespace DesktopApp {
12 | //public void Serialize(string filename, Dictionary dictionary) {
13 | // using( var writer = new StreamWriter(filename) ) {
14 | // _serializer.Serialize(writer, dictionary.Select(p => new Item() { Key = p.Key, Value = p.Value }).ToArray());
15 | // }
16 | //}
17 |
18 | public class Ressource {
19 | [XmlType(TypeName = "string")]
20 | public class Item {
21 | [XmlAttribute("name")]
22 | public string Key;
23 | [XmlText]
24 | public string Value;
25 | }
26 |
27 | static SortedDictionary _res = null;
28 |
29 | static Ressource() {
30 | string lng = CultureInfo.CurrentUICulture.TwoLetterISOLanguageName;
31 | string fn = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "strings." + lng + ".xml");
32 | XmlSerializer xs = new XmlSerializer(typeof(Item[]), new XmlRootAttribute("resources"));
33 | Item[] tmp;
34 |
35 | //using( FileStream stream = new FileStream(fn, FileMode.Open) )
36 | //using( XmlReader reader = XmlReader.Create(stream) ) {
37 | // _res = ((Item[])xs.Deserialize(reader)).ToDictionary(p => p.Name, p => p.Value);
38 | //}
39 |
40 | if( !File.Exists(fn) ) fn = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "strings.de.xml");
41 | try {
42 | using( FileStream fs = new FileStream(fn, FileMode.Open) ) tmp = (xs.Deserialize(fs) as Item[]);
43 | _res = new SortedDictionary(tmp.ToDictionary(item => item.Key, item => item.Value));
44 | tmp = null;
45 | } catch( Exception ex ) {
46 | Debug.WriteLine(ex.ToString());
47 | }
48 | }
49 |
50 | public static string Get(string name) { return _res != null && _res.ContainsKey(name) ? _res[name] : name; }
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/MqttJson/MqttJson.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {56063287-2F56-4797-8A1E-C898A87258A3}
8 | Library
9 | Properties
10 | MqttJson
11 | MqttJson
12 | v4.8
13 | 512
14 |
15 |
16 |
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 | false
25 |
26 |
27 | pdbonly
28 | true
29 | bin\Release\
30 | TRACE
31 | prompt
32 | 4
33 | false
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
56 |
--------------------------------------------------------------------------------
/DesktopApp/PluginMowOutsideArea.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel;
3 | using System.IO;
4 | using System.Runtime.Serialization;
5 | using System.Threading;
6 | using MqttJson;
7 | public class PluginMowOutsideArea : IPlugin {
8 | public enum MoaState { None, Mon }
9 | [DataContract]
10 | public class MoaOptions { // Options for PropertyGrid on Plugin tab
11 | [DataMember]
12 | [DescriptionAttribute("Time for mowing area")]
13 | public int TimeInArea { get; set; }
14 | [DataMember]
15 | [Description("State of mow outside area"), ReadOnly(true)]
16 | public MoaState StateOfMoa { get; set; }
17 | [DataMember]
18 | [DescriptionAttribute("Starting Time of Monitoring"), ReadOnly(true)]
19 | public string StartTime { get; set; }
20 | public MoaOptions() {
21 | TimeInArea = 0; // mow until accu empty
22 | StateOfMoa = MoaState.None;
23 | StartTime = "Not started";
24 | }
25 | }
26 |
27 | const string MoaJson = "MowOutsideArea.json"; // file name for options
28 | private MoaOptions _op;
29 | private Timer _tm;
30 | public PluginMowOutsideArea() { // try to read options from file
31 | _op = DeskApp.GetJson(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, MoaJson));
32 | }
33 | ~PluginMowOutsideArea() { // write non empty options to file
34 | DeskApp.PutJson(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, MoaJson), _op);
35 | }
36 | string IPlugin.Desc {
37 | get { return "Monitor mowing of an outside island"; }
38 | }
39 | object IPlugin.Options {
40 | get { return _op; }
41 | }
42 | bool IPlugin.Doit(PluginData pd) {
43 | DeskApp.Trace("MOA: None -> Mon");
44 | _op.StateOfMoa = MoaState.Mon; // begin monitoring
45 | _op.StartTime = DateTime.Now.ToString("dd.MM.yyyy HH:mm");
46 | if( _op.TimeInArea > 0 ) {
47 | _tm = new Timer(timer_Callback, null, _op.TimeInArea * 60000, Timeout.Infinite);
48 | DeskApp.Trace(string.Format("MOA: Start Timer {0}", _op.TimeInArea));
49 | }
50 | return true;
51 | }
52 | bool IPlugin.Todo(PluginData pd) {
53 | StatusCode ls = pd.Data.LastState;
54 | DeskApp.Trace(string.Format("MOA: State {0}", ls));
55 | if( _op.StateOfMoa == MoaState.Mon && (ls == StatusCode.SEARCHING_HOME || ls == StatusCode.WIRE_GOING_HOME) ) {
56 | DeskApp.Send("{\"cmd\":2}"); // Pause
57 | _op.StateOfMoa = MoaState.None;
58 | DeskApp.Trace("MOA: Monitor -> End");
59 | _op.StartTime = "Not started";
60 | }
61 | return true;
62 | }
63 | void timer_Callback(object state) {
64 | DeskApp.Send("{\"cmd\":3}"); // Home
65 | DeskApp.Trace("MOA: Timer -> End");
66 | _tm = null;
67 | }
68 | }
--------------------------------------------------------------------------------
/DesktopApp/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace DesktopApp.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DesktopApp.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/DesktopApp/PluginHomeBorderCut.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel;
3 | using System.IO;
4 | using System.Runtime.Serialization;
5 | using System.Threading;
6 |
7 | using MqttJson;
8 |
9 | public class PluginHomeBorderCut : IPlugin {
10 | public enum HbcState { None, Leave, Wait, Pause }
11 |
12 | [DataContract]
13 | public class HbcOptions { // Options for PropertyGrid on Plugin tab
14 | [DataMember]
15 | [Description("Time from Leave before Pause and Home (Default 3s)")]
16 | public int TimeToWire { get; set; }
17 | [DataMember]
18 | [Description("State of border cut"), ReadOnly(true)]
19 | public HbcState StateOfBcut { get; set; }
20 |
21 | public HbcOptions() {
22 | TimeToWire = 3;
23 | StateOfBcut = HbcState.None;
24 | }
25 | }
26 |
27 | const string HbcJson = "HomeBorderCut.json"; // file name for options
28 |
29 | private HbcOptions _op = new HbcOptions(); // options
30 | private Timer _tm; // = new Timer(timer_Callback);
31 |
32 | public PluginHomeBorderCut() { // read options from file
33 | _op = DeskApp.GetJson(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, HbcJson));
34 | }
35 | ~PluginHomeBorderCut() { // write options to file
36 | DeskApp.PutJson(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, HbcJson), _op);
37 | }
38 |
39 | string IPlugin.Desc { get { return "Cut border from home (charging station)"; } }
40 | object IPlugin.Options { get { return _op; } }
41 |
42 | bool IPlugin.Doit(PluginData pd) {
43 | if( pd.Data.LastState == StatusCode.HOME ) {
44 | DeskApp.Send("{\"cmd\":4}");
45 | DeskApp.Trace("HBC: Training");
46 | _op.StateOfBcut = HbcState.Leave;
47 | } else return false;
48 | return true;
49 | }
50 |
51 | bool IPlugin.Todo(PluginData pd) {
52 | Data d = pd.Data;
53 |
54 | if( _op.StateOfBcut != HbcState.None ) {
55 | DeskApp.Trace(string.Format("HBC: State {0}", pd.Data.LastState));
56 | if( d.LastState == StatusCode.HOME || d.LastState == StatusCode.LEAVE_HOUSE ) {
57 | if( _op.StateOfBcut == HbcState.Leave ) {
58 | _tm = new Timer(timer_Callback, null, _op.TimeToWire * 1000, Timeout.Infinite);
59 | _op.StateOfBcut = HbcState.Wait;
60 | DeskApp.Trace("HBC: Leave -> Timer");
61 | } else {
62 | DeskApp.Trace("HBC: Leave ignore " + d.LastState);
63 | }
64 | //} else if( _op.StateOfBcut == HbcState.Leave && d.LastState == StatusCode.APP_WIRE_FOLLOW_AREA_TRAINING ) {
65 | // if( _op.TimeOnWire > 0 ) {
66 | // _tm = new Timer(timer_Callback, null, _op.TimeOnWire * 1000, Timeout.Infinite);
67 | // _op.StateOfBcut = HbcState.Wait;
68 | // DeskApp.Trace("HBC: Wire -> Timer");
69 | // } else {
70 | // _op.StateOfBcut = HbcState.Pause;
71 | // DeskApp.Send("{\"cmd\":2}"); // Stop
72 | // DeskApp.Trace("HBC: Wire -> Pause");
73 | // }
74 | } else if( _op.StateOfBcut == HbcState.Pause && d.LastState == StatusCode.PAUSE ) {
75 | DeskApp.Send("{\"cmd\":3}"); // Home
76 | _op.StateOfBcut = HbcState.None;
77 | DeskApp.Trace("HBC: Pause -> Home");
78 | } else {
79 | _op.StateOfBcut = HbcState.None; // somthing wrong?
80 | DeskApp.Trace("HBC: aborted " + d.LastState);
81 | return false;
82 | }
83 | }
84 | return true;
85 | }
86 |
87 | void timer_Callback(object state) {
88 | DeskApp.Send("{\"cmd\":2}");
89 | _op.StateOfBcut = HbcState.Pause;
90 | DeskApp.Trace("HBC: Timer -> Pause");
91 | _tm = null;
92 | }
93 | }
94 |
--------------------------------------------------------------------------------
/DesktopApp/FormChoice.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace DesktopApp {
2 | partial class FormChoice {
3 | ///
4 | /// Required designer variable.
5 | ///
6 | private System.ComponentModel.IContainer components = null;
7 |
8 | ///
9 | /// Clean up any resources being used.
10 | ///
11 | /// true if managed resources should be disposed; otherwise, false.
12 | protected override void Dispose(bool disposing) {
13 | if (disposing && (components != null)) {
14 | components.Dispose();
15 | }
16 | base.Dispose(disposing);
17 | }
18 |
19 | #region Windows Form Designer generated code
20 |
21 | ///
22 | /// Required method for Designer support - do not modify
23 | /// the contents of this method with the code editor.
24 | ///
25 | private void InitializeComponent() {
26 | this.button = new System.Windows.Forms.Button();
27 | this.panel = new System.Windows.Forms.Panel();
28 | this.listView = new System.Windows.Forms.ListView();
29 | this.chName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
30 | this.chMac = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
31 | this.panel.SuspendLayout();
32 | this.SuspendLayout();
33 | //
34 | // button
35 | //
36 | this.button.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
37 | this.button.DialogResult = System.Windows.Forms.DialogResult.OK;
38 | this.button.Location = new System.Drawing.Point(181, 5);
39 | this.button.Name = "button";
40 | this.button.Size = new System.Drawing.Size(60, 23);
41 | this.button.TabIndex = 1;
42 | this.button.Text = "OK";
43 | this.button.UseVisualStyleBackColor = true;
44 | //
45 | // panel
46 | //
47 | this.panel.AutoSize = true;
48 | this.panel.Controls.Add(this.button);
49 | this.panel.Dock = System.Windows.Forms.DockStyle.Bottom;
50 | this.panel.Location = new System.Drawing.Point(0, 90);
51 | this.panel.Name = "panel";
52 | this.panel.Size = new System.Drawing.Size(244, 31);
53 | this.panel.TabIndex = 2;
54 | //
55 | // listView
56 | //
57 | this.listView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
58 | this.chName,
59 | this.chMac});
60 | this.listView.Dock = System.Windows.Forms.DockStyle.Fill;
61 | this.listView.FullRowSelect = true;
62 | this.listView.HideSelection = false;
63 | this.listView.Location = new System.Drawing.Point(0, 0);
64 | this.listView.MultiSelect = false;
65 | this.listView.Name = "listView";
66 | this.listView.Size = new System.Drawing.Size(244, 90);
67 | this.listView.TabIndex = 3;
68 | this.listView.UseCompatibleStateImageBehavior = false;
69 | this.listView.View = System.Windows.Forms.View.Details;
70 | //
71 | // chName
72 | //
73 | this.chName.Text = "Name";
74 | //
75 | // chMac
76 | //
77 | this.chMac.Text = "MAC-Adresse";
78 | //
79 | // FormChoice
80 | //
81 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
82 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
83 | this.ClientSize = new System.Drawing.Size(244, 121);
84 | this.Controls.Add(this.listView);
85 | this.Controls.Add(this.panel);
86 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
87 | this.MaximizeBox = false;
88 | this.MinimizeBox = false;
89 | this.Name = "FormChoice";
90 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
91 | this.Text = "Landroid-S auswählen";
92 | this.panel.ResumeLayout(false);
93 | this.ResumeLayout(false);
94 | this.PerformLayout();
95 |
96 | }
97 |
98 | #endregion
99 | private System.Windows.Forms.Button button;
100 | private System.Windows.Forms.Panel panel;
101 | private System.Windows.Forms.ListView listView;
102 | private System.Windows.Forms.ColumnHeader chName;
103 | private System.Windows.Forms.ColumnHeader chMac;
104 | }
105 | }
--------------------------------------------------------------------------------
/DesktopApp/strings.da.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Fejl
6 | Lav Batteri
7 | Batteri Over Temperatur
8 | Knivmotor fejl
9 | Luk klappen til klipning
10 | Tæt på hjemfart
11 | Find hjem Timeout
12 | Plæneklipperen løftet
13 | Plæneklipperen låst
14 | Plæneklipper udenfor grænsetråd
15 | Udskift ledningsforbindelsen
16 | Plæneklipper fastlåst
17 | Timeout 'fanget'
18 | Plæneklipper er vendt om
19 | Hjulmotor fejl
20 | Tråd mangler
21 |
22 | Lader
23 | Kører hjem
24 | Forlader Ladestation
25 | Manuel Stop
26 | Slår græs
27 | Hjemme
28 | Pause
29 | Regnudsættelse
30 | Plæneklipper fastlåst
31 | Ukendt status
32 | Zone Rutevejledning
33 | Zone Træning
34 | Kantklipning
35 | Kører hjem
36 |
37 |
38 | Bruger
39 | &Email
40 | &Adgangskode
41 | &Navn
42 | Behold &i forgrunden
43 | &Login
44 | &Forbind
45 | &Afbryd
46 |
47 | Status
48 | Arbejdstid
49 | Batteri
50 | Stigning
51 | Hældning
52 | Retning
53 | T-slået
54 | Klippetid efter sidste dobbeltklik:
55 | Dist
56 | Samlet afstand
57 | T-kørt
58 | Samlet tid
59 | Seneste opdatering
60 | &Start
61 | &Hjem
62 | S&top
63 | &Hent
64 | Din Landroid pauser i 20 minutter og går derefter ud.
65 |
66 | Skema
67 | Modul
68 | Dag
69 | Kant
70 | Start
71 | Varighed
72 | Slut
73 | Klippetid
74 | Regnudsættelse
75 | &Gem
76 | Starttid i hh:mm
77 | Varighed i minutter mellem 0 og 1440
78 | Sluttid i hh:mm
79 |
80 | Zoner
81 | Start [m]
82 | Andel
83 | &Træning
84 | &Gem
85 | Start i meter mellem 0 og 999
86 |
87 |
--------------------------------------------------------------------------------
/DesktopApp/strings.en.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Error
5 | Battery low
6 | Battery Over Temperature
7 | blade motor fault
8 | close door to cut
9 | close to go home
10 | home find timeout
11 | lifted
12 | lock
13 | outside wire
14 | reverse wire
15 | trapped
16 | trapped timeout fault
17 | upside down
18 | wheel motor fault
19 | wire missing
20 |
21 | Charging
22 | Going home
23 | Leaving home
24 | Manual stop
25 | Mowing
26 | Home
27 | Pause
28 | Rain delay
29 | Trapped
30 | Unknown status
31 | Following wire area search
32 | Following wire area training
33 | Following wire border cut
34 | Following wire going home
35 |
36 |
37 |
38 | User
39 | Email
40 | Password
41 | Name
42 | Keep window in foreground
43 | Login
44 | Connect
45 | Disconnect
46 |
47 | Status
48 | Working hours
49 | Battery
50 | Pitch
51 | Roll
52 | Yaw
53 | Mowing time
54 | Mowing time since last double-click:
55 | Distance
56 | Total distance
57 | Working time
58 | Total time
59 | Last update
60 | Start
61 | Home
62 | Stop
63 | Poll
64 | 20 minute pause
65 |
66 | Plan
67 | Mode
68 | Take selected row for all days
69 | Day
70 | Edge cut
71 | Start
72 | Duration
73 | End
74 | Correction %
75 | Rain
76 | Save...
77 | Start time hh:mm
78 | Duration in minutes between 0 and 1440
79 | End time hh:mm
80 |
81 | Zone
82 | Start [m]
83 | Proportion %
84 | Round trip
85 | Save...
86 | Start in meters between 0 and 999
87 |
88 | Activities
89 | Date Time
90 | State
91 | Error
92 | &Refresh
93 | Login nessesary
94 |
95 | Plugin
96 | Script
97 | Description
98 |
99 |
100 |
--------------------------------------------------------------------------------
/DesktopApp/strings.nl.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Fout
6 | Batterij bijna leeg
7 | Batterij te heet
8 | Messen geblokkeerd
9 | Sluit de klep voorafgaand aan het maaien
10 | Sluit de klep om naar het basisstation te laten rijden
11 | Home time-out
12 | Opgetild
13 | Vergrendeld
14 | Buiten werkgebied
15 | Aansluitfout, draden verwisselen
16 | Vastgelopen
17 | Verstrikt. Veiligheidstime-out
18 | Omgekeerd
19 | Fout wielmotor
20 | Draad ontbreekt
21 |
22 | Aan het opladen
23 | Op weg naar huis
24 | Vanaf het laadstation vertrekken
25 | Handmatige stop
26 | Aan het maaien
27 | Huis
28 | Pauze
29 | Uitstel door regen
30 | Vastgelopen
31 | Onbekend
32 | Zones aan het zoeken
33 | Verdelen in zones
34 | Randen maaien
35 | Naar huis
36 |
37 |
38 | Gebruiker
39 | &Email
40 | &Wachtwoord
41 | &Naam
42 | Venster op voorgrond
43 | &Inloggen
44 | &Verbinden
45 | &Uitschakelen
46 |
47 | Status
48 | Werktijd
49 | Accu
50 | Helling
51 | Glooiingshoek
52 | Richting
53 | Maaitijd
54 | Maaitijd sinds laatste dubbele klick:
55 | Afstand
56 | Totale afstand
57 | Werktijd
58 | Totale tijd
59 | Laatste update
60 | &Start
61 | &Huis
62 | S&top
63 | &Vernieuw
64 | Waarschuwing!!!...Stop!!!
65 |
66 | Planner
67 | Mode
68 | Dag
69 | Kant
70 | Start
71 | Duur
72 | Einde
73 | Werktijd +/-
74 | Regentijd
75 | &Opslaan...
76 | Start als tijd is hh:mm
77 | Duur in minuten tussen 0 en 1440
78 | Stoppen als tijd is hh:mm
79 |
80 | Zone
81 | Start [m]
82 | %
83 | &Omtrek
84 | &Opslaan...
85 | Start in meters tussen 0 en 999
86 |
87 | Activities
88 | Date Time
89 | State
90 | Error
91 | &Refresh
92 | Login required
93 |
94 | Plugin
95 | Script
96 | Description
97 |
98 |
--------------------------------------------------------------------------------
/DesktopApp/strings.sk.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Chyba
5 | Batéria vybitá
6 | Batéria prehriata
7 | Chyba motora kosenia
8 | Zatvorte kryt kosačky
9 | Blížim sa k nabíjačke
10 | Nenašiel som nabíjaciu stanicu
11 | Kosačka zdvihnutá
12 | Kosačka zamknutá
13 | Kosačka mimo okrajového drôtu
14 | Prever zapojenie okrajového drôtu
15 | Kosačka uviazla
16 | Kosačka uviazla
17 | Kosačka je prevrátená
18 | Chyba motora
19 | Okrajový drát je chybný
20 |
21 | Nabíjanie
22 | Na ceste k nabíjačke
23 | Odchádzam z nabíjačky
24 | Manuálne zastvenie
25 | Kosím
26 | Doma - v nabíjačke
27 | Pauza
28 | Prestávka kôli dažďu
29 | Kosačka uviazla
30 | neznámy stav
31 | Hľadám zónu
32 | Testujem zónu
33 | Kosím okraj
34 | Na ceste k nabíjačke
35 |
36 |
37 |
38 | Užívateľ
39 | &Email
40 | &Heslo
41 | &Meno
42 | Ponechať okno &na popredí
43 | &Prihlásiť
44 | P&ripojiť
45 | &Odpojiť
46 |
47 | Stav
48 | Pracovný čas
49 | Batéria
50 | Náklon
51 | Sklon bočný
52 | Smer
53 | čas kosenia
54 | Čas kosenia od posledného dvojkliku:
55 | Celková vzdialenosť
56 | Celková ubehnutá vzdialnosť
57 | Celkový čas
58 | Celkový čas
59 | Posledná aktualizácia
60 | Št&art
61 | &Domov
62 | S&top
63 | &Obnov
64 | Váš Landroid sa zastaví na 20 minút a potom zhasne.
65 |
66 | Plánovač
67 | Mód
68 | Deň
69 | Okraj
70 | Štart
71 | Trvanie
72 | Koniec
73 | Korekcia
74 | Prestávka po daždi
75 | &Uložiť...
76 | Začiatok v hh:mm
77 | Trvanie v minútach od 0 do 1440
78 | Koniec v hh:mm
79 |
80 | Zóny
81 | Štart [m]
82 | Pomer
83 | U&kážka
84 | &Uložiť...
85 | Začiatok v metroch od 0 do 999
86 |
87 | Activities
88 | Date Time
89 | State
90 | Error
91 | &Refresh
92 | Login required
93 |
94 | Plugin
95 | Script
96 | Description
97 |
98 |
--------------------------------------------------------------------------------
/DesktopApp/strings.fr.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Erreur
5 | Batterie faible
6 | Batterie en surchauffe
7 | Problème du moteur de coupe
8 | Fermer le capot pour pouvoir tondre
9 | Fermet pour retourner à la base
10 | Temps dépassé pour retourner à la base
11 | Robot soulevé du sol
12 | Robot verrouillé
13 | Robot en dehors du fil
14 | Câble inversé
15 | Robot coincé
16 | Robot coincé trop longtemps
17 | Robot renversé
18 | Problème du moteur des roues
19 | Câble manquant ou coupé
20 |
21 | En charge
22 | Retour à la base
23 | Départ de la base
24 | Arrêt manuel
25 | Tonte en cours
26 | A la base
27 | En pause
28 | Délai après la pluie
29 | Robot coincé
30 | Inconnu
31 | Recherche de zone
32 | Apprentissage de zone
33 | Coupe des bords
34 | Retour à la base
35 |
36 |
37 |
38 | Utilisateur
39 | &Email
40 | &Mot de passe
41 | &Nom
42 | Fenêtre &toujours visible
43 | &Inscription
44 | &Connexion
45 | &Déconnexion
46 |
47 | Status
48 | Horaire
49 | Batterie
50 | Tangage
51 | Roulis
52 | Lacet
53 | Lame
54 | Temps de tonte:
55 | Distance
56 | Distance totale
57 | Durée
58 | Durée total
59 | Dernier état
60 | &Démarrer
61 | &Maison
62 | &Stop
63 | &Interroger
64 | Pause de 20min puis extinction.
65 |
66 | Horaires
67 | Mode
68 | Jour
69 | Bord
70 | Début
71 | Durée
72 | Fin
73 | Correction
74 | Attente si pluie
75 | &Enregistrer
76 | Heure de début au format hh:mm
77 | Durée en minutes entre 0 et 1440
78 | Heure de fin au format hh:mm
79 |
80 | Multi-zone
81 | Début [m]
82 | Pourcentage
83 | &Tour de bord
84 | &Enregistrer
85 | Début en mètres entre 0 et 999
86 |
87 | Activities
88 | Date Time
89 | State
90 | Error
91 | &Refresh
92 | Login required
93 |
94 | Plugin
95 | Script
96 | Description
97 |
98 |
99 |
--------------------------------------------------------------------------------
/DesktopApp/strings.it.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Errore
6 | Batteria scarica
7 | Battery Over Temperature
8 | Lama bloccata
9 | Chiudi lo sportellino per tagliare
10 | Chiudi per andare alla home
11 | Timeout della home
12 | Landroid sollevato
13 | Landroid bloccato
14 | Landroid fuori dal filo
15 | Inverti filo
16 | Landroid intrappolato
17 | Intrappolato - limite di sicurezza scaduto
18 | Landroid rovesciato
19 | Errore sul motore della ruota
20 | Filo non rilevato
21 |
22 | Wird geladen
23 | In rientro
24 | Uscita dalla base
25 | Stop manuale
26 | Taglio in corso
27 | Home
28 | Pause
29 | Ritardo pioggia
30 | Landroid intrappolato
31 | Sconosciuto
32 | Zonenanfahrt
33 | Zonen Training
34 | Kantenschnitt
35 | Heimfahrt
36 |
37 |
38 |
39 | Nutzer
40 | &Email
41 | &Passwort
42 | &Name
43 | Fenster im &Vordergrund halten
44 | &Anmelden
45 | &Verbinden
46 | &Trennen
47 |
48 | Status
49 | Arbeitszeit
50 | Akkumulator
51 | Steigung
52 | Neigung
53 | Richtung
54 | T-Mäh
55 | Mähzeit seit letztem Doppelklick:
56 | S-Ges
57 | Gesamtstrecke
58 | T-Ges
59 | Gesamtzeit
60 | Letzte Aktualisierung
61 | &Start
62 | &Heim
63 | S&topp
64 | &Poll
65 | Dein Landroid pausiert 20 min und geht dann aus.
66 |
67 | Planer
68 | Modus
69 | Tag
70 | Kante
71 | Start
72 | Dauer
73 | Ende
74 | Korrektur
75 | Regenzeit
76 | &Sichern...
77 | Start als Zeit in hh:mm
78 | Dauer in Minuten zwischen 0 und 1440
79 | Ende als Zeit in hh:mm
80 |
81 | Zonen
82 | Start [m]
83 | Anteil
84 | &Rundfahrt
85 | &Sichern...
86 | Start in Metern zwischen 0 und 999
87 |
88 | Aktivität
89 | Datum Zeit
90 | Zustand
91 | Fehler
92 | &Aktualisieren
93 | Anmelden ist notwendig
94 |
95 | Plugin
96 | Skript
97 | Beschreibung
98 |
99 |
--------------------------------------------------------------------------------
/DesktopApp/strings.de.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Fehler
6 | Batterieladung niedrig
7 | Batterietemperatur unzulässig
8 | Fehler Messermotor
9 | Klappe zum Mähen schließen
10 | Schließen zur Heimfahrt
11 | Zeitüberschreitung Heimfahrt
12 | Mäher angehoben
13 | Mäher gesperrt
14 | Mäher außerhalb Grenzdraht
15 | Drahtanschluss tauschen
16 | Mäher festgefahren
17 | Zeitüberschreitung ‘gefangen’
18 | Mäher umgedreht
19 | Fehler Radmotor
20 | Draht fehlt
21 |
22 | Wird geladen
23 | Heimfahrt
24 | Ausfahrt Ladestation
25 | Manueller Stopp
26 | Mähen
27 | zu Hause
28 | Pause
29 | Regenverzögerung
30 | Mäher festgefahren
31 | unbekannt
32 | Zonenanfahrt
33 | Zonen Training
34 | Kantenschnitt
35 | Heimfahrt
36 |
37 |
38 |
39 | Nutzer
40 | &Email
41 | &Passwort
42 | &Name
43 | Fenster im &Vordergrund halten
44 | &Anmelden
45 | &Verbinden
46 | &Trennen
47 |
48 | Status
49 | Arbeitszeit
50 | Akkumulator
51 | Steigung
52 | Neigung
53 | Richtung
54 | T-Mäh
55 | Mähzeit seit letztem Doppelklick:
56 | S-Ges
57 | Gesamtstrecke
58 | T-Ges
59 | Gesamtzeit
60 | Letzte Aktualisierung
61 | &Start
62 | &Heim
63 | S&topp
64 | &Poll
65 | Dein Landroid pausiert 20 min und geht dann aus.
66 |
67 | Planer
68 | Modus
69 | Übernehme selektierte Zeile für alle Tage
70 | Tag
71 | Kante
72 | Start
73 | Dauer
74 | Ende
75 | Korrektur
76 | Regenzeit
77 | &Sichern...
78 | Start als Zeit in hh:mm
79 | Dauer in Minuten zwischen 0 und 1440
80 | Ende als Zeit in hh:mm
81 |
82 | Zonen
83 | Start [m]
84 | Anteil
85 | &Rundfahrt
86 | &Sichern...
87 | Start in Metern zwischen 0 und 999
88 |
89 | Aktivität
90 | Datum Zeit
91 | Zustand
92 | Fehler
93 | &Aktualisieren
94 | Anmelden ist notwendig
95 |
96 | Plugin
97 | Skript
98 | Beschreibung
99 |
100 |
--------------------------------------------------------------------------------
/DesktopApp/FormChoice.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/DesktopApp/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 |
--------------------------------------------------------------------------------
/DesktopApp/DesktopApp.Mono.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {3D305AC2-C506-42AD-B087-01B43862D638}
8 | WinExe
9 | Properties
10 | DesktopApp
11 | DeskApp
12 | v4.6
13 | 512
14 | true
15 |
16 | mobj\
17 |
18 |
19 | true
20 | full
21 | false
22 | mono\Debug\
23 | DEBUG;TRACE
24 | prompt
25 | 4
26 | false
27 |
28 |
29 | AnyCPU
30 | pdbonly
31 | true
32 | mono\Release\
33 | TRACE
34 | prompt
35 | 4
36 | false
37 |
38 |
39 | Landroid.ico
40 |
41 |
42 |
43 | ..\CSScriptLibrary.dll
44 |
45 |
46 | ..\M2Mqtt.Mono.dll
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 | True
64 | True
65 | AppRes.resx
66 |
67 |
68 | PreserveNewest
69 |
70 |
71 | Form
72 |
73 |
74 | FormChoice.cs
75 |
76 |
77 | Form
78 |
79 |
80 | FormMain.cs
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 | AppRes.Designer.cs
91 |
92 |
93 | FormChoice.Designer.cs
94 | FormChoice.cs
95 |
96 |
97 | FormMain.Designer.cs
98 | FormMain.cs
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 | {56063287-2F56-4797-8A1E-C898A87258A3}
108 | MqttJson
109 |
110 |
111 |
112 |
113 | PreserveNewest
114 |
115 |
116 | PreserveNewest
117 |
118 |
119 | PreserveNewest
120 |
121 |
122 | PreserveNewest
123 |
124 |
125 | PreserveNewest
126 |
127 |
128 | PreserveNewest
129 |
130 |
131 | PreserveNewest
132 |
133 |
134 | PreserveNewest
135 |
136 |
137 |
138 |
139 |
146 |
--------------------------------------------------------------------------------
/Desktop App.Mono.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2012
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MqttJson", "MqttJson\MqttJson.csproj", "{56063287-2F56-4797-8A1E-C898A87258A3}"
5 | EndProject
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DesktopApp.Mono", "DesktopApp\DesktopApp.Mono.csproj", "{3D305AC2-C506-42AD-B087-01B43862D638}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {56063287-2F56-4797-8A1E-C898A87258A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {56063287-2F56-4797-8A1E-C898A87258A3}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {56063287-2F56-4797-8A1E-C898A87258A3}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {56063287-2F56-4797-8A1E-C898A87258A3}.Release|Any CPU.Build.0 = Release|Any CPU
18 | {3D305AC2-C506-42AD-B087-01B43862D638}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
19 | {3D305AC2-C506-42AD-B087-01B43862D638}.Debug|Any CPU.Build.0 = Debug|Any CPU
20 | {3D305AC2-C506-42AD-B087-01B43862D638}.Release|Any CPU.ActiveCfg = Release|Any CPU
21 | {3D305AC2-C506-42AD-B087-01B43862D638}.Release|Any CPU.Build.0 = Release|Any CPU
22 | EndGlobalSection
23 | GlobalSection(MonoDevelopProperties) = preSolution
24 | Policies = $0
25 | $0.TextStylePolicy = $1
26 | $1.FileWidth = 120
27 | $1.TabWidth = 2
28 | $1.IndentWidth = 2
29 | $1.EolMarker = Windows
30 | $1.inheritsSet = VisualStudio
31 | $1.inheritsScope = text/plain
32 | $1.scope = text/x-csharp
33 | $0.CSharpFormattingPolicy = $2
34 | $2.AfterDelegateDeclarationParameterComma = True
35 | $2.inheritsSet = Mono
36 | $2.inheritsScope = text/x-csharp
37 | $2.scope = text/x-csharp
38 | $0.TextStylePolicy = $3
39 | $3.FileWidth = 120
40 | $3.TabWidth = 2
41 | $3.IndentWidth = 2
42 | $3.inheritsSet = Mono
43 | $3.inheritsScope = text/plain
44 | $3.scope = text/plain
45 | $0.DotNetNamingPolicy = $4
46 | $4.DirectoryNamespaceAssociation = None
47 | $4.ResourceNamePolicy = FileFormatDefault
48 | $0.StandardHeader = $5
49 | $5.Text =
50 | $5.IncludeInNewFiles = True
51 | $0.NameConventionPolicy = $6
52 | $6.Rules = $7
53 | $7.NamingRule = $8
54 | $8.Name = Namespaces
55 | $8.AffectedEntity = Namespace
56 | $8.VisibilityMask = VisibilityMask
57 | $8.NamingStyle = PascalCase
58 | $8.IncludeInstanceMembers = True
59 | $8.IncludeStaticEntities = True
60 | $7.NamingRule = $9
61 | $9.Name = Types
62 | $9.AffectedEntity = Class, Struct, Enum, Delegate
63 | $9.VisibilityMask = Public
64 | $9.NamingStyle = PascalCase
65 | $9.IncludeInstanceMembers = True
66 | $9.IncludeStaticEntities = True
67 | $7.NamingRule = $10
68 | $10.Name = Interfaces
69 | $10.RequiredPrefixes = $11
70 | $11.String = I
71 | $10.AffectedEntity = Interface
72 | $10.VisibilityMask = Public
73 | $10.NamingStyle = PascalCase
74 | $10.IncludeInstanceMembers = True
75 | $10.IncludeStaticEntities = True
76 | $7.NamingRule = $12
77 | $12.Name = Attributes
78 | $12.RequiredSuffixes = $13
79 | $13.String = Attribute
80 | $12.AffectedEntity = CustomAttributes
81 | $12.VisibilityMask = Public
82 | $12.NamingStyle = PascalCase
83 | $12.IncludeInstanceMembers = True
84 | $12.IncludeStaticEntities = True
85 | $7.NamingRule = $14
86 | $14.Name = Event Arguments
87 | $14.RequiredSuffixes = $15
88 | $15.String = EventArgs
89 | $14.AffectedEntity = CustomEventArgs
90 | $14.VisibilityMask = Public
91 | $14.NamingStyle = PascalCase
92 | $14.IncludeInstanceMembers = True
93 | $14.IncludeStaticEntities = True
94 | $7.NamingRule = $16
95 | $16.Name = Exceptions
96 | $16.RequiredSuffixes = $17
97 | $17.String = Exception
98 | $16.AffectedEntity = CustomExceptions
99 | $16.VisibilityMask = VisibilityMask
100 | $16.NamingStyle = PascalCase
101 | $16.IncludeInstanceMembers = True
102 | $16.IncludeStaticEntities = True
103 | $7.NamingRule = $18
104 | $18.Name = Methods
105 | $18.AffectedEntity = Methods
106 | $18.VisibilityMask = Protected, Public
107 | $18.NamingStyle = PascalCase
108 | $18.IncludeInstanceMembers = True
109 | $18.IncludeStaticEntities = True
110 | $7.NamingRule = $19
111 | $19.Name = Static Readonly Fields
112 | $19.AffectedEntity = ReadonlyField
113 | $19.VisibilityMask = Protected, Public
114 | $19.NamingStyle = PascalCase
115 | $19.IncludeInstanceMembers = False
116 | $19.IncludeStaticEntities = True
117 | $7.NamingRule = $20
118 | $20.Name = Fields
119 | $20.AffectedEntity = Field
120 | $20.VisibilityMask = Protected, Public
121 | $20.NamingStyle = PascalCase
122 | $20.IncludeInstanceMembers = True
123 | $20.IncludeStaticEntities = True
124 | $7.NamingRule = $21
125 | $21.Name = ReadOnly Fields
126 | $21.AffectedEntity = ReadonlyField
127 | $21.VisibilityMask = Protected, Public
128 | $21.NamingStyle = PascalCase
129 | $21.IncludeInstanceMembers = True
130 | $21.IncludeStaticEntities = False
131 | $7.NamingRule = $22
132 | $22.Name = Constant Fields
133 | $22.AffectedEntity = ConstantField
134 | $22.VisibilityMask = Protected, Public
135 | $22.NamingStyle = PascalCase
136 | $22.IncludeInstanceMembers = True
137 | $22.IncludeStaticEntities = True
138 | $7.NamingRule = $23
139 | $23.Name = Properties
140 | $23.AffectedEntity = Property
141 | $23.VisibilityMask = Protected, Public
142 | $23.NamingStyle = PascalCase
143 | $23.IncludeInstanceMembers = True
144 | $23.IncludeStaticEntities = True
145 | $7.NamingRule = $24
146 | $24.Name = Events
147 | $24.AffectedEntity = Event
148 | $24.VisibilityMask = Protected, Public
149 | $24.NamingStyle = PascalCase
150 | $24.IncludeInstanceMembers = True
151 | $24.IncludeStaticEntities = True
152 | $7.NamingRule = $25
153 | $25.Name = Enum Members
154 | $25.AffectedEntity = EnumMember
155 | $25.VisibilityMask = VisibilityMask
156 | $25.NamingStyle = PascalCase
157 | $25.IncludeInstanceMembers = True
158 | $25.IncludeStaticEntities = True
159 | $7.NamingRule = $26
160 | $26.Name = Parameters
161 | $26.AffectedEntity = Parameter
162 | $26.VisibilityMask = VisibilityMask
163 | $26.NamingStyle = CamelCase
164 | $26.IncludeInstanceMembers = True
165 | $26.IncludeStaticEntities = True
166 | $7.NamingRule = $27
167 | $27.Name = Type Parameters
168 | $27.RequiredPrefixes = $28
169 | $28.String = T
170 | $27.AffectedEntity = TypeParameter
171 | $27.VisibilityMask = VisibilityMask
172 | $27.NamingStyle = PascalCase
173 | $27.IncludeInstanceMembers = True
174 | $27.IncludeStaticEntities = True
175 | outputpath = DesktopApp\mono
176 | EndGlobalSection
177 | EndGlobal
178 |
--------------------------------------------------------------------------------
/DesktopApp/AppRes.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // Dieser Code wurde von einem Tool generiert.
4 | // Laufzeitversion:4.0.30319.42000
5 | //
6 | // Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
7 | // der Code erneut generiert wird.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace DesktopApp {
12 | using System;
13 |
14 |
15 | ///
16 | /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
17 | ///
18 | // Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert
19 | // -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert.
20 | // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
21 | // mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class AppRes {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal AppRes() {
33 | }
34 |
35 | ///
36 | /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DesktopApp.AppRes", typeof(AppRes).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
51 | /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 |
63 | ///
64 | /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
65 | ///
66 | internal static System.Drawing.Bitmap bt_charging {
67 | get {
68 | object obj = ResourceManager.GetObject("bt_charging", resourceCulture);
69 | return ((System.Drawing.Bitmap)(obj));
70 | }
71 | }
72 |
73 | ///
74 | /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
75 | ///
76 | internal static System.Drawing.Bitmap home16 {
77 | get {
78 | object obj = ResourceManager.GetObject("home16", resourceCulture);
79 | return ((System.Drawing.Bitmap)(obj));
80 | }
81 | }
82 |
83 | ///
84 | /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
85 | ///
86 | internal static System.Drawing.Bitmap pause16 {
87 | get {
88 | object obj = ResourceManager.GetObject("pause16", resourceCulture);
89 | return ((System.Drawing.Bitmap)(obj));
90 | }
91 | }
92 |
93 | ///
94 | /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
95 | ///
96 | internal static System.Drawing.Bitmap play16 {
97 | get {
98 | object obj = ResourceManager.GetObject("play16", resourceCulture);
99 | return ((System.Drawing.Bitmap)(obj));
100 | }
101 | }
102 |
103 | ///
104 | /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
105 | ///
106 | internal static System.Drawing.Bitmap refresh16 {
107 | get {
108 | object obj = ResourceManager.GetObject("refresh16", resourceCulture);
109 | return ((System.Drawing.Bitmap)(obj));
110 | }
111 | }
112 |
113 | ///
114 | /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
115 | ///
116 | internal static System.Drawing.Bitmap right16 {
117 | get {
118 | object obj = ResourceManager.GetObject("right16", resourceCulture);
119 | return ((System.Drawing.Bitmap)(obj));
120 | }
121 | }
122 |
123 | ///
124 | /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
125 | ///
126 | internal static System.Drawing.Bitmap rssi_0 {
127 | get {
128 | object obj = ResourceManager.GetObject("rssi_0", resourceCulture);
129 | return ((System.Drawing.Bitmap)(obj));
130 | }
131 | }
132 |
133 | ///
134 | /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
135 | ///
136 | internal static System.Drawing.Bitmap rssi_1 {
137 | get {
138 | object obj = ResourceManager.GetObject("rssi_1", resourceCulture);
139 | return ((System.Drawing.Bitmap)(obj));
140 | }
141 | }
142 |
143 | ///
144 | /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
145 | ///
146 | internal static System.Drawing.Bitmap rssi_2 {
147 | get {
148 | object obj = ResourceManager.GetObject("rssi_2", resourceCulture);
149 | return ((System.Drawing.Bitmap)(obj));
150 | }
151 | }
152 |
153 | ///
154 | /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
155 | ///
156 | internal static System.Drawing.Bitmap rssi_3 {
157 | get {
158 | object obj = ResourceManager.GetObject("rssi_3", resourceCulture);
159 | return ((System.Drawing.Bitmap)(obj));
160 | }
161 | }
162 |
163 | ///
164 | /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
165 | ///
166 | internal static System.Drawing.Bitmap stop16 {
167 | get {
168 | object obj = ResourceManager.GetObject("stop16", resourceCulture);
169 | return ((System.Drawing.Bitmap)(obj));
170 | }
171 | }
172 |
173 | ///
174 | /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
175 | ///
176 | internal static System.Drawing.Bitmap tooltip {
177 | get {
178 | object obj = ResourceManager.GetObject("tooltip", resourceCulture);
179 | return ((System.Drawing.Bitmap)(obj));
180 | }
181 | }
182 | }
183 | }
184 |
--------------------------------------------------------------------------------
/DesktopApp/DesktopApp.Net.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {3D305AC2-C506-42AD-B087-01B43862D638}
8 | WinExe
9 | Properties
10 | DesktopApp
11 | DeskApp
12 | v4.8
13 | 512
14 | true
15 |
16 | false
17 | publish\
18 | true
19 | Disk
20 | false
21 | Foreground
22 | 7
23 | Days
24 | false
25 | false
26 | true
27 | 0
28 | 1.0.0.%2a
29 | false
30 | true
31 |
32 |
33 | AnyCPU
34 | true
35 | full
36 | false
37 | bin\Debug\
38 | DEBUG;TRACE
39 | prompt
40 | 4
41 | false
42 |
43 |
44 | AnyCPU
45 | pdbonly
46 | true
47 | bin\Release\
48 | TRACE
49 | prompt
50 | 4
51 | false
52 |
53 |
54 | Landroid.ico
55 |
56 |
57 |
58 | False
59 | ..\CSScriptLibrary.dll
60 |
61 |
62 | False
63 | ..\M2Mqtt.Net.dll
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 | True
84 | True
85 | AppRes.resx
86 |
87 |
88 | PreserveNewest
89 |
90 |
91 | Form
92 |
93 |
94 | FormChoice.cs
95 |
96 |
97 | Form
98 |
99 |
100 | FormMain.cs
101 |
102 |
103 |
104 |
105 |
106 |
107 | ResXFileCodeGenerator
108 | AppRes.Designer.cs
109 |
110 |
111 | ResXFileCodeGeneratorEx
112 | FormChoice1.Designer.cs
113 | FormChoice.cs
114 |
115 |
116 | FormMain1.Designer.cs
117 | FormMain.cs
118 |
119 |
120 |
121 |
122 | Designer
123 |
124 |
125 |
126 |
127 | PreserveNewest
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 | PreserveNewest
139 |
140 |
141 | PreserveNewest
142 | Designer
143 |
144 |
145 | PreserveNewest
146 |
147 |
148 | PreserveNewest
149 |
150 |
151 | PreserveNewest
152 |
153 |
154 | PreserveNewest
155 |
156 |
157 | PreserveNewest
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 | False
167 | Microsoft .NET Framework 4.5 %28x86 and x64%29
168 | true
169 |
170 |
171 | False
172 | .NET Framework 3.5 SP1
173 | false
174 |
175 |
176 |
177 |
178 | {56063287-2f56-4797-8a1e-c898a87258a3}
179 | MqttJson
180 |
181 |
182 |
183 |
190 |
--------------------------------------------------------------------------------
/DesktopApp/AppRes.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 |
122 | Images\bt_charging.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
123 |
124 |
125 | Images\home16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
126 |
127 |
128 | Images\pause16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
129 |
130 |
131 | Images\play16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
132 |
133 |
134 | Images\refresh16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
135 |
136 |
137 | Images\right16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
138 |
139 |
140 | Images\rssi_0.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
141 |
142 |
143 | Images\rssi_1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
144 |
145 |
146 | Images\rssi_2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
147 |
148 |
149 | Images\rssi_3.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
150 |
151 |
152 | Images\stop16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
153 |
154 |
155 | Images\tooltip.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
156 |
157 |
--------------------------------------------------------------------------------
/MqttJson/MqttJson.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Diagnostics;
4 | using System.IO;
5 | using System.Runtime.Serialization;
6 | using System.Runtime.Serialization.Json;
7 | using System.Xml;
8 |
9 | namespace MqttJson{
10 | #region Enums
11 | public enum ErrorCode : int {
12 | UNK = -1,
13 | NONE = 0,
14 | TRAPPED = 1,
15 | LIFTED = 2,
16 | WIRE_MISSING = 3,
17 | OUTSIDE_WIRE = 4,
18 | RAINING = 5,
19 | CLOSE_DOOR_TO_CUT_GRASS = 6,
20 | CLOSE_DOOR_GO_HOME = 7,
21 | MOTOR_BLADE_FAULT = 8,
22 | MOTOR_WHEELS_FAULT = 9,
23 | TRAPPED_TIMEOUT_FAULT = 10,
24 | UPSIDE_DOWN = 11,
25 | BATTERY_LOW = 12,
26 | REVERSE_WIRE = 13,
27 | BATTERY_CHARGE_ERROR = 14,
28 | HOME_FIND_TIMEOUT = 15,
29 | LOCK = 16,
30 | BATTERY_OVERTEMP = 17,
31 | DUMMY_MODEL = 18,
32 | BATTERY_TRUNK_OPEN_TIMEOUT = 19,
33 | ERR_WIRE_SYNC = 20,
34 | NUM = 21
35 | }
36 | public enum StatusCode : int {
37 | UNK = -1,
38 | IDLE = 0,
39 | HOME = 1,
40 | START_SEQUENCE = 2,
41 | LEAVE_HOUSE = 3,
42 | FOLLOW_WIRE = 4,
43 | SEARCHING_HOME = 5,
44 | SEARCHING_WIRE = 6,
45 | GRASS_CUTTING = 7,
46 | LIFT_RECOVERY = 8,
47 | TRAPPED_RECOVERY = 9,
48 | BLADE_BLOCKED_RECOVERY = 10,
49 | DEBUG = 11,
50 | REMOTE_CONTROL = 12,
51 | OFF_LIMITS_ESCAPE = 13,
52 | WIRE_GOING_HOME = 30,
53 | WIRE_AREA_TRAINING = 31,
54 | WIRE_BORDER_CUT = 32,
55 | WIRE_AREA_SEARCH = 33,
56 | PAUSE = 34
57 | }
58 | public enum ChargeCoge : int {
59 | CHARGED = 0,
60 | CHARGING = 1,
61 | ERROR_CHARGING = 2
62 | }
63 | public enum Command : int {
64 | NONE = 0,
65 | START = 1,
66 | STOP = 2,
67 | HOME_REQ = 3,
68 | ZONE_SEARCH_REQ = 4,
69 | LOCK = 5,
70 | UNLOCK = 6,
71 | RESET_LOG = 7,
72 | PAUSE_OVER_WIRE,
73 | SAFE_HOMING
74 | }
75 | #endregion
76 |
77 | #region MqttJson
78 | /*
79 | {
80 | "cfg":{
81 | "id":1,
82 | "lg":"it",
83 | "tm":"14:13:57", "dt":"30/07/2017",
84 | "sc":{"m":1,"p":0,
85 | "d":[["15:30",330,0],["15:30",330,1],["15:30",330,0],["15:30",330,1],["15:30",330,0],["15:30",330,1],["15:30",330,0]]},
86 | "cmd":0,
87 | "mz":[0,0,0,0], "mzv":[0,0,0,0,0,0,0,0,0,0],
88 | "rd":120,
89 | "sn":"..."},
90 | "al":{"lvl":0,"t":60},
91 | "t":-13,
92 | "modules":{"DF":{"cut":1,"fh":1}
93 | },
94 | "dat":{
95 | "mac":"F0FE6B...",
96 | "fw":2.69,
97 | "bt":{"t":31.7,"v":19.53,"p":82,"nr":910,"c":0},
98 | "dmp":[3.3,-3.2,328.8],
99 | "st":{"b":20010,"d":315068,"wt":21307},
100 | "ls":1,
101 | "le":0,
102 | "lz":0,
103 | "rsi":-74,
104 | "lk":0
105 | }
106 | }
107 | */
108 | [DataContract]
109 | public class OneTimeScheduler {
110 | [DataMember(Name = "bc")] public int BorderCut; // cmommand for border cut
111 | [DataMember(Name = "wtm")] public int WorkTime; // working time in minutes
112 | }
113 |
114 | [DataContract] public struct Schedule {
115 | [DataMember(Name = "m")] public int Mode;
116 | [DataMember(Name = "distm", EmitDefaultValue = false)] public int? Party;
117 | [DataMember(Name = "ots", EmitDefaultValue = false)] public OneTimeScheduler Ots;
118 | [DataMember(Name = "p")] public int Perc; // override from -100% to +100%, 0% is normal
119 | [DataMember(Name = "d")] public List> Days;
120 | [DataMember(Name = "dd", EmitDefaultValue = false)] public List> DDays;
121 | }
122 |
123 | [DataContract]
124 | public class ModuleConfig {
125 | [DataMember(Name = "enabled")] public int Enabled; // config of module
126 | }
127 |
128 | [DataContract]
129 | public class ModuleConfigDF { // config of module OLM
130 | [DataMember(Name = "cut")] public int Cutting;
131 | [DataMember(Name = "fh")] public int FastHome;
132 | }
133 |
134 | [DataContract] public class ModuleConfigs {
135 | [DataMember(Name = "US")] public ModuleConfig US; // config of module ACS
136 | [DataMember(Name = "4G")] public ModuleConfig G4; // config of module FML
137 | [DataMember(Name = "DF")] public ModuleConfigDF DF; // config of module OML
138 | }
139 |
140 | [DataContract]
141 | public class AutoLock {
142 | [DataMember(Name = "lvl")] public int Level;
143 | [DataMember(Name = "t")] public int Time;
144 | }
145 |
146 | [DataContract] public struct Config {
147 | [DataMember(Name = "id",EmitDefaultValue = false)] public int? Id;
148 | [DataMember(Name = "lg")] public string Language; // always it :-(
149 | [DataMember(Name = "tm")] public string Time;
150 | [DataMember(Name = "dt")] public string Date;
151 | [DataMember(Name = "sc")] public Schedule Schedule;
152 | [DataMember(Name = "cmd")] public Command Cmd;
153 | [DataMember(Name = "mz")] public int[] MultiZones; // [0-3] start point in meters
154 | [DataMember(Name = "mzv")] public int[] MultiZonePercs; // [0-9] ring list of start indizes
155 | [DataMember(Name = "rd")] public int RainDelay;
156 | [DataMember(Name = "sn")] public string SerialNo;
157 | [DataMember(Name = "al",EmitDefaultValue = false)] public AutoLock AutoLock;
158 | [DataMember(Name = "tq",EmitDefaultValue = false)] public int? Torque;
159 | [DataMember(Name = "modules",EmitDefaultValue = false)] public ModuleConfigs ModulesC;
160 | }
161 |
162 | [DataContract] public struct Battery {
163 | [DataMember(Name = "t")] public float Temp;
164 | [DataMember(Name = "v")] public float Volt;
165 | [DataMember(Name = "p")] public float Perc;
166 | [DataMember(Name = "nr")] public int Cycle;
167 | [DataMember(Name = "c")] public ChargeCoge Charging;
168 | [DataMember(Name = "m")] public int Maintenance;
169 | }
170 |
171 | [DataContract] public struct Statistic {
172 | [DataMember(Name = "b")] public int Blade; // total runtime with blade on in minutes
173 | [DataMember(Name = "d")] public int Distance; // total distance in meters
174 | [DataMember(Name = "wt")] public int WorkTime; // total worktim in minutes
175 | [DataMember(Name = "bl")] public int BladeLast; // blade time since last reset
176 | }
177 |
178 | [DataContract] public class Rain {
179 | [DataMember(Name = "s")] public int State; // state of sensor
180 | [DataMember(Name = "cnt")] public int Counter; // delay counter
181 | }
182 |
183 | [DataContract] public class ModuleState {
184 | [DataMember(Name = "stat")] public string State; // state of module
185 | }
186 |
187 | [DataContract] public class ModuleStates {
188 | [DataMember(Name = "US")] public ModuleState US; // state of module ACS
189 | [DataMember(Name = "DF")] public ModuleState DF; // state of module OLM
190 | [DataMember(Name = "RL")] public ModuleState RL; // state of module RLM
191 | [DataMember(Name = "4G")] public ModuleState G4; // state of module FML
192 | }
193 |
194 | [DataContract] public struct Data {
195 | [DataMember(Name = "mac")] public string MacAdr;
196 | [DataMember(Name = "fw")] public double Firmware;
197 | [DataMember(Name = "fwb", EmitDefaultValue = false)] public int? Beta;
198 | [DataMember(Name = "bt")] public Battery Battery;
199 | [DataMember(Name = "dmp")] public float[] Orient; // 0-pitch, 1-roll, 2-yaw
200 | [DataMember(Name = "st")] public Statistic Statistic;
201 | [DataMember(Name = "ls")] public StatusCode LastState;
202 | [DataMember(Name = "le")] public ErrorCode LastError;
203 | [DataMember(Name = "lz")] public int LastZone;
204 | [DataMember(Name = "rsi")] public int RecvSignal;
205 | [DataMember(Name = "lk")] public int Lock;
206 | [DataMember(Name = "act", EmitDefaultValue = false)] public int? Act;
207 | [DataMember(Name = "tr", EmitDefaultValue = false)] public int? Tr;
208 | [DataMember(Name = "conn", EmitDefaultValue = false)] public string Conn;
209 | [DataMember(Name = "rain", EmitDefaultValue = false)] public Rain Rain;
210 | [DataMember(Name = "modules", EmitDefaultValue = false)] public ModuleStates ModulesD;
211 | }
212 | #endregion
213 |
214 | #region Plugin
215 | public struct PluginData {
216 | public string Name;
217 | public Config Config;
218 | public Data Data;
219 | }
220 |
221 | public delegate void DelegateString(string msg);
222 |
223 | public static class DeskApp {
224 | public static DelegateString _send { get; set; }
225 | public static DelegateString _trace { get; set; }
226 |
227 | public static void Send(string mqtt) { _send?.Invoke(mqtt); }
228 | public static void Trace(string text) { _trace?.Invoke(text); }
229 |
230 | public static T GetJson(string name) where T : class, new() {
231 | if( File.Exists(name) ) {
232 | try {
233 | using( FileStream fs = new FileStream(name, FileMode.Open) ) {
234 | DataContractJsonSerializer dcjs = new DataContractJsonSerializer(typeof(T));
235 |
236 | return dcjs.ReadObject(fs) as T;
237 | }
238 | } catch {
239 | return new T();
240 | }
241 | }
242 | return new T();
243 | }
244 |
245 | public static void PutJson(string name, T json) where T : class {
246 | DataContractJsonSerializer dcjs = new DataContractJsonSerializer(typeof(T));
247 | FileStream fs = new FileStream(name, FileMode.Create);
248 |
249 | dcjs.WriteObject(fs, json);
250 | fs.Close();
251 | }
252 | }
253 |
254 | public interface IPlugin {
255 | object Options { get; }
256 | string Desc { get; }
257 | bool Doit(PluginData pd);
258 | bool Todo(PluginData pd);
259 | }
260 | #endregion
261 | }
262 |
--------------------------------------------------------------------------------
/DesktopApp/LsClient.cs:
--------------------------------------------------------------------------------
1 | #define PLUGIN
2 |
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Collections.Specialized;
6 | using System.Configuration;
7 | using System.Diagnostics;
8 | using System.IO;
9 | using System.Runtime.Serialization;
10 | using System.Runtime.Serialization.Json;
11 | using System.Text;
12 | using System.Security.Cryptography.X509Certificates;
13 | using System.Net;
14 |
15 | using uPLibrary.Networking.M2Mqtt;
16 | using uPLibrary.Networking.M2Mqtt.Messages;
17 | using System.Threading;
18 |
19 | #if PLUGIN
20 | using CSScriptLibrary;
21 | #endif
22 |
23 | using MqttJson;
24 |
25 | namespace DesktopApp
26 | {
27 | #region Structs
28 | /*
29 | User auth {"id":000,"name":"...","email":"...","created_at":"...","updated_at":"...","city":null,"address":null,"zipcode":null,
30 | "country_id":276,"phone":null,"birth_date":null,"sex":null,"newsletter_subscription":null,"user_type":"customer",
31 | "api_token":"...","token_expiration":"...", "mqtt_client_id":"android-..."}
32 | */
33 | [DataContract]
34 | public struct WorxUser {
35 | [DataMember(Name = "name")]
36 | public string Name;
37 | [DataMember(Name = "email")]
38 | public string Email;
39 | [DataMember(Name = "api_token")]
40 | public string ApiToken;
41 | [DataMember(Name = "mqtt_client_id")]
42 | public string MqttClientId;
43 | [DataMember(Name = "mqtt_endpoint")]
44 | public string MqttEndpoint;
45 | }
46 | [DataContract]
47 | public struct LsOAuth {
48 | [DataMember(Name = "token_type")]
49 | public string Type;
50 | [DataMember(Name = "expires_in")]
51 | public int Expires;
52 | [DataMember(Name = "access_token")]
53 | public string Access;
54 | [DataMember(Name = "refresh_token")]
55 | public string Refresh;
56 | }
57 | [DataContract]
58 | public struct LsUserMe {
59 | [DataMember(Name = "mqtt_endpoint")] public string Endpoint;
60 | }
61 | [DataContract]
62 | public struct LsCertificate {
63 | [DataMember(Name = "pkcs12")]
64 | public string Pkcs12;
65 | }
66 |
67 | /* Product items: [{
68 | * "id":12061,"uuid":"96c52ef5-4410-4002-9d84-34c5b8bbcb6d","product_id":22,"user_id":1020,
69 | * "serial_number":"30173502161229020238","mac_address":"F0FE6B207964","name":"Gustav","locked":false,
70 | * "firmware_version":3.45,"firmware_auto_upgrade":false,"push_notifications":true,"sim":null,
71 | * "push_notifications_level":"warning","test":false,"iot_registered":true,"mqtt_registered":true,
72 | * "pin_code":null,"registered_at":"2017-03-27 00:00:00","online":true,"app_settings":null,"accessories":null,
73 | * "features":{"chassis":"s_2017","display_type":"led","input_type":"keyboard_led","lock":true,
74 | * "mqtt":true,"multi_zone":true,"multi_zone_percentage":true,"multi_zone_zones":4,
75 | * "rain_delay":true,"unrestricted_mowing_time":true,"wifi_pairing":"smartlink"},
76 | * "pending_radio_link_validation":null,
77 | * "mqtt_endpoint":"iot.eu-west-1.worxlandroid.com",
78 | * "mqtt_topics":{"command_in":"DB510\/F0FE6B207964\/commandIn","command_out":"DB510\/F0FE6B207964\/commandOut"},
79 | * "warranty_registered":true,"purchased_at":"2017-03-24 00:00:00","warranty_expires_at":"2020-03-24 00:00:00",
80 | * "setup_location":{"latitude":50.5130831,"longitude":12.4183362},
81 | * "city":{"id":2954602,"country_id":276,"name":"Auerbach","latitude":50.51667,"longitude":12.4,"created_at":"2018-02-15 22:21:33","updated_at":"2018-02-15 22:21:33"},
82 | * "time_zone":"Europe\/Berlin","lawn_size":550,"lawn_perimeter":null,
83 | * "auto_schedule_settings":{"boost":0,"exclusion_scheduler":{"days":[{"slots":[],"exclude_day":false},{"slots":[],"exclude_day":false},{"slots":[],"exclude_day":false},{"slots":[],"exclude_day":false},{"slots":[],"exclude_day":false},{"slots":[],"exclude_day":false},{"slots":[],"exclude_day":false}],"exclude_nights":true},
84 | * "grass_type":null,"irrigation":null,"nutrition":null,"soil_type":null},
85 | * "auto_schedule":false,
86 | * "distance_covered":2813588,"mower_work_time":180560,
87 | * "blade_work_time":165998,"blade_work_time_reset":null,"blade_work_time_reset_at":null,
88 | * "battery_charge_cycles":13912,"battery_charge_cycles_reset":null,"battery_charge_cycles_reset_at":null,
89 | * "messages_in":1484,"messages_out":164756,"raw_messages_in":4616,"raw_messages_out":164756,
90 | * "created_at":"2017-03-13 19:27:22","updated_at":"2022-08-11 16:02:27"},
91 | * ,"last_status":{"timestamp":"2022-10-04 18:02:21","payload": ...
92 | * ]
93 | */
94 | [DataContract]
95 | public struct LsMqttTopic {
96 | [DataMember(Name = "command_in")]
97 | public string CmdIn;
98 | [DataMember(Name = "command_out")]
99 | public string CmdOut;
100 | }
101 | [DataContract]
102 | public struct LsLastStatus {
103 | [DataMember(Name = "timestamp")]
104 | public string TimeStamp;
105 | [DataMember(Name = "payload")]
106 | public LsMqtt PayLoad;
107 | }
108 | [DataContract]
109 | public struct LsProductItem {
110 | [DataMember(Name = "serial_number")]
111 | public string SerialNo;
112 | [DataMember(Name = "mac_address")]
113 | public string MacAdr;
114 | [DataMember(Name = "name")]
115 | public string Name;
116 | [DataMember(Name = "firmware_auto_upgrade")]
117 | public bool AutoUpgd;
118 | [DataMember(Name = "mqtt_endpoint")]
119 | public string Endpoint;
120 | [DataMember(Name = "mqtt_topics")]
121 | public LsMqttTopic Topic;
122 | [DataMember(Name = "last_status")]
123 | public LsLastStatus Last;
124 | }
125 | [DataContract]
126 | public struct LsMqtt {
127 | [DataMember(Name = "cfg")]
128 | public Config Cfg;
129 | [DataMember(Name = "dat")]
130 | public Data Dat;
131 | }
132 |
133 | [DataContract]
134 | public struct LsJson {
135 | [DataMember(Name = "api")] public string Api;
136 | [DataMember(Name = "email")] public string Email;
137 | [DataMember(Name = "pass")] public string Password;
138 | [DataMember(Name = "uuid")] public string Uuid;
139 | [DataMember(Name = "name")] public string Name;
140 | [DataMember(Name = "broker")] public string Broker;
141 | [DataMember(Name = "mac")] public string MacAdr;
142 | [DataMember(Name = "board")] public string Board;
143 | [DataMember(Name = "blade")] public int Blade;
144 | [DataMember(Name = "top")] public bool Top;
145 | [DataMember(Name = "x")] public int X;
146 | [DataMember(Name = "y")] public int Y;
147 | [DataMember(Name = "w")] public int W;
148 | [DataMember(Name = "h")] public int H;
149 | [DataMember(Name = "plugins")] public List Plugins;
150 |
151 | public bool Equals(LsJson lsj) {
152 | bool b;
153 |
154 | b = Api == lsj.Api && Email == lsj.Email && Password == lsj.Password && Uuid == lsj.Uuid;
155 | b = b && Name == lsj.Name && Broker == lsj.Broker && MacAdr == lsj.MacAdr;
156 | b = b && Top == lsj.Top && X == lsj.X && Y == lsj.Y && W == lsj.W && H == lsj.H && Blade == lsj.Blade;
157 | if( b && Plugins != null && lsj.Plugins != null ) {
158 | b = Plugins.Count == lsj.Plugins.Count;
159 | for( int i = 0; b && i < Plugins.Count; i++ ) b = b && Plugins[i] == lsj.Plugins[i];
160 | }
161 | return b;
162 | }
163 | }
164 |
165 | [DataContract] public struct LsEstimatedTime {
166 | [DataMember(Name = "beg")] public float Beg;
167 | [DataMember(Name = "end")] public float End;
168 | [DataMember(Name = "vpm")] public float VoltPerMin;
169 | }
170 |
171 | [DataContract] public struct LsEstimatedTimes {
172 | [DataMember(Name = "home_0")] public LsEstimatedTime HomeOff;
173 | [DataMember(Name = "home_1")] public LsEstimatedTime HomeOn;
174 | [DataMember(Name = "mowing")] public LsEstimatedTime Mowing;
175 | }
176 | #endregion
177 |
178 |
179 | #region Activity-Log
180 | /*
181 | {
182 | "_id":"5d65fcd8241fa136e0551d1f",
183 | "timestamp":"2019-08-28 04:02:31",
184 | "product_item_id":12061,
185 | "payload":{
186 | "cfg":{"dt":"28/08/2019","tm":"06:02:23","mzv":[0,0,0,0,0,0,0,0,0,0],"mz":[0,0,0,0]},
187 | "dat":{"le":0,"ls":0,"fw":3.51,"lz":0,"lk":0,"bt":{"c":0,"m":1}}
188 | }
189 | }
190 | */
191 | [DataContract]
192 | public struct ActivityConfig {
193 | [DataMember(Name = "dt")] public string Date;
194 | [DataMember(Name = "tm")] public string Time;
195 | [DataMember(Name = "mz")] public int[] MultiZones; // [0-3] start point in meters
196 | [DataMember(Name = "mzv")] public int[] MultiZonePercs; // [0-9] ring list of start indizes
197 | }
198 | [DataContract]
199 | public struct ActivityBattery {
200 | [DataMember(Name = "c")] public ChargeCoge Charging;
201 | [DataMember(Name = "m")] public int Maintenance;
202 | }
203 | [DataContract]
204 | public struct ActivityData {
205 | [DataMember(Name = "le")] public ErrorCode LastError;
206 | [DataMember(Name = "ls")] public StatusCode LastState;
207 | [DataMember(Name = "fw")] public double Firmware;
208 | [DataMember(Name = "lz")] public int LastZone;
209 | [DataMember(Name = "lk")] public int Lock;
210 | [DataMember(Name = "bt")] public ActivityBattery Battery;
211 | }
212 | [DataContract]
213 | public struct ActivityPayload {
214 | [DataMember(Name = "cfg")] public ActivityConfig Cfg;
215 | [DataMember(Name = "dat")] public ActivityData Dat;
216 | }
217 | [DataContract]
218 | public struct Activity {
219 | [DataMember(Name = "_id")] public string ActId;
220 | [DataMember(Name = "timestamp")] public string Stamp;
221 | [DataMember(Name = "product_item_id")] public string MowId;
222 | [DataMember(Name = "payload")] public ActivityPayload Payload;
223 | }
224 | #endregion
225 |
226 | public delegate void ErrDelegte(string msg);
227 | public delegate void LogDelegte(string log, int c = 0);
228 | public delegate void MqttDelegate();
229 |
230 | //public static partial class DeskApp {
231 | // internal static DelegateString _send { get; set; }
232 | // internal static DelegateString _trace { get; set; }
233 | //}
234 |
235 | public class LsClient {
236 | public enum States { None, Connected, Subscribed, Exit, Unsubscribed, Disconnected };
237 |
238 | private WebClient _client = new WebClient();
239 | private string _tokRef = null;
240 | private DateTime _tokDT;
241 | private int _tokExp = 3600;
242 | private X509Certificate2 _certWX = null;
243 | private MqttClient _mqtt = null;
244 | private string _api, _uuid, _board, _mac;
245 | private string _cmdIn;
246 | private string[] _cmdOut;
247 | private byte[] _cmdQos;
248 | private ushort _msgId = 0;
249 | private bool _msgPoll = false;
250 |
251 | public string Broker { get; private set; }
252 |
253 | public List Products = new List();
254 | public Dictionary Plugins = new Dictionary();
255 |
256 | public States State = States.None;
257 |
258 | public ErrDelegte Err;
259 | public LogDelegte Log;
260 | public MqttDelegate Recv;
261 | public string Json;
262 | public LsMqtt Data;
263 |
264 | private string ArgCfg() {
265 | string[] args = Environment.GetCommandLineArgs();
266 |
267 | if( args.Length > 1 ) return "." + args[1];
268 | else return string.Empty;
269 | }
270 | public bool Login(string api, string mail, string pass, string uuid) {
271 | return WebApi(api, mail, pass, uuid);
272 | }
273 | public bool WebApi(string api, string mail, string pass, string uuid) {
274 | NameValueCollection nvc = new NameValueCollection();
275 | string str, url_lgn, url_api;
276 | byte[] buf;
277 |
278 | _api = api;
279 | url_lgn = ConfigurationManager.AppSettings[$"{_api}_Login"];
280 | url_api = ConfigurationManager.AppSettings[$"{_api}_WebApi"];
281 | #region Anmeldung
282 | nvc.Add("username", mail);
283 | nvc.Add("password", pass);
284 | nvc.Add("grant_type", "password");
285 | nvc.Add("client_id", ConfigurationManager.AppSettings[$"{_api}_CliId"]);
286 | //nvc.Add("client_secret", sec);
287 | nvc.Add("scope", "*");
288 | try {
289 | buf = _client.UploadValues(url_lgn + "oauth/token", nvc);
290 | //buf = _client.UploadValues(_api + "oauth/token", nvc);
291 | str = Encoding.UTF8.GetString(buf);
292 | Debug.WriteLine("Oauth token: {0}", str);
293 | Log(string.Format("Oauth token: {0}", str), 1);
294 | using( MemoryStream ms = new MemoryStream(buf) ) {
295 | DataContractJsonSerializer dcjs = new DataContractJsonSerializer(typeof(LsOAuth));
296 | LsOAuth lsoa = (LsOAuth)dcjs.ReadObject(ms);
297 |
298 | _client.Headers["Authorization"] = string.Format("{0} {1}", lsoa.Type, lsoa.Access);
299 | _tokRef = lsoa.Refresh;
300 | _tokExp = lsoa.Expires;
301 | _tokDT = DateTime.Now;
302 | ms.Close();
303 | }
304 | } catch( Exception ex ) {
305 | Err(ex.Message);
306 | Log(ex.ToString(), 9);
307 | return false;
308 | }
309 | #endregion
310 |
311 | try {
312 | /*
313 | #region Benutzer
314 | buf = _client.DownloadData(_api + "users/me");
315 | str = Encoding.UTF8.GetString(buf);
316 | Debug.WriteLine("User info: {0}", str);
317 | Log(string.Format("User info: {0}", str), 1);
318 | using( MemoryStream ms = new MemoryStream(buf) ) {
319 | DataContractJsonSerializer dcjs = new DataContractJsonSerializer(typeof(LsUserMe));
320 | LsUserMe ku = (LsUserMe)dcjs.ReadObject(ms);
321 |
322 | Broker = ku.Endpoint;
323 | ms.Close();
324 | }
325 | #endregion
326 | */
327 |
328 | #region Product items
329 | buf = _client.DownloadData(url_api + "product-items?status=1");
330 | str = Encoding.UTF8.GetString(buf);
331 | Debug.WriteLine("Product items: {0}", str);
332 | Log(string.Format("Product items: {0}", str), 1);
333 | using( MemoryStream ms = new MemoryStream(buf) ) {
334 | DataContractJsonSerializer dcjs = new DataContractJsonSerializer(typeof(List));
335 | Products = (List)dcjs.ReadObject(ms);
336 |
337 | ms.Close();
338 | }
339 | #endregion
340 |
341 | /*
342 | #region Status
343 | buf = null;
344 | foreach( LsProductItem pi in Products ) {
345 | buf = _client.DownloadData(_api + "product-items/" + pi.SerialNo + "/status");
346 | str = Encoding.UTF8.GetString(buf);
347 | Debug.WriteLine("Status {0}: {1}", pi.Name, str);
348 | Log(string.Format("Status {0}: {1}", pi.Name, str), 1);
349 | }
350 | if( buf != null ) {
351 | MemoryStream ms = new MemoryStream(buf);
352 | DataContractJsonSerializer dcjs = new DataContractJsonSerializer(typeof(LsMqtt));
353 | LsMqtt jm = (LsMqtt)dcjs.ReadObject(ms);
354 |
355 | Json = str;
356 | Data = jm;
357 | //_msgPoll = false;
358 | ms.Close();
359 | Recv();
360 | }
361 | #endregion
362 | */
363 |
364 | if( api == "SM" ) return Products.Count > 0;
365 | #region Certificate
366 | buf = _client.DownloadData(url_api + "users/certificate");
367 | str = Encoding.UTF8.GetString(buf);
368 | Debug.WriteLine("Certificate: {0}", str);
369 | Log(string.Format("Certificate: {0}", str), 1);
370 | using( MemoryStream ms = new MemoryStream(buf) ) {
371 | DataContractJsonSerializer dcjs = new DataContractJsonSerializer(typeof(LsCertificate));
372 | LsCertificate lsc = (LsCertificate)dcjs.ReadObject(ms);
373 |
374 | ms.Close();
375 | if( !string.IsNullOrEmpty(lsc.Pkcs12) ) {
376 | str = lsc.Pkcs12.Replace("\\/", "/");
377 | buf = Convert.FromBase64String(str);
378 | File.WriteAllBytes(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "AWS" + ArgCfg() + ".p12"), buf);
379 | _certWX = new X509Certificate2(buf);
380 | }
381 |
382 | //string mac = Products.Count > 0 ? Products[0].MacAdr.Substring(5) : "000000";
383 | //int xx = int.Parse(mac, System.Globalization.NumberStyles.HexNumber) ^ 0xE1588A;
384 | //Log(string.Format("AWS certificate done ({0})", xx), 2);
385 | //buf = _certWX.Export(X509ContentType.Cert);
386 | //File.WriteAllBytes(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "WX.p12"), buf);
387 | }
388 | #endregion
389 | } catch(Exception ex ) {
390 | Err(ex.Message);
391 | Log(ex.ToString(), 9);
392 | return false;
393 | }
394 |
395 | buf = null;
396 | return _certWX != null && Products.Count > 0;
397 | }
398 | public bool LoadAWS() {
399 | string name = "AWS" + ArgCfg() + ".p12";
400 | string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, name);
401 |
402 | if( File.Exists(path) ) {
403 | try {
404 | _certWX = new X509Certificate2(path);
405 | Log(string.Format("AwsFile: {0}", name));
406 | return true;
407 | } catch( Exception ex ) {
408 | Log(ex.ToString());
409 | }
410 | }
411 | return false;
412 | }
413 |
414 | private bool RefreshToken() {
415 | NameValueCollection nvc = new NameValueCollection();
416 | string str;
417 | byte[] buf;
418 |
419 | str = ConfigurationManager.AppSettings[$"{_api}_Login"];
420 | nvc.Add("grant_type", "refresh_token");
421 | nvc.Add("scope", "*");
422 | nvc.Add("client_id", ConfigurationManager.AppSettings[$"{_api}_CliId"]);
423 | nvc.Add("refresh_token", _tokRef);
424 | try {
425 | buf = _client.UploadValues(str + "oauth/token", nvc);
426 | str = Encoding.UTF8.GetString(buf);
427 | Debug.WriteLine("Oauth token: {0}", str);
428 | //Log(string.Format("Oauth token: {0}", str), 1);
429 | using( MemoryStream ms = new MemoryStream(buf) ) {
430 | DataContractJsonSerializer dcjs = new DataContractJsonSerializer(typeof(LsOAuth));
431 | LsOAuth lsoa = (LsOAuth)dcjs.ReadObject(ms);
432 |
433 | _client.Headers["Authorization"] = string.Format("{0} {1}", lsoa.Type, lsoa.Access);
434 | _tokRef = lsoa.Refresh;
435 | _tokExp = lsoa.Expires;
436 | _tokDT = DateTime.Now;
437 | ms.Close();
438 | }
439 | } catch( Exception ex ) {
440 | Err(ex.Message);
441 | Log(ex.ToString(), 9);
442 | return false;
443 | }
444 | return true;
445 | }
446 |
447 | public List GetActivities(string name) {
448 | string str;
449 | List ls = new List();
450 |
451 | str = ConfigurationManager.AppSettings[$"{_api}_WebApi"];
452 | if( (_tokDT - DateTime.Now).TotalSeconds > _tokExp ) {
453 | if( !RefreshToken() ) {
454 | Log("Could not refresh token", 9);
455 | return ls;
456 | }
457 | }
458 | foreach( LsProductItem pi in Products ) {
459 | if( pi.Name == name ) {
460 | byte[] buf = _client.DownloadData(str + "product-items/" + pi.SerialNo + "/activity-log");
461 |
462 | if( buf != null ) {
463 | MemoryStream ms = new MemoryStream(buf);
464 | DataContractJsonSerializer dcjs = new DataContractJsonSerializer(typeof(List));
465 |
466 | ls = dcjs.ReadObject(ms) as List;
467 | foreach( Activity a in ls ) {
468 | ActivityPayload p = a.Payload;
469 |
470 | Log(string.Format("{0}: {1} - {2} - {3} - {4}", a.Stamp, p.Dat.LastError, p.Dat.LastState, p.Dat.Battery.Charging, p.Dat.Battery.Maintenance));
471 | }
472 | ms.Close();
473 | }
474 | }
475 | }
476 | return ls;
477 | }
478 | //public void AutoUpgrde(string serial, bool b) {
479 | // string url = ConfigurationManager.AppSettings["ApiBaseUrl"] + "product-items/" + serial, str;
480 |
481 | // _client.Headers[HttpRequestHeader.ContentType] = "application/json";
482 | // //str = client.UploadString(str, "PUT", "{\"name\":\"Egon\"}");
483 | // str = "{\"firmware_auto_upgrade\":" + (b ? "true" : "false") + "}";
484 | // str = _client.UploadString(url, "PUT", str);
485 | // Log(string.Format("Auto upgd: {0}", str), 1);
486 | // Debug.WriteLine("Auto upgd: {0}", str);
487 | //}
488 |
489 | public bool Start(string broker, string uuid, string board, string mac) {
490 | Broker = broker; _uuid = "android-" + uuid; _board = board; _mac = mac;
491 | Log(string.Format("Broker: '{0}'", broker));
492 | Log(string.Format("Topic: '{0}/{1}'", board, mac));
493 | _cmdIn = string.Format("{0}/{1}/commandIn", board, mac);
494 | _cmdOut = new string[] { string.Format("{0}/{1}/commandOut", board, mac) };
495 | _cmdQos = new byte[] { MqttMsgBase.QOS_LEVEL_AT_MOST_ONCE }; // | MqttMsgBase.QOS_LEVEL_GRANTED_FAILURE
496 | return Start(true);
497 | }
498 |
499 | public bool Start(bool first) {
500 | if( _mqtt != null ) {
501 | _mqtt.MqttMsgSubscribed -= MqttMsgSubscribed;
502 | _mqtt.MqttMsgUnsubscribed -= MqttMsgUnsubscribed;
503 | _mqtt.MqttMsgPublishReceived -= MqttMsgPublishReceived;
504 | _mqtt.MqttMsgPublished -= MqttMsgPublished;
505 | _mqtt.ConnectionClosed -= ConnectionClosed;
506 | _mqtt = null;
507 | }
508 |
509 | try {
510 | _mqtt = new MqttClient(Broker, 8883, true, null, _certWX, MqttSslProtocols.TLSv1_2);
511 | } catch( Exception ex ) {
512 | if( first ) Err(ex.Message);
513 | Log(ex.ToString(), 9);
514 | return false;
515 | }
516 |
517 | try {
518 | _mqtt.MqttMsgSubscribed += MqttMsgSubscribed;
519 | _mqtt.MqttMsgUnsubscribed += MqttMsgUnsubscribed;
520 | _mqtt.MqttMsgPublished += MqttMsgPublished;
521 | _mqtt.MqttMsgPublishReceived += MqttMsgPublishReceived;
522 | _mqtt.ConnectionClosed += ConnectionClosed;
523 |
524 | byte code = _mqtt.Connect(_uuid);
525 | Log(string.Format("Connect '{0} ({1})'", code, _mqtt.IsConnected));
526 | State = States.Connected;
527 |
528 | _mqtt.Subscribe(_cmdOut, _cmdQos);
529 | Log(string.Format("Subscribe init"));
530 |
531 | //_msgId = _mqtt.Publish(_cmdIn, Encoding.ASCII.GetBytes("{}"));
532 | //_msgPoll = true;
533 | //Log(string.Format("Publish send '{0}'", _msgId));
534 | } catch( Exception ex ) {
535 | if( first ) Err(ex.Message);
536 | Log(ex.ToString(), 9);
537 | return false;
538 | }
539 |
540 | return true;
541 | }
542 |
543 | public void Exit() {
544 | if( _mqtt != null && _mqtt.IsConnected ) {
545 | int wait = 20;
546 |
547 | //_mqtt.MqttMsgPublishReceived -= MqttMsgPublishReceived;
548 | //_mqtt.MqttMsgPublished -= MqttMsgPublished;
549 | _mqtt.Unsubscribe(_cmdOut);
550 | while( State != States.Unsubscribed && wait-- > 0 ) Thread.Sleep(100);
551 | if( wait == 0 ) {
552 | Log("Timeout unsubscribe", 9);
553 | State = States.Unsubscribed;
554 | }
555 | //_mqtt.MqttMsgSubscribed -= MqttMsgSubscribed;
556 | //_mqtt.MqttMsgUnsubscribed -= MqttMsgUnsubscribed;
557 | //_mqtt.ConnectionClosed -= ConnectionClosed;
558 | try { _mqtt.Disconnect(); }
559 | catch( Exception ex) { Log(ex.ToString(), 9); }
560 | //_mqtt = null;
561 | }
562 | }
563 |
564 | public bool Connected { get { return _mqtt != null && _mqtt.IsConnected; } }
565 | public bool Polling { get { return _msgPoll && _mqtt != null && _mqtt.IsConnected; } }
566 | public void Poll() {
567 | string cfg;
568 |
569 | cfg = "{" + (Data.Cfg.Id != null ? $"\"id\":{Data.Cfg.Id}" : "") + "}";
570 | _msgId = _mqtt.Publish(_cmdIn, Encoding.UTF8.GetBytes(cfg));
571 | _msgPoll = true;
572 | }
573 | public void Publish(string s) {
574 | _msgId = _mqtt.Publish(_cmdIn, Encoding.UTF8.GetBytes(s));
575 | }
576 | public void PublishWithId(string s) {
577 | string cfg;
578 |
579 | cfg = "{" + (Data.Cfg.Id != null ? $"\"id\":{Data.Cfg.Id}," : "") + s + "}";
580 | _msgId = _mqtt.Publish(_cmdIn, Encoding.UTF8.GetBytes(cfg));
581 | }
582 | private void MqttMsgSubscribed(object sender, MqttMsgSubscribedEventArgs e) {
583 | Log(string.Format("Subscribe done '{0}'", e.MessageId));
584 | State = States.Subscribed;
585 | Poll();
586 | }
587 | private void MqttMsgUnsubscribed(object sender, MqttMsgUnsubscribedEventArgs e) {
588 | State = States.Unsubscribed;
589 | Log(string.Format("Unsubscribe done '{0}'", e.MessageId));
590 | }
591 | private void MqttMsgPublished(object sender, MqttMsgPublishedEventArgs e) {
592 | Log(string.Format("Published done '{0}' ({1})", e.MessageId, e.IsPublished));
593 | }
594 | private void MqttMsgPublishReceived(object sender, MqttMsgPublishEventArgs e) {
595 | Json = Encoding.UTF8.GetString(e.Message);
596 |
597 | Debug.WriteLine(Json);
598 | try {
599 | MemoryStream ms = new MemoryStream(e.Message);
600 | DataContractJsonSerializer dcjs = new DataContractJsonSerializer(typeof(LsMqtt));
601 | LsMqtt jm = (LsMqtt)dcjs.ReadObject(ms);
602 |
603 | Data = jm;
604 | _msgPoll = false;
605 | ms.Close();
606 | Recv();
607 | } catch( Exception ex ) {
608 | string s;
609 |
610 | Log(ex.Message);
611 | s = Encoding.UTF8.GetString(e.Message);
612 | Log(s);
613 | }
614 | }
615 | private void ConnectionClosed(object sender, EventArgs e) {
616 | if( State == States.Unsubscribed ) {
617 | State = States.Disconnected;
618 | Log("Disconnect");
619 | } else {
620 | int num = int.Parse(ConfigurationManager.AppSettings["AutoReconnect"]);
621 |
622 | Log("Mqtt connection closed", 9);
623 | for( int i = 0; i < num; i++ ) {
624 | System.Threading.Thread.Sleep(10000);
625 | if( _mqtt.IsConnected ) { Log("Mqtt is connected"); break; } else if( Start(false) ) { Log("Mqtt reconnected"); break; } else Log(string.Format("Mqtt reconnect {0} failed", i), 1);
626 | }
627 | }
628 | }
629 |
630 | #if PLUGIN
631 | private void LogPlugin(string log) { Log(log); }
632 | public void LoadPlugins(string dir) {
633 | Plugins.Clear();
634 | DeskApp._send = Publish;
635 | DeskApp._trace = LogPlugin;
636 |
637 | foreach( string script in Directory.GetFiles(dir, "*.cs") ) {
638 | using( StreamReader sr = new StreamReader(script) ) {
639 | try {
640 | string scriptCode = sr.ReadToEnd();
641 | string name = Path.GetFileNameWithoutExtension(script);
642 | AsmHelper helper = new AsmHelper(CSScript.LoadCode(scriptCode, null, false));
643 | IPlugin plugin = helper.CreateObject(name) as IPlugin;
644 |
645 | Plugins.Add(name, plugin);
646 | } catch( Exception ex ) {
647 | //MessageBox.Show(ex.ToString(), "Load Plugin " + script, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
648 | Log(ex.ToString());
649 | }
650 | sr.Close();
651 | }
652 | }
653 | }
654 | #endif
655 | }
656 | }
657 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 | {one line to give the program's name and a brief idea of what it does.}
635 | Copyright (C) 2017 {name of author}
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Landroid-S Desktop App Copyright (C) 2017 EishaV
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
--------------------------------------------------------------------------------