From 8a602e8ee858b58edd26123251ad275ed0a90af3 Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Fri, 30 Mar 2018 17:44:22 +0000 Subject: [PATCH] =?UTF-8?q?5.0.5=20+=20AIS=20Version=201.1=20..=20neueste?= =?UTF-8?q?=20=C3=84nderungen=20sind=20noch=20auf=20dem=20SMSPLASH01?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AIS/SQL/CreateTables.sql | 6 +- AIS/bsmd.AISService/AISService.cs | 10 +++ AIS/bsmd.AISService/DB/AISStation.cs | 12 ++-- AIS/bsmd.AISService/Program.cs | 7 ++- AIS/bsmd.AISService/ais_config.xml | 23 +++++++ AIS/bsmd.AISService/bsmd.AISService.csproj | 5 ++ ENI-2/ENI2/ENI2/DetailRootControl.xaml.cs | 37 +++++++++-- .../OverViewDetailControl.xaml.cs | 8 +++ ENI-2/ENI2/ENI2/ENI2.csproj | 4 +- .../CopyDeclarationDialog.xaml.cs | 14 +++++ .../ENI2/Properties/Resources.Designer.cs | 18 ++++++ ENI-2/ENI2/ENI2/Properties/Resources.resx | 6 ++ Stundensheet.xlsx | Bin 37114 -> 37243 bytes .../Properties/AssemblyProductInfo.cs | 2 +- .../Properties/AssemblyProjectInfo.cs | 2 +- .../IResponseService.cs | 2 +- .../ResponseService.svc.cs | 2 +- nsw/Source/bsmd.dbh/NSWResponse.cs | 6 +- nsw/Source/bsmd.dbh/Request.cs | 58 ++++++++++-------- nsw/Source/bsmd.dbh/Response.cs | 8 ++- 20 files changed, 180 insertions(+), 50 deletions(-) create mode 100644 AIS/bsmd.AISService/ais_config.xml diff --git a/AIS/SQL/CreateTables.sql b/AIS/SQL/CreateTables.sql index 6ba8d1d5..a830c0f8 100644 --- a/AIS/SQL/CreateTables.sql +++ b/AIS/SQL/CreateTables.sql @@ -40,6 +40,8 @@ CREATE TABLE [dbo].[aisstation] ( [comPort] NVARCHAR (10) NULL, [name] NVARCHAR (255) NULL, [baudrate] INT NULL, + [address] NVARCHAR (255) NULL, + [active] BIT NULL, PRIMARY KEY CLUSTERED ([Id] ASC) ); @@ -101,10 +103,10 @@ CREATE TABLE [dbo].[hotposition] ( GO -PRINT N'Creating unnamed constraint on [dbo].[aisstaticdata]...'; +PRINT N'Creating unnamed constraint on [dbo].[hotposition]...'; GO -ALTER TABLE [dbo].[aisstaticdata] +ALTER TABLE [dbo].[hotposition] ADD DEFAULT newid() FOR [Id]; GO \ No newline at end of file diff --git a/AIS/bsmd.AISService/AISService.cs b/AIS/bsmd.AISService/AISService.cs index 8f8444b9..b7115204 100644 --- a/AIS/bsmd.AISService/AISService.cs +++ b/AIS/bsmd.AISService/AISService.cs @@ -53,6 +53,16 @@ namespace bsmd.AISService } + internal void DebugStart() + { + this.Init(null); + string msg = ""; + if(this.qManager.Start(ref msg)) + { + Console.Read(); // hold it right here + } + } + protected override void OnStop() { this.qManager.Stop(); diff --git a/AIS/bsmd.AISService/DB/AISStation.cs b/AIS/bsmd.AISService/DB/AISStation.cs index bb264494..37cb1090 100644 --- a/AIS/bsmd.AISService/DB/AISStation.cs +++ b/AIS/bsmd.AISService/DB/AISStation.cs @@ -13,7 +13,7 @@ namespace bsmd.AISService.DB { #region private members - private int station_Id; + private Guid station_Id; private string name; private bool active; private string comport; @@ -177,7 +177,7 @@ namespace bsmd.AISService.DB while (reader.Read()) { AISStation station = new AISStation(); - station.station_Id = reader.GetInt32(0); + station.station_Id = reader.GetGuid(0); station.name = reader.GetString(1); station.active = reader.GetBoolean(2); station.latitude = (double) reader.GetInt32(3) / 600000; @@ -201,12 +201,12 @@ namespace bsmd.AISService.DB public static AISStation CreateStation(string name, DBConnector con) { AISStation newStation = new AISStation(); + newStation.station_Id = Guid.NewGuid(); newStation.name = name; newStation.active = true; - string query = string.Format("INSERT INTO aisstation SET name='{0}',active=1", - name); - con.ExecuteNonQuery(query); - newStation.station_Id = Convert.ToInt32(con.ExecuteScalar("SELECT LAST_INSERT_ID()")); + string query = string.Format("INSERT INTO aisstation SET Id='{0}', name='{1}',active=1", + newStation.station_Id, newStation.name); + con.ExecuteNonQuery(query); return newStation; } diff --git a/AIS/bsmd.AISService/Program.cs b/AIS/bsmd.AISService/Program.cs index 28f96537..6e5351dc 100644 --- a/AIS/bsmd.AISService/Program.cs +++ b/AIS/bsmd.AISService/Program.cs @@ -6,6 +6,7 @@ using System; using System.Collections.Generic; using System.ComponentModel; using System.Configuration.Install; +using System.Diagnostics; using System.Linq; using System.Reflection; using System.ServiceProcess; @@ -41,7 +42,11 @@ namespace bsmd.AISService return 1; } } - else + else if(Debugger.IsAttached) + { + AISService aisService = new AISService(); + aisService.DebugStart(); + } else { DisplayUsage(); } diff --git a/AIS/bsmd.AISService/ais_config.xml b/AIS/bsmd.AISService/ais_config.xml new file mode 100644 index 00000000..42481a80 --- /dev/null +++ b/AIS/bsmd.AISService/ais_config.xml @@ -0,0 +1,23 @@ + + + + + + + + 127.0.0.1 + 32100 + + + ais_config.xml + Server=192.168.2.12;Database=ais;Uid=aisuser;Pwd=aispasswd + true + 500 + 120 + 120 + 20 + \ No newline at end of file diff --git a/AIS/bsmd.AISService/bsmd.AISService.csproj b/AIS/bsmd.AISService/bsmd.AISService.csproj index a42a1192..60b6de37 100644 --- a/AIS/bsmd.AISService/bsmd.AISService.csproj +++ b/AIS/bsmd.AISService/bsmd.AISService.csproj @@ -116,6 +116,11 @@ ProjectInstaller.cs + + + PreserveNewest + +