diff --git a/SendNSWMessageService/NSWSendService.cs b/SendNSWMessageService/NSWSendService.cs index e565b488..a28c27b0 100644 --- a/SendNSWMessageService/NSWSendService.cs +++ b/SendNSWMessageService/NSWSendService.cs @@ -31,12 +31,12 @@ namespace SendNSWMessageService } - public void Commandline(string[] args) + public void Commandline() { // Dieser Modus dient allein dazu, eine separate Instanz "nebenher" laufen zu lassen, ohne // sie als Service zu installieren. Dies ist sinnvoll um für spezielle HIS Einstellungen Tests zu machen // ohne den laufenden Betrieb zu stören (hoffentlich!) - this.Init(args); // setup timer + this.Init(); // setup timer this.DoOnce(); while (true) System.Threading.Thread.Sleep(1000); // sleep until someone kills me :) @@ -46,7 +46,7 @@ namespace SendNSWMessageService { this.EventLog.Source = this.ServiceName; this.EventLog.Log = "Application"; - this.Init(args); + this.Init(); System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly(); FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(assembly.Location); @@ -57,7 +57,7 @@ namespace SendNSWMessageService this.DoOnce(); } - private void Init(string[] args) + private void Init() { this._timer = new Timer(); this._timer.Interval = Properties.Settings.Default.SleepSeconds * 1000; @@ -269,233 +269,16 @@ namespace SendNSWMessageService { core.BSMDStatusInternal = MessageCore.BSMDStatus.PREPARE; // aus irgendwelchen Gründen wurde nichts verschickt -> zurück auf PREPARE } - DBManager.Instance.Save(core); - - #region old logic - /* - if ((core.InitialHIS == Message.NSWProvider.DUDR) || (core.InitialHIS == Message.NSWProvider.DUDR_TEST)) - { - - bool sendSucceeded = true; - bool didSendSomething = false; - - // Fall: keine Meldeklasse aber trotzdem auf TO_SEND. Entweder beim Beantragen von Visit-Id's oder beim Storno der gesamten - // Anmeldung - if ((core.DisplayId.Length == 0) || (core.Cancelled ?? false)) - { - sendSucceeded = bsmd.hisnord.Request.CreateSendFile(core, messages, (core.InitialHIS == Message.NSWProvider.DUDR_TEST)) ?? false; - } - else - { - foreach (Message message in messages) - { - bool? sendResult = bsmd.hisnord.Request.CreateSendFile(core, message, (core.InitialHIS == Message.NSWProvider.DUDR_TEST)); - if (sendResult.HasValue) - { - didSendSomething = true; - if (!sendResult.Value) sendSucceeded = false; - } - } - } - - if (!didSendSomething) core.BSMDStatusInternal = MessageCore.BSMDStatus.PREPARE; // zurück zu neutral - else - { - if (!sendSucceeded) core.BSMDStatusInternal = MessageCore.BSMDStatus.FAILURE; - else core.BSMDStatusInternal = MessageCore.BSMDStatus.SENT; - } - - _log.InfoFormat("HIS-Nord Send: Core {0} [{1}] new Status {2}", core.Id, core.IMO, core.BSMDStatusInternal.ToString()); - - DBManager.Instance.Save(core); - } - - else - { - bool sendSucceeded; - - #region DBH / Dakosy Logik - - List toSendMessageList = new List(); - - if ((core.IsTransit && core.TransitId.IsNullOrEmpty()) || - (!core.IsTransit && core.VisitId.IsNullOrEmpty())) - { - foreach (Message message in messages) - { - if ((message.MessageNotificationClass == Message.NotificationClass.VISIT) || - (message.MessageNotificationClass == Message.NotificationClass.TRANSIT)) - { - if ((message.InternalStatus == Message.BSMDStatus.UNDEFINED) || - (message.InternalStatus == Message.BSMDStatus.PREPARE) || - (message.InternalStatus == Message.BSMDStatus.TOSEND)) - { - _log.Debug("Visit/Transit not found, SENDING VISIT/TRANSIT message"); - if (message.HIS == Message.NSWProvider.UNDEFINED) - message.HIS = core.InitialHIS; - if (core.DefaultReportingPartyId.HasValue) - message.ReportingPartyId = core.DefaultReportingPartyId; - toSendMessageList.Add(message); - } - } - } - } - else // eine VISIT/TRANSIT Id ist vorhanden, die Daten können gesendet werden - { - // Änderung Sept 15: versendet werden alle Nachrichten, die *nicht* bestätigt sind - // also auch alles was auf in bearbeitung / Korrektur etc steht - // Einzig bleibt die Frage offen, was mit Nachrichten passiert, die über das UI - // nachträglich geändert werden. Ich denke hier muss in dashface ggf. der Status - // wieder auf PREPARE gesetzt werden - _log.Debug("Visit/Transit found, SENDING DATA messages"); - - foreach (Message message in messages) - { - // Eine Nachricht mit dem Status "Suspended / Zurückgestellt" wird so lange nicht - // versendet, bis im ENI der Status wieder explizit zurückgesetzt wird (16.4.16) - - // Update 5.10.17: Alles was nicht explizit auf "TOSEND" steht wird nicht verschickt! - if (message.InternalStatus != Message.BSMDStatus.TOSEND) continue; - - // "virtuelle" Messages nicht versenden (DK, EU) - if ((message.MessageNotificationClass == Message.NotificationClass.STO) || - (message.MessageNotificationClass == Message.NotificationClass.CREWD) || - (message.MessageNotificationClass == Message.NotificationClass.PASD)) - continue; - - // Wenn das ein Transit ist, werden nicht erforderliche Meldeklassen übersprungen - if (core.IsTransit) - { - if ((message.MessageNotificationClass == Message.NotificationClass.BKRD) || - (message.MessageNotificationClass == Message.NotificationClass.PRE72H) || - (message.MessageNotificationClass == Message.NotificationClass.TIEFD) || - (message.MessageNotificationClass == Message.NotificationClass.NAME) || - (message.MessageNotificationClass == Message.NotificationClass.INFO) || - (message.MessageNotificationClass == Message.NotificationClass.ATA) || - (message.MessageNotificationClass == Message.NotificationClass.ATD) || - (message.MessageNotificationClass == Message.NotificationClass.LADG) || - (message.MessageNotificationClass == Message.NotificationClass.SERV) || - (message.MessageNotificationClass == Message.NotificationClass.WAS) || - (message.MessageNotificationClass == Message.NotificationClass.TOWD)) - continue; - } - - // Visit/Transit Meldeklassen werden nicht erneut übertragen - if ((message.MessageNotificationClass == Message.NotificationClass.VISIT) || - (message.MessageNotificationClass == Message.NotificationClass.TRANSIT)) - continue; - - //if ((message.InternalStatus != Message.BSMDStatus.CONFIRMED) && - //(message.InternalStatus != Message.BSMDStatus.SENT)) - //{ - - // 28.12.2015: Das über "Overview" eingestellte HIS ist immer "führend" (zumindest aktuell zum Testen) - // if (message.HIS == Message.NSWProvider.UNDEFINED) - message.HIS = core.InitialHIS; - if (core.DefaultReportingPartyId.HasValue) - { - message.ReportingPartyId = core.DefaultReportingPartyId; // Referenz umbiegen - if (DBManager.Instance.GetReportingPartyDict().ContainsKey(core.DefaultReportingPartyId.Value)) // geladenes Objekt ersetzen - message.ReportingParty = DBManager.Instance.GetReportingPartyDict()[core.DefaultReportingPartyId.Value]; - } - toSendMessageList.Add(message); - //} - } - } - - foreach (Message message in toSendMessageList) - { - try - { - _log.InfoFormat("Sending {0} message to {1}", - message.MessageNotificationClass.ToString(), message.HIS.ToString()); - - sendSucceeded = false; - - // switch über passendes HIS / Schnittstelle - switch (message.HIS) - { - case Message.NSWProvider.DBH: - case Message.NSWProvider.DBH_TEST: - if (!XtraSendLogic.ShouldSendMessage(message)) - { - message.InternalStatus = Message.BSMDStatus.SUSPENDED; - } - else - { - sendSucceeded = bsmd.dbh.Request.SendMessage(message, (message.HIS == Message.NSWProvider.DBH_TEST)); - if (!sendSucceeded) - message.InternalStatus = Message.BSMDStatus.SEND_FAILED; - } - - break; - - case Message.NSWProvider.DAKOSY: - case Message.NSWProvider.DAKOSY_TEST: - sendSucceeded = bsmd.dakosy.Request.Send(message, true); - if (!sendSucceeded) message.InternalStatus = Message.BSMDStatus.SEND_FAILED; - break; - - default: - _log.WarnFormat("Initial HIS not specified for message {0}", message.Id); - break; - } - - if (sendSucceeded) - { - // alte Fehlerliste entfernen (die Antwort kann praktisch noch nicht da sein) - // vor dem Versenden zu entfernen halte ich für doof, wenn das Versenden scheitert - - foreach (MessageError messageError in message.ErrorList) - DBManager.Instance.Delete(messageError); - foreach (MessageViolation messageViolation in message.ViolationList) - DBManager.Instance.Delete(messageViolation); - - _log.Info("send successful, saving message."); - message.InternalStatus = Message.BSMDStatus.SENT; - message.SentAt = DateTime.Now; - } - - DBManager.Instance.Save(message); - - } - catch (Exception ex) - { - _log.ErrorFormat("SENDING message {0}: {1}", message.Id.ToString(), ex.Message); - } - } - - if (toSendMessageList.Count > 0) - { - core.BSMDStatusInternal = MessageCore.BSMDStatus.SENT; - } - else - { - core.BSMDStatusInternal = MessageCore.BSMDStatus.PREPARE; - } - DBManager.Instance.Save(core); - - #endregion - - } - } - */ - #endregion + DBManager.Instance.Save(core); } - - if(bsmd.hisnord.Properties.Settings.Default.ConnectTestSystem) - bsmd.hisnord.transmitter.CallTransmitter(true); - if(bsmd.hisnord.Properties.Settings.Default.ConnectLiveSystem) - bsmd.hisnord.transmitter.CallTransmitter(false); + + bsmd.hisnord.transmitter.CallTransmitter(); // ob test oder nicht ist in stat. dict gespeichert bsmd.hisnord.Request.ReadResponseFiles(); - - if (bsmd.hisnord.Properties.Settings.Default.ConnectTestSystem) - bsmd.hisnord.Response.ReadAnswers(true); - if (bsmd.hisnord.Properties.Settings.Default.ConnectLiveSystem) - bsmd.hisnord.Response.ReadAnswers(false); + + bsmd.hisnord.Response.ReadAnswers(); List coresMarkedForStatusQuery = DBManager.Instance.GetMessageCoresWithNSWStatusFlag(); diff --git a/SendNSWMessageService/Program.cs b/SendNSWMessageService/Program.cs index 8fdba582..a5029a52 100644 --- a/SendNSWMessageService/Program.cs +++ b/SendNSWMessageService/Program.cs @@ -24,7 +24,7 @@ namespace SendNSWMessageService } else if(args.Length > 0) { - ((NSWSendService)ServicesToRun[0]).Commandline(args); + ((NSWSendService)ServicesToRun[0]).Commandline(); } else { diff --git a/SendNSWMessageService/ProjectInstaller.Designer.cs b/SendNSWMessageService/ProjectInstaller.Designer.cs index 6940855e..c73e37a9 100644 --- a/SendNSWMessageService/ProjectInstaller.Designer.cs +++ b/SendNSWMessageService/ProjectInstaller.Designer.cs @@ -39,9 +39,9 @@ // // nswSendServiceInstaller // - this.nswSendServiceInstaller.Description = "Sending Testing-NSW requests to HIS"; - this.nswSendServiceInstaller.DisplayName = "NSW Test Send Service"; - this.nswSendServiceInstaller.ServiceName = "NSWTestSendService"; + this.nswSendServiceInstaller.Description = "Sending NSW requests to HIS"; + this.nswSendServiceInstaller.DisplayName = "NSW Send Service"; + this.nswSendServiceInstaller.ServiceName = "NSWSendService"; // // ProjectInstaller // diff --git a/SendNSWMessageService/SendNSWMessageService.csproj b/SendNSWMessageService/SendNSWMessageService.csproj index 6bb7aa13..6aa2e852 100644 --- a/SendNSWMessageService/SendNSWMessageService.csproj +++ b/SendNSWMessageService/SendNSWMessageService.csproj @@ -39,14 +39,15 @@ ..\bsmdKey.snk - - ..\packages\log4net.2.0.8\lib\net45-full\log4net.dll - True + + ..\packages\log4net.2.0.13\lib\net45\log4net.dll + + diff --git a/SendNSWMessageService/packages.config b/SendNSWMessageService/packages.config index 9a0551c5..518cdea0 100644 --- a/SendNSWMessageService/packages.config +++ b/SendNSWMessageService/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/bsmd.dakosy/bsmd.dakosy.csproj b/bsmd.dakosy/bsmd.dakosy.csproj index 62d69515..ec83c10e 100644 --- a/bsmd.dakosy/bsmd.dakosy.csproj +++ b/bsmd.dakosy/bsmd.dakosy.csproj @@ -37,12 +37,13 @@ ..\bsmdKey.snk - - ..\packages\log4net.2.0.8\lib\net45-full\log4net.dll - True + + ..\packages\log4net.2.0.13\lib\net45\log4net.dll + + diff --git a/bsmd.dakosy/packages.config b/bsmd.dakosy/packages.config index 9a0551c5..518cdea0 100644 --- a/bsmd.dakosy/packages.config +++ b/bsmd.dakosy/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/bsmd.dbh/bsmd.dbh.csproj b/bsmd.dbh/bsmd.dbh.csproj index e4d97ad7..ac301775 100644 --- a/bsmd.dbh/bsmd.dbh.csproj +++ b/bsmd.dbh/bsmd.dbh.csproj @@ -37,15 +37,17 @@ ..\bsmdKey.snk - - True + + ..\packages\log4net.2.0.13\lib\net45\log4net.dll + + diff --git a/bsmd.dbh/packages.config b/bsmd.dbh/packages.config index 9a0551c5..518cdea0 100644 --- a/bsmd.dbh/packages.config +++ b/bsmd.dbh/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/bsmd.hisnord/Properties/Settings.Designer.cs b/bsmd.hisnord/Properties/Settings.Designer.cs index 243c3969..28170550 100644 --- a/bsmd.hisnord/Properties/Settings.Designer.cs +++ b/bsmd.hisnord/Properties/Settings.Designer.cs @@ -12,7 +12,7 @@ namespace bsmd.hisnord.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.2.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.8.1.0")] public sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); @@ -110,48 +110,12 @@ namespace bsmd.hisnord.Properties { [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("E:\\svnlager\\BSMD\\nsw\\HIS-NORD\\")] - public string TestTransmitterRoot { + public string TransmitterRoot { get { - return ((string)(this["TestTransmitterRoot"])); + return ((string)(this["TransmitterRoot"])); } set { - this["TestTransmitterRoot"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("")] - public string LiveTransmitterRoot { - get { - return ((string)(this["LiveTransmitterRoot"])); - } - set { - this["LiveTransmitterRoot"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("False")] - public bool ConnectTestSystem { - get { - return ((bool)(this["ConnectTestSystem"])); - } - set { - this["ConnectTestSystem"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("True")] - public bool ConnectLiveSystem { - get { - return ((bool)(this["ConnectLiveSystem"])); - } - set { - this["ConnectLiveSystem"] = value; + this["TransmitterRoot"] = value; } } } diff --git a/bsmd.hisnord/Properties/Settings.settings b/bsmd.hisnord/Properties/Settings.settings index 35a943b2..6d22ad4c 100644 --- a/bsmd.hisnord/Properties/Settings.settings +++ b/bsmd.hisnord/Properties/Settings.settings @@ -23,17 +23,8 @@ E:\svnlager\BSMD\nsw\HIS-NORD\Transmitter-Tool\ANSWERS_CORRUPT - + E:\svnlager\BSMD\nsw\HIS-NORD\ - - - - - False - - - True - \ No newline at end of file diff --git a/bsmd.hisnord/Request.cs b/bsmd.hisnord/Request.cs index dbddb53b..a03e877f 100644 --- a/bsmd.hisnord/Request.cs +++ b/bsmd.hisnord/Request.cs @@ -21,9 +21,7 @@ namespace bsmd.hisnord { private static readonly ILog _log = LogManager.GetLogger(typeof(Request)); private static Dictionary _reportingPartyDict = null; - private static readonly Dictionary> coreFilenameDict = new Dictionary>(); - private static readonly Dictionary coreUseTestDict = new Dictionary(); - //private static Dictionary noteMessageDict = new Dictionary(); + private static readonly Dictionary> coreFilenameDict = new Dictionary>(); internal static Dictionary ReportingPartyDict { @@ -41,7 +39,7 @@ namespace bsmd.hisnord foreach (Message message in coreFilenameDict[core].Keys) { - transmitter.result theResult = transmitter.GetResult(coreFilenameDict[core][message], coreUseTestDict[core]); + transmitter.result theResult = transmitter.GetResult(coreFilenameDict[core][message]); if (theResult != null) { _log.InfoFormat("Result: Code {0} Detail {1} Message {2}", theResult.code, theResult.detail, theResult.message); @@ -1594,9 +1592,7 @@ namespace bsmd.hisnord #region serialize and save message - - string outputDir = Path.Combine(useTest ? Properties.Settings.Default.TestTransmitterRoot : Properties.Settings.Default.LiveTransmitterRoot, - Properties.Settings.Default.OutputDir); + string outputDir = Path.Combine(Properties.Settings.Default.TransmitterRoot, Properties.Settings.Default.OutputDir); string filename = string.Format("BSMD_{1}-{2}-{0}.xml", (message == null) ? "CANCEL" : message.MessageNotificationClassDisplay, DateTime.Now.ToString("yyyyMMddHHmmss"), core.Id.Value); _log.InfoFormat("saving {0} to output directory", filename); @@ -1612,8 +1608,7 @@ namespace bsmd.hisnord coreFilenameDict[core] = new Dictionary(); if(message != null) coreFilenameDict[core][message] = filename; - - coreUseTestDict[core] = useTest; + retval = true; #endregion diff --git a/bsmd.hisnord/Response.cs b/bsmd.hisnord/Response.cs index b181b8e9..0b40b6da 100644 --- a/bsmd.hisnord/Response.cs +++ b/bsmd.hisnord/Response.cs @@ -15,10 +15,9 @@ namespace bsmd.hisnord private static readonly ILog _log = LogManager.GetLogger(typeof(Response)); - public static void ReadAnswers(bool useTest) + public static void ReadAnswers() { - string answerDir = Path.Combine(useTest ? Properties.Settings.Default.TestTransmitterRoot : Properties.Settings.Default.LiveTransmitterRoot, - Properties.Settings.Default.AnswerDir); + string answerDir = Path.Combine(Properties.Settings.Default.TransmitterRoot, Properties.Settings.Default.AnswerDir); foreach (string answerFile in Directory.GetFiles(answerDir)) { @@ -293,8 +292,8 @@ namespace bsmd.hisnord if(isOK) { // archive file - string answerArchiveDir = Path.Combine(useTest ? Properties.Settings.Default.TestTransmitterRoot : Properties.Settings.Default.LiveTransmitterRoot, - Properties.Settings.Default.AnswerArchiveDir); + string answerArchiveDir = Path.Combine(Properties.Settings.Default.TransmitterRoot, Properties.Settings.Default.AnswerArchiveDir); + try { File.Move(answerFile, Path.Combine(answerArchiveDir, Path.GetFileName(answerFile))); @@ -307,8 +306,8 @@ namespace bsmd.hisnord else { // save in separate folder (to look at it later?) - string answerCorruptDir = Path.Combine(useTest ? Properties.Settings.Default.TestTransmitterRoot : Properties.Settings.Default.LiveTransmitterRoot, - Properties.Settings.Default.AnswerCorruptDir); + string answerCorruptDir = Path.Combine(Properties.Settings.Default.TransmitterRoot, Properties.Settings.Default.AnswerCorruptDir); + try { File.Move(answerFile, Path.Combine(answerCorruptDir, Path.GetFileName(answerFile))); diff --git a/bsmd.hisnord/app.config b/bsmd.hisnord/app.config index 72c489c2..63ead48a 100644 --- a/bsmd.hisnord/app.config +++ b/bsmd.hisnord/app.config @@ -28,18 +28,9 @@ E:\svnlager\BSMD\nsw\HIS-NORD\Transmitter-Tool\ANSWERS_CORRUPT - + E:\svnlager\BSMD\nsw\HIS-NORD\ - - - - - False - - - True - \ No newline at end of file diff --git a/bsmd.hisnord/bsmd.hisnord.csproj b/bsmd.hisnord/bsmd.hisnord.csproj index d84075ba..0f7b99a1 100644 --- a/bsmd.hisnord/bsmd.hisnord.csproj +++ b/bsmd.hisnord/bsmd.hisnord.csproj @@ -37,12 +37,13 @@ ..\bsmdKey.snk - - ..\packages\log4net.2.0.8\lib\net45-full\log4net.dll - True + + ..\packages\log4net.2.0.13\lib\net45\log4net.dll + + diff --git a/bsmd.hisnord/packages.config b/bsmd.hisnord/packages.config index 9a0551c5..518cdea0 100644 --- a/bsmd.hisnord/packages.config +++ b/bsmd.hisnord/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/bsmd.hisnord/transmitter.cs b/bsmd.hisnord/transmitter.cs index 4abb8800..d19895c5 100644 --- a/bsmd.hisnord/transmitter.cs +++ b/bsmd.hisnord/transmitter.cs @@ -19,24 +19,17 @@ namespace bsmd.hisnord public class transmitter { private static readonly ILog _log = LogManager.GetLogger(typeof(transmitter)); - private static int? processId; // Achtung, das müsste getrennt behandelt werden Test <-> Livesystem! - private static int? processTestId; + private static int? processId; // Achtung, das müsste getrennt behandelt werden Test <-> Livesystem! - public static void CallTransmitter(bool useTest) + public static void CallTransmitter() { - string rootDir = useTest ? Properties.Settings.Default.TestTransmitterRoot : Properties.Settings.Default.LiveTransmitterRoot; + string rootDir = Properties.Settings.Default.TransmitterRoot; - if(!useTest && processId.HasValue) + if(processId.HasValue) { _log.InfoFormat("Transmitter process {0} still running, aborting call", processId); return; - } - - if(useTest && processTestId.HasValue) - { - _log.InfoFormat("Transmitter process (Test system) {0} still running, aborting call", processId); - return; - } + } ProcessStartInfo startInfo = new ProcessStartInfo(Path.Combine(rootDir, Properties.Settings.Default.Transmitter)); startInfo.WorkingDirectory = rootDir; @@ -50,14 +43,8 @@ namespace bsmd.hisnord using (Process transmitterProcess = new Process()) { - if (useTest) - { - transmitterProcess.Exited += TransmitterTestProcess_Exited; - } - else - { - transmitterProcess.Exited += TransmitterProcess_Exited; - } + + transmitterProcess.Exited += TransmitterProcess_Exited; transmitterProcess.ErrorDataReceived += TransmitterProcess_ErrorDataReceived; transmitterProcess.OutputDataReceived += TransmitterProcess_OutputDataReceived; @@ -69,16 +56,7 @@ namespace bsmd.hisnord transmitterProcess.BeginErrorReadLine(); transmitterProcess.BeginOutputReadLine(); - int aProcessId = transmitterProcess.Id; - - if (useTest) - { - processTestId = aProcessId; - } - else - { - processId = aProcessId; - } + processId = transmitterProcess.Id; // _log.DebugFormat("started {0}", transmitterProcess.ProcessName); int timeout = Properties.Settings.Default.BatchTimeoutMins * 1000 * 60; // convert to ms @@ -89,9 +67,8 @@ namespace bsmd.hisnord try { transmitterProcess.Kill(); - _log.Info("Transmitter killed"); - if (useTest) processTestId = null; - else processId = null; + _log.Info("Transmitter killed"); + processId = null; } catch (Exception e) { @@ -111,13 +88,7 @@ namespace bsmd.hisnord { if(!e.Data.IsNullOrEmpty()) _log.Error(e.Data); - } - - private static void TransmitterTestProcess_Exited(object sender, EventArgs e) - { - _log.Debug("Transmitter process (test) exited"); - processTestId = null; - } + } private static void TransmitterProcess_Exited(object sender, EventArgs e) { @@ -125,14 +96,11 @@ namespace bsmd.hisnord processId = null; } - public static result GetResult(string filenameFullPath, bool useTest) + public static result GetResult(string filenameFullPath) { // now we should read the response message... string resultFilename = string.Format("{0}.result.xml", Path.GetFileName(filenameFullPath)); - - string resultDir = Path.Combine(useTest ? Properties.Settings.Default.TestTransmitterRoot : Properties.Settings.Default.LiveTransmitterRoot, - Properties.Settings.Default.ResultDir); - + string resultDir = Path.Combine(Properties.Settings.Default.TransmitterRoot, Properties.Settings.Default.ResultDir); string resultFullPath = Path.Combine(resultDir, resultFilename); return result.ReadResult(resultFullPath); } diff --git a/bsmd.status/bsmd.status.csproj b/bsmd.status/bsmd.status.csproj index 1c06ad6a..923bb180 100644 --- a/bsmd.status/bsmd.status.csproj +++ b/bsmd.status/bsmd.status.csproj @@ -38,11 +38,11 @@ ..\bsmdKey.snk - - ..\packages\log4net.2.0.8\lib\net45-full\log4net.dll - True + + ..\packages\log4net.2.0.13\lib\net45\log4net.dll + diff --git a/bsmd.status/packages.config b/bsmd.status/packages.config index 9a0551c5..518cdea0 100644 --- a/bsmd.status/packages.config +++ b/bsmd.status/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file