OPCFoundation / UA-ModelCompiler

ModelCompiler converts XML files into C# and ANSI C
MIT License
151 stars 94 forks source link

Method generating custom method state in C#, but says it could not be found #180

Closed SortedIvan closed 5 months ago

SortedIvan commented 5 months ago
  <opc:Method SymbolicName="GetLogsFunctionType">
        <opc:InputArguments>
        </opc:InputArguments>
        <opc:OutputArguments>
               <opc:Argument Name="Return" DataType="ua:String" ValueRank="Array" />
        </opc:OutputArguments>
  </opc:Method>

<opc:ObjectType SymbolicName="Test" BaseType="ua:BaseObjectType" SupportsEvents="true">
    <opc:Description>Descr</opc:Description>
    <opc:Children>
        <opc:Method SymbolicName="GetLogs" ModellingRule="Mandatory" TypeDefinition="GetLogsFunctionType">
        </opc:Method>
    </opc:Children>
</opc:ObjectType>

This is compiled by model compiler, but generates this in C# code:

        /// <remarks />
        public GetLogsFunctionMethodState GetLogs
        {
            get
            {
                return m_getLogsMethod;
            }

            set
            {
                if (!Object.ReferenceEquals(m_getLogsMethod, value))
                {
                    ChangeMasks |= NodeStateChangeMasks.Children;
                }

                m_getLogsMethod = value;
            }
        }
        #endregion

However, GetLogsFunctionMethodState does not exist. Furthermore, the other methods that do not have any custom input/output arguments seem to be a regular MethodState

SortedIvan commented 5 months ago

I just looked at another issue from someone else here, it seems that the issue is the naming convention. The method name seems to cause the compiler to generate a new type