It is currently April 26th, 2024, 1:35 pm

Need help to code a USB Meter - Please

Get help with creating, editing & fixing problems with skins
User avatar
jsmorley
Developer
Posts: 22630
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Need help to code a USB Meter - Please

Post by jsmorley »

dfghrngsdkg wrote: October 1st, 2019, 12:02 pm Also: Only if 3. is a legit procedure in coding (confirmed), is it better to write "OneChangeAction=etc" out like I did in the code above or can I shorten it by simply writing: "OnChangeAction=[!UpdateMeasure "MeasureTotalDrive2" | "MeasureTotalDrive3"]
No, that won't work. You must fully spell out each bang, enclosing them in [brackets].

OnChangeAction=[!UpdateMeasure "MeasureTotalDrive2"][!UpdateMeasure "MeasureTotalDrive3"]

You can shorten things a bit by adding various measures to a Group.

https://docs.rainmeter.net/manual/groups/

Code: Select all

[MeasureOne]
Measure=Calc
Group=myGroup

[MeasureTwo]
Measure=Calc
Group=myGroup

[MeasureTrigger]
Measure=Calc
OnChangeAction=[!UpdateMeasureGroup "MyGroup"]
dfghrngsdkg
Posts: 43
Joined: February 16th, 2019, 8:40 pm

Re: Need help to code a USB Meter - Please

Post by dfghrngsdkg »

jsmorley wrote: October 1st, 2019, 12:06 pm No, that won't work. You must fully spell out each bang, enclosing them in [brackets].

OnChangeAction=[!UpdateMeasure "MeasureTotalDrive2"][!UpdateMeasure "MeasureTotalDrive3"]

You can shorten things a bit by adding various measures to a Group.

https://docs.rainmeter.net/manual/groups/

Code: Select all

[MeasureOne]
Measure=Calc
Group=myGroup

[MeasureTwo]
Measure=Calc
Group=myGroup

[MeasureTrigger]
Measure=Calc
OnChangeAction=[!UpdateMeasureGroup "MyGroup"]
Hey,

Thank you for the input. I tried it and it works, however it causes the Header-Delay I've had experienced. So I think that I'll go with the original setting = by keeping the "OnChangeAction=" command in each .inc file.

PS: Without to run the risk of bothering you, do you have a time to look into the last remaining issue: The spacing/positioning? The rainmeter-skin is already attached on Thread-Page 3. It's just this thingy left that bothers me and my attempt to create container (based on your previous input) didn;t get me far / anywhere.
User avatar
balala
Rainmeter Sage
Posts: 16172
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Need help to code a USB Meter - Please

Post by balala »

dfghrngsdkg wrote: October 1st, 2019, 12:02 pm 1. I'll try it. Thought enabling the UpdateDivider might interfere with the newly placed "OnChangeAction=[!UpdateMeasure "MeasureTotalDrive"]"
No, it won't.
dfghrngsdkg wrote: October 1st, 2019, 12:02 pm 2. I asked as it appeared logical to me and with your confirmation makes it easier for me to be confident in doing so.
Usually anything can be done. Then have to check the result. If it is ok, use it, if it's not, just return to the previously working approach and work with that one.
dfghrngsdkg wrote: October 1st, 2019, 12:02 pm 3. Sorry, my bad. I thought that if I skip the part of placing the "OnChangeAction=[!UpdateMeasure "MeasureTotalDrive"]" to each .inc file and instead place it into the main .ini file -which works as the connector of all dots by creating something like this:

Code: Select all

[MeasureTotalDrive]
Measure=Calc
Formula=( MeasureTotalDrive2 + MeasureTotalDrive3 )
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!HideMeter "MeterStyleTransfer"][!Redraw]
IfFalseAction=[!ShowMeter "MeterStyleTransfer"][!Redraw]
OnChangeAction=[!UpdateMeasure "MeasureTotalDrive2"][!UpdateMeasure "MeasureTotalDrive3"]
You have to place that option onto each measure, one by one.
dfghrngsdkg wrote: October 1st, 2019, 12:02 pm Also: Only if 3. is a legit procedure in coding (confirmed), is it better to write "OneChangeAction=etc" out like I did in the code above or can I shorten it by simply writing: "OnChangeAction=[!UpdateMeasure "MeasureTotalDrive2" | "MeasureTotalDrive3"]
See jsmorley's reply above.
dfghrngsdkg
Posts: 43
Joined: February 16th, 2019, 8:40 pm

