Exemplo n.º 1
0
        public static int WriteXML_Tithi(StringBuilder doc, GPLocationProvider loc, GPGregorianTime vc)
        {
            doc.Append("<xml>\n");
            doc.Append("\t<request name=\"Tithi\" version=\"" + GPFileHelper.FileVersion + "\">\n");
            doc.Append("\t\t<arg name=\"longitude\" val=\"" + vc.getLocation().GetLongitudeEastPositive() + "\" />\n");
            doc.Append("\t\t<arg name=\"latitude\" val=\"" + vc.getLocation().GetLatitudeNorthPositive() + "\" />\n");
            doc.Append("\t\t<arg name=\"timezone\" val=\"" + vc.getLocation().getTimeZone().OffsetSeconds / 60 + "\" />\n");
            doc.Append("\t\t<arg name=\"startdate\" val=\"" + vc + "\" />\n");
            doc.Append("\t</request>\n");
            doc.Append("\t<result name=\"Tithi\">\n");

            GPGregorianTime d  = new GPGregorianTime(vc);
            GPGregorianTime d1 = new GPGregorianTime(loc);
            GPGregorianTime d2 = new GPGregorianTime(loc);


            GPAstroData day = new GPAstroData();

            day.calculateDayData(vc, loc);

            d.setDayHours(day.sun.getSunriseDayHours());

            GPTithi.GetPrevTithiStart(d, out d1);
            GPTithi.GetNextTithiStart(d, out d2);


            //dt.SetDegTime(d1.getDayHours() * 360);
            // start tithi at t[0]
            doc.Append("\t\t<tithi\n\t\t\tid=\"" + day.nTithi + "\"\n");
            doc.Append("\t\t\tname=\"" + GPTithi.getName(day.nTithi) + "\"\n");
            doc.Append("\t\t\tstartdate=\"" + d1.getShortDateString() + "\"\n");
            doc.Append("\t\t\tstarttime=\"" + d1.getShortTimeString() + "\"\n");

            //dt.SetDegTime(d2.getDayHours() * 360);
            doc.Append("\t\t\tenddate=\"" + d2.getShortDateString() + "\"\n");
            doc.Append("\t\t\tendtime=\"" + d2.getShortTimeString() + "\"\n />");


            doc.Append("\t</result>\n");
            doc.Append("</xml>\n");

            return(1);
        }