Attribute VB_Name = "Module1"
'#Uses "..\include\Global.inc"
'#Uses "..\include\Const.inc"
'#Uses "..\classes\FunctionClass.cls"
'#Uses "..\classes\ParameterClass.cls"

Option Explicit

'*****************************************************************************
' Module:
'        LIN
'-----------------------------------------------------------------------------
' Description:
'        This file contains functions which are create controls for the
'        module 'LIN'.
'-----------------------------------------------------------------------------
' History:
'
'        Rev.    Author       Date           Description
'        ---------------------------------------------------------------------
'        1.0     Raja         30.05.2005     LIN for Pegasus lite XC164CM
'
'*****************************************************************************


'*****************************************************************************
'Description:
'        For each function which should be used for this module a line
'        "If (Not func.AddFunction .." must be inserted in this function.
'        For each parameter that should be used for this function a
'        line "If (Not func.AddParameter .." must be inserted in this function.
'
'        Note:
'        For each added function a project variable with the name
'        "WDT_NAME_Functionname" must exist in the *.vars file.
'-----------------------------------------------------------------------------
'Parameters:
'        func             reference to the FunctionClass object
'        r                reference to the Registers object
'-----------------------------------------------------------------------------
'Returns:
'        True            on successfull operation
'        False           else
'*****************************************************************************
Public Function RefreshFunctionDescriptions(vIndex As Variant, func As FunctionClass, r As ProjectData) As Boolean
  On Error Resume Next

  RefreshFunctionDescriptions = False

  Dim sDescription As String
  Dim sReturnValue As String
  Dim sVarPre As String

  sVarPre = "LIN"

  ' for each function of this module the property AddFunction must be called
  '
  ' AddFunction(sFuncName As String, sFuncType As String, sFuncDescription As String,
  '             sReturnvalue As String, lSort As Long) As Boolean
  '
  ' sFuncName          | String | function name as key (use the name of the variable
  '                               for the function name e.g. SSC_NAME_Init)
  ' sFuncType          | String | type of the function
  ' sFuncDescription   | String | description of the function
  ' sReturnvalue       | String | description of the return value
  ' lSort              | Long   | ' sort of the function (0 => macro, 1 => function, 2 => ISR, 3 => TRAP)

    ' for each parameter of a function the property AddParameter must be called
    '
    'AddParameter(sParName As String, sPar As String, sParType As String, sParDescription As String) As Boolean
    '
    ' sParName         | String | parameter name (key)
    ' sPar             | String | parameter name
    ' sParType         | String | type of the parameter
    ' sParDescription  | String | description of the parameter


  '------------------------------------------------------------------------------------------------
  ' Description for LIN_NAME_Init
  '------------------------------------------------------------------------------------------------
  sDescription = GetGeneralInitDescription(sVarPre)
  
  sReturnValue = "None"
  
  If (Not func.AddFunction(sVarPre & "_NAME_Init", "void", sDescription, sReturnValue, 1)) Then Exit Function

  
  '------------------------------------------------------------------------------------------------
  ' Description for LIN
  '------------------------------------------------------------------------------------------------
  sDescription = "This macro triggers the LIN." & vbCrLf

  sReturnValue = "None"
  If (Not func.AddFunction(sVarPre & "_NAME_TriggerLIN", "", sDescription, sReturnValue, 0)) Then Exit Function



        If (Not func.Sort) Then Exit Function

  RefreshFunctionDescriptions = True
End Function


'*****************************************************************************
'Description:
'        For each parameter that should be used as a constant (on page "Parameters")
'        a line "If (Not func.AddParameter .." must be insert in this function.
'
'        Note:
'        For each added parameter a project variable with the name
'        "DUMMY_PARA_Parametername" must be exist in the *.vars file.
'-----------------------------------------------------------------------------
'Parameters:
'        vIndex           parameter of the module which was added with AddModule
'        func             reference to the FunctionClass object
'        r                reference to the Registers object
'-----------------------------------------------------------------------------
'Returns:
'        True            on successfull operation
'        False           else
'*****************************************************************************
Public Function RefreshParameterDescriptions(vIndex As Variant, para As ParameterClass, r As ProjectData) As Boolean
  On Error Resume Next

  RefreshParameterDescriptions = False

  Dim sDescription  As String
  Dim sVarPre       As String
  Dim sRegPre       As String
  Dim sParaName     As String
  Dim i             As Integer

  sVarPre = "LIN" & vIndex
  sRegPre = sVarPre & "_"


  ' for each parameter of this module the property AddParameter must be called
  '
  ' AddParameter(sParameterName As String, sParameterDescription As String) As Boolean
  '
  ' sParameterName         | String | parameter name as key (use the name of the variable
  '                                   for the parameter name e.g. SSC_PARA_MODE)
  ' sParameterDescription  | String | description of the parameter

        
        If (Not para.Sort) Then Exit Function

  RefreshParameterDescriptions = True
End Function