Re: Need help to code a USB Meter - Please

Post by dfghrngsdkg »

At balala:

1. I enabled all "UpdateDriver=2", but had to refrain from adding Drive-Numbers to the code: "OnChangeAction=[!UpdateMeasure "MeasureTotalDrive"] because only then it works without delay. So it will now measure all TotalDrives combined and simultaneously (I suppose). Just hope it won't gradient slow down the show/hide if more Drives are added in the future. For now its speed is that of an expected "instantly".

2. and 3. Yes I've seen it. I tried and it works, however it unfortunately causes the Header-Delay I've had experienced. So I changed it back to the original setting = by keeping the "OnChangeAction=" command in each .inc file.
User avatar
balala
Rainmeter Sage
Posts: 16172
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Need help to code a USB Meter - Please

Post by balala »

dfghrngsdkg wrote: October 1st, 2019, 1:35 pm 1. I enabled all "UpdateDriver=2", but had to refrain from adding Drive-Numbers to the code: "OnChangeAction=[!UpdateMeasure "MeasureTotalDrive"] because only then it works without delay. So it will now measure all TotalDrives combined and simultaneously (I suppose). Just hope it won't gradient slow down the show/hide if more Drives are added in the future. For now its speed is that of an expected "instantly".

2. and 3. Yes I've seen it. I tried and it works, however it unfortunately causes the Header-Delay I've had experienced. So I changed it back to the original setting = by keeping the "OnChangeAction=" command in each .inc file.
Ok, please post the code of the main .ini file, or if even better, especially if changes have been applied to the included .inc files as well, pack once again the whole config and upload it here. Just to have the same codes, because probably a lot of changes have been added.
dfghrngsdkg
Posts: 43
Joined: February 16th, 2019, 8:40 pm

Re: Need help to code a USB Meter - Please

Post by dfghrngsdkg »

This is the updated Version.2
Drives++ Testing_v.2.rmskin
1. It contains the Drives+USB version with its disabled "[Group=DriveTotal]" that I've added afterwards to the .inc and .ini files which caused the Header-Delay to reoccur.

2. It contains the "USB_Standalone" version. Here I have the issue that Drive1=E: , Drive2=F: does not work. It is probably because "Drive1" is already linked/reserved to C: + in the Drives+USB.ini. In order to make it work here I have to write: Drive3=E: and Drive4=F: . I tried to figure out a way to be able to keep the original order of Drive1=E: , Drive2=F:, etc. by including @,#, [ ], but to no avail. Seems as I have to write additional .inc files for the Standalone Version. If this is the case: How do I include a Resources Sub-folder link into the .ini file? Will it be like: @Include2=#@#USBDrives#Drive2_USB.inc?
Another issue is that G: not appears because of missing space. I checked it and it is Dynamic but the drive wont show up.

2.The spacing/positioning is still an unsolved issue and more easier to spot in the Standalone. I tried to create a "container" based on jsmorley's tutorial, however this is way above my non-coder head so I erased the bits and parts of my miserable trial&error and hope one of you experts can help me out.
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 16172
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Need help to code a USB Meter - Please

Post by balala »

dfghrngsdkg wrote: October 1st, 2019, 8:08 pm This is the updated Version.2
Ok will test it tomorrow, because here is almost midnight and I'm gonna go now to sleep.
dfghrngsdkg
Posts: 43
Joined: February 16th, 2019, 8:40 pm

Re: Need help to code a USB Meter - Please

Post by dfghrngsdkg »

