Пример #1
0
        private static string GetData(DataObject dobjExt, string dobjCat)
        {
            double temp = dobjExt.GetItem(dobjCat);

            if (temp == double.MinValue)
            {
                return("Keine Daten");
            }

            return(HttpUtility.HtmlEncode(temp.ToString("F") + " " + DataObjectCategory.GetSensorValueUnit(dobjCat)));
        }
Пример #2
0
        private static string CreateHTMLTableString(DataObject dobj)
        {
            if (!XML.HtmlEnabled || !dobj.DataAvailable)
            {
                return(string.Empty);
            }

            StringBuilder sb = new StringBuilder();

            sb.Clear();



            List <string> capabaleItems = DataObjectCategory.GetCapableItems(dobj.Protocol);

            sb.AppendLine("</br><h3>" + HttpUtility.HtmlEncode(dobj.Name) + "</h3>");
            sb.AppendLine("  <table> ");
            sb.AppendLine("  <tr>");
            sb.AppendLine("    <th>" + HttpUtility.HtmlEncode("Datum und Uhrzeit") + "</th>");
            foreach (string s in capabaleItems)
            {
                sb.AppendLine("    <th>" + HttpUtility.HtmlEncode(s) + "</th>");
            }
            sb.AppendLine("    <th>" + HttpUtility.HtmlEncode("Zusatz-Info") + "</th>");
            sb.AppendLine("  </tr>");

            foreach (string dt in dobj.GetLogTimings())
            {
                sb.AppendLine("  <tr>");
                sb.AppendLine("    <td>" + dt + "</td>");

                foreach (string s in capabaleItems)
                {
                    sb.AppendLine("    <td>" + HttpUtility.HtmlEncode(dobj.GetLogItem(dt, s) + DataObjectCategory.GetSensorValueUnit(s)) + "</td>");
                }

                sb.AppendLine("    <td>" + HttpUtility.HtmlEncode(dobj.AdditionalInformation) + "</td>");
                sb.AppendLine("  </tr>");
            }

            sb.AppendLine("  </table> ");
            sb.AppendLine("</br>");

            return(sb.ToString());
        }