/// <summary>Send Notification to Ground App, specific to Element Id.</summary> /// <param name="requestId">The RequestId for the corresponding request.</param> /// <param name="pStatus">Status : Completed/Failed/Processing.</param> /// <param name="pElementId">The concerned ElementId.</param> public static void SendElementIdNotificationToGroundApp(string requestId, PIS.Ground.GroundCore.AppGround.NotificationIdEnum pStatus, string pElementId) { //String.Format(CultureInfo.CurrentCulture, Logs.INFO_NOTIFICATIONTOAPPGROUND, pElementId, requestId, pStatus) LogManager.WriteLog(TraceType.INFO, String.Format(CultureInfo.CurrentCulture, Logs.INFO_NOTIFICATIONTOAPPGROUND, pElementId, requestId, pStatus), "PIS.Ground.DataPackage.LiveVideoControl.sendElementIdNotificationToGroundApp", null, EventIdEnum.LiveVideoControl); try { // serialize ElementId. System.Xml.Serialization.XmlSerializer xmlSzr = new System.Xml.Serialization.XmlSerializer(typeof(string)); StringWriter lstr = new StringWriter(); xmlSzr.Serialize(lstr, pElementId); LiveVideoControlService.SendNotificationToGroundApp(new Guid(requestId), pStatus, lstr.ToString()); } catch (FormatException) { // serialize ElementId. System.Xml.Serialization.XmlSerializer xmlSzr = new System.Xml.Serialization.XmlSerializer(typeof(string)); StringWriter lstr = new StringWriter(); xmlSzr.Serialize(lstr, pElementId); LiveVideoControlService.SendNotificationToGroundApp(Guid.Empty, pStatus, lstr.ToString()); } catch (Exception ex) { LogManager.WriteLog( TraceType.ERROR, ex.Message, "PIS.Ground.LiveVideoControl.LiveVideoControlService.sendNotificationToGroundApp", ex, EventIdEnum.DataPackage); } }
/// <summary> /// Send notification to Ground Application. /// <param name="pRequestId"> Request ID corresponding to the specified request </param> /// <param name="pStatus"> Status : Completed/Failed/Processing </param> /// <param name="pParameters">Parameters: key-value pairs</param> /// </summary> private static void SendNotificationToGroundApp(Guid requestId, PIS.Ground.GroundCore.AppGround.NotificationIdEnum status, System.Collections.Generic.Dictionary <string, string> pParameters) { LogManager.WriteLog(TraceType.INFO, String.Format(CultureInfo.CurrentCulture, Logs.INFO_FUNCTION_CALLED, "SendNotificationToGroundApp"), "PIS.Ground.Infotainment.Journaling.JournalingService.SendNotificationToGroundApp", null, EventIdEnum.InfotainmentJournaling); try { List <string> lParameters = new List <string>(); foreach (KeyValuePair <string, string> lKeyValue in pParameters) { lParameters.Add(lKeyValue.Key); lParameters.Add(lKeyValue.Value); } System.Xml.Serialization.XmlSerializer lXmlSerializer = new System.Xml.Serialization.XmlSerializer(typeof(List <string>)); StringWriter lStringWriter = new StringWriter(); lXmlSerializer.Serialize(lStringWriter, lParameters); //Send Notification tp AppGround _notificationSender.SendNotification(status, lStringWriter.ToString(), requestId); } catch (Exception ex) { LogManager.WriteLog(TraceType.ERROR, String.Format(CultureInfo.CurrentCulture, Logs.INFO_FUNCTION_EXCEPTION, "SendNotificationToGroundApp"), "PIS.Ground.Infotainment.Journaling.JournalingService.SendNotificationToGroundApp", ex, EventIdEnum.InfotainmentJournaling); } }
/// <summary> /// Send notification to Ground Application. /// <param name="pRequestId"> Request ID corresponding to the specified request </param> /// <param name="pStatus"> Status : Completed/Failed/Processing </param> /// </summary> private static void SendNotificationToGroundApp(Guid pRequestId, PIS.Ground.GroundCore.AppGround.NotificationIdEnum pStatus, string pElementId) { Dictionary <string, string> lParameters = new Dictionary <string, string>(); lParameters.Add(NOTIFICATION_PARAMETER_ELEMENT_ID, pElementId); SendNotificationToGroundApp(pRequestId, pStatus, lParameters); }
public void SendNotification(string RequestId, PIS.Ground.GroundCore.AppGround.NotificationIdEnum NotificationId, string Parameter) { PIS.Ground.GroundCore.AppGround.SendNotificationRequest inValue = new PIS.Ground.GroundCore.AppGround.SendNotificationRequest(); inValue.RequestId = RequestId; inValue.NotificationId = NotificationId; inValue.Parameter = Parameter; PIS.Ground.GroundCore.AppGround.SendNotificationResponse retVal = ((PIS.Ground.GroundCore.AppGround.INotificationAppGroundService)(this)).SendNotification(inValue); }
/// <summary> /// Send notification to Ground Application. /// <param name="pRequestId"> Request ID corresponding to the specified request </param> /// <param name="pStatus"> Status : Completed/Failed/Processing </param> /// </summary> private static void SendNotificationToGroundApp(Guid requestId, PIS.Ground.GroundCore.AppGround.NotificationIdEnum status) { LogManager.WriteLog(TraceType.INFO, String.Format(CultureInfo.CurrentCulture, Logs.INFO_FUNCTION_CALLED, "SendNotificationToGroundApp"), "PIS.Ground.Infotainment.Journaling.JournalingService.SendNotificationToGroundApp", null, EventIdEnum.InfotainmentJournaling); try { _notificationSender.SendNotification(status, null, requestId); } catch (Exception ex) { LogManager.WriteLog(TraceType.ERROR, String.Format(CultureInfo.CurrentCulture, Logs.INFO_FUNCTION_EXCEPTION, "SendNotificationToGroundApp"), "PIS.Ground.Infotainment.Journaling.JournalingService.SendNotificationToGroundApp", ex, EventIdEnum.InfotainmentJournaling); } }
/// <summary>Sends a notification to Ground App.</summary> /// <param name="requestId">Request ID for the corresponding request.</param> /// <param name="status">Processing status.</param> /// <param name="parameter">The generic notification parameter.</param> private static void SendNotificationToGroundApp( Guid requestId, PIS.Ground.GroundCore.AppGround.NotificationIdEnum status, string parameter) { LogManager.WriteLog(TraceType.INFO, String.Format(CultureInfo.CurrentCulture, Logs.INFO_FUNCTION_CALLED, "SendNotificationToGroundApp"), "PIS.Ground.LiveVideoControl.LiveVideoControlService.SendNotificationToGroundApp", null, EventIdEnum.Mission); try { //send notification to ground app _notificationSender.SendNotification(status, parameter, requestId); } catch (Exception ex) { LogManager.WriteLog(TraceType.ERROR, String.Format(CultureInfo.CurrentCulture, Logs.INFO_FUNCTION_EXCEPTION, "SendNotificationToGroundApp"), "PIS.Ground.LiveVideoControl.LiveVideoControlService.SendNotificationToGroundApp", ex, EventIdEnum.Mission); } }
/// <summary>Sends a notification to Ground App.</summary> /// <param name="requestId">Request ID for the corresponding request.</param> /// <param name="status">Processing status.</param> /// <param name="parameter">The generic notification parameter.</param> private static void SendNotificationToGroundApp( Guid requestId, PIS.Ground.GroundCore.AppGround.NotificationIdEnum status, string parameter) { try { _notificationSender.SendNotification(status, parameter, requestId); } catch (Exception ex) { LogManager.WriteLog(TraceType.ERROR, ex.Message, "PIS.Ground.LiveVideoControl.RequestProcessor.SendNotificationToGroundApp", ex, EventIdEnum.LiveVideoControl); } }
/// <summary>Sends a notification to Ground App.</summary> /// <param name="requestId">Request ID for the corresponding request.</param> /// <param name="status">Processing status.</param> /// <param name="parameter">The generic notification parameter.</param> private void SendNotificationToGroundApp( Guid requestId, PIS.Ground.GroundCore.AppGround.NotificationIdEnum status, string parameter) { try { if (_notificationSender != null) { _notificationSender.SendNotification(status, parameter, requestId); } else { DataPackageService.mWriteLog(TraceType.ERROR, System.Reflection.MethodBase.GetCurrentMethod().Name, null, Logs.ERROR_UNDEFINED_NOTIFICATION_SENDER, EventIdEnum.DataPackage); } } catch (Exception ex) { DataPackageService.mWriteLog(TraceType.ERROR, System.Reflection.MethodBase.GetCurrentMethod().Name, ex, ex.Message, EventIdEnum.DataPackage); } }
public SendNotificationRequest(string RequestId, PIS.Ground.GroundCore.AppGround.NotificationIdEnum NotificationId, string Parameter) { this.RequestId = RequestId; this.NotificationId = NotificationId; this.Parameter = Parameter; }