It is currently March 29th, 2024, 8:36 am

Need help to code a USB Meter - Please

Get help with creating, editing & fixing problems with skins
User avatar
balala
Rainmeter Sage
Posts: 16110
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 2nd, 2019, 5:41 pm 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 one of the two USB.inc?
I used your skin, posted by you previously. The only difference is that I changed the drive letters, to use the needed ones.
dfghrngsdkg wrote: October 2nd, 2019, 5:41 pm I'll give it a try later on.
Ok, let me know if you succeeded.
dfghrngsdkg wrote: October 2nd, 2019, 5:41 pm Did you used the USB-Standalone.ini that is included in Version.2 I posted in yesterday? Because there I have this problem.
No, I didn't but I can't even, because the @Resources\Drive3_USB.inc, @Resources\Drive4_USB.inc and @Resources\Drive5_USB.inc files are missing. The log warns me when I refresh the skin.
dfghrngsdkg wrote: October 2nd, 2019, 5:41 pm Here is a picture of what I am talking about:
See above. I'm waiting for the missing files.
dfghrngsdkg wrote: October 2nd, 2019, 5:41 pm Ps; how to make these gifs?
There are a lot of programs out there to record your screen. I'm using GifCam, but you can find another as well if you google a little bit the web.
dfghrngsdkg
Posts: 43
Joined: February 16th, 2019, 8:40 pm

Re: Need help to code a USB Meter - Please

Post by dfghrngsdkg »

No @Resources?

"Create .r,skinpackage" > Name, Author, Version > Add Skin > Chose Folder: Drives++ (which includes @Resources, USB_Standalone) > press "Next" and skin-package is created. Did I miss something? Unfortunately I can't look into the Skin-package after its creation.

Until then I'll send it as zip so you can extract the @Resources and USB.ini
Drives++.zip
No virus n stuff included.
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 16110
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 2nd, 2019, 7:27 pm No @Resources?
But yes, the @Resources folder exists. The Drive3_USB.inc, Drive4_USB.inc and Drive5_USB.inc files are missing. There are only the Drive1_C.inc, Drive2_USB.inc, Drive3_USB.inc, Font&Colors.inc and MeterStyles.inc files, no Drive3_USB.inc, Drive4_USB.inc and Drive5_USB.inc.
dfghrngsdkg wrote: October 2nd, 2019, 7:27 pm "Create .r,skinpackage" > Name, Author, Version > Add Skin > Chose Folder: Drives++ (which includes @Resources, USB_Standalone) > press "Next" and skin-package is created. Did I miss something? Unfortunately I can't look into the Skin-package after its creation.
Basically this is the procedure.
dfghrngsdkg wrote: October 2nd, 2019, 7:27 pm Until then I'll send it as zip so you can extract the @Resources and USB.ini
Drives++.zip
No virus n stuff included.
This time the @Resources is completely empty. No files included at all.
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 2nd, 2019, 8:00 pm But yes, the @Resources folder exists. The Drive3_USB.inc, Drive4_USB.inc and Drive5_USB.inc files are missing. There are only the Drive1_C.inc, Drive2_USB.inc, Drive3_USB.inc, Font&Colors.inc and MeterStyles.inc files, no Drive3_USB.inc, Drive4_USB.inc and Drive5_USB.inc.

Basically this is the procedure.

This time the @Resources is completely empty. No files included at all.
Hey,
Sound strange and after checking my file it was indeed empty but the skins where running on my desktop.

OK, The folder: "Drives++" I gonna resend should include the following:

1. Drives+USB.ini
2. 2 Folder:
=> USB_Standalone that includes: USBs.ini
=> @Resources that includes: Drive1_C.inc , Drive2_D.inc , Drive3_USB.inc , Drive4_USB.inc , Drive5_USB.inc , Font&Colors.inc , MeterStyles.inc

After mounting you should have two separate skins that look like this:
L+R2.jpg

