I have the following doxygen file:
/** #mainpage PConnect
#section s_definition Definition
This guide is the main documentation of Pascal/Delphi Connector Wrapper for the CGM Assist.
#section s_definition Definition
The PConnect gives you the ability to use the Connector of the CGM-Assist by using Pascal/Delphi functions.
#note For further information take a look into the "Implementation Guide"
*/
Now I try to generate this .dox file, but I always get this as Output:
Definition
This guide is the main documentation of /Delphi Connector Wrapper for the CGM Assist.
Definition
The PConnect gives you the ability to use the Connector of the CGM-Assist by using /Delphi . # " "
Do you have an idea, why it always cut out the "Pascal"? And why it doesn't write the full content?
Another strange restrained is, that if I just write this:
{* #brief A simple Key/Value Record
* #param key Key
* #param value Value to the key
}
Map = record
var key: PAnsiChar;
var value: PAnsiChar;
end;
then it doesn't show the record in the documentation. But if I write another Record in front of this like:
//Only if this record is written here, the "Map" will be shown in documentation xD
Test = Record
var test: PAnsiChar;
end;
{* #brief A simple Key/Value Record
* #param key Key
* #param value Value to the key
}
Map = record
var key: PAnsiChar;
var value: PAnsiChar;
end;
Then it shows the Record "Map" in the documentation.
PS: I'm using pas2dox for the sourcecode documentation.
Related
I have some code like the following example:
/** #file HelloPi.c */
/** The definition of pi */
#define PI 3.1415
/** #brief The main function.
* #details Prints the value of #PI, which is actual defined as 3.1415. */
void main()
{
printf("The value of pi is %f\n",PI);
}
In my doxygen dokumentation I would like to to have NO macro expansion for PI (and other defines) in general.
But on one paragraph in the documentation I need the value of pi (e.g. #details description of the main function).
Is there any possibility to expand the macro at this single part of documentation with a command or something? Something like /** #details ...the value of #PI is $(PI).*/
I only know the build-in MACRO_EXPANSION tag which works for the whole documentation: https://www.doxygen.nl/manual/preprocessing.html :-/
Thanks for help :)
Jan
Edit:
Add an other example which maybe better describes my Problem:
/** #file ErrorHandling.c */
#define ERR_CODE_POWERUNIT 1001 ///< Error in power unit */
/** #page errors
* [value of ERR_CODE_POWERUNIT ] means \copybrief ERR_CODE_POWERUNIT */
void errHandler(int error)
{
if(error=ERR_CODE_POWERUNIT)
printf("Error %d occur\n",ERR_CODE_POWERUNIT);
}
In the documentation I would like to have:
"1001 means Error in power unit"
In doxygen there is no possibility to do a conversion of a predefined variable (only) in the documentation.
You used in your documentation the an environment variable $(PI) but ths is quite cumbersome as you have to st the environment variable each time.
A better solution would be to use an ALIASES like:
ALIASES += pi=3.1415
or
ALIASES +\= "The value of PI = 3.14159265359..."
with which you define a command \pi that can be used in the documentation and will be replaced with the text / commands in the alias.
/** #details ...the value of #PI is \pi.*/
would result in something like (by head:
...the value of #PI is 3.1415
I have a simple custom module which posts messages to a server-side Suitelet.
/**
* test_app_client_module.js
* #NApiVersion 2.x
* #NScriptType ClientScript
* #NModuleScope SameAccount
*/
define(['N/ui/message'], function(message) {
var exports = {};
function showMessage(messageObject) {
message.create(messageObject).show();
};
exports.showMessage = showMessage;
return exports;
});
This module functions properly when used with form.ClientScriptModulePath and invoked from a file cabinet, excluding #NScriptType.
However, if I attempt to create a script record to define this module in a remote function, I get the following error.
SuiteScript 2.0 entry point scripts must implement one script type function.
Any suggestions?
As the error message states, you haven't implemented an entry point function. All Script modules need at least one entry point.
Add an empty pageInit function to your module.
exports.pageInit = function () {}
So, I'm trying to understand Symfony forms. I'm searching the core code for "allow_delete" option to see how it works under the hood, but the only place where it can be found is in the CollectionType class and I cannot find any logic there.
Documentation states:
If set to true, then if an existing item is not contained in the
submitted data, it will be correctly absent from the final array of
items.
Where in the code exactly it influences the submitted data?
You can find the function in MergeCollectionListener.php beginning on line 91:
// Remove deleted items before adding to free keys that are to be
// replaced
if ($this->allowDelete) {
foreach ($itemsToDelete as $key) {
unset($dataToMergeInto[$key]);
}
}
$dataToMergeInto is set as $dataToMergeInto = $event->getForm()->getNormData();
which refers to a function in which is explained in FormInterface.php:
/**
* Returns the normalized data of the field.
*
* #return mixed When the field is not submitted, the default data is returned.
* When the field is submitted, the normalized submitted data is
* returned if the field is valid, null otherwise.
*/
public function getNormData();
I use m file which initialize parameters in MATLAB workspace.
It is example of file:
Pconstant=Simulink.Parameter;
Pconstant.Value=3;
Pconstant.CoderInfo.StorageClass = 'exportedGlobal';
Pgain=Simulink.Parameter;
Pgain.Value=10;
Pgain.CoderInfo.StorageClass = 'exportedGlobal';
These parameters are used as value in 'Gain' and 'Constant' blocks. I generate c source code for this model and received following structure in model_data.c file:
/* Block parameters (auto storage) */
P_ParameterTest_T ParameterTest_P = {
10.0, /* Expression: Pgain
* Referenced by: '<Root>/Gain'
*/
3.0, /* Expression: Pconstant
* Referenced by: '<Root>/Constant'
*/
};
Model.h file contains following code:
/* Parameters (auto storage) */
struct P_ParameterTest_T_ {
real_T Gain_Gain; /* Expression: Pgain
* Referenced by: '<Root>/Gain'
*/
real_T Constant_Value; /* Expression: Pconstant
* Referenced by: '<Root>/Constant'
*/
};
Model source code compiling into model.a lib file which is used in other programs.
I can change value of constant in external c code:
parameters = (BLOCK_PARAMETERS*)rtmGetDefaultParam(model);
parameters->Constant_Value = 1;
But this solution is not good for me. Because I do not know where are used these parameters and I do not know fields names of structure.
Can I write code which will be set value in all fields of structure where are used Pconstant parameter? Something like this:
Pconstant = 1; //instead of parameters->Constant_Value = 1;
Thanks for help.
You say you have defined the storage class as ExportedGlobal but in the generated code, it appears as "auto storage", so something's not quite right there.
To achieve what you want, I think you need to turn "Inline parameters" on in the optimization pane (see documentation), and then click on the "Configure..." button to define which parameters you do not want inlined, i.e. Pconstant and Pgain (see the bit in the doc about inlining parameters). The structure construction you have in your code is normally used when "inline parameters" is turned off.
I'm guessing you have Simulink Coder, so you should also have a look in the Simulink Coder doc about how it generates code for parameters in different conditions. From memory, it's generally pretty thorough.
If I use "after the member" documentation for function parameters, for example, use //!< after each parameter, instead of #param in the header, the "Parameters" section is always placed after "Return" in the generated output file.
Is is possible to define the order so that "Parameters" will be placed before "Return"?
/**
*****************************************************************************************
* #brief Test API
*
* #usage This API can be called at any time
*
* #return 0 if successful; or 1 if failed
****************************************************************************************/
int TestAPI(
int argument1, //!< first argument
int argument2 //!< second argument
);
I've just tried out your code with Doxygen 1.7.5.1, and confirmed that with your code, the Parameter list in the output comes after the description of Return.
This is a shame, as the //!< style is much nicer than having to re-state the names of all the parameters with #param:
/**
*****************************************************************************************
* #brief Test API
*
* #usage This API can be called at any time
*
* #param argument1 first argument
* #param argument2 second argument
*
* #return 0 if successful; or 1 if failed
****************************************************************************************/
int TestAPI2(
int argument1,
int argument2
);
I had a look in the Doxygen Bugzilla bug database, to see if it was a relatively recent bug (as then you could try reverting to an older installation).
I believe you've found Doxygen Bug 316311: 'parameter documentation after return documentation by using inline comments', which was reported in September 2005, and hasn't been fixed.
So, sadly, I'm afraid the answer to your question Is is possible to define the order so that "Parameters" will be placed before "Return"? is almost certainly No.
Edit
I've just added a note to Doxygen Bug 316311, asking for it to be changed to Status=CONFIRMED.