Codegen: Remove date in header file
    16 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    Chuck Bye
 el 18 de Nov. de 2019
  
    
    
    
    
    Comentada: jarvis
 el 24 de Mzo. de 2025
            I am using 
   codegen -config config -o kim -d 'CodeGeneration\GeneratedCode' doKim -args args{1} getKimDefaultInputArgs
The cpp and h files have time in the header:
   // MATLAB Coder version            : 4.3
   // C/C++ source code generated on  : 14-Nov-2019 19:20:15
What option will remove the date from the source file
This is my config:
-------------------------------- Report -------------------------------
                  EnableTraceability: true
           GenerateCodeMetricsReport: true
       GenerateCodeReplacementReport: true
                      GenerateReport: true
    HighlightPotentialDataTypeIssues: true
                        LaunchReport: false
                   ReportInfoVarName: ''
          ReportPotentialDifferences: false
------------------------------- Debugging -----------------------------
                       RuntimeChecks: false
---------------------------- Code Generation --------------------------
                  BuildConfiguration: 'Faster Builds'
              CodeExecutionProfiling: false
        CodeProfilingInstrumentation: false
              CustomToolchainOptions: [[] cell]
                 DataTypeReplacement: 'CBuiltIn'
                 FilePartitionMethod: 'MapMFileToCFile'
                         GenCodeOnly: true
                 GenerateExampleMain: 'GenerateCodeOnly'
                    GenerateMakefile: true
    HighlightPotentialRowMajorIssues: true
                   MultiInstanceCode: true
                          OutputType: 'LIB'
               PassStructByReference: true
                  PostCodeGenCommand: ''
             PreserveArrayDimensions: false
                            RowMajor: false
                        SILDebugging: false
           SILPILCheckConstantInputs: false
                          TargetLang: 'C++'
                           Toolchain: 'Automatically locate an installed toolchain'
                    VerificationMode: 'None'
------------------------ Language And Semantics -----------------------
              CodeReplacementLibrary: 'None'
           CompileTimeRecursionLimit: 50
              ConstantFoldingTimeout: 40000
             DynamicMemoryAllocation: 'Threshold'
    DynamicMemoryAllocationThreshold: 65536
            EnableAutoExtrinsicCalls: true
              EnableRuntimeRecursion: true
                EnableVariableSizing: false
        GenerateNonFiniteFilesIfUsed: true
               InitFltsAndDblsToZero: true
               PreserveVariableNames: 'None'
                   PurelyIntegerCode: false
                SILPILSyncGlobalData: false
           SaturateOnIntegerOverflow: true
                    SupportNonFinite: false
                  TargetLangStandard: 'C89/C90 (ANSI)'
------------------------- C++ Language Features -----------------------
               CppInterfaceClassName: ''
                   CppInterfaceStyle: 'Functions'
                        CppNamespace: ''
---------------- Function Inlining and Stack Allocation ---------------
                    InlineStackLimit: 4000
                     InlineThreshold: 10
                  InlineThresholdMax: 200
                       StackUsageMax: 200000
----------------------------- Optimizations ---------------------------
                   ConvertIfToSwitch: false
                        EnableMemcpy: true
                        EnableOpenMP: true
             EnableStrengthReduction: false
                 LoopUnrollThreshold: 5
                     MemcpyThreshold: 64
------------------------------- Comments ------------------------------
                    GenerateComments: true
                       MATLABFcnDesc: true
                MATLABSourceComments: true
                             Verbose: true
------------------------------ Custom Code ----------------------------
                    CustomHeaderCode: ''
                       CustomInclude: ''
                   CustomInitializer: ''
                       CustomLibrary: ''
                        CustomSource: ''
                    CustomSourceCode: ''
                    CustomTerminator: ''
                   ReservedNameArray: ''
-------------------------- Third Party Library ------------------------
                  CustomBLASCallback: ''
                   CustomFFTCallback: ''
                CustomLAPACKCallback: ''
------------------------------ Code Style -----------------------------
                         CastingMode: 'Nominal'
                        CodeTemplate: []
                         ColumnLimit: 80
                        CommentStyle: 'Auto'
                   CustomFileNameStr: '$N$M'
             CustomSymbolStrEMXArray: 'emxArray_$M$N'
          CustomSymbolStrEMXArrayFcn: 'emx$M$N'
                  CustomSymbolStrFcn: '$M$N'
                CustomSymbolStrField: '$M$N'
            CustomSymbolStrGlobalVar: '$M$N'
                CustomSymbolStrMacro: '$M$N'
               CustomSymbolStrTmpVar: '$M$N'
                 CustomSymbolStrType: '$M$N'
        EnableCustomReplacementTypes: false
              EnableSignedLeftShifts: false
             EnableSignedRightShifts: false
             GenerateDefaultInSwitch: false
                    HeaderGuardStyle: 'UseIncludeGuard'
                IncludeInitializeFcn: true
                 IncludeTerminateFcn: true
                          IndentSize: 2
                         IndentStyle: 'K&R'
                         MaxIdLength: 31
                    ParenthesesLevel: 'Nominal'
            PreserveExternInFcnDecls: true
                    ReplacementTypes: [1x1 coder.ReplacementTypes]
                    RunInitializeFcn: true
------------------------------- Hardware ------------------------------
                            Hardware: []
              HardwareImplementation: [1x1 coder.HardwareImplementation]
    Edit Configuration Object
0 comentarios
Respuesta aceptada
  Ryan Livingston
    
 el 19 de Nov. de 2019
        Specifically, look at the %<SourceGeneratedOn> token which generates the date. You can remove that in your custom template.
1 comentario
  jarvis
 el 24 de Mzo. de 2025
				I have some doubt in CGT template. I need to add author name, version, date,description of model in all generated file.
I have added commands in CGT templates like
/*******************************************************************************
 ** Author                  : %<Creator>
 ** Model Rev               : %<ModelVersion>
 ** Change Description      : %<Description>
 ** Date                    : %<Date>
 *******************************************************************************/
This is working fine as expected for main model code files (top model)
/*******************************************************************************
 ** Author                  : vijay
 ** Model Rev               : 1.55
 ** Change Description      : test
 ** Date                    : 17-Mar-2025
 *******************************************************************************/
But the above content is missing i  .c and .h files for model that are used as reference model.
Eventhough I have tried with doc block and I masked the content to creator,descrption in refence model. But its printing blank like this 
/*******************************************************************************
 ** Author                  :
 ** Model Rev               : 1.532
 ** Change Description      :
 ** Date                    :
 *******************************************************************************/
Más respuestas (1)
Ver también
Categorías
				Más información sobre Code Appearance en Help Center y File Exchange.
			
	Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