Note about spacing/positioning:
The Design of: Drives+USB its (spacing/positioning of each Drive and Header) is what I want to keep because I like it this way. It works until E: is removed with F: moves up but not follows into the exact position of E: (see the other, detailed image I've posted before)

What you can tell from the picture is:
The spacing on: USB_Standalone is way off. Because E: and F: can't move up, won't move up. This, because of what I already explained. If I change the Y=xxR value to move both Drives up in the standalone version it will affect the E: and F: positions in Drives+USB and vice versa.

Possible solution: jsmorley suggested containers, to create an "invisible" border or frame around "[TRANSFERS]" where E: and F: can equally anchor at, especially when E: is removed -to keep the position the same. Not sure that it needs container around each E: and F: too. My attempt creating these containers was a fail so unfortunately I can't give any hint or further coding idea*. A container or anything that works, that solves this problem would be nice and will be applied later to C: and D: - to make the whole skin vertically flexible.

* I want to apologize for not being much of a help or seemingly leave the work with you folks. I would do it by myself if I could, but I am new to coding and my skills can let me do only very simple things. I not even have an idea of how much workload it is for this project, 20min, 2h? I honestly don't know. Unfortunately. All I have is this idea in mind which I thought in the beginning that it wont be much of a hassle. :(((


I'll add two files here: a zip and rainmeter-skin. Please tell me if both files contain the same inventory (as listed above).
Drives++.zip
Drives++_Testing_v.3.rmskin
Fingers crossed and with kind regards,
You do not have the required permissions to view the files attached to this post.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5384
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Need help to code a USB Meter - Please

Post by eclectic-tech »

Your 2 top includes and the [Transfers] sections never change location, only the available USB includes need to be positioned relative to the [Transfers] and each other.

I would suggest using Y=0R for all of the USB label meters (first meter in those skins). That way when they are not shown, the relative position starts at zero. Then I would add a [Spacer] section with a height of 10 pixels (like you tried) to each USB @include, this sets the height of "all the included meters" to about 65 pixels (the same height as Drive1 and Drive2 includes).

I moved the [Transfers] meter to a fixed Y position between the Drive2 include and the USB includes, and added Padding=5,0,0,5 to that meter for positioning between Drive2 and the first USB include.
drivesA.png
drivesB.png
Here is a package Drive++_Tested that should install along side your current skin so you can compare.

I would go about this differently (many ways to achieve the same results, which is what makes Rainmeter fun and versatile), but this should get you where you want to be using includes.
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 »

Hello,

Thank you for also looking into this matter. Yes, this is it! :thumbup:
When comparing yours and mine, I found some parts I'd like to have clarified for a better understanding of my doings.

1. About the "[!UpdateMeter *]" :
If I add this part then I do not need to create "Groups" as this command would update every involved "MeterTotalDrive" by using " * " - am I right? Or does it update every other Meter regardless?

2. I've noticed that you had placed " [MeterStyleTransfer] " inbetween Drive1/2 and Drive3/4/5 which puzzles me a bit.
Meter styles.jpg
My guess is: It is because to create the needed order: Drive1/2 -> Header -> USB_Drives (3/4/5) as a reference to get the spacing and positioning to work when using Y=0R. Like: "What you code is what you get (to see)"? I've never seen such approach as I am not familiar with - or is there no meaning/reason behind it at all and it just looks like as it is?

3. Positioning/ Spacing: Yes, I tried "Padding" but couldn't get the desired result, even it was already there, right in front of me. One of my thoughts for example: "Why should I add a "R" to C:'s "Y=0" if C: is already on top?" and by doing so ignoring that "R" possibly serves as a "general marker" to get the rest to follow.

In this screenshot below I've (tried) to summarized your work and a few questions came up:
spaceings.jpg
A) If all USB.inc files have no "Padding=" coded into it, how can they maintain the space in between (lower orange-dotted line) and especially if "Y=0R" is set in all .inc files? To my understanding an "Y=0R" would cause that all Drives simultaneously anchor right below the Header (I had run into something like this previously).

B) If I set both, D: and the Header to "Y=0R" would they maintain their current position too? If not, what I have to do?

C) If I include a "show/hide" command into D: with both, D: and the Header are set to :Y=0R", would the Header incl. the USB's move up alltogether orderly to fill the then blank space if D: is detached or would it create a clusterf..k?

With kind regards,
You do not have the required permissions to view the files attached to this post.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5384
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Need help to code a USB Meter - Please

Post by eclectic-tech »

dfghrngsdkg wrote: October 3rd, 2019, 12:20 pm Hello,

Thank you for also looking into this matter. Yes, this is it! :thumbup:
When comparing yours and mine, I found some parts I'd like to have clarified for a better understanding of my doings.

