示例#1
0
        public void SetLayerPropertiesWithRaDecTest()
        {
            Layer layer = new Layer();

            layer.Group = new Group("Sky", GroupType.ReferenceFrame, null);

            string expected = "<LayerApi><Layer Name=\"California\" CoordinatesType=\"Spherical\" XAxisColumn=\"-1\" YAxisColumn=\"-1\" ZAxisColumn=\"-1\" XAxisReverse=\"false\" YAxisReverse=\"false\" ZAxisReverse=\"false\" LatColumn=\"2\" LngColumn=\"1\" GeometryColumn=\"-1\" ColorMapColumn=\"6\" AltColumn=\"3\" StartDateColumn=\"4\" EndDateColumn=\"-1\" SizeColumn=\"5\" NameColumn=\"0\" Decay=\"16\" ScaleFactor=\"8\" Opacity=\"1\" StartTime=\"1/1/0001 12:00:00 AM\" EndTime=\"12/31/9999 11:59:59 PM\" FadeSpan=\"00:00:00\" ColorValue=\"ARGBColor:255:255:0:0\" AltType=\"Depth\" MarkerScale=\"World\" AltUnit=\"Meters\" RaUnits=\"Hours\" PointScaleType=\"Power\" FadeType=\"None\" PlotType=\"Gaussian\" MarkerIndex=\"0\" ShowFarSide=\"true\" /></LayerApi>";

            XElement element          = XElement.Parse(expected);
            var      listOfAttributes = element.Element(Constants.LayerElementNodeName).Attributes();

            WWTManager_Accessor.SetLayerProperties(layer, listOfAttributes);

            string actual = WWTManager_Accessor.GetLayerProperties(layer, false);

            Assert.AreEqual(expected, actual);
        }
示例#2
0
        public void GetLayerPropertiesLatLongTest()
        {
            string expected = "<LayerApi><Layer Name=\"California\" CoordinatesType=\"Spherical\" XAxisColumn=\"-1\" YAxisColumn=\"-1\" ZAxisColumn=\"-1\" XAxisReverse=\"false\" YAxisReverse=\"false\" ZAxisReverse=\"false\" LatColumn=\"2\" LngColumn=\"1\" GeometryColumn=\"-1\" ColorMapColumn=\"6\" AltColumn=\"3\" StartDateColumn=\"4\" EndDateColumn=\"-1\" SizeColumn=\"5\" NameColumn=\"0\" Decay=\"0\" ScaleFactor=\"1\" Opacity=\"0\" StartTime=\"1/1/0001 12:00:00 AM\" EndTime=\"12/31/9999 11:59:59 PM\" FadeSpan=\"00:00:00\" ColorValue=\"ARGBColor:255:255:255:255\" AltType=\"Altitude\" MarkerScale=\"World\" AltUnit=\"Meters\" RaUnits=\"Hours\" PointScaleType=\"Power\" FadeType=\"None\" PlotType=\"Gaussian\" MarkerIndex=\"0\" ShowFarSide=\"true\" /></LayerApi>";

            Layer layer = new Layer();

            layer.Name            = "California";
            layer.LatColumn       = 2;
            layer.LngColumn       = 1;
            layer.GeometryColumn  = -1;
            layer.ColorMapColumn  = 6;
            layer.AltColumn       = 3;
            layer.StartDateColumn = 4;
            layer.EndDateColumn   = -1;
            layer.SizeColumn      = 5;
            layer.NameColumn      = 0;
            layer.TimeDecay       = 0;
            layer.ScaleFactor     = 1;
            layer.Opacity         = 0;
            layer.StartTime       = Convert.ToDateTime("1/1/0001 12:00:00 AM", CultureInfo.InvariantCulture);
            layer.EndTime         = Convert.ToDateTime("12/31/9999 11:59:59 PM", CultureInfo.InvariantCulture);
            layer.FadeSpan        = new TimeSpan();
            layer.Color           = "ARGBColor:255:255:255:255";
            layer.AltType         = AltType.Altitude;
            layer.MarkerScale     = ScaleRelativeType.World;
            layer.AltUnit         = AltUnit.Meters;
            layer.PointScaleType  = ScaleType.Power;
            layer.FadeType        = FadeType.None;

            // Dummy sun group
            Group group = new Group("Sun", GroupType.ReferenceFrame, null);

            layer.Group = group;

            string actual = WWTManager_Accessor.GetLayerProperties(layer, false);

            Assert.AreEqual(expected, actual);
        }