Esempio n. 1
0
        protected void OnButtonOkClicked(object sender, EventArgs e)
        {
            mime mmime = new mime(cbAdress.ActiveText, eSujet.Text, tvMail.Buffer.Text, smyAd);

            this.Respond(1);
        }
Esempio n. 2
0
        // TODO faire un compteur de volume 1.5 octet par donné

        protected void OnButtonOkClicked(object sender, EventArgs e)
        {
            String sMail;
            int    iTot, iDure;
            int    iCt;

            Gtk.TreeIter Giter;

            if (nbMain.Page == 0)
            {
                sMail  = "send GFS:" + eReqSud.Text + "," + eReqNord.Text + "," + eReqOuest.Text + "," + eReqEst.Text + "|";
                sMail += cbGPas.ActiveText + "," + cbGPas.ActiveText + "|";
                int iPas = Convert.ToUInt16(cbDPas.ActiveText);

                if (cbExpo.Active)                     // TODO la version exponentielle
                {
                    iDure = Convert.ToUInt16(eDure.Text);
                    if (iDure > 360)
                    {
                        iDure = 360;                          // si plus que 15jours
                    }
                    iTot = iPas;

                    cbDPas.Model.GetIterFromString(out Giter, cbDPas.Active.ToString());

                    do
                    {
                        sMail += String.Format("{0},{1}..", iTot, iTot + iPas);
                        iTot  += 4 * iPas;
                        //iPas *= 2;
                        GLib.Value thisRow = new GLib.Value();
                        cbDPas.Model.GetValue(Giter, 0, ref thisRow);
                        if (cbDPas.Model.IterNext(ref Giter))
                        {
                            iPas = Convert.ToUInt16((String)cbDPas.Model.GetValue(Giter, 0));
                        }
                    } while (iTot < iDure);
                    iPas /= 2;
                    iCt   = 0;
                    do
                    {
                        iCt++;
                        iTot -= iPas;
                    } while (iTot > iDure);
                    switch (iCt)
                    {
                    case 1:
                    case 2:
                        sMail += String.Format("{0}", iTot + iPas);
                        break;

                    case 3:                     //supprime les ...
                        sMail  = sMail.TrimEnd('.');
                        sMail += String.Format(",{0}", iTot + iPas);
                        break;

                    case 4:
                    case 5:
                        sMail = sMail.TrimEnd('.');
                        break;
                    }
                }
                else
                {
                    sMail += String.Format("{0},{1}..{2}", iPas, 2 * iPas, eDure.Text);
                }
                sMail += "|WIND";
                if (cbCAPE.Active == true)
                {
                    sMail += ",CAPE";
                }
                if (cbVague.Active == true)
                {
                    sMail += ",WAVES";
                }
                if (cbRain.Active == true)
                {
                    sMail += ",RAIN";
                }
            }
            else                 //	if (nbMain.Page ==1)
            {
                sMail  = "send Spot:" + eLat.Text + "," + eLong.Text + "|";
                sMail += eDure1.Text + "," + cbDPas1.ActiveText + "|";
                //if (cbVent.Active == true)
                sMail += "WIND,";
                if (cbPress.Active == true)
                {
                    sMail += "PRMSL,";
                }
                if (cbWaves.Active == true)
                {
                    sMail += "WAVES,";
                }
                if (cbRain1.Active == true)
                {
                    sMail += "RAIN,";
                }
                if (cbCape1.Active == true)
                {
                    sMail += "CAPE,";
                }
                if (cbSurfTmp.Active == true)
                {
                    sMail += "SFCTMP,";
                }
                if (cbLFTX.Active == true)
                {
                    sMail += "LFTX,";
                }
                sMail = sMail.TrimEnd(',');
            }

            mime mmime = new mime((String)"*****@*****.**", (String)"Saildocs Request", sMail, smyAd);

            this.Respond(1);
        }
