Ejemplo n.º 1
0
        private int GetSensorTypeDecimals(string sensorType)
        {
            int            sensorTypeDecimals = 1;
            SensorTypeInfo sensorTypeInfo     = null;

            sensorType = sensorType.ToStr().Trim().ToUpper();
            if (AlarmHelper.IsTempSensor(sensorType))
            {
                sensorTypeDecimals = 1;
            }
            else if (sensorType.IndexOf("HUMI") >= 0)
            {
                sensorTypeDecimals = 0;
            }
            else if (AlarmHelper.IsContactSensor(sensorType))
            {
                sensorTypeDecimals = 0;
            }
            else if (sensorType.IndexOf("REPEA") >= 0)
            {
                sensorTypeDecimals = 0;
            }
            else if (sensorType.Length > 0)
            {
                sensorTypeInfo = AlarmHelper.GetSensorTypeInfo(sensorType);
                if (sensorTypeInfo.ID != 0)
                {
                    sensorTypeDecimals = sensorTypeInfo.nDecimals;
                    sensorTypeInfo     = null;
                }
            }
            return(sensorTypeDecimals);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Check for sensor type Units Of Measure
        /// </summary>
        /// <param name="alarmObject"></param>
        /// <returns></returns>
        private string GetSensorTypeUOM(Interface.Alarm.AlarmObject alarmObject)
        {
            string         sensorType = "", sensorTypeUOM = "";
            SensorTypeInfo sensorTypeInfo = null;

            sensorType = alarmObject.SensorType.ToStr().Trim().ToUpper();
            if (AlarmHelper.IsTempSensor(sensorType))
            {
                sensorTypeUOM = (alarmObject.IsCelsius) ? "C" : "F";
            }
            else if (sensorType.IndexOf("HUMI") >= 0)
            {
                sensorTypeUOM = "%RH";
            }
            else if (AlarmHelper.IsContactSensor(sensorType))
            {
                sensorTypeUOM = "";
            }
            else if (sensorType.Length > 0)
            {
                sensorTypeInfo = AlarmHelper.GetSensorTypeInfo(sensorType);
                if (sensorTypeInfo != null)
                {
                    sensorTypeUOM  = sensorTypeInfo.UOM;
                    sensorTypeInfo = null;
                }
            }
            return(sensorTypeUOM);
        }
        public bool Invoke(AlarmObject alarmObject, INotificationClient client)
        {
            /* if the value is null, this notification is to clear the dynamic notifications(message boards and relay switches). */
            if (alarmObject.IsDynamicNotificationCleared)
            {
                return(true);
            }

            bool hasEscalations  = false;
            bool isContactSensor = false;

            /* Make isContactSensor as true if the sensor type is contact. */
            if (AlarmHelper.IsContactSensor(alarmObject.SensorType) && alarmObject.IsInAlarmState)
            {
                isContactSensor = true;
            }


            EscalationList escalationList = new EscalationList();

            /* Loading escalation information for current object */
            escalationList.Load(new Criteria()
            {
                ID = alarmObject.EscalationProfileID
            });
            if (escalationList.Count > 0)
            {
                hasEscalations             = true;
                alarmObject.HasEscalations = true;
            }

            /*update the escalation information to alarm object*/
            if (hasEscalations)
            {
                alarmObject.StopEscalationOnExitAlarm = escalationList[0].StopEscOnSesnorNormalState;
                alarmObject.StopEscalationOnUserAck   = escalationList[0].StopEscOnUserAck;
            }
            else
            {
                alarmObject.StopEscalationOnExitAlarm = false;
                alarmObject.StopEscalationOnExitAlarm = false;
            }

            escalationList.Dispose();

            /* if the sensor has escalations or it is a contact sensor then then send to the escalation process */
            if ((hasEscalations || isContactSensor) && alarmObject.AlarmType != AlarmType.COMMUNICATIONS)
            {
                ThreadPool.QueueUserWorkItem(new EscalationProcess().DoEscalationProcess, new EscalationState()
                {
                    AlarmObject        = alarmObject,
                    NotificationClient = client,
                    EscalationList     = escalationList
                });
            }
            else
            {
                /* if the object does not has any escalation then mark it as completed.*/
                AlarmHelper.MarkAsCompleted(alarmObject, " DOES NOT have any escalations ");
            }

            /* if the sensor type is contact then return false to stop sending notification immediately.*/
            if (isContactSensor && alarmObject.AlarmType != AlarmType.COMMUNICATIONS)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Get format string
        /// </summary>
        /// <param name="formatString"></param>
        /// <param name="alarmObject"></param>
        /// <returns></returns>
        public string SubstituteFormatString(string formatString, Interface.Alarm.AlarmObject alarmObject)
        {
            string  temperatureReading = "Reading OK", sUCOM = "", sValue;
            decimal dMin, dMax;

            string[] aValues = new string[4];

            /*Set Alarm Values*/
            //Check for contact sensor
            if (AlarmHelper.IsContactSensor(alarmObject.SensorType))
            {
                temperatureReading = (alarmObject.Value == 0) ? "CLOSED" : "OPEN";
            }
            else
            {
                temperatureReading = (alarmObject.Value < alarmObject.AlarmMinValue) ? "LOW" : "HIGH";
            }

            dMin   = alarmObject.AlarmMinValue;
            dMax   = alarmObject.AlarmMaxValue;
            sValue = alarmObject.DisplayValue;
            sUCOM  = "";


            if (alarmObject.AlarmType == AlarmType.COMMUNICATIONS)
            {
                sValue = alarmObject.CurrentAlarmMinutes.ToString();
            }
            else
            {
                aValues = FormatSensorValues(alarmObject);
                if (aValues.Length >= 3)
                {
                    sValue = aValues[0];
                    dMin   = aValues[1].ToDecimal();
                    dMax   = aValues[2].ToDecimal();
                    sUCOM  = aValues[3];
                }
            }

            //Substitute values for format string
            //formatString = formatString.Replace("\\n", Environment.NewLine);
            //formatString = formatString.Replace("\\n", "\\n");
            //formatString = formatString.Replace("\n", Environment.NewLine);
            formatString = Microsoft.VisualBasic.Strings.Replace(formatString, "%%ID%%", FormatFactoryID(alarmObject.FactoryID), 1, -1, Constants.vbTextCompare);
            formatString = Microsoft.VisualBasic.Strings.Replace(formatString, "%%NAME%%", alarmObject.ProbeName, 1, -1, Constants.vbTextCompare);
            formatString = Microsoft.VisualBasic.Strings.Replace(formatString, "%%NAME2%%", alarmObject.ProbeName2, 1, -1, Constants.vbTextCompare);
            formatString = Microsoft.VisualBasic.Strings.Replace(formatString, "%%TYPE%%", (alarmObject.AlarmType == AlarmType.COMMUNICATIONS.ToInt16()) ? alarmObject.SensorClass : alarmObject.SensorType, 1, -1, Constants.vbTextCompare);
            formatString = Microsoft.VisualBasic.Strings.Replace(formatString, "%%VALUE%%", sValue, 1, -1, Constants.vbTextCompare);
            formatString = Microsoft.VisualBasic.Strings.Replace(formatString, "%%MIN%%", dMin.ToStr(), 1, -1, Constants.vbTextCompare);
            formatString = Microsoft.VisualBasic.Strings.Replace(formatString, "%%MAX%%", dMax.ToStr(), 1, -1, Constants.vbTextCompare);
            formatString = Microsoft.VisualBasic.Strings.Replace(formatString, "%%UOM%%", sUCOM.ToStr(), 1, -1, Constants.vbTextCompare);
            formatString = Microsoft.VisualBasic.Strings.Replace(formatString, "%%TIME%%", alarmObject.AlarmTime.ToLocalTime().ToString(), 1, -1, Constants.vbTextCompare);
            formatString = Microsoft.VisualBasic.Strings.Replace(formatString, "%%GMTTIME%%", alarmObject.AlarmTime.ToStr(), 1, -1, Constants.vbTextCompare);
            formatString = Microsoft.VisualBasic.Strings.Replace(formatString, "%%NOW%%", DateTime.Now.ToStr(), 1, -1, Constants.vbTextCompare);
            formatString = Microsoft.VisualBasic.Strings.Replace(formatString, "%%GROUP%%", alarmObject.GroupName, 1, -1, Constants.vbTextCompare);
            formatString = Microsoft.VisualBasic.Strings.Replace(formatString, "%%HOTCOLD%%", temperatureReading, 1, -1, Constants.vbTextCompare);
            formatString = Microsoft.VisualBasic.Strings.Replace(formatString, "%%CORF%%", (alarmObject.IsCelsius) ? "C" : "F", 1, -1, Constants.vbTextCompare);
            formatString = Microsoft.VisualBasic.Strings.Replace(formatString, "%%THRESHOLD%%", alarmObject.Threshold.ToStr(), 1, -1, Constants.vbTextCompare);
            formatString = Microsoft.VisualBasic.Strings.Replace(formatString, "%%THRESHOLDMINS%%", alarmObject.CondThresholdMins.ToStr(), 1, -1, Constants.vbTextCompare);
            formatString = Microsoft.VisualBasic.Strings.Replace(formatString, "%%TimeOutOfRange%%", Common.FormatMinutes(GetCurrentMinInAlarm(alarmObject)), 1, -1, Constants.vbTextCompare);
            formatString = Microsoft.VisualBasic.Strings.Replace(formatString, "%%AlarmStartTime%%", alarmObject.AlarmStartTime.ToLocalTime().ToString(), 1, -1, Constants.vbTextCompare);
            formatString = Microsoft.VisualBasic.Strings.Replace(formatString, "%%ESCALATION%%", (alarmObject.IsEscalationNotification ? "** ESCALATION NOTIFICATION **" : ((alarmObject.IsFailsafeEscalationNotification) ? "** FAILSAFE ESCALATION NOTIFICATION **" : "")), 1, -1, Constants.vbTextCompare);
            formatString = Microsoft.VisualBasic.Strings.Replace(formatString, "%%SEVERITY%%", alarmObject.Severity.ToStr(), 1, -1, Constants.vbTextCompare);
            // Does this put in the actual current value?
            if (formatString != null)
            {
                if (formatString.Contains("%%CURRENTVALUE%%", StringComparison.OrdinalIgnoreCase))
                {
                    // Need to hit datbase for current values

                    SensorCurrentStatus sensorCurrentStatus = new SensorCurrentStatus();
                    try
                    {
                        LogBook.Write("Getting current value and time for sensor");
                        sensorCurrentStatus.UTID  = alarmObject.UTID;
                        sensorCurrentStatus.Probe = alarmObject.Probe;
                        sensorCurrentStatus.Execute();
                    }
                    catch (Exception ex)
                    {
                        LogBook.Write(ex, "CooperAtkins.NotificationClient.NotificationComposer.NotificationStyle", ErrorSeverity.High);
                    }
                    finally
                    {
                        sensorCurrentStatus.Dispose();
                    }
                    formatString = Microsoft.VisualBasic.Strings.Replace(formatString, "%%CURRENTVALUE%%", sensorCurrentStatus.CurrentValue.ToStr(), 1, -1, Constants.vbTextCompare);
                    formatString = Microsoft.VisualBasic.Strings.Replace(formatString, "%%CURRENTVALUETIME%%", sensorCurrentStatus.CurrentTime.ToLocalTime().ToString(), 1, -1, Constants.vbTextCompare);
                }
            }



            return(formatString);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Get default format string
        /// </summary>
        /// <param name="alarmObject"></param>
        /// <param name="languageID"></param>
        /// <param name="formatType"></param>
        /// <returns></returns>
        private string GetDefaultFormatString(Interface.Alarm.AlarmObject alarmObject, int languageID, string formatType)
        {
            string formatString = "";

            if (alarmObject.AlarmType == AlarmType.COMMUNICATIONS)
            {
                formatString = "MISSED COMM: %%TYPE%% %%NAME%% In %%GROUP%% (%%TimeOutOfRange%%)";
            }
            else if (AlarmHelper.IsContactSensor(alarmObject.SensorType))
            {
                //Check logic for vbTextCompare in c#

                /*Body Pager*/
                if (formatType.IndexOf("BodyPager") >= 0)
                {
                    formatString = "";
                }

                /*Notify Tree*/
                else if (formatType.IndexOf("NotifyTree") >= 0)
                {
                    formatString = "";
                }

                /*Email Body*/
                else if (formatType.IndexOf("EmailBody") >= 0)
                {
                    formatString = "";
                }

                /*Pager Subject*/
                else if (formatType.IndexOf("SubjectPager") >= 0)
                {
                    formatString = "TempTrak ALERT - %%NAME%% In %%GROUP%%: %%VALUE%% (%%THRESHOLDMINS%%)";
                }

                /*Email Subject*/
                else if (formatType.IndexOf("EmailSubject") >= 0)
                {
                    formatString = "TempTrak ALERT - %%NAME%% In %%GROUP%%: %%VALUE%% (%%THRESHOLDMINS%%)";
                }

                /*Net send*/
                else if (formatType.IndexOf("NetSend") >= 0)
                {
                    formatString = "!! TEMP TRAK ALERT !!\n%%NAME%% In %%GROUP%%: %%VALUE%% (%%THRESHOLDMINS%%)";
                }

                /*Popup*/
                else if (formatType.IndexOf("Popup") >= 0)
                {
                    formatString = "!! TEMP TRAK ALERT !!\n%%NAME%% In %%GROUP%%: %%VALUE%% (%%THRESHOLDMINS%%)";
                }

                /*Message Board*/
                else if (formatType.IndexOf("Board") >= 0)
                {
                    formatString = "WARNING: %%NAME%% In %%GROUP%%: at %%VALUE%% (%%THRESHOLDMINS%%)";
                }

                /*Default*/
                else
                {
                    formatString = "TempTrak ALERT - %%NAME%% In %%GROUP%%: %%VALUE%% (%%THRESHOLDMINS%%)";
                }
            }
            else
            {
                /*Pager Body*/
                if (formatType.IndexOf("BodyPager") >= 0)
                {
                    formatString = "";
                }

                /*Notify Tree*/
                else if (formatType.IndexOf("NotifyTree") >= 0)
                {
                    formatString = "";
                }

                /*Email Body*/
                else if (formatType.IndexOf("EmailBody") >= 0)
                {
                    formatString = "";
                }

                /*Pager Subject*/
                else if (formatType.IndexOf("SubjectPager") >= 0)
                {
                    formatString = "TempTrak ALERT - %%NAME%% In %%GROUP%% at %%VALUE%% (%%MIN%%-%%MAX%%)";
                }

                /*Email Subject*/
                else if (formatType.IndexOf("EmailSubject") >= 0)
                {
                    formatString = "TempTrak ALERT - %%NAME%% In %%GROUP%%: at %%VALUE%% (Normal Range %%MIN%%-%%MAX%%)";
                }

                /*Net send*/
                else if (formatType.IndexOf("NetSend") >= 0)
                {
                    formatString = "!! TEMP TRAK ALERT !!\n%%NAME%% In %%GROUP%%: at %%VALUE%% (Normal Range %%MIN%%-%%MAX%%)";
                }

                /*Popup*/
                else if (formatType.IndexOf("Popup") >= 0)
                {
                    formatString = "!! TEMP TRAK ALERT !!\n%%NAME%% In %%GROUP%%: at %%VALUE%% (Normal Range %%MIN%%-%%MAX%%)";
                }

                /*Message Board*/
                else if (formatType.IndexOf("Board") >= 0)
                {
                    formatString = "WARNING: %%NAME%% In %%GROUP%%: at %%VALUE%% (Range %%MIN%%-%%MAX%%)";
                }

                /*Default*/
                else
                {
                    formatString = "TempTrak ALERT - %%NAME%% In %%GROUP%%: at %%VALUE%% (Range %%MIN%%-%%MAX%%)";
                }
            }
            return(formatString);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Gets alarm list.
        /// </summary>
        /// <param name="criteria"></param>
        /// <returns></returns>
        protected override AlarmList LoadList(BaseCriteria criteria)
        {
            try
            {
                Criteria listCriteria = (Criteria)criteria;

                //Initialize the CSqlDbCommand for execute the stored procedure
                CSqlDbCommand cmd = new CSqlDbCommand(DBCommands.USP_NS_GET_ALARMLIST, System.Data.CommandType.StoredProcedure);

                //Execute reader
                CDAO.ExecReader(cmd);
                bool flag = true;

                System.Collections.Hashtable extFields = null;
                List <string> fields = new List <string>();

                while (CDAO.DataReader.Read())
                {
                    //For the first time get all the field names
                    if (flag)
                    {
                        for (int index = 0; index < CDAO.DataReader.FieldCount; index++)
                        {
                            fields.Add(CDAO.DataReader.GetName(index));
                        }

                        //Remove known fields from the list.
                        fields.Remove("UTID");
                        fields.Remove("Probe");
                        fields.Remove("ProbeName");
                        fields.Remove("PuckDesc2");
                        fields.Remove("FactoryID");
                        fields.Remove("AlarmType");
                        fields.Remove("AlarmID");
                        fields.Remove("SensorType");
                        fields.Remove("SensorClass");
                        fields.Remove("Options");
                        fields.Remove("AlarmData");
                        fields.Remove("CondMaxValue");
                        fields.Remove("CondMinValue");
                        fields.Remove("CondThresholdMins");
                        fields.Remove("NotificationRecID");
                        fields.Remove("AlarmProfileRecID");
                        fields.Remove("NotificationProfileID");
                        fields.Remove("EscalationProfileID");
                        fields.Remove("AlarmTime");
                        fields.Remove("AlarmStartTime");
                        fields.Remove("PagerMessage");
                        fields.Remove("SwitchBitmask");
                        fields.Remove("Severity");
                        fields.Remove("GroupName");
                        fields.Remove("NotifyResetFlags");


                        flag = false;
                    }


                    extFields = new System.Collections.Hashtable();

                    //Adding all extra fields in to a hash table.
                    foreach (string item in fields)
                    {
                        extFields.Add(item, CDAO.DataReader[item]);
                    }


                    AlarmObject alarm = new AlarmObject();
                    alarm.AddtionalFields = extFields;


                    alarm.UTID        = CDAO.DataReader["UTID"].ToStr();
                    alarm.Probe       = CDAO.DataReader["Probe"].ToInt();
                    alarm.ProbeName   = CDAO.DataReader["ProbeName"].ToStr();
                    alarm.ProbeName2  = CDAO.DataReader["PuckDesc2"].ToStr();
                    alarm.FactoryID   = CDAO.DataReader["FactoryID"].ToStr();
                    alarm.AlarmType   = CDAO.DataReader["AlarmType"].ToInt16();
                    alarm.AlarmID     = CDAO.DataReader["AlarmID"].ToInt();
                    alarm.SensorType  = CDAO.DataReader["SensorType"].ToStr();
                    alarm.SensorClass = CDAO.DataReader["SensorClass"].ToStr();
                    //alarm.IsNewAlarmRecordWasCreated = (CDAO.DataReader["Options"].ToInt() == 0 ? false : true);


                    if (alarm.AlarmType >= AlarmType.RESETMODE)
                    {
                        //if the alarm type is reset, then
                        alarm.SensorAlarmID = alarm.UTID + "_" + alarm.Probe + "_" + (alarm.AlarmType - AlarmType.RESETMODE).ToString();
                    }
                    else
                    {
                        alarm.SensorAlarmID = alarm.UTID + "_" + alarm.Probe + "_" + alarm.AlarmType.ToString();
                    }

                    alarm.AlarmTime = TypeCommonExtensions.IfNull(CDAO.DataReader["AlarmTime"], DateTime.UtcNow).ToDateTime();

                    alarm.AlarmStartTime = TypeCommonExtensions.IfNull(CDAO.DataReader["AlarmStartTime"], alarm.AlarmTime).ToDateTime();

                    if (alarm.AlarmStartTime == DateTime.MinValue || alarm.AlarmStartTime < DateTime.Parse("1/1/2000"))
                    {
                        alarm.AlarmStartTime = alarm.AlarmTime;
                    }

                    alarm.Value = CDAO.DataReader["AlarmData"].ToDecimal();

                    alarm.AlarmMaxValue                  = CDAO.DataReader["CondMaxValue"].ToDecimal();
                    alarm.AlarmMinValue                  = CDAO.DataReader["CondMinValue"].ToDecimal();
                    alarm.Threshold                      = Common.DateDiff("n", alarm.AlarmStartTime, alarm.AlarmTime);
                    alarm.CondThresholdMins              = CDAO.DataReader["CondThresholdMins"].ToInt();
                    alarm.TimeOutOfRange                 = Common.DateDiff("n", alarm.AlarmStartTime, alarm.AlarmTime);
                    alarm.NotificationID                 = CDAO.DataReader["NotificationRecID"].ToInt();
                    alarm.AlarmProfileID                 = CDAO.DataReader["AlarmProfileRecID"].ToInt();
                    alarm.NotifyProfileID                = CDAO.DataReader["NotificationProfileID"].ToInt();
                    alarm.EscalationProfileID            = CDAO.DataReader["EscalationProfileID"].ToInt();
                    alarm.PagerMessage                   = CDAO.DataReader["PagerPrompt"].ToStr();
                    alarm.SwitchBitmask                  = CDAO.DataReader["SwitchBitmask"].ToInt16();
                    alarm.Severity                       = (Severity)CDAO.DataReader["Severity"].ToInt();
                    alarm.DisplayValue                   = alarm.Value.ToString();
                    alarm.ResetNotifyOnUserAck           = (CDAO.DataReader["NotifyResetFlags"].ToInt() & 1).ToBoolean();
                    alarm.ResetNotifyOnSensorNormalRange = (CDAO.DataReader["NotifyResetFlags"].ToInt() & 2).ToBoolean();

                    if (AlarmHelper.IsContactSensor(alarm.SensorType))
                    {
                        if (alarm.Value == 0)
                        {
                            alarm.DisplayValue = "CLOSED";
                        }
                        else
                        {
                            alarm.DisplayValue = "OPEN";
                        }
                    }


                    // Only allow "ShowCelsius" flag to be set for "TEMP" type sensors
                    alarm.IsCelsius = (AlarmHelper.IsTempSensor(alarm.SensorType) ? (((CDAO.DataReader["NotifyFlags"].ToInt()) & 0x1) != 0) : false);

                    alarm.GroupName = CDAO.DataReader["GroupName"].ToStr();

                    //ProcessStatus will be returned as "O" if it is a old notification.
                    if (CDAO.DataReader["ProcessStatus"].ToStr() == "O")
                    {
                        alarm.IsResumedNitification = true;
                    }
                    else
                    {
                        alarm.IsResumedNitification = false;
                    }



                    this.Add(alarm);
                }
            }
            catch
            {
                throw;
            }
            finally
            {
                CDAO.CloseDataReader();
                // Added on 2/19/2012
                // To dispose the data reader object
                // Srinivas Rao E
                CDAO.Dispose();
            }
            return(this);
        }
Ejemplo n.º 7
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="alarmObject"></param>
        /// <returns></returns>
        private NotifyObject GetNotifyObject(AlarmObject alarmObject, string popupMessage, NotifyPopupAddress notifyPopupAddress)
        {
            string alertTime = "", location = "", temperatureReading = "", notificationData = "";
            /*Initialize NotifyObject*/
            NotifyObject notifyObject = new NotifyObject();

            /*Notification settings*/
            NotificationStyle notificationStyle = new NotificationStyle();

            /*Alert Time*/
            alertTime = alarmObject.AlarmTime.ToLocalTime().ToString();
            //Common.LocalTimeToUTC(alarmObject.AlarmTime, Common.TZ_OFFSET).ToStr();
            alertTime = (alertTime == string.Empty ? DateTime.Now.ToStr() : alertTime);

            /*Location*/
            location = alarmObject.ProbeName.ToStr() + (alarmObject.GroupName.ToStr() != string.Empty ? ("(" + alarmObject.GroupName + ")") : "");

            /*HOT COLD*/
            //Check for contact sensor
            if (AlarmHelper.IsContactSensor(alarmObject.SensorType))
            {
                temperatureReading = (alarmObject.Value == 0) ? "CLOSED" : "OPEN";
            }
            else
            {
                temperatureReading = (alarmObject.Value < alarmObject.AlarmMinValue) ? "LOW" : "HIGH";
            }

            /*Building the alert message data*/
            notificationData = "<alert><msg>" + HtmlEncode(popupMessage) + "</msg>" +
                               "<time_local>" + HtmlEncode(alertTime) + "</time_local>"
                               + "<time_gmt>" + HtmlEncode(alarmObject.AlarmTime.ToStr()) + "</time_gmt>"
                               + "<loc>" + HtmlEncode((alarmObject.GroupName.ToStr())) + "</loc>"
                               + "<name>" + HtmlEncode((alarmObject.ProbeName.ToStr())) + "</name>"
                               + "<type>" + HtmlEncode((alarmObject.SensorType.ToStr())) + "</type>"
                               + "<class>" + HtmlEncode((alarmObject.SensorClass.ToStr())) + "</class>"
                               + "<alertType>" + HtmlEncode((temperatureReading)) + "</alertType>"
                               + "</alert>";

            string temp      = "00000000";
            int    strLength = temp.Length - notificationData.Length.ToString().Length;

            notificationData = temp.Substring(0, strLength) + notificationData.Length + notificationData;
            /*Assign values to Notification settings*/
            Hashtable notificationSettings = new Hashtable();

            /*Remote Port*/
            notificationSettings.Add("RemotePort", ConfigurationManager.AppSettings["PortNumber"]);

            /*Remote Host*/
            notificationSettings.Add("RemoteHost", notifyPopupAddress.NetSendTo);

            /*Name that was configured in temp trak application*/
            notificationSettings.Add("Name", notifyPopupAddress.Name);

            /*Notification ID*/
            notificationSettings.Add("NotificationID", alarmObject.NotificationID);

            /*Notification settings*/
            notifyObject.NotifierSettings = notificationSettings;

            /*Pop up message*/
            notifyObject.NotificationData = notificationData;

            /*Set Notification Type*/
            notifyObject.NotificationType = (alarmObject.IsServerPopup) ? "ServerPopup" : "RemotePopup";

            return(notifyObject);
        }