Embedded todo / tasks list
PhreaK
Posts: 966
Up until now my todo list management when working on a NetLinx system had pretty much run like so:
I made a slight improvement on this process by running 'grep -nri TODO <whatever my source dir is>' when I remembered then going and following up on them. This sort of functions as a workflow however is not ideal as I'd tend to run that after compiling and uploading as I was waiting for the master to reboot, then see the issue, fix it, upload and reboot again.
Before jumping in and writing a little live TODO tracker to accompany studio I thought I'd just double check and make sure there wasn't already something that could do the trick. The good news is there is: 'Tools -> Find in files'. You can use it to search for whatever TODO / FIXME / WHYTHEHELLISTHISNOTWORKINGAAAAARRRRRGGGGHHHHH etc keywords you like to use and filter based on what you're interested in rather than using a whole bunch of '#warning' directives. It will show a list of matches as well as allow you to click on each and take your straight to the file / line where it is. I've now got it attached to a hotkey and trigger it as compulsively as I save.
Just though I'd share as I know it's something that's going to save me a butload of time / frustration. Hope it may help out someone else.
- note an issue whilst working on another part of the system
- take note of the issue in a comment prefixed with TODO / FIXME (habit from working in eclipse)
- return to what I was working on
- completely forget about it (as I'm not in eclipse and don't have a task list that updates)
I made a slight improvement on this process by running 'grep -nri TODO <whatever my source dir is>' when I remembered then going and following up on them. This sort of functions as a workflow however is not ideal as I'd tend to run that after compiling and uploading as I was waiting for the master to reboot, then see the issue, fix it, upload and reboot again.
Before jumping in and writing a little live TODO tracker to accompany studio I thought I'd just double check and make sure there wasn't already something that could do the trick. The good news is there is: 'Tools -> Find in files'. You can use it to search for whatever TODO / FIXME / WHYTHEHELLISTHISNOTWORKINGAAAAARRRRRGGGGHHHHH etc keywords you like to use and filter based on what you're interested in rather than using a whole bunch of '#warning' directives. It will show a list of matches as well as allow you to click on each and take your straight to the file / line where it is. I've now got it attached to a hotkey and trigger it as compulsively as I save.
Just though I'd share as I know it's something that's going to save me a butload of time / frustration. Hope it may help out someone else.
0
Comments
I have written a code stub waiting for this application.
Something like;
DEFINE_FUNCTION INTEGER fnAnswer_to_the_Ultimate_Question_of_Life_The_Universe_and_Everything ()
?
I'll second this one. Simple and effective.
For now, however, I'm sticking with the #WARN function.
I like using the macros from time to time for adding quick debugging/comments like that.
NetLinx macros will do cut/copy/paste. If I want to wrap a bit of code in a compiler directive, I just highlight the code, choose my "#IF" macro and run it. It cuts the block of code to the clipboard, types out the the "#IF_DEFINED" and "#END_IF" on seperate lines, then pastes the code back between them. In the hotkey editor there's a command under the Edit category called "Run 'macro-name'" that will run the currently selected macro on the Macros toolbar, so I've assigned a hotkey to that. Of course I have to go back to add the compiler directive after the #IF_DEFINED, but it definitely helps save a little time.
[size=+1]A Word Of Caution To This Tale![/size] [size=-2](Tale... Tale...)[/size] When you double click on a Find In Files result, NetLinx selects all the text on that line. This can be great if you're using a macro like I've described above. Double-click the Find result, run macro, Double-click next result, run macro... HOWEVER [size=-2](here's the caution part)[/size] NetLinx also selects the Carriage Return but NOT the Linefeed! To see what I mean, turn on Show End of Line. If you copy the text that NetLinx generously highlighted for you, then paste it elsewhere, you'll end up with a line terminated in only a CR and this error message at compile time: NetLinx will fix a lone CR or LF if you close the file then reopen it. To avoid this problem entirely, hold SHIFT and hit the END key. The END key pops the carat to before the CR, effectively removing it from the selection.
I've attached the couple macros I've used from time to time if you want to see an example. The "!BLANK" macro does nothing. It only exists to be used as the "default" current macro in case I accidentally hit the hotkey...