It is currently September 21st, 2021, 5:17 pm

I'm having an !UpdateMeter Bang issue ....

Help with creating, editing & fixing problems with skins
User avatar
Thinkr8
Posts: 25
Joined: November 14th, 2020, 2:36 pm

I'm having an !UpdateMeter Bang issue ....

Post by Thinkr8 »

I spent nearly 8 hrs. yesterday trying to get the code correct without asking for any help. Welp, I failed. I'm pretty sure the problem is staring me in the face, but I can't find it. Would it be possible for I could get some input on this, thank you?

Code: Select all

{ ... the [Title1] meter should update/refresh when entering a drive letter on the settings window (Command1), but it don't .... }
[Title1]
Meter=String
MeterStyle=MeterLabel4
{ DynamicVariables=1 }
{ AcurateText=1 }
Text=Removable Disk Drive 1 - #RDD1#:
X=35r
Y=365
ToolTipText=Click For Text Box / Type In Drive Letter Within Quotes, then Enter.
LeftMouseUpAction=!CommandMeasure "MeasureInput1" "ExecuteBatch 1"

[MeasureInput1]
Measure=Plugin
Plugin=InputText.dll
MeterStyle=MeterLabel4
FocusDismiss=1
{ DynamicVariables=1 }
{ AcurateText=1 }
X=320
Y=367
H=15
W=180
SolidColor=0,56,96

{ ... using [!Refresh *] here is not what I want, I'd rather have the meter update -but- it won't even though [!UpdateMeter "Title1"] is active .... }

Command1=[!SetVariable RDD1 "$UserInput$"][!WriteKeyValue Variables RDD1 "[MeasureInput1]"][!UpdateMeter "Title1"][!WriteKeyValue Variables RDD1 [MeasureInput1] "#@#ST-TNG-E\Inks\R-Disk.inc"][!Refresh *]#RDD1#

{ ... and [!Update *] doesn't work where [!Refresh *] is. No !Update type Bang will work where [!Refresh *] is, I tried many times .... }

{ ... and I get this error when hitting the enter key .... !SetVariable: Skin "K" not found (ST-TNG-E v3\Settings\Settings.ini) This settings.ini points to the R-Disk.inc file where the removable disk drive measures and meters reside ... and the settings.ini is picking up the drive letters that are entered into the settings window (InputText). The drive letters should only go to the R-Disk.inc file, like so; RDD1="?", RDD2="?", and RDD3="?", they go to both files .... also, toggled on or off the DynamicVariables/AcurateText do nothing .... }
I've attached a testing skin. - I hope I posted this correctly :)
You do not have the required permissions to view the files attached to this post.
Last edited by Thinkr8 on July 30th, 2021, 11:32 am, edited 3 times in total.
Someone said, "Your thinking too much, so I thought more."
User avatar
balala
Rainmeter Sage
Posts: 13212
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: I'm having an !UpdateMeter Bang issue ....

Post by balala »

Ok, but what is the question? If I'm understanding you correctly, you have some problem with a !UpdateMeter bang? What is the problem and with which one, because you didn't say?
User avatar
Thinkr8
Posts: 25
Joined: November 14th, 2020, 2:36 pm

Re: I'm having an !UpdateMeter Bang issue ....

Post by Thinkr8 »

I listed the problem with the code that has the issue. :)

I need the settings window and the Removable Drives meter I'm building to update (not the entire skin) once the drive letter is entered into the input textbox on the settings window.

The code I put up has some description of the issue, TY.
Someone said, "Your thinking too much, so I thought more."
User avatar
eclectic-tech
Rainmeter Sage
Posts: 4390
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: I'm having an !UpdateMeter Bang issue ....

Post by eclectic-tech »

Thinkr8 wrote: July 29th, 2021, 2:19 pm I listed the problem with the code that has the issue. :)

I need the settings window and the Removable Drives meter I'm building to update (not the entire skin) once the drive letter is entered into the input textbox on the settings window.

The code I put up has some description of the issue, TY.
You are setting the variable to the current file (Settings.ini) but the default values are not included in that skin, so they are written to the [Variables] section. That is why the variable values show up in that file.

Then, in the same series of bangs, you also writing it to another included file (R-Disk.inc) which is included in the RemoveableDisk.ini. However, neither of those files are included in the Settings.ini, so the changes will not show.

Due to the multiple include, I would create the default RDD# variables in "#@#ST-TNG-E\Inks\ST-TNG-E.inc", and then in the command, set the variable and write the new RDD# variable to "#@#ST-TNG-E\Inks\ST-TNG-E.inc" which IS included in the Settings.ini.
Make sure you remove any of those RDD# variables that are in the [Variables] section any other files (or they will override these).
You could then update and redraw meters in the settings skin. You will also need to refresh the "RemoveableDisk.ini" skin, to see the new drive letter there. In my example, I simply used a !Refresh to see the changes in the setting skin.

So the command in each of your input plugin would be:

Code: Select all

