Ejemplo n.º 1
0
        private string CalcDisplayValue(GridHitInfo gridHitInfo)
        {
            return(GridViewObjects.GetRowCellValue(gridHitInfo.RowHandle, gridHitInfo.Column)
                   .Return(rcv =>
            {
                var value = rcv.ToString();
                var catValue = value;
                var typeValue = value;
                var descriptionValue = value;
                var classValue = value;

                (gridHitInfo.Column.FieldName == "Name" || gridHitInfo.Column.FieldName == "OtherName")
                .Then(() => value = Catalogs.GetFrom(catValue));

                (gridHitInfo.Column.FieldName == "Type")
                .Then(() => value = ObjectType.GetFrom(typeValue));

                (gridHitInfo.Column.FieldName == "Description")
                .Then(() => value = Lookup.GetFrom(descriptionValue));

                (gridHitInfo.Column.FieldName == "Classification")
                .Then(() => value = Classification.GetFrom(
                          GridViewObjects.GetRowCellValue(gridHitInfo.RowHandle, "Type").ToString(),
                          classValue));

                (gridHitInfo.Column.FieldName == "MinimumAperture")
                .Then(() => value = MinimumApertureTip + CalcAperturesSkyBkgndBrightness + " mag/arcsec^2");

                (gridHitInfo.Column.FieldName == "BestExitPupil")
                .Then(() => value = BestExitPupilTip);

                return value;
            }, string.Empty));
        }
Ejemplo n.º 2
0
        public void Classification()
        {
            var c = new Classification();

            Assert.Equal("elliptical",
                         c.GetFrom("GALXY", "Elliptical"));

            Assert.Equal("elliptical - lenticular ring",
                         c.GetFrom("GALXY", "E-SO Ring"));

            Assert.Equal("barred spiral moderately wound arms",
                         c.GetFrom("GALXY", "SBb"));

            Assert.Equal("barred spiral lenticular - tightly wound arms",
                         c.GetFrom("GALXY", "SBO-a"));

            Assert.Equal("elliptical - lenticular with central bar",
                         c.GetFrom("GALXY", "E-SO Bar"));

            Assert.Equal("elliptical peculiar",
                         c.GetFrom("GALXY", "E pec"));

            Assert.Equal("barred spiral / peculiar",
                         c.GetFrom("GALXY", "SB/P"));

            Assert.Equal("elliptical plus star",
                         c.GetFrom("GALXY", "E+*"));

            Assert.Equal("spiral (moderately wound arms) irregular Magellanic",
                         c.GetFrom("GALXY", "S(B)dm"));

            Assert.Equal("elliptical very round",
                         c.GetFrom("GALXY", "E0"));

            Assert.True(true);
        }