コード例 #1
0
        private async Task <bool> GetWindData()
        {
            WindDto windDto = await wind.GetWind();

            FindViewById <TextView>(Resource.Id.resultJsonText).Text = wind.ReturnedJsonString;
            if (windDto == null)
            {
                FindViewById <TextView>(Resource.Id.stationNameText).Text = "GetWind returned null.";
                return(false);
            }
            else
            {
                FindViewById <TextView>(Resource.Id.stationNameText).Text      = windDto.sDn;
                FindViewById <TextView>(Resource.Id.windTrueSpeedText).Text    = windDto.wWts.ToSpeedUnit(Settings.SpeedUnit).ToUiDashes3();
                FindViewById <TextView>(Resource.Id.windTrueDirText).Text      = windDto.wWtd.ToUiDashes3();
                FindViewById <TextView>(Resource.Id.windTrueOrientation).Text  = windDto.wWto.ToUpper();
                FindViewById <TextView>(Resource.Id.windTrueMaxSpeedText).Text = windDto.wWtmxs.ToSpeedUnit(Settings.SpeedUnit).ToUiDashes3();

                FindViewById <TextView>(Resource.Id.windAppSpeedText).Text    = windDto.wWas.ToSpeedUnit(Settings.SpeedUnit).ToUiDashes3();
                FindViewById <TextView>(Resource.Id.windAppDirText).Text      = windDto.wWad.ToUiDashes3();
                FindViewById <TextView>(Resource.Id.windAppOrientation).Text  = windDto.wWao.ToUpper();
                FindViewById <TextView>(Resource.Id.windAppMaxSpeedText).Text = windDto.wWamxs.ToSpeedUnit(Settings.SpeedUnit).ToUiDashes3();

                FindViewById <TextView>(Resource.Id.latitudeText).Text  = lat.ToString(windDto.wLat);
                FindViewById <TextView>(Resource.Id.longitudeText).Text = lng.ToString(windDto.wLng);

                FindViewById <TextView>(Resource.Id.sogText).Text    = windDto.wSog.ToSpeedUnit(Settings.SpeedUnit).ToUiDashes3();
                FindViewById <TextView>(Resource.Id.cogText).Text    = windDto.wCog.ToUiDashes3() + "°";
                FindViewById <TextView>(Resource.Id.hdtText).Text    = windDto.wHdt.ToUiDashes3() + "°";
                FindViewById <TextView>(Resource.Id.magVarText).Text = windDto.wMagVar.ToUiDashes3() + "°";

                FindViewById <TextView>(Resource.Id.resultUrlText).Text = wind.GetLatestUrl();
                return(true);
            }
        }
コード例 #2
0
        public void TestToString()
        {
            GeoPosition pos = new GeoPosition(46.72, -5.23, 12);

            Assert.AreEqual("46E43'12\", 5S13'48\", 12 m", pos.ToString());
        }