Attribute VB_Name = "Module1"
Option Explicit
'*****************************************************************************
' Module:
'        Const.inc
'-----------------------------------------------------------------------------
' Description:
'        This file contains global constants. This file should be the same
'        for all controllers.
'
'-----------------------------------------------------------------------------
' History:
'
'        Rev. Author         Date        Description
'        ----------------------------------------------------------------------
'        1.0  ste            01.02.00    final version
'        1.1  ste            07.03.00    constants "TOOLTIP_ENABLED_PARAMETER_NAME" added
'
'        ----------------------------------------------------------------------
'        3.0  ahe            26.07.00    final version for C161PI
'                                        - added TOOLTIP_DISABLED_ISR16
'                                        - changed TOOLTIP_DISABLED_ISR32
'
'        !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
'        This file is NOT compatibel to the 32-bit MC
'             ahe            28.07.00
'        !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
'        3.1  ste            24.02.03    CONST TO_HIGH and TO_LOW added
'                            06.03.03    CONST CAPTION_LBL_PEC_HINT added
'        ----------------------------------------------------------------------
'             ste            01.10.03    constant "FORMAT_NOTES" changed
'             ste            06.11.03    constant "TO_HIGH" and "TO_LOW" changed
'
'*****************************************************************************

'*****************************************************************************
' @Global Constants
'*****************************************************************************

' format identifiers
Global Const FORMAT_FUNCTIONS = "N150"
Global Const FORMAT_PARAMETERS = "N150"
Global Const FORMAT_FILES = "S80"
Global Const FORMAT_NOTES = "S10000"


' message box constants
'
' use this constant as text for the MsgBox when the project settings are called
Global Const MSG_CALL_PROJECTSETTINGS = "These basic settings have a major effect on the whole" & vbCrLf & _
                                         "configuration and should therefore be set at the beginning" & vbCrLf & _
                                         "of a project. If any of these settings are reconfigured," & vbCrLf & _
                                         "the peripherals actual configuration should be checked." & vbCrLf & _
                                         "Do you really want to continue ?"

' use this constant as text for the MsgBox when the controller type will be changed
Global Const MSG_CHANGE_CONTROLLER = "Any of your settings which are incompatible with the selected" & vbCrLf & _
                                         "controller type will be adjusted without further notification." & vbCrLf & _
                                         "Do you really want to continue ?"


' use this constant as text for the MsgBox when the System clock will be changed
Global Const MSG_CHANGE_SYSTEMCLOCK = "Any of your settings which are dependent from the system clock" & vbCrLf & _
                                         "will be adjusted without further notification." & vbCrLf & _
                                         "Do you really want to continue ?"


' use this constant as text for the MsgBox when the project should be closed
Global Const MSG_CLOSE_PROJECT = "Closing this window closes the project !" & vbCrLf & _
                                         "Do you want to continue ?"


' use this constant as text for the MsgBox when the application should be closed
Global Const MSG_CLOSE_APPLICATION = "Save changes ?"


Global Const MSG_DOCU_BUTTON = "To access all information and documentation related to the selected " & _
                               "peripheral click on the down arrow located on the right."

' us this constant as text for the MsgBox when the codegenerator is called (only for the first demo-version
Global Const MSG_CALL_CODEGENERATOR = "The generated code is for demonstration purposes only. " & vbCrLf & _
                                         "Do you really want to continue ?"


' caption constants
'
Global Const CAPTION_FRA_USE_INIT = "Initialization Function"
Global Const CAPTION_FRA_CFILE = "Source File"
Global Const CAPTION_LBL_CFILE = "File name"
Global Const CAPTION_FRA_LIBRARY1 = "Function Library (Part 1)"
Global Const CAPTION_FRA_LIBRARY2 = "Function Library (Part 2)"
Global Const CAPTION_FRA_HFILE = "Header File"
Global Const CAPTION_LBL_HFILE = "File name"
Global Const CAPTION_FRA_PARAMETERS1 = "Parameters (Part 1)"
Global Const CAPTION_FRA_PARAMETERS2 = "Parameters (Part 2)"
' this text was delivered by Infineon (Mrs. Kelling)
Global Const CAPTION_LBL_PEC_HINT = "A PEC transfer shall not be used, in case more than one interrupt source is using the same interrupt node."


'
'
Global Const CALCULATION_NOT_POSSIBLE = "n.a."
Global Const TO_HIGH = "too high"
Global Const TO_LOW = "too low"


