nasa / CCDD

CFS Command and Data Dictionary Tool (CCDDT)
81 stars 31 forks source link

XTCE file import resulting in no tables #113

Closed smcHannah closed 6 months ago

smcHannah commented 9 months ago

Hi!

I've used the OpenC3 COSMOS xtce_converter to create a .xtce file, however when I try to import it into CCDD no tables are created. The CCDD log is saying the import was successful.

I am following these instructions to use the xtce_converter: https://docs.openc3.com/docs/meta/xtce

I also opened an issue on OpenC3 COSMOS about this issue, but they are unable to help: https://github.com/OpenC3/cosmos/issues/956

Is there anything in particular about xtce files that may result in this issue?

I am using CCDD 2.1.4e and we are using OpenC3 definitions to create CFS files. I just need to put the command and telemetry message definitions in CCDD for operations uses.

KevinMcCluney commented 8 months ago

CCDD version 2.1.5 was released on 12/6/2023. This version updates the XTCE (and EDS) import/export handlers to use the latest schemas. If the structure and command table information in a .xtce file is not where CCDD expects to find it then it can't create the table. You can look in Appendix C and C.4 in the updated user's guide you can compare how structure and command table information is translated into XTCE format.

smcHannah commented 8 months ago

I've compared it to Appendix C and C.4 and can't seem to identify any differences that would account for this issue. However, when using xtcetools to check it matches the schema and when I do I get the following errors: XML Schema Compliance Error: ( line 2 column 189 ) cvc-elt.1.a: Cannot find the declaration of element 'SpaceSystem'. And the following one for every line that contains ByteOrderList: XML Schema Compliance Error: ( line 34 column 24 ) unexpected element (uri:"http://www.omg.org/space/xtce", local:"ByteOrderList"). Expected elements are <{http://www.omg.org/space/xtce}UnitSet>,<{http://www.omg.org/space/xtce}IntegerDataEncoding>,<{http://www.omg.org/space/xtce}AncillaryDataSet>,<{http://www.omg.org/space/xtce}BinaryDataEncoding>,<{http://www.omg.org/space/xtce}DefaultAlarm>,<{http://www.omg.org/space/xtce}StringDataEncoding>,<{http://www.omg.org/space/xtce}ValidRange>,<{http://www.omg.org/space/xtce}ToString>,<{http://www.omg.org/space/xtce}LongDescription>,<{http://www.omg.org/space/xtce}FloatDataEncoding>,<{http://www.omg.org/space/xtce}ContextAlarmList>,<{http://www.omg.org/space/xtce}AliasSet>

Also, if I use CNES XTCE-Checker then I get lots of the following errors: XML_PARSER_ERROR line:34 cvc-complex-type.2.4.a: Invalid content was found starting with element '{"http://www.omg.org/space/xtce":ByteOrderList}'. One of '{"http://www.omg.org/space/xtce":LongDescription, "http://www.omg.org/space/xtce":AliasSet, "http://www.omg.org/space/xtce":AncillaryDataSet, "http://www.omg.org/space/xtce":UnitSet}' is expected.

An example of how I use ByteOrderList is below: `<?xml version="1.0" encoding="UTF-8"?>

`
smcHannah commented 8 months ago

Also if I put </ByteOrderList> and <IntegerDataEncoding sizeInBits="32" encoding="twosCompliment"/> before <ByteOrderList> <Byte byteSignificance="0"/> <Byte byteSignificance="1"/> <Byte byteSignificance="2"/> <Byte byteSignificance="3"/> </ByteOrderList> the CNES XTCE-Checker error changes to XML_PARSER_ERROR line:36 cvc-complex-type.2.4.a: Invalid content was found starting with element '{"http://www.omg.org/space/xtce":ByteOrderList}'. One of '{"http://www.omg.org/space/xtce":ToString, "http://www.omg.org/space/xtce":ValidRange, "http://www.omg.org/space/xtce":DefaultAlarm, "http://www.omg.org/space/xtce":ContextAlarmList}' is expected.

KevinMcCluney commented 8 months ago

Please post an example of a file you're trying to import. CCDD 2.1.5 uses version 1.2 of the XTCE schema. The xtcetools README implies it's based on version 1.1. I'm not familiar with xtcetools or XTCE-Checker.

KevinMcCluney commented 8 months ago

I downloaded xtcetools and used it to validate a CCDD XTCE export file. The version 1.2 schema embedded in xtcetools.jar is out of date. It defaults to a schema embedded in the jar file if it can't read the schema from the web. I haven't been able to get it to read from the web, so I embedded the updated schema in the jar file. Based on that latest schema there are elements missing in the CCDD-generated XTCE file (CCDD doesn't use those elements, but the schema demands them). Also, the SpaceSystem and other names don't allow a period (.) or brackets ([ and ]). CCDD stores table paths in those name fields, which can contain those characters, so that also causes schema validation failures. I'm working on updates to CCDD so that it passes the xtcetools validation.

KevinMcCluney commented 6 months ago

CCDD version 2.1.6 XTCE exports should pass validation against schema version 1.2.