cogu / autosar

A set of python modules for working with AUTOSAR XML files
MIT License
387 stars 168 forks source link

createConstant issue #89

Closed Han40 closed 7 months ago

Han40 commented 2 years ago

as i want to createConst in my own const package, but the reference implication datatype is in the external arxml this is an array type , the parent implication datatype has no dataType.variantProps , but the subelement has it. it report errror: _autosar\builder.py", line 28, in createFromDataTypeInternal variantProps = dataType.variantProps[0] IndexError: list index out of range @cogu how could i solve this problem.

`

rt_Array_UInt8_6
          <CATEGORY>ARRAY</CATEGORY>
          <ADMIN-DATA>
            <SDGS>
              <SDG GID="DV_SDG">
                <SD GID="DV_ReadOnly">1</SD>
              </SDG>
            </SDGS>
          </ADMIN-DATA>
          <SUB-ELEMENTS>
            <IMPLEMENTATION-DATA-TYPE-ELEMENT UUID="4dc31bd7-14f2-502e-08a6-3eed92b75371">
              <SHORT-NAME>rt_Array_UInt8_6</SHORT-NAME>
              <CATEGORY>TYPE_REFERENCE</CATEGORY>
              <ARRAY-SIZE>6</ARRAY-SIZE>
              <ARRAY-SIZE-SEMANTICS>FIXED-SIZE</ARRAY-SIZE-SEMANTICS>
              <SW-DATA-DEF-PROPS>
                <SW-DATA-DEF-PROPS-VARIANTS>
                  <SW-DATA-DEF-PROPS-CONDITIONAL>
                    <IMPLEMENTATION-DATA-TYPE-REF DEST="IMPLEMENTATION-DATA-TYPE">/AFA_pkg/AFA_dt/UInt8</IMPLEMENTATION-DATA-TYPE-REF>
                  </SW-DATA-DEF-PROPS-CONDITIONAL>
                </SW-DATA-DEF-PROPS-VARIANTS>
              </SW-DATA-DEF-PROPS>
            </IMPLEMENTATION-DATA-TYPE-ELEMENT>
          </SUB-ELEMENTS>
        </IMPLEMENTATION-DATA-TYPE>`
cogu commented 7 months ago