Page 1 of 1

plugin programmer query

Posted: 19 Jan 2022 00:03
by Ron Melby
I expect more than one answer but would like all opinions.

If a plugin tool (my profiler) puts out a report, and you give it no default path, where should the output go?
desktop? project folder? plugin data? or elsewhere?

Re: plugin programmer query

Posted: 19 Jan 2022 09:47
by tatewise
IMO it depends on who is interested in the report.
If it is the plugin author then the Project's Plugin Data folder seems appropriate.
If it is the plugin end-user then the Project's Public folder may be a better option.
In any case, the path could be an optional setting, and the tool should tell the user where the report has been saved.

Re: plugin programmer query

Posted: 26 Jan 2022 08:23
by MortimerCat
I would like to find reports in a sub-folder within my Documents folder

{HOME}/Documents/{plugin name}/myReport.txt

Re: plugin programmer query

Posted: 28 Jan 2022 16:15
by Ron Melby
Mortimer Cat (I will have a look see, maybe I can incorporate that by parameter and arguement)

I am trying to make the profiler use 'sloppy' arguments and am soliciting any changes for comprehension and readability to the @usage of the program, currently as follows:

@Usage :

(1):
local _prf = require '_prf'

(2):
__prf.start()
prf.start(['call'])
_prf.start(['opcod'])
_prf.start(['opcod',] *choice:(['min'], ['mid'], *default:['max'])])
_prf.start(['opcod',] *range choice:[(1000, 100000}])

--**
dependant on plugin size in bytes, regardless of your choice of arguments, the profiler may choose either ('call') or ('opcod', 'max') as arguments.

<code>

(3):
_prf.stop()

(4):
_prf.report()
_prf.report([folder])
_prf.report(*ordering:['flow'])
_prf.report([folder,] *ordering:['flow'])

--**
only an existing folder argument without a file will be used if provided.
Such as:
'C:/Users/admin/Desktop/' (**which Windows has understood since about 1998)
or
'C:\\Users\\admin\\Desktop\\'
no file name can be provided; it is built in the profiler.
If more than a fully qualified folder name only is provided, or a fully qualified folder name is not correctly provided, or no folder argument is provided, then the default folder will be chosen, ie:
'C:/ProgramData/Calico Pie/Family Historian/Plugin Data/'
adapted for your installation as retrieved by:
fhGetContextInfo('CI_APP_DATA_FOLDER')

the default sorting of the report is time, descending. if you want the report in flow of program use the argument 'flow'

Re: plugin programmer query

Posted: 30 Jan 2022 16:01
by Ron Melby
Mortimer Cat you will need to comment line 117 and enable line 118, note that the folder must exist prior to running the profiler. I have path systems file and folder management systems and save and restore systems, but they are a large body and I use them as requires, so I am reticent to do any save and restore of settings, since I do not use chill code but something much more efficient and readable, and incompatible with most plugins that save and restore settings.

such as it is, here it is folks.