BIT text

awsum140

Known around here
Joined
Nov 14, 2017
Messages
1,254
Reaction score
1,128
Location
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.
 

jaydeel

BIT Beta Team
Joined
Nov 9, 2016
Messages
1,126
Reaction score
1,237
Location
SF Bay Area
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:

awsum140

Known around here
Joined
Nov 14, 2017
Messages
1,254
Reaction score
1,128
Location
Southern NJ
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
 

Mike

Staff member
Joined
Mar 9, 2014
Messages
2,982
Reaction score
2,725
Location
New York
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.
 

awsum140

Known around here
Joined
Nov 14, 2017
Messages
1,254
Reaction score
1,128
Location
Southern NJ
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%.
 

Mike

Staff member
Joined
Mar 9, 2014
Messages
2,982
Reaction score
2,725
Location
New York
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.
 

awsum140

Known around here
Joined
Nov 14, 2017
Messages
1,254
Reaction score
1,128
Location
Southern NJ
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.
 

looney2ns

IPCT Contributor
Joined
Sep 25, 2016
Messages
15,521
Reaction score
22,657
Location
Evansville, In. USA
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.
 

awsum140

Known around here
Joined
Nov 14, 2017
Messages
1,254
Reaction score
1,128
Location
Southern NJ
It has done it more than once here, but every time it seems related to making changes in macros. Restarting solves the problem though.
 

Mike

Staff member
Joined
Mar 9, 2014
Messages
2,982
Reaction score
2,725
Location
New York
It has done it more than once here, but every time it seems related to making changes in macros. Restarting solves the problem though.
It happens when you change macros? How so? When you assign them to BI?
 

awsum140

Known around here
Joined
Nov 14, 2017
Messages
1,254
Reaction score
1,128
Location
Southern NJ
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.:)
 

Mike

Staff member
Joined
Mar 9, 2014
Messages
2,982
Reaction score
2,725
Location
New York
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?
 

awsum140

Known around here
Joined
Nov 14, 2017
Messages
1,254
Reaction score
1,128
Location
Southern NJ
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:
 

TonyR

IPCT Contributor
Joined
Jul 15, 2014
Messages
16,443
Reaction score
38,159
Location
Alabama
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:
 
Top