Пример #1
0
        /// <summary>
        /// Process the given appendix.
        /// </summary>
        /// <param name="append">
        /// The name of the appendix.
        /// </param>
        /// <param name="framed">
        /// Whether or not the symbols are framed.
        /// </param>
        private void ProcessSymbolCollection(string append, bool framed)
        {
            const double Scale = 1.0;

            // Since some appendices cross reference symbols,
            // in other appendices, we'll check to make sure
            // we haven't already drawn a particular symbol code.
            IList <string> symList = new List <string>();

            var affiliations = new[] { "U", "F", "N", "H" };
            var keys         = MilAppendix.Keys(append);

            foreach (var ap in keys)
            {
                MilSymbol ms;
                var       sc = ap;
                if (symList.Contains(sc))
                {
                    continue;
                }

                symList.Add(sc);

                // There is no affiliation for weather
                var schemeKey = CodingScheme.GetCode(sc);
                if (schemeKey == CodingScheme.Weather)
                {
                    ms = new MilSymbol(sc, Scale, "X=67.8");
                    this.ProcessSymbol(ms, sc);
                    continue;
                }

                if (schemeKey == CodingScheme.TacticalGraphics)
                {
                    sc = sc.Substring(0, 1) + "H" + sc.Substring(2, 1) + "A" + sc.Substring(4);
                    ms = new MilSymbol(sc, Scale, "H=HH;H1=H1;W=W;W1=W1;T=TT;N=N;X=XX;V=VV;C=CC;Y=YY;Q=-60.0");
                    this.ProcessSymbol(ms, sc);
                    continue;
                }

                if (!framed)
                {
                    sc = sc.Substring(0, 2) + "X" + sc.Substring(3);
                }

                foreach (var c in affiliations)
                {
                    sc = sc[0] + c + sc[2] + "P" + sc.Substring(4, 10) + "E";

                    ms = new MilSymbol(sc, Scale, null, null);
                    this.ProcessSymbol(ms, sc);
                }
            }
        }
Пример #2
0
        /// <summary>
        /// Plots all of the core symbols that are in Appendix D.
        /// Since not all symbol codes are non-blank, there are some blanks in the output.
        /// Refer to MIL-STD 2525C for comparison.
        /// </summary>
        /// <param name="append">
        /// The appendix from which to get the symbols.
        /// </param>
        /// <param name="framed">
        /// Whether or not the symbols are framed.
        /// </param>
        private static void PlotAllSymbols(string append, bool framed)
        {
            Canvas cv = GetCanvas();

            if (cv == null)
            {
                return;
            }

            // Since some appendices cross reference symbols,
            // in other appendices, we'll check to make sure
            // we haven't already drawn a particular symbol code.
            IList <string> symList = new List <string>();

            double x = Edge;
            double y = Edge;

            var  affiliations = new[] { "U", "F", "N", "H" };
            bool first        = true;

            var keys = MilAppendix.Keys(append);

            foreach (string ap in keys)
            {
                string sc = ap;
                if (symList.Contains(sc))
                {
                    continue;
                }

                symList.Add(sc);

                // There is no affiliation for weather
                int schemeKey = CodingScheme.GetCode(sc);
                if (schemeKey == CodingScheme.Weather)
                {
                    // Check centering
                    // var ls1 = new Line { X1 = x + 5, Y1 = y + 5, X2 = x - 5, Y2 = y - 5, Stroke = new SolidColorBrush(Colors.Red), StrokeThickness = 1 };
                    // var ls2 = new Line { X1 = x - 5, Y1 = y + 5, X2 = x + 5, Y2 = y - 5, Stroke = new SolidColorBrush(Colors.Red), StrokeThickness = 1 };
                    // cv.Children.Add(ls1);
                    // cv.Children.Add(ls2);
                    var ms = new MilSymbol(sc, Scale, "X=67.8");
                    DrawSymbol(cv, ms, x, y);
                    if ((x += Tight) > 12 * Tight)
                    {
                        x  = Edge;
                        y += Tight;
                    }

                    continue;
                }

                if (schemeKey == CodingScheme.TacticalGraphics)
                {
                    // Check centering
                    // var ls1 = new Line { X1 = x + 5, Y1 = y + 5, X2 = x - 5, Y2 = y - 5, Stroke = new SolidColorBrush(Colors.Red), StrokeThickness = 1 };
                    // var ls2 = new Line { X1 = x - 5, Y1 = y + 5, X2 = x + 5, Y2 = y - 5, Stroke = new SolidColorBrush(Colors.Red), StrokeThickness = 1 };
                    // cv.Children.Add(ls1);
                    // cv.Children.Add(ls2);
                    sc = sc.Substring(0, 1) + "H" + sc.Substring(2, 1) + "A" + sc.Substring(4);
                    var ms = new MilSymbol(sc, Scale, "H=HH;H1=H1;W=W;W1=W1;T=TT;N=N;X=XX;V=VV;C=CC;Y=YY;Q=-60.0");
                    DrawSymbol(cv, ms, x, y);
                    if ((x += Tight) > 12 * Tight)
                    {
                        x  = Edge;
                        y += Tight + 25;
                    }

                    continue;
                }

                if (!framed)
                {
                    sc = sc.Substring(0, 2) + "X" + sc.Substring(3);
                }

                foreach (string c in affiliations)
                {
                    sc = sc[0] + c + sc[2] + "C" + sc.Substring(4, 10) + "E";

                    var ms = new MilSymbol(sc, Scale, null, null);
                    if (first && ms.Empty)
                    {
                        continue;
                    }

                    first = false;
                    DrawSymbol(cv, ms, x, y);

                    if ((x += Tight) > 12 * Tight)
                    {
                        x  = Edge;
                        y += Tight;
                    }
                }
            }
        }