1. About the "[!UpdateMeter *]" :
If I add this part then I do not need to create "Groups" as this command would update every involved "MeterTotalDrive" by using " * " - am I right? Or does it update every other Meter regardless?
Yes, the asterisk means "All meters". You need groups to be able to control all meters related to specific drives using a single bang action. A !Redraw bang without !UpdateMeter bang is useless; you need to update before you redraw.
dfghrngsdkg wrote: 2. I've noticed that you had placed " [MeterStyleTransfer] " inbetween Drive1/2 and Drive3/4/5 which puzzles me a bit.
{image removed}
My guess is: It is because to create the needed order: Drive1/2 -> Header -> USB_Drives (3/4/5) as a reference to get the spacing and positioning to work when using Y=0R. Like: "What you code is what you get (to see)"? I've never seen such approach as I am not familiar with - or is there no meaning/reason behind it at all and it just looks like as it is?
I placed it there initially because you had it's vertical position relative to the previous meter; meters will be drawn in the order they appear in the code. Later I changed it to a static position, so now it could be anywhere in the code.
dfghrngsdkg wrote: 3. Positioning/ Spacing: Yes, I tried "Padding" but couldn't get the desired result, even it was already there, right in front of me. One of my thoughts for example: "Why should I add a "R" to C:'s "Y=0" if C: is already on top?" and by doing so ignoring that "R" possibly serves as a "general marker" to get the rest to follow.
Since only the USB included meters needed to be at a set distance from the [Transfers] section and each other, I set the vertical position of the first meter in each USB include to Y=0R so they would not change any placement when they are hidden (height equals zero). When any of them are hidden, the next meter will be placed at the same vertical position. In order to get separation between the USB include, I recreated a [Spacer] section at the end of all USB includes to make all of them approximately the same size as Drive1 and Drive2 includes (~65 pixels); you can change the H value to move them closer together or further apart vertically.
dfghrngsdkg wrote:In this screenshot below I've (tried) to summarized your work and a few questions came up:
{image removed}

A) If all USB.inc files have no "Padding=" coded into it, how can they maintain the space in between (lower orange-dotted line) and especially if "Y=0R" is set in all .inc files? To my understanding an "Y=0R" would cause that all Drives simultaneously anchor right below the Header (I had run into something like this previously).
No, Y=0R will place the meter containing that code directly below the preceding meter. If the preceding meter is hidden, then the meter with Y=0R will appear exactly where the previous meter would have been. Padding is completely different from Relative positioning. Padding is used to fine-tune spacing "around" meters (Padding=Left Pixels,Top Pixels, Right Pixels, Bottom Pixels) while R & r are used to position meters relative to other meters.
dfghrngsdkg wrote:B) If I set both, D: and the Header to "Y=0R" would they maintain their current position too? If not, what I have to do?
They may, but because they do not have a [Spacer] section, which is used to create a vertical gap at the bottom of those includes, you may need to add that to them. However, they are static meters, that will never increase or decrease in vertical size, other than if the font size is changed, which would require additional changes, so why place them relative to anything? I set the Y values to static numbers to give me the desired spacing.
dfghrngsdkg wrote:C) If I include a "show/hide" command into D: with both, D: and the Header are set to :Y=0R", would the Header incl. the USB's move up alltogether orderly to fill the then blank space if D: is detached or would it create a clusterf..k?
Not quite the way it is coded, because I used padding in the Header meter. I suppose you could set those Y=0R, and replace the padding with a new [Spacer] section below the [Transfers] section to maintain vertical spacing.

Try it and see what happens, then make small changes, one-at-a-time until you get the desired spacing.
User avatar
balala
Rainmeter Sage
Posts: 16110
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 3rd, 2019, 12:20 pm Yes, this is it! :thumbup:
Have eclectic-tech's solution fixed the issue?
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 3rd, 2019, 3:48 pm Have eclectic-tech's solution fixed the issue?
Actually Yes, especially with the detailed background information. Also, the "[Spacer]" seems to be the key. So thank you all for your helping hands and brains. Next step will be the trial for making it vertically flexible to head for the original idea to have a static C: with D:- G: or even H: to be the flexible Drives with the skin recognizing and arranging it accordingly. Here I'll look into your information you provided balala about the static vs. dynamic Drive value. But that's a task for another day as for now its fine. :)

Just one thingy:
"I recreated a [Spacer] section at the end of all USB includes to make all of them approximately the same size as Drive1 and Drive2 includes (~65 pixels); you can change the H value to move them closer together or further apart vertically."
It seems I can't get this to work. If I change the value of "H=10" in Drive3_USB.inc and Drive4_USB.inc to any other number and refresh the skin, nothing is happening, it's still the same vertical position. Maybe I misunderstood something?
User avatar
balala
Rainmeter Sage
Posts: 16110
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 3rd, 2019, 4:57 pm It seems I can't get this to work. If I change the value of "H=10" in Drive3_USB.inc and Drive4_USB.inc to any other number and refresh the skin, nothing is happening, it's still the same vertical position. Maybe I misunderstood something?
Which meters are you talking about? Because in the last package you've posted (but in fact nor in the previous one) there are no height set to H=10 nor in Drive3_USB.inc, nor in Drive4_USB.inc.