Пример #1
0
        private void _BuildNames()
        {
            _names.Clear();

            EntityExport ee = new DomainEntityExport(_configHelper);

            _names.Add("Entity", ee.NameIt(this.IconType == JointMilitarySymbologyLibrary.IconType.FULL_FRAME ? _sig : null, _symbolSet, _entity, _entityType, _entitySubType));

            ModifierExport me = new DomainModifierExport(_configHelper);

            _names.Add("ModifierOne", me.NameIt(_symbolSet, "1", _modifierOne));
            _names.Add("ModifierTwo", me.NameIt(_symbolSet, "2", _modifierTwo));

            FrameExport fe = new DomainFrameExport(_configHelper);

            if (_affiliation != null)
            {
                _names.Add("Frame", fe.NameIt(_context, _dimension, _standardIdentity, _status, _affiliation.CivilianGraphic != "" || _affiliation.PlannedCivilianGraphic != ""));
            }
            else
            {
                _names.Add("Frame", fe.NameIt(_context, _dimension, _standardIdentity, _status, false));
            }

            HQTFFDExport he = new DomainHQTFFDExport(_configHelper);

            _names.Add("HQTFFD", he.NameIt(_sig, _dimension, _hqTFDummy));

            AmplifierExport ae = new DomainAmplifierExport(_configHelper);

            _names.Add("Amplifier", ae.NameIt(_amplifierGroup, _amplifier, _sig));

            OCAExport oe = new DomainOCAExport(_configHelper);

            _names.Add("OCA", oe.NameIt(_sig, _dimension, _status));
        }
        private void _BuildNames()
        {
            _names.Clear();

            EntityExport ee = new DomainEntityExport(_configHelper);
            _names.Add("Entity",ee.NameIt(this.IconType == JointMilitarySymbologyLibrary.IconType.FULL_FRAME ? _sig : null, _symbolSet, _entity, _entityType, _entitySubType));

            ModifierExport me = new DomainModifierExport(_configHelper);
            _names.Add("ModifierOne", me.NameIt(_symbolSet, "1", _modifierOne));
            _names.Add("ModifierTwo", me.NameIt(_symbolSet, "2", _modifierTwo));

            FrameExport fe = new DomainFrameExport(_configHelper);
            if(_affiliation != null)
                _names.Add("Frame", fe.NameIt(_context, _dimension, _standardIdentity, _status, _affiliation.CivilianGraphic != "" || _affiliation.PlannedCivilianGraphic != ""));
            else
                _names.Add("Frame", fe.NameIt(_context, _dimension, _standardIdentity, _status, false));

            HQTFFDExport he = new DomainHQTFFDExport(_configHelper);
            _names.Add("HQTFFD", he.NameIt(_sig, _dimension, _hqTFDummy));

            AmplifierExport ae = new DomainAmplifierExport(_configHelper);
            _names.Add("Amplifier", ae.NameIt(_amplifierGroup, _amplifier, _sig));

            OCAExport oe = new DomainOCAExport(_configHelper);
            _names.Add("OCA", oe.NameIt(_sig, _dimension, _status));
        }
Пример #3
0
        public void ExportAmplifiers(string path, ETLExportEnum exportType = ETLExportEnum.ETLExportSimple, bool append = false, bool omitSource = false, bool omitLegacy = false, long size = 32, string amplifierExpression = "")
        {
            // The public entry point for exporting amplifiers from the JMSML library
            // into CSV format.  These include echelons, mobilities, and auxiliary equipment

            // Accepts a path for the output (sans file name extension).  The output may also
            // be appended to an existing file.

            IAmplifierExport amplifierExporter = null;
            string line = "";

            _configHelper.PointSize = (int)size;

            switch (exportType)
            {
                case ETLExportEnum.ETLExportDomain:
                    amplifierExporter = new DomainAmplifierExport(_configHelper);
                    break;

                case ETLExportEnum.ETLExportImage:
                    amplifierExporter = new ImageAmplifierExport(_configHelper, omitSource, omitLegacy);
                    break;
            }

            if (amplifierExporter != null)
            {
                using (var w = new StreamWriter(path + ".csv", append))
                {
                    if (!append)
                    {
                        line = string.Format("{0}", amplifierExporter.Headers);

                        w.WriteLine(line);
                        w.Flush();
                    }

                    foreach (LibraryAmplifierGroup lag in _library.AmplifierGroups)
                    {
                        if (amplifierExpression != "" && !System.Text.RegularExpressions.Regex.IsMatch(lag.Label, amplifierExpression, System.Text.RegularExpressions.RegexOptions.IgnoreCase))
                            continue;

                        if (lag.Amplifiers != null)
                        {
                            foreach (LibraryAmplifierGroupAmplifier amp in lag.Amplifiers)
                            {
                                if (amp.Graphics != null && exportType == ETLExportEnum.ETLExportImage)
                                {
                                    foreach (LibraryAmplifierGroupAmplifierGraphic graphic in amp.Graphics)
                                    {
                                        line = amplifierExporter.Line(lag, amp, graphic);

                                        if (line != "")
                                        {
                                            w.WriteLine(line);
                                            w.Flush();
                                        }
                                    }
                                }
                                else if (exportType == ETLExportEnum.ETLExportDomain)
                                {
                                    if (!amp.IsExtension)
                                    {
                                        line = amplifierExporter.Line(lag, amp, null);

                                        if (line != "")
                                        {
                                            w.WriteLine(line);
                                            w.Flush();
                                        }
                                    }
                                }
                            }
                        }
                    }

                    w.Close();
                }
            }
        }