Command1=[!SetVariable RDD1 "$UserInput$"][!WriteKeyValue Variables RDD1 "[MeasureInput1]" "#@#ST-TNG-E\Inks\ST-TNG-E.inc"][!Refresh]
This sets the new value in the settings skin and writes it to the included variables file. How you handle the refresh or update and redraw is up to you.

Aside:
I would suggest to NOT USE SPACES in skin names, variable names, and section names. That is going to create headaches, and hard to troubleshoot errors, for you and an end user, when there are spaces in any of their paths.
I would also recommend always enclosing path bang parameters in quotation marks.
User avatar
Thinkr8
Posts: 25
Joined: November 14th, 2020, 2:36 pm

Re: I'm having an !UpdateMeter Bang issue ....

Post by Thinkr8 »

eclectic-tech wrote: July 29th, 2021, 4:09 pm You are setting the variable to the current file (Settings.ini) but the default values are not included in that skin, so they are written to the [Variables] section. That is why the variable values show up in that file.

Then, in the same series of bangs, you also writing it to another included file (R-Disk.inc) which is included in the RemoveableDisk.ini. However, neither of those files are included in the Settings.ini, so the changes will not show.

Due to the multiple include, I would create the default RDD# variables in "#@#ST-TNG-E\Inks\ST-TNG-E.inc", and then in the command, set the variable and write the new RDD# variable to "#@#ST-TNG-E\Inks\ST-TNG-E.inc" which IS included in the Settings.ini.
Make sure you remove any of those RDD# variables that are in the [Variables] section any other files (or they will override these).
You could then update and redraw meters in the settings skin. You will also need to refresh the "RemoveableDisk.ini" skin, to see the new drive letter there. In my example, I simply used a !Refresh to see the changes in the setting skin.

So the command in each of your input plugin would be:

Code: Select all

Command1=[!SetVariable RDD1 "$UserInput$"][!WriteKeyValue Variables RDD1 "[MeasureInput1]" "#@#ST-TNG-E\Inks\ST-TNG-E.inc"][!Refresh]
This sets the new value in the settings skin and writes it to the included variables file. How you handle the refresh or update and redraw is up to you.

Aside:
I would suggest to NOT USE SPACES in skin names, variable names, and section names. That is going to create headaches, and hard to troubleshoot errors, for you and an end user, when there are spaces in any of their paths.
I would also recommend always enclosing path bang parameters in quotation marks.
Thank you Eclectic-tech I will give it a try and thanks for the other tips as well :)
Someone said, "Your thinking too much, so I thought more."
User avatar
balala
Rainmeter Sage
Posts: 13212
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: I'm having an !UpdateMeter Bang issue ....

Post by balala »

EDIT: Sorry, it seems eclectic-tech overtook me. Again!
Thinkr8 wrote: July 29th, 2021, 2:19 pm I listed the problem with the code that has the issue. :)

I need the settings window and the Removable Drives meter I'm building to update (not the entire skin) once the drive letter is entered into the input textbox on the settings window.

The code I put up has some description of the issue, TY.
There are some problems with the codes and with what are you asking, namely:
  • First note that some variables are duplicated. For instance RDD1, RDD2 and RDD3 are "declared" in two places: in the [Variables] section of RDD Test\@Resources\ST-TNG-E\Inks\R-Disk.inc file and in the same section of the skin's RDD Test\Settings\Settings.ini file itself. You should keep only one occurrence of those variables (I probably would vote for the R-Disk.inc file, but this is up to you).
  • A second problem is that the content of the RDD Test\@Resources\ST-TNG-E\Inks\R-Disk.inc file is not included into the skin. Add a @Include2=#@#ST-TNG-E\Inks\R-Disk.inc option to the [Variables] section of this file.
  • Finally remove the [!WriteKeyValue Variables RDD1 "[MeasureInput1]"] bang from the Command1 option of the [MeasureInput1] measure, within the RDD Test\@Resources\ST-TNG-E\Inks\Settings.inc file, not to write the letter twice when you are entering it and hitting Enter (or, if according to the first point above, you kept the RDDX variables into the Settings.ini file, not in R-Disk.inc, remove the [!WriteKeyValue Variables RDD1 [MeasureInput1] "#@#ST-TNG-E\Inks\R-Disk.inc"] bang - anyway remove one of them).
  • I also would tend to remove the #RDD1# variable from the end of the Command1 option of the [MeasureInput1] measure of the RDD Test\@Resources\ST-TNG-E\Inks\Settings.inc file. Not sure why have you added it there, but this for sure is not a valid bang.
