Feature Request: Thread Name
I'd like to have the option of specifying a name for each thread which could be incorporated into strings (filenames etc) as an alternative to thread number. Ideally also used in webcam URLs.
It could be that %t was replaced by name if name was specified or it could be a separate conversion specifier thing.
- 07 Mar 2006
Hmmm. A text_user
and corresponding conversion specifier. I can see the purpose for it.
It could also be name
and be used also as a label for the web control interface.
I will leave this in discussion mode for a while to see what the other regular developers think also thinking about version 4.X where this may be the name label for a config section.
Just spotted this as a place to post this patch.
For some time now I have been using the text_event string as a name on my StatisticsDataPatch
screen, but that name cannot be overlaid onto event image(s) reliably since text_event is null sometimes (when no event in progress). It doesn't appear on hourly snapshots, for example.
So I added a new ConversionSpecifier
called %e (which actually seems to be the last single-letter one!) which inserts the string value specified by config file variable 'name' into the string.
This allows me to use text_left strings like this:
text_left %e\\nEVENT %v (Noise %N Thr. %o)
Note that multi-line support in text_left strings (using \\n) is already in Motion. It causes the text to scroll up the screen from the bottom.
The results are illustrated in the image attached, 20081215_event0104_cam2.jpg
The patch is attached below, named SWpatch_Friendlyname_161208. It is a number of diff -Naur catted together, I hope that's acceptable. It's a long time now since I did a Motion patch! It's short, so should not need much massaging if it doesn't cleanly apply. It's against 3.2.11.Oh and the web control interface seamlessly lets you change the 'name' parameter per thread - I didn't need to write any patch, it just works....
- 15 Dec 2008
Doesn't work against 3.2.12. The config parameters are now held in a conf array so in motion.c you have cnt->conf.name instead of cnt->name.
As a result you don't need to declare name as an array in context structure at all - it's all handled in conf.c. It's probably best if not necessary, to keep FRIENDLY_NAME_MAX to limit output length.
- 13 Jun 2016