Esempio n. 3
0
        protected void OnButtonOkClicked(object sender, EventArgs e)
        {
            String sMail;
            mime   mmime = null;

            sMail = "";
            if (cbListFreq.Active)
            {
                sMail += "PUB_PACTOR\r\n";
            }
            //if (checkbutton4.Active)		sMail += "HAM.2KEPS\r\n";   //pas meteo
            //if (checkbutton9.Active)				sMail += "AMSAT.KEPS\r\n";   // pas les meteo
            if (sMail != "")
            {
                mmime = new mime((String)"INQUIRY", (String)"REQUEST", sMail, smyAd);
            }


            // envoyé commerequette sailmail
            sMail = "";
            if (cbSatKepler.Active)
            {
                sMail += "Send https://www.celestrak.com/NORAD/elements/noaa.txt\r\n";                  // chang titre 4281 char
            }
            if (checkbutton3.Active)
            {
                sMail += "Send http://www.sidc.be/silso/DATA/EISN/EISN_current.txt  \r\n";                  // tache solaire obs belgique
            }
            if (checkbutton5.Active)
            {
                sMail += "Send http://services.swpc.noaa.gov/text/27-day-outlook.txt \r\n";                   // flux solaire NOAA
            }
            if (checkbutton7.Active)
            {
                sMail += "Send atl.outlook\r\n";
            }
            if (checkbutton9.Active)
            {
                sMail += "Send http://www.nhc.noaa.gov/tafb_latest/atlsfc24_latestBW_sm3.gif \r\n";                 //Carte gif sit gene
            }
            if (sMail != "")
            {
                mmime = new mime((String)"*****@*****.**", (String)"Saildocs Request", sMail, smyAd);
            }

            sMail = "";
            // requette noaa
            if (checkbutton6.Active)
            {
                sMail  = "open\r\ncd fax\r\n";
                sMail += "get PYAA01.TIF";
                sMail += "\r\nquit\r\n";                   // 30ko compressé passe pas en gzip
            }
            if (checkbutton8.Active)
            {
                sMail  = "open\r\ncd data\r\ncd hurricane_products\r\ncd atlantic\r\ncd weather\r\n";
                sMail += "get outlook.txt";
                sMail += "\r\nquit\r\n";
            }
            if (sMail != "")
            {
                mmime = new mime((String)"*****@*****.**", (String)"Req", sMail, smyAd);
            }

            this.Respond(1);
        }
Esempio n. 4
0
        protected void OnButtonOkClicked(object sender, EventArgs e)
        {
            String sMail;
            String U = "ABCDEFGHIJKLMNOPQRSTUVWX";
            String L = U.ToLower();

            double dvit = double.Parse(eVit.Text, System.Globalization.CultureInfo.InvariantCulture);

            sMail = eCap.Text.Substring(eCap.Text.Length - 1, 1);
            if (sMail != "T")
            {
                eCap.Text += "T";
            }

            sMail = "TIME: " + eDatps.Text + "\r\nLATITUDE: " + eLat.Text + "\r\nLONGITUDE: " + eLong.Text;
            if (dvit > 0.2)
            {
                sMail += "\r\nCOURSE: " + eCap.Text + "\r\nSPEED: " + eVit.Text;
            }
            sMail += "\r\nCOMMENT: " + tvComment.Buffer.Text;
            sMail += "\r\n";

            mime mmime = new mime((String)"*****@*****.**", (String)"POSITION REPORT", sMail, mPosCfg.sMyAdress);

            // recalc le locator
            int    idx  = eLat.Text.IndexOf("-");
            String sMid = eLat.Text.Substring(0, idx);
            double dLat = Convert.ToDouble(sMid);

            sMid = eLat.Text.Substring(idx + 1, eLat.Text.Length - idx - 2);
            double dmin = double.Parse(sMid, System.Globalization.CultureInfo.InvariantCulture);               // Minute et fraction

            dLat += dmin / 100;
            if (eLat.Text.Substring(eLat.Text.Length - 1, 1) == "S")
            {
                dLat = -dLat;
            }
            idx  = eLong.Text.IndexOf("-");
            sMid = eLong.Text.Substring(0, idx);
            double dLong = Convert.ToDouble(sMid);

            sMid   = eLong.Text.Substring(idx + 1, eLong.Text.Length - idx - 2);
            dmin   = double.Parse(sMid, System.Globalization.CultureInfo.InvariantCulture);             // Minute et fraction
            dLong += dmin / 100;
            if (eLong.Text.Substring(eLong.Text.Length - 1, 1) == "W")
            {
                dLong = -dLong;
            }

            dLat  += 90;
            dLong += 180;
            String GLat = U.Substring((int)(dLat / 10), 1);
            String GLon = U.Substring((int)(dLong / 20), 1);
            String nLat = "" + (int)(dLat % 10);
            String nLon = "" + (int)((dLong / 2) % 10);
            double rLat = (dLat - (int)(dLat)) * 60;
            double rLon = (dLong - 2 * (int)(dLong / 2)) * 60;
            String gLat = L.Substring((int)(rLat / 2.5), 1);
            String gLon = L.Substring((int)(rLon / 5), 1);

            mPosCfg.sMyLoc = "" + GLon + GLat + nLon + nLat + gLon + gLat;

            //ecrit la config
            mPosCfg.sLat = eLat.Text;
            mPosCfg.sLon = eLong.Text;
            mPosCfg.WritetheConf();

            this.Respond(1);
        }