' tooltip constants
'
Global Const TOOLTIP_DISABLED_IF = "This control is disabled because:"
Global Const TOOLTIP_DISABLED_FUNCTION = "This function is disabled because:"
Global Const TOOLTIP_DISABLED_MACRO = "This macro is disabled because:"
Global Const TOOLTIP_DISABLED_PARAMETER = "This parameter name can not be changed because:"
Global Const TOOLTIP_DISABLED_TRAP = "This trap function is disabled because:"

' use this constant as first line in the 'DisabledToolTipText' for the description of the ISR's
' on page 'Functions'
Global Const TOOLTIP_DISABLED_ISR = "This function will be automatically selected by DAvE." & vbCrLf

'- Der Text dieser Konstante ist gueltig nur fuer 16-bit MC.
'- Um zu den alten MC (z.B. C165UTAH) kompatibel zu bleiben gibt es die Konstante TOOLTIP_DISABLED_ISR16
'  die den gleichen Text hat.
Global Const TOOLTIP_DISABLED_ISR32 = "This function will be automatically selected by DAvE." & vbCrLf & _
                                           "This is the case if the initialization function is selected and " & vbCrLf & _
                                           "the interrupt is enabled. Further, the interrupt priority level " & vbCrLf & _
                                           "must be greater than zero." & vbCrLf & vbCrLf

Global Const TOOLTIP_DISABLED_ISR16 = "This function will be automatically selected by DAvE." & vbCrLf & _
                                           "This is the case if the initialization function is selected and " & vbCrLf & _
                                           "the interrupt is enabled. Further, the interrupt priority level " & vbCrLf & _
                                           "must be greater than zero." & vbCrLf & vbCrLf


' use this constant as a part of the ISR description (DisabledToolTipText) on page 'Functions'
Global Const TOOLTIP_ISR_USERCODE = "Please note that you have to add application specific " & _
                                           "code to this function."


Global Const TOOLTIP_DISABLED_FUNC_NAME = "This function name or macro name can only be changed " & _
                                           "if the function or macro is selected."
Global Const TOOLTIP_DISABLED_CFILE_NAME = "The source file name can only be changed if " & _
                                           "the initialization function is selected."
Global Const TOOLTIP_DISABLED_HFILE_NAME = "The header file name can only be changed if " & _
                                           "the initialization function is selected."
Global Const TOOLTIP_DISABLED_PARAMETER_NAME = "The parameter name can only be changed if " & _
                                               "the initialization function is selected."
Global Const TOOLTIP_ENABLED_PARAMETER_NAME = "This parameter is used in several functions. " & _
                                               "For the description of this parameter see the function " & _
                                               "descriptions."

Global Const TOOLTIP_DESELECTED_INIT = "the initialization function is not selected"



' title for the code generator
Global Const CODEGEN_TITLE = "DAvE Codegenerator"


' constant strings for the code generator
Global Const SECTION_PROJECT_INCLUDES = _
"//****************************************************************************" & vbCrLf & _
"// @Project Includes" & vbCrLf & _
"//****************************************************************************"
Global Const SECTION_MACROS = _
"//****************************************************************************" & vbCrLf & _
"// @Macros" & vbCrLf & _
"//****************************************************************************"
Global Const SECTION_DEFINES = _
"//****************************************************************************" & vbCrLf & _
"// @Defines" & vbCrLf & _
"//****************************************************************************"
Global Const SECTION_TYPEDEFS = _
"//****************************************************************************" & vbCrLf & _
"// @Typedefs" & vbCrLf & _
"//****************************************************************************"
Global Const SECTION_IMPORTED_GLOBAL_VARIABLES = _
"//****************************************************************************" & vbCrLf & _
"// @Imported Global Variables" & vbCrLf & _
"//****************************************************************************"
Global Const SECTION_GLOBAL_VARIABLES = _
"//****************************************************************************" & vbCrLf & _
"// @Global Variables" & vbCrLf & _
"//****************************************************************************"
Global Const SECTION_EXTERNAL_PROTOTYPES = _
"//****************************************************************************" & vbCrLf & _
"// @External Prototypes" & vbCrLf & _
"//****************************************************************************"
Global Const SECTION_LOCAL_PROTOTYPES = _
"//****************************************************************************" & vbCrLf & _
"// @Prototypes Of Local Functions" & vbCrLf & _
"//****************************************************************************"
Global Const SECTION_GLOBAL_PROTOTYPES = _
"//****************************************************************************" & vbCrLf & _
"// @Prototypes Of Global Functions" & vbCrLf & _
"//****************************************************************************"
Global Const SECTION_INTERRUPT_VECTORS = _
"//****************************************************************************" & vbCrLf & _
"// @Interrupt Vectors" & vbCrLf & _
"//****************************************************************************"
Global Const SECTION_SFR_DECLARATION = _
"//****************************************************************************" & vbCrLf & _
"// @Declaration of SFRs" & vbCrLf & _
"//****************************************************************************"