Additional notes:
  • In Rainmeter, unlike in C++ (if I'm not mistaken) you don't comment out by {, but by semicolon (;). Please do so.
  • The .ini and .inc files used by skins should be encoded as UTF-16 LE, not as UTF-8. Your files are encoded as UTF-8, recommend to change this (some details here).
User avatar
Yincognito
Rainmeter Sage
Posts: 4052
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: I'm having an !UpdateMeter Bang issue ....

Post by Yincognito »

Thinkr8 wrote: July 29th, 2021, 2:19 pm I listed the problem with the code that has the issue. :)

I need the settings window and the Removable Drives meter I'm building to update (not the entire skin) once the drive letter is entered into the input textbox on the settings window.

The code I put up has some description of the issue, TY.
I would try doing this first, and taking care of the other advices given by eclectic-tech and balala later:

Code: Select all

[Title1]
Meter=String
MeterStyle=MeterLabel4
Text=Removable Disk Drive 1 - #RDD1#:
X=35r
Y=365
ToolTipText=Click For Text Box / Type In Drive Letter Within Quotes, then Enter.
LeftMouseUpAction=!CommandMeasure "MeasureInput1" "ExecuteBatch 1"
DynamicVariables=1

[MeasureInput1]
Measure=Plugin
Plugin=InputText.dll
MeterStyle=MeterLabel4
FocusDismiss=1
X=320
Y=367
H=15
W=180
SolidColor=0,56,96
Command1=[!SetVariable RDD1 "$UserInput$"][!WriteKeyValue Variables RDD1 "[MeasureInput1]" "#ROOTCONFIGPATH#Settings\Settings.ini"][!WriteKeyValue Variables RDD1 "[MeasureInput1]" "#@#ST-TNG-E\Inks\R-Disk.inc"][!UpdateMeter Title1][!Redraw]
DynamicVariables=1
Some dynamic variable option is required when working with ever changing variables. This follows EXACTLY your current approach (and where I saw those RDD variables present), unlike the (most likely, perfectly correct) modifications suggested by others - the only difference compared to your code is that it works: when you press Enter, the value displayed by the meter in the settings window will change as well.
User avatar
Thinkr8
Posts: 25
Joined: November 14th, 2020, 2:36 pm

Re: I'm having an !UpdateMeter Bang issue ....

Post by Thinkr8 »

I tried Electic-techs way and it works, so basically, for now, I have a fix. Thanks for your input everyone, I will take the advice and look into it. :)
Now I need to self-teach me how to get the removable drive.ini to refresh after entering the drive letter. :)
How do I mark this topic as solved?
Someone said, "Your thinking too much, so I thought more."
User avatar
Yincognito
Rainmeter Sage
Posts: 4052
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: I'm having an !UpdateMeter Bang issue ....

Post by Yincognito »

Thinkr8 wrote: July 29th, 2021, 5:20 pmHow do I mark this topic as solved?
Edit your first post of the topic and change the Post Icon: to the checkmark.
User avatar
Thinkr8
Posts: 25
Joined: November 14th, 2020, 2:36 pm

Re: I'm having an !UpdateMeter Bang issue ....

Post by Thinkr8 »

balala wrote: July 29th, 2021, 4:41 pm EDIT: Sorry, it seems eclectic-tech overtook me. Again!



There are some problems with the codes and with what are you asking, namely:
  • First note that some variables are duplicated. For instance RDD1, RDD2 and RDD3 are "declared" in two places: in the [Variables] section of RDD Test\@Resources\ST-TNG-E\Inks\R-Disk.inc file and in the same section of the skin's RDD Test\Settings\Settings.ini file itself. You should keep only one occurrence of those variables (I probably would vote for the R-Disk.inc file, but this is up to you).
  • A second problem is that the content of the RDD Test\@Resources\ST-TNG-E\Inks\R-Disk.inc file is not included into the skin. Add a @Include2=#@#ST-TNG-E\Inks\R-Disk.inc option to the [Variables] section of this file.
  • Finally remove the [!WriteKeyValue Variables RDD1 "[MeasureInput1]"] bang from the Command1 option of the [MeasureInput1] measure, within the RDD Test\@Resources\ST-TNG-E\Inks\Settings.inc file, not to write the letter twice when you are entering it and hitting Enter (or, if according to the first point above, you kept the RDDX variables into the Settings.ini file, not in R-Disk.inc, remove the [!WriteKeyValue Variables RDD1 [MeasureInput1] "#@#ST-TNG-E\Inks\R-Disk.inc"] bang - anyway remove one of them).
  • I also would tend to remove the #RDD1# variable from the end of the Command1 option of the [MeasureInput1] measure of the RDD Test\@Resources\ST-TNG-E\Inks\Settings.inc file. Not sure why have you added it there, but this for sure is not a valid bang.
Additional notes:
  • In Rainmeter, unlike in C++ (if I'm not mistaken) you don't comment out by {, but by semicolon (;). Please do so.
  • The .ini and .inc files used by skins should be encoded as UTF-16 LE, not as UTF-8. Your files are encoded as UTF-8, recommend to change this (some details here).
This is good advice and I did initiate the UTF-16 LE using Notepad++, which brings up - when using a right-click on text line in Notepad++ while in a .inc file you get { ??? } for toggle single line comment, while in a .ini file to toggle off you use the semi-colon ; - that's why I use those, Notepad++ suggest it so, so I do it that way. :)

Do you know where I need to go in the documentation section to find how I can refresh the removable drive.ini after the drive letter is entered into the textbox? :) TY
Someone said, "Your thinking too much, so I thought more."