示例#1
0
        public string WeatherDataListing()
        {
            //Forms the weather data into a string separated by line feeds
            string wsList = "";

            if (weaList.Count > 0)
            {
                {
                    wsList += "WriteDate:\t" + ReportDate.ToString("hh:mm:ss");
                    wsList += "\r\n" + "TempScale:\t" + TempScale.ToString();
                    wsList += "\r\n" + "WindScale:\t" + WindScale.ToString();
                    wsList += "\r\n" + "SkyTemp:\t" + SkyTemp.ToString();
                    wsList += "\r\n" + "AmbTemp:\t" + AmbTemp.ToString();
                    wsList += "\r\n" + "SenTemp:\t" + SenTemp.ToString();
                    wsList += "\r\n" + "WindSpeed:\t" + WindSpeed.ToString();
                    wsList += "\r\n" + "Humidity:\t\t" + Humidity.ToString();
                    wsList += "\r\n" + "DewPoint:\t" + DewPoint.ToString();
                    wsList += "\r\n" + "DewHeat:\t" + DewHeat.ToString();
                    wsList += "\r\n" + "RainFlag:\t\t" + RainFlag.ToString();
                    wsList += "\r\n" + "WetFlag:\t\t" + WetFlag.ToString();
                    wsList += "\r\n" + "ElapsedTime:\t" + ElapsedSeconds.ToString();
                    wsList += "\r\n" + "LastDataWrite:\t" + LastDataWrite.ToString("hh:mm:ss");
                    wsList += "\r\n" + "Cloudiness:\t" + Cloudiness.ToString();
                    wsList += "\r\n" + "Windiness:\t" + Windiness.ToString();
                    wsList += "\r\n" + "Raininess:\t" + Raininess.ToString();
                    wsList += "\r\n" + "Darkness:\t" + Darkness.ToString();
                    wsList += "\r\n" + "RoofCloseFlag:\t" + RoofCloseFlag.ToString();
                    wsList += "\r\n" + "AlertFlag:\t\t" + AlertFlag.ToString();
                }
            }
            return(wsList);
        }
示例#2
0
    private void refreshWind()
    {
        windDirection = Random.Range(0, 360);
        int _windSpeed = Random.Range(0, 3);

        if (isTypoon)
        {
            _windSpeed = 3;
        }
        switch (_windSpeed)
        {
        case 0:
            //대충 세기 1정도
            windSpeed = global::WindSpeed.NORMAL;
            break;

        case 1:
            //세기 2정도
            windSpeed = global::WindSpeed.MIDDLE;
            break;

        case 2:
            //세기 3정도
            windSpeed = global::WindSpeed.STRONG;
            break;

        case 3:
            windSpeed = global::WindSpeed.TYPOON;
            break;
        }
        windSpeedText.text = windSpeed.ToString();
        windDirectionImage.transform.rotation = Quaternion.Euler(0, 0, windDirection);
    }
        protected override void WriteDataXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            ele.TryPathTo("WindSpeed", true, out subEle);
            subEle.Value = WindSpeed.ToString();

            ele.TryPathTo("CloudSpeed/Lower", true, out subEle);
            subEle.Value = CloudSpeedLower.ToString();

            ele.TryPathTo("CloudSpeed/Upper", true, out subEle);
            subEle.Value = CloudSpeedUpper.ToString();

            ele.TryPathTo("TransitionDelta", true, out subEle);
            subEle.Value = TransitionDelta.ToString();

            ele.TryPathTo("SunGlare", true, out subEle);
            subEle.Value = SunGlare.ToString();

            ele.TryPathTo("SunDamage", true, out subEle);
            subEle.Value = SunDamage.ToString();

            ele.TryPathTo("Precipitation/BeginFadeIn", true, out subEle);
            subEle.Value = PrecipitationBeginFadeIn.ToString();

            ele.TryPathTo("Precipitation/EndFadeOut", true, out subEle);
            subEle.Value = PrecipitationEndFadeOut.ToString();

            ele.TryPathTo("Thunder_Lightning/BeginFadeIn", true, out subEle);
            subEle.Value = Thunder_LightningBeginFadeIn.ToString();

            ele.TryPathTo("Thunder_Lightning/EndFadeOut", true, out subEle);
            subEle.Value = Thunder_LightningEndFadeOut.ToString();

            ele.TryPathTo("Thunder_Lightning/Frequency", true, out subEle);
            subEle.Value = Thunder_LightningFrequency.ToString();

            ele.TryPathTo("Classification", true, out subEle);
            subEle.Value = Classification.ToString();

            ele.TryPathTo("LightningColor/Red", true, out subEle);
            subEle.Value = LightningColorRed.ToString();

            ele.TryPathTo("LightningColor/Green", true, out subEle);
            subEle.Value = LightningColorGreen.ToString();

            ele.TryPathTo("LightningColor/Blue", true, out subEle);
            subEle.Value = LightningColorBlue.ToString();
        }
示例#4
0
        public bool AccessUpdate()
        {
            OleDbConnection connection = new OleDbConnection(Atend.Control.ConnectionString.AccessCnString);
            OleDbCommand    command    = new OleDbCommand("D_Weather_Update", connection);

            command.CommandType = CommandType.StoredProcedure;
            command.Parameters.Add(new OleDbParameter("iTemp", Temp));
            command.Parameters.Add(new OleDbParameter("iWindSpeed", WindSpeed));
            command.Parameters.Add(new OleDbParameter("iIceDiagonal", IceDiagonal));
            command.Parameters.Add(new OleDbParameter("iSaftyFactor", SaftyFactor));
            command.Parameters.Add(new OleDbParameter("iCode", Code));

            Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;

            ed.WriteMessage(string.Format("Code:={0},temp:={1},WindSpeed:={2},iIceDiagonal:={3},iSaftyFactor:={4}", code.ToString(), Temp.ToString(), WindSpeed.ToString(), IceDiagonal.ToString(), SaftyFactor.ToString()));
            try
            {
                connection.Open();
                command.ExecuteNonQuery();
                connection.Close();
                return(true);
            }
            catch (System.Exception ex1)
            {
                //Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
                ed.WriteMessage(string.Format(" ERROR Weather.Update: {0} \n", ex1.Message));

                connection.Close();
                return(false);
            }
        }
示例#5
0
 public override string ToString()
 {
     return("{ Temp: " + Temperature.ToString() + " *C "
            + "| Windspeed: " + WindSpeed.ToString() + " km/h "
            + "| Wind Direction: " + WindDirection.ToString() + " }");
 }