Global Const END_OF_FUNCTION = "//  End of function "

' text for undefined user pec pointer
Global Const PECC_SOURCE = "// DO NOT FORGET TO SET THE SOURCE-POINTER FOR PECC CHANNEL "
Global Const PECC_DEST = "// DO NOT FORGET TO SET THE DESTINATION-POINTER FOR PECC CHANNEL "



' use this constant in the Project_Init functions
Global Const COMPILER_EDE_HINT = "  /// the following initialization is made by the compiler EDE when you" & vbCrLf & _
                                         "  /// import the DAvE project"
                                         
'constants for LIN
Global Const LIN_LDF_GENERATION = "DAvE XC164CM LIN Configuration tool will generate LDF" & _
                                  vbCrLf & "source and header files. Please copy the generated files" & _
                                  vbCrLf & "to LIN LLD folder. For further details regarding LIN LLD" & _
                                  vbCrLf & "Please contact Infineon Technologies."
Global Const EVENT_Trig_FRAME_ERROR = "The ID has already been used.Please use a different ID"
Global Const SIGNAL_OFFSET_IN_FRAME = "There is a signal in the offset already.This can't be overwritten"
Global Const SIGNAL_EXCEEDS_FRAMELENGTH = "This signal size exceeds the frame size,This signal can't be placed"
Global Const SIGNAL_OUT_OF_RANGE = "Not enough space is available at the signal offset."
Global Const SAME_LIST_NAME = "Name already exists in the list.Enter a different name."
Global Const SAME_FRAME_ID = "Frame ID already exists in the list.Enter a different, valid frame ID."
Global Const SAME_FRAME_PUBLISHER = "Please provide the frames from different Publishers."
Global Const SAME_MESSAGE_ID = "Message ID already exists in the list.Enter a different, valid message ID."
Global Const TIMEBASE_ERROR = "The frame transfer time should be an exact multiple of Master Time base." & vbCrLf & "Please re-enter the time."
Global Const NON_EXISTENT_ID = "The ID doesn't exist.Enter an existing frame ID."
Global Const CODE_GEN_ERROR = "The LIN cluster contains no nodes.NCF files can't be generated."
Global Const INV_COMMA = """"
Global Const CURLY_BRACE1 = "{"
Global Const CURLY_BRACE2 = "}"
Global Const CURLY_BRACES = INV_COMMA & CURLY_BRACE1 & INV_COMMA & " and " & INV_COMMA & CURLY_BRACE2 & INV_COMMA
Global Const INIT_EXAMPLE = "e.g., if the signal size is 3 bytes (24 bits), then initial value can be written as {1,12,0}"
Global Const INITIAL_VALUE_TEMPLATE = "The initial value should be an array of integer values, " & _
                               "enclosed within " & CURLY_BRACES & vbCrLf & INIT_EXAMPLE
Global Const GEN_MASTER = "Master interface name"
Global Const GEN_TB = "Time base for frame transfer time"
Global Const GEN_JT = "Jitter for a frame transfer time"
Global Const GEN_LDF = "DAvE generates LDF file"
Global Const GEN_LDFNAME = "Enter the name of LDF file to be generated"
Global Const GEN_LDFSEL = "Existing LIN LDF file can be selected here, spaces in file path are not allowed"
Global Const GEN_LINVER = "Select LIN protocol version. Default is 2.0"
Global Const GEN_LINLANG = "Select LIN language. Default is 2.0"
Global Const GEN_LINSPEED = "LIN Speed shall be in the range of 1.0 to 20.0 kbps"
Global Const GEN_SID = "Supplier id ranges from 0 to 0x7FFE"
Global Const GEN_FID = "Function id ranges from 0 to 0xFFFE"
Global Const GEN_VID = "Variant id ranges from 0 to 255"

Global Const NODE_NAME = "Node names should be unique in a LIN cluster"
Global Const NODE_REMARK = "Node specific remarks can be added here"
Global Const NODE_NCF = "Option create NCF is to generate Node Configuration File"
Global Const NODE_NCFNAME = "Name of the NCF file to be generated"
Global Const NODE_NCFSEL = "Select the existing NCF file"
Global Const NODE_BTNADD = "Add the node name first and proceed to configurations"
Global Const NODE_NAD = "Node NAD shall be unique in a LIN cluster"
Global Const NODE_P2MIN = "Minimum time between a master request frame and " & _
                            vbCrLf & "the following slave response frame.Default 0 ms"
Global Const NODE_STMIN = "Minimum time between two slave response frames " & _
                            vbCrLf & "in a multi-PDU response.Default 0 ms"
Global Const NODE_SSID = "Select the SSID values " & _
                            vbCrLf & "Default {0xb1,0xb2}"
Global Const NODE_MML = "Maximum message length value ranges from 1 to 4095 to be used in diagnostic messages"
Global Const SIGNAL_OFFSET = "Selected signal size and offset shall not exceed the frame size " & _
                              vbCrLf & "Note: Scalar signal size may not cross more than one byte boundary" & _
                              vbCrLf & "E.g. Frame size is 16 bits then" & _
                              vbCrLf & "  Signal size is 8 bits and offset is 8 --> correct" & _
                              vbCrLf & "  Signal size is 9 bits and offset is 8 --> incorrect"
Global Const SIGNAL_SIZE = "The Signal Size and offset shall be selected to fit in a Frame " & _
                              vbCrLf & "Scalar signals shall not cross more than one byte boundary"
Global Const SIGNAL_NAME = "Signal names should be unique in a LIN cluster"
Global Const SIGNAL_SCALAR = "Scalar signal size ranges from 1 to 16 bits"
Global Const SIGNAL_BYTEARRAY = "Signal byte array ranges from 1 to 8 bytes"
Global Const SIGNAL_PUBLISHER = "Select signal publisher interface"
Global Const SIGNAL_SUBSCRIBERS = "Select signal subscriber interface/s"
Global Const SIGNAL_BTNADD = "Add the signal first and proceed to configurations"
Global Const FRAME_NAME = "Frame names shall be unique in a LIN cluster"
Global Const FRAME_ID = "Frame IDs are unique and ranges from 0 to 63"
Global Const FRAME_MsgID = "Message IDs are unique and ranges from 0 to 0xFFFE"
Global Const FRAME_SIZE = "Frame size shall be ranges from 1 to 8 bytes"
Global Const FRAME_TYPE = "Select frame type {Unconditional,Event Triggered,Sporadic}"
Global Const FRAME_EvtIDs = "Enter valid unconditional frame ids separated by commas"
Global Const FRAME_BTNADD = "Add the frame first and proceed to configurations"
Global Const FRAME_PUBLISHER = "Select the frame publisher"
Global Const FRAME_SIGNALS = "Signals published by the selected interface, " & _
                             vbCrLf & "select signals to add to the frame."
Global Const FRAME_BTNSIGe = "Add the selected signals to the unconditinal frame"
Global Const FRAME_BTNSIGd = "No signals for event triggered/sporadic frame"
Global Const FRAME_MINMAX = "Frame transfer time shall be an exact multiple of master time base"
Global Const SCH_NAME = "Scheduler names are unique in LIN cluster"
Global Const SCH_BTNADD = "Add the scheduler first and proceed to configurations"
Global Const SCH_BTNFRM = "Add the selected frame to the scheduler"
Global Const SCH_FRMLST = "Select a frame to add to the scheduler"
Global Const SCH_SCHEDULE = "Frames added to the selected scheduler"
Global Const SCH_SCHLST = ""
                
'*****************************************************************************
' @Global Types
'*****************************************************************************


'*****************************************************************************
' @Global Functions
'*****************************************************************************

'*****************************************************************************
'Description:
'        This function returns a string with the description text for the
'        module header in the C file.
'-----------------------------------------------------------------------------
'Parameters:
'        ModuleName       Name of the module
'-----------------------------------------------------------------------------
'Returns:
'        string with module description
'*****************************************************************************
Function GetModuleHeaderC(ModuleName As String) As String
On Error Resume Next
    GetModuleHeaderC = "This file contains functions that use the " & ModuleName & " module."
End Function


'*****************************************************************************
'Description:
'        This function returns a string with the description text for the
'        module header in the H file.
'-----------------------------------------------------------------------------
'Parameters:
'        ModuleName       Name of the module
'-----------------------------------------------------------------------------
'Returns:
'        string with module description
'*****************************************************************************
Function GetModuleHeaderH(ModuleName As String) As String
On Error Resume Next
    GetModuleHeaderH = "This file contains all function prototypes and macros for the " & ModuleName & " module."
End Function


'*****************************************************************************
'Description:
'        This function returns an unformatted string with a general description
'        of the init function.
'-----------------------------------------------------------------------------
'Parameters:
'        ModuleName       Name of the module
'-----------------------------------------------------------------------------
'Returns:
'        string with description
'*****************************************************************************

Function GetGeneralInitDescription(ModuleName As String) As String
    On Error Resume Next
    GetGeneralInitDescription = _
    "This is the initialization function of the " & ModuleName & " function library. " & _
    "It is assumed that the SFRs used by this library are in reset state. "
End Function