balala wrote: October 1st, 2019, 8:30 pm Ok will test it tomorrow, because here is almost midnight and I'm gonna go now to sleep.
Nevermind, take your time to breath and rest. Have a good night.
User avatar
balala
Rainmeter Sage
Posts: 16172
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Need help to code a USB Meter - Please

Post by balala »

Ok, tested it and:
dfghrngsdkg wrote: October 1st, 2019, 8:08 pm 1. It contains the Drives+USB version with its disabled "[Group=DriveTotal]" that I've added afterwards to the .inc and .ini files which caused the Header-Delay to reoccur.
No such delay for me. I rewrote the drive letters, obviously having different drives, but now it does work instantly:
GIF.gif
dfghrngsdkg wrote: October 1st, 2019, 8:08 pm If this is the case: How do I include a Resources Sub-folder link into the .ini file? Will it be like: @Include2=#@#USBDrives#Drive2_USB.inc?
If the value of the USBDrives variable is set statically (eg in the [Variables] section) this will work. But it won't if you try to dynamically set its value, through a !SetVariable bang.
dfghrngsdkg wrote: October 1st, 2019, 8:08 pm Another issue is that G: not appears because of missing space. I checked it and it is Dynamic but the drive wont show up.
Have no idea what are you talking about: the drive which can be seen in my above animation has the G: drive letter and it does work. What space is missing and where?
dfghrngsdkg wrote: October 1st, 2019, 8:08 pm 2.The spacing/positioning is still an unsolved issue and more easier to spot in the Standalone. I tried to create a "container" based on jsmorley's tutorial, however this is way above my non-coder head so I erased the bits and parts of my miserable trial&error and hope one of you experts can help me out.
To be honest is not yet clear for me what this issue is. I'm trying to understand based on your description, but no success yet.
You do not have the required permissions to view the files attached to this post.
dfghrngsdkg
Posts: 43
Joined: February 16th, 2019, 8:40 pm

Re: Need help to code a USB Meter - Please

Post by dfghrngsdkg »

Hey,
No such delay for me. I rewrote the drive letters, obviously having different drives, but now it does work instantly
.

What did you differently? Because with the group command I have the delay. Maybe I did something wrong? Please Can you provide me the part that worked for you (by rewriting) for: a) .ini and b) one of the two USB.inc?

;===================
If the value of the USBDrives variable is set statically (eg in the [Variables] section) this will work. But it won't if you try to dynamically set its value, through a !SetVariable bang.
I'll give it a try later on.

;================
dfghrngsdkg wrote: ↑Yesterday, 1:08 pm
Another issue is that G: not appears because of missing space. I checked it and it is Dynamic but the drive wont show up.
Have no idea what are you talking about: the drive which can be seen in my above animation has the G: drive letter and it does work. What space is missing and where?
Did you used the USB-Standalone.ini that is included in Version.2 I posted in yesterday? Because there I have this problem.

This is mine: on the left the USB standalone (with no second USB showing up) and on the right with second USB showing up in the Drives+USB.ini.
standalone.JPG
Please Note that this version now has a D: Drive but the rest is as the version you have.

;==============
dfghrngsdkg wrote: ↑Yesterday, 1:08 pm
2.The spacing/positioning is still an unsolved issue and more easier to spot in the Standalone. I tried to create a "container" based on jsmorley's tutorial, however this is way above my non-coder head so I erased the bits and parts of my miserable trial&error and hope one of you experts can help me out.
To be honest is not yet clear for me what this issue is. I'm trying to understand based on your description, but no success yet.
Here is a picture of what I am talking about:
screen.JPG
On the left it shows how it should be like (the spacing from Header to Drive and between the Drives) on the right it is after removing Drive (E:). This problem becomes more obvious when using the USB-Standalone version and if I change the Y= values in the USB-Standalone (in the F: Drive.inc) to move it up a bit then it will cause a too narrow spacing that when both Drives are attached. jsmorley suggested to make containers to anchor (correctly positioning) all Drives (on Top of Thread Page 4) but I have no clue how to make such a thing. I tried once but failed.

;======

Ps; how to make these gifs?

With kind regards,
You do not have the required permissions to view the files attached to this post.