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

            GPGregorianTime d   = new GPGregorianTime(vc);
            GPGregorianTime dn  = new GPGregorianTime(loc);
            GPSun           sun = new GPSun();
            int             nak;

            for (int i = 0; i < 30; i++)
            {
                nak = GPNaksatra.GetNextNaksatra(d, out dn);
                d.Copy(dn);
                doc.Append("\t\t<day date=\"" + d + "\">\n");
                //str = string.Format("{}.{}.{}", d.day, d.month, d.year);
                //n = m_list.InsertItem(50, GPNaksatra.GetName(nak));
                //m_list.SetItemText(n, 1, str);
                doc.Append("\t\t\t<naksatra id=\"" + nak + "\" name=\"" + GPNaksatra.getName(nak) + "\"\n");
                //dt.SetDegTime(d.getDayHours() * 360);
                //time_print(str, dt);
                doc.Append("\t\t\t\tstarttime=\"" + d.getShortTimeString() + "\" />\n");
                //m_list.SetItemText(n, 2, str);

                // sunrise time get
                sun.SunCalc(d, loc);
                //time_print(str, sun.rise);
                //m_list.SetItemText(n, 3, str);
                doc.Append("\t\t\t<sunrise time=\"" + sun.rise + "\" />\n");

                doc.Append("\t\t</day>\n");
                // increment for non-duplication of naksatra
                d.Copy(dn);
                d.setDayHours(d.getDayHours() + 1.0 / 8.0);
            }


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


            return(1);
        }