BIT text

awsum140

Known around here
Nov 14, 2017
1,253
1,129
Southern NJ
So, after using both WU and BI for years I finally put a weather cam up on WU. I'm using Blue Iris Tools, thanks Mike, to add the current conditions. Everything is working fine.

I've read the online help file and don't see an answer to my question. When I bring up "wind description" it is a rather long text string. Is there a way to edit that string to reduce it, or even split it? For example -

West 5.5 mph 8 mph gusts

or

West 5.5 mph

8 mph gusts

I'm betting the answer is in there somewhere behind the milk.
 
The attached batch file will do this for you. It examines the content of BIT's 'winddescription.txt' file and replaces the first occurrence of "mph " with "mph\n" ('\n' is an escape char for newline).

NOTE: The batch file can be edited to find/replace other text in ANY text file. Even multiple files.

NOTE: The batch files uses a neat 3rd-party utility called FNR "Find and Replace" (see step 2 below for the link). It has a very handy GUI interface for developing and testing file search and replace methods, as well as a feature to generate the required commandline.... Note also that FNR can use regular expressions to do more advanced searches (like replace the first "mph " in a string with multiple occurrences of "mph ").

If you want to try this, it will take a few steps...

  1. Create new folder to serve as a repository for a copy of your BIT 'winddescription.txt' file (Why? 'C:\Program Files (x86)' is a protected folder; you cannot programmatically edit files here. Furthermore, doing this preserves the original BIT file in case you'd like to use it elsewhere.)
  2. Download the FNR "Find and Replace" utility from this <link>. It is a single file. Copy it onto your primary drive (I use 'c:/bin', which is on my environment Path variable).
  3. Download the attached 'BIT_mod_utility.zip' and unzip it to a folder on your primary drive (I use 'c:/bat', which is on my environment Path variable).
  4. Use a text editor to edit 'BIT_mod_utility.bat' and make sure the line 'set dest_dir=' points to the new folder you created in step 1... Confirm also that the line 'set source_dir=' points to BIT's *.txt files location (on my machine it is 'C:\Program Files (x86)\Blue Iris Tools\txt')... Also confirm that the last line using FNR points to the folder where you installed it in step 2. Save the edits.
  5. Test the batch file. Click the Windows key, type cmd.exe, then navigate to the batch file folder in step 3, then run the script... Now confirm that a copy of BIT's 'winddescription.txt' file has been placed in the new folder in step 1. If not, edit the batch file as necessary... WHAT YOU SHOULD SEE: If the original BIT winddescription file contains text like "West 5.5 mph 8 mph gusts", the copy will contain 'West 5.5 mph\n8 mph gusts". (The attached zip file contains a file 'test.txt' you can use for testing).
  6. In Blue Iris, create a new Macro (select Options>Macros) pointing the new 'winddescription.txt' file in the folder from step 1.
  7. In Blue Iris, add the new macro to the video feed of your camera (Options>Video>Edit Overlays). Be sure to uncheck the option "Multi-line dynamic font height' (Image 1).

You can add this batch file to Windows Task Scheduler and have it run a few times every hour. Image 2 below shows the command to use.

Image 1
BI Macro Edit.png

Image 2
BIT Task Scheduler.png
 

Attachments

Last edited:
I ran the upgrade and that's a good solution, Mike. Makes me happy, anyway, if that counts. Thanks for the work you put into this!

Here's the image I'm using on WU, very downgraded video from a 4231E-S...

image.FY_WU.jpg
 
  • Like
Reactions: Mike and looney2ns
Iran the upgrade and that's a good solution, Mike. Makes me happy, anyway, if that counts. Thanks for the work you put into this!

Here's the image I'm using on WU, very downgraded video from a 4231E-S...

View attachment 37840
Glad to hear. You can also remove everything after the comma and/or put it in its own textbox if you want.
 
  • Like
Reactions: awsum140
Hey, Mike. Out of curiosity what should CPU utilization look like for BIT? From what I've seen it runs at about 1%, but I just noticed my CPU utilization was up about 10%, checked, and BIT was sitting at about 12%.
 
Hey, Mike. Out of curiosity what should CPU utilization look like for BIT? From what I've seen it runs at about 1%, but I just noticed my CPU utilization was up about 10%, checked, and BIT was sitting at about 12%.
It's usually in the low single digits but I've seen it spike and hang. Closing it and opening it should resolve it.
 
  • Like
Reactions: awsum140
Thanks, Mike, that's what I did. I was just wondering if I was just "lucky" :) It did seem related to updating/changing the macros though, if that's any help.
 
Hey, Mike. Out of curiosity what should CPU utilization look like for BIT? From what I've seen it runs at about 1%, but I just noticed my CPU utilization was up about 10%, checked, and BIT was sitting at about 12%.

I've had BIT do this once I believe, normally mine runs under 1%. But restarting solved it, and problem did not resurface.
 
  • Like
Reactions: awsum140
It has done it more than once here, but every time it seems related to making changes in macros. Restarting solves the problem though.
 
No, not on original assignment but if I change a macro to a different number. In all fairness, Mike, I used to sometimes test software, years ago, prior to deployment to see how it could be "broken". It could also be potentially related to other tasks the machine does, which I know is blasphemous.:)
 
  • Like
Reactions: Mike
No, not on original assignment but if I change a macro to a different number. In all fairness, Mike, I used to sometimes test software, years ago, prior to deployment to see how it could be "broken". It could also be potentially related to other tasks the machine does, which I know is blasphemous.:)
Haha sounds good, no problem. I am glad you are reporting this to me, the more I know the more I can fix! So it happens if you change macro #'s in BIT?
 
Sorry, just check this thread again.

Yes, it happened when I fooled with macros, reassigning them after you updated to be able to modify the wind description text. See, no good deed goes unpunished :highfive:
 
  • Like
Reactions: TonyR
Sorry, just check this thread again.

Yes, it happened when I fooled with macros, reassigning them after you updated to be able to modify the wind description text. See, no good deed goes unpunished :highfive:

Much like when I try to explain to my better half why I thought I was doing the right thing and which invariably elicits the immediate response "....that's what you get for thinking". :idk: