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));
        }
Example #3
0
        public void ExportFrames(string path, string contextExpression = "", string standardIdentityExpression = "", string dimensionExpression = "", ETLExportEnum exportType = ETLExportEnum.ETLExportSimple, bool append = false, bool omitSource = false, bool omitLegacy = false, long size = 32)
        {
            // The public entry point for exporting frames from the JMSML library
            // into CSV format.

            // Accepts a path for the output (sans file name extension).  The caller
            // may also provide optional regular expressions to filter on the Label
            // attributes of the objects being exported.

            IFrameExport frameExporter = null;
            string line = "";

            _configHelper.PointSize = (int)size;

            switch (exportType)
            {
                case ETLExportEnum.ETLExportDomain:
                    frameExporter = new DomainFrameExport(_configHelper);
                    break;

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

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

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

                    if (exportType == ETLExportEnum.ETLExportImage)
                    {
                        foreach (LibraryContext context in _library.Contexts)
                        {
                            if (contextExpression != "" && !System.Text.RegularExpressions.Regex.IsMatch(context.Label, contextExpression, System.Text.RegularExpressions.RegexOptions.IgnoreCase))
                                continue;

                            foreach (LibraryStandardIdentity identity in _library.StandardIdentities)
                            {
                                if (standardIdentityExpression != "" && !System.Text.RegularExpressions.Regex.IsMatch(identity.Label, standardIdentityExpression, System.Text.RegularExpressions.RegexOptions.IgnoreCase))
                                    continue;

                                foreach (LibraryDimension dimension in _library.Dimensions)
                                {
                                    if (dimensionExpression != "" && !System.Text.RegularExpressions.Regex.IsMatch(dimension.Label, dimensionExpression, System.Text.RegularExpressions.RegexOptions.IgnoreCase))
                                        continue;

                                    // Export a frame for Status = Current

                                    line = frameExporter.Line(_librarian, context, identity, dimension, _library.Statuses[0], false, false);

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

                                    // Export the frame for Status = Planned (not every frame will have a Planned version)
                                    // Shortened the label for this export so the stylx file will use the shorter name.

                                    LibraryStatus status = _library.Statuses[1];
                                    status.LabelAlias = "Planned";
                                    line = frameExporter.Line(_librarian, context, identity, dimension, status, false, false);
                                    status.LabelAlias = "";

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

                                    // Export the frame for the Civilian option (not every frame has one)

                                    line = frameExporter.Line(_librarian, context, identity, dimension, _library.Statuses[0], true, false);

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

                                    // Export the frame for the Planned Civilian option (not every frame has one)

                                    line = frameExporter.Line(_librarian, context, identity, dimension, _library.Statuses[1], false, true);

                                    if (line != "")
                                    {
                                        w.WriteLine(line);
                                        w.Flush();
                                    }
                                }
                            }
                        }
                    }
                    else
                    {
                        foreach (LibraryStandardIdentity identity in _library.StandardIdentities)
                        {
                            if (standardIdentityExpression != "" && !System.Text.RegularExpressions.Regex.IsMatch(identity.Label, standardIdentityExpression, System.Text.RegularExpressions.RegexOptions.IgnoreCase))
                                continue;

                            line = frameExporter.Line(null, null, identity, null, null, false, false);

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

                    w.Close();
                }
            }
        }