It is currently April 27th, 2024, 6:50 am

Variable CPU data but fixed BAR width ... and a 2nd problem

Get help with creating, editing & fixing problems with skins
User avatar
Youkai1977
Posts: 164
Joined: October 31st, 2018, 4:11 pm
Location: Germany

Re: Variable CPU data but fixed BAR width ... and a 2nd problem

Post by Youkai1977 »

@Yincognito:

First of all, thank you for liking my design. I have to refer back to my post from the day before yesterday, and to be fair I'll only praise the implementation with shapes and the work.
The actual design idea (at least the background graphics) is someone else's and I have appropriated it. Which is why I'm still not quite sure whether I can offer my complete suite for download or whether I can just use it for myself on my PC.

Ok, but now back to the core topic of this thread ... my crude formulas and your solutions.

So your formula gave me the solution with

Code: Select all

[mCPU_AV:%]
and the

Code: Select all

MinValue
and

Code: Select all

MaxValue
I have also rewritten my CPU meter accordingly. At the end of this post you will find the current beta version of my CPU meter.

All in all, I have only made a few code optimizations and a few small design changes to the SHAPE bars.

A big thank you to all the other hard-working helpers at this point as well :bow:


BUUUUUTTTTTTT, I have noticed 2 strange things with my CPU meter, where I am now not quite sure if my code still contains an error (See heading of this topic ... my 2nd problem) ... or if there is perhaps a BUG in Rainmeter.
Namely, if I start 2 Instances of my CPU meter, i.e. my CPU meter runs twice on the screen, THEN, AND ONLY THEN, does the "Min-Value" Display for CPU usage (CDU) work. :???:
If only 1 Instance of my CPU meter is running, then the "MIN-Value" Usage Display (CDU) is permanently 0.00%.

At the End of this Posting are 2 Screenshots what I mean. And no, is not a Joke or a Fake, is really.

How can this be? Or is this coincidentally related to what I have read here in the forum, that "Windows 11 22H2" and higher versions, where it is currently difficult to read out the real values such as MHz/GHz, Usage etc., and third-party programs such as HWiNFO etc. also have their problems?

I currently have completely different values for CPU utilization in Windows TAskmanager, HWiNFO etc., even though I have the latest Rainmeter and HWiNFO version.
Currently, as I am writing this text here, I have "4.32GHz" CPU clock in the task manager, for example, while Rainmeter gives me the data from HWiNFO with "3.755.3MHz", i.e. ~"3.75GHz" CPU clock.
Has the problem between Windows11, Rainmeter and third party programs still not been fixed since 22H2, or have I just got a pin in my head and have now programmed junk into my CPU meter code because of all the reading on the subject here in the forum? :confused: :???:
You do not have the required permissions to view the files attached to this post.
- Win11 Pro x64 (23H2 - 22631.3085)
- Rainmeter 4.5.18
- Gigabyte B550i AORUS Pro AX V1.2
- Corsair Venegeance LPX 2x 16GB (32GB) DDR4 3200MHz
- RYZEN 7 5800X
- PowerColor RX570 8GB
- Samsung 980Pro 250GB (NVMe) - Drive C: Windows
- Kingston SNV2S1000G (NVMe) - Drive D: Rainmeter, Skins & Others - Drive D: Games
- NAS Synology DS216j - 2x 1GB HDDs - My Main Backup & Data Storage in my Home-Network
- Mon 1: 24" HP 24f (1920 x 1080 @ 75Hz) - Primary
- Mon 2: 22" Philips 226VL (1920 x 1080 @ 60Hz) - Secondary 1
- Mon 3: 50" Philips 50PUS7304/12 (3840 x 2160 @ 60Hz) - Secondary 2
- Corsair CX 650M Power Supply
- NZXT H210 Case
- ISP Vodafone with 1000/50 Mbit Cable Internet

The absolutly High-End Machine on 2024 ... at least the graphics card :oops: O.O :rofl:
User avatar
Yincognito
Rainmeter Sage
Posts: 7175
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Variable CPU data but fixed BAR width ... and a 2nd problem

Post by Yincognito »

Well, first, I'm still on Win 10 so I can't speak for Win 11 cases. Secondly, I'm more of a "this is how you do it" kind of guy and less of a "I'm going to fix all issues in your skin line by line" type, so I'll probably avoid reading hundreds of lines to correct a typo or some other small detail that prevents things from happening as expected.

That being said, what I will say is that:
- it helps to test things in a simpler environment first, and only then apply them to your actual scenario, knowing that it should work
- depending on how you retrieve your CPU usage value (and this is done in a measure, not a meter), that value might exceed 100%, so this might play a part in messing the display a little bit
- as far as I know, in Win 11, only the individual process CPU usages are off compared to Task Manager, so measuring the total / core CPU should more or less match the Task Manager values, if done correctly (see here)
- I don't know how you get those values in your skin and personally I don't use HWINFO for this, so this might also contribute to values that don't match

I might take a look at your skin later on, but it would help to be precise and indicate exactly where the problem is, so that we don't have to look for the needle in the haystack for you. For example, I fail to see how the "instances of a meter" mess the expected result, it shouldn't even be the case when "instances of a measure" is concerned... :confused:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Yincognito
Rainmeter Sage
Posts: 7175
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Variable CPU data but fixed BAR width ... and a 2nd problem

Post by Yincognito »

Youkai1977 wrote: February 8th, 2024, 5:06 pmBUUUUUTTTTTTT, I have noticed 2 strange things with my CPU meter, where I am now not quite sure if my code still contains an error (See heading of this topic ... my 2nd problem) ... or if there is perhaps a BUG in Rainmeter.
Namely, if I start 2 Instances of my CPU meter, i.e. my CPU meter runs twice on the screen, THEN, AND ONLY THEN, does the "Min-Value" Display for CPU usage (CDU) work. :???:
If only 1 Instance of my CPU meter is running, then the "MIN-Value" Usage Display (CDU) is permanently 0.00%.

At the End of this Posting are 2 Screenshots what I mean. And no, is not a Joke or a Fake, is really.

How can this be? Or is this coincidentally related to what I have read here in the forum, that "Windows 11 22H2" and higher versions, where it is currently difficult to read out the real values such as MHz/GHz, Usage etc., and third-party programs such as HWiNFO etc. also have their problems?

I currently have completely different values for CPU utilization in Windows TAskmanager, HWiNFO etc., even though I have the latest Rainmeter and HWiNFO version.
Currently, as I am writing this text here, I have "4.32GHz" CPU clock in the task manager, for example, while Rainmeter gives me the data from HWiNFO with "3.755.3MHz", i.e. ~"3.75GHz" CPU clock.
Has the problem between Windows11, Rainmeter and third party programs still not been fixed since 22H2, or have I just got a pin in my head and have now programmed junk into my CPU meter code because of all the reading on the subject here in the forum? :confused: :???:
It's not that bad for me, on Win 10:
Mars.jpg
The occasional CPU clock MHz frequency difference might also be because of the different moments (in terms of milliseconds or such) that these measurements were taken. The CPU usage should be roughly the same in Task Manager, Rainmeter, HWiNFO in both Win10 and Win11, assuming you're looking at the same "CPU Utility" (aka % Processor Utility) values that Task Manager uses to diaply the CPU usage. Your Min-Value was occasionally 0% for me during the process of setting the HWiNFO gadget / registry indexes, but as you can see, it's not 0% anymore.

By the way, the CPU frequency can alternatively be computed using the base CPU frequency and the CPU performance percentage, e.g.:

Code: Select all

[CPUSpeed]
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=HARDWARE\DESCRIPTION\System\CentralProcessor\0
RegValue=~MHz
UpdateDivider=3600

[CPUPerf]
Measure=Plugin
Plugin=UsageMonitor
Category=Processor Information
Counter=% Processor Performance
Name=0,_Total

[CPUFreq]
Measure=Calc
Formula=(CPUSpeed*(CPUPerf?CPUPerf:100)/100)
Both me and SilverAzide have some posts on the forum in that regard, but I don't feel like searching the exact matches at this time, so you only have the summary of it above.
You do not have the required permissions to view the files attached to this post.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Youkai1977
Posts: 164
Joined: October 31st, 2018, 4:11 pm
Location: Germany

Re: Variable CPU data but fixed BAR width ... and a 2nd problem

Post by Youkai1977 »

@Yincognito:

First of all, as far as I understood your answers correctly through the translator, I do NOT expect you or anyone else here on the forum to chew me up and present the solutions neatly on a silver platter. If that came across in my last post, I apologize.

I have already read most of the posts you mentioned here on the forum about the current "Win11 22H2" problem.

However, I must admit that they are currently confusing me more than helping. But that's not the fault of the posts. It's probably more due to my situation, such as the language barrier, and the fact that the whole thing has now caught me unexpectedly and cold. It's no longer a secret here in the forum that I only do this as a hobby on the side and therefore have no in-depth knowledge of the subject matter.

To cut a long story short, I'm just annoyed about the whole thing, because after more than 2 years I sit down again and tinker a bit with Rainmeter, I'm proud of what I've achieved and then the displayed result is just crap because ... why?! I think that's exactly the point. Somehow nobody really knows, do they?

At least if I understand the topics mentioned here in the forum and on the Internet correctly. So far, everything sounds like a temporary solution to me and you should be happy with what you end up with.
Or is it not a mess after all, because it is now a % value based on time, or was it a time value that was converted into % ... do you know what I mean? No?! Welcome to the club, me neither -.-
From the fact that I have recently been experiencing such crude things as in my last screenshots, that I have to have 2 equal instances of meters running for the display of a certain value to work ... just crude

Anyway, I tried your tip with the "basic CPU frequency and CPU performance percentage" and now have at least approximately the value for the CPU speed that Windows gives me in the task manager.
Whether this is the average sum of all cores or the root of the weight of Sagittarui's A* star (the black hole in the center of the Milky Way) is a) irrelevant to me tonight, and b) as I understand the whole thing under the circumstances mentioned for me, nobody can say with certainty what you get as a result, I think I can come back to point "a" and accept it with gritted teeth.

As a person with the handicap of an autistic person, I am currently noticing that reading the entire data situation and correctly interpreting and assigning these values ​​completely overwhelms my strength, time and, above all, the fact that it is just a hobby.
And before I lose the desire to continue, I will leave my CPU meter at this point and move on to more harmless meters to adapt them to my planned new suite. As well as probably follow your approach (if I have understood you correctly at this point) and write my meters in the future in such a way that they are as less dependent on third-party programs as possible.
I have already implemented this on a small scale using your tip, as well as reading out the CPU name. I now get the latter from the Windows registry.

As for the crude story that the MIN usage display only works when 2 instances of my CPU meter are running, I'm still all ears if anyone has an idea, guess, etc. about it.
- Win11 Pro x64 (23H2 - 22631.3085)
- Rainmeter 4.5.18
- Gigabyte B550i AORUS Pro AX V1.2
- Corsair Venegeance LPX 2x 16GB (32GB) DDR4 3200MHz
- RYZEN 7 5800X
- PowerColor RX570 8GB
- Samsung 980Pro 250GB (NVMe) - Drive C: Windows
- Kingston SNV2S1000G (NVMe) - Drive D: Rainmeter, Skins & Others - Drive D: Games
- NAS Synology DS216j - 2x 1GB HDDs - My Main Backup & Data Storage in my Home-Network
- Mon 1: 24" HP 24f (1920 x 1080 @ 75Hz) - Primary
- Mon 2: 22" Philips 226VL (1920 x 1080 @ 60Hz) - Secondary 1
- Mon 3: 50" Philips 50PUS7304/12 (3840 x 2160 @ 60Hz) - Secondary 2
- Corsair CX 650M Power Supply
- NZXT H210 Case
- ISP Vodafone with 1000/50 Mbit Cable Internet

The absolutly High-End Machine on 2024 ... at least the graphics card :oops: O.O :rofl:
User avatar
Yincognito
Rainmeter Sage
Posts: 7175
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Variable CPU data but fixed BAR width ... and a 2nd problem

Post by Yincognito »

Youkai1977 wrote: February 9th, 2024, 5:01 pmFirst of all, as far as I understood your answers correctly through the translator [...] I'm still all ears if anyone has an idea, guess, etc. about it.
I don't think you need to apologize, because it wasn't about expecting to be presented solutions on a silver platter in this case. It was more about not understanding what you meant when saying that "MIN usage display only works when 2 instances of the CPU meter are running" and the fact that going through your skin line by line to try to figure out what does that actually mean in terms of code isn't feasible (at least for me), that's all. In other words, there's no precise description of the problem to help me (or us) come up with a solution, because:
- a value provided by the skin isn't influenced by meters, but by MEASURES, so missing such a value doesn't make sense, being provided by HWiNFO
- while displaying something is indeed related to meters, your "working" screenshot presents two SKIN instances, not meter instances, as far as I can tell
- I can't replicate the issue, since, as you could see in my screenshot, the MIN usage was displayed fine on my system
So, that's why I didn't offer a solution for that. Where I understood what issue you referred to, I did provide a solution, like in the CPU speed / frequency case. Also, the Win 11 issues are only related to the CPU usage of individual processes, not the total or core CPU usages. It isn't that important to understand what it's all about, just the effects of it (like, for example, the CPU usage of the "Rainmeter.exe" process being lower than it should be, compared to other overall CPU usage data).

Being less dependent on 3rd party programs is not an objective per se, if those programs provide what you want. Apparently this wasn't the case when it came to the CPU speed, which is why I suggested a more "internal" solution. As for describing other problems, it would help to simplify either the code in a basic sample and see if the issue still occurs, or be more precise in terms of code (e.g. "hey, [MeasureXYZ] at line NNN in ABC.ini doesn't yield what I want - how to fix it" or something along those lines).
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Youkai1977
Posts: 164
Joined: October 31st, 2018, 4:11 pm
Location: Germany

Re: Variable CPU data but fixed BAR width ... and a 2nd problem

Post by Youkai1977 »

First of all, thank you for your answer.
I am reassured that it was not understood as "I expect answers/solutions on a silver platter".

Yes, I think I didn't formulate my question about the MIN value problem very clearly. But that's because I don't know what I actually need to ask.
Because as I can see from your answer, my CPU meter seems to be working as it should. So an error on my part in the code seems to be as good as ruled out.
So it can only possibly be Windows 11, which I am using, and you are still using Windows 10, as far as I understood correctly. Or we have the phenomenon here that for some inexplicable reason, which sometimes happens in IT, one thing does not work or harmonize together. I once saw a report on this. 2 absolutely identical PCs, identical software and drivers, even the screens and peripherals such as mouse, keyboard etc. were all identical. And yet a program wouldn't start on one PC and caused blue screens.
Maybe this MIN value problem is something similar... just inexplicable :confused:

Yes, I had understood that the Win11 problems mainly relate to the utilization of individual cores, despite all the circumstances mentioned for me to muddle through here.
It became complicated for me at the point when I read how to calculate/read out what this, that and the other means now, and that of course values such as CPU speed and so on are also influenced by this, and you have to rewrite your meters if you want to have it differently again.
In short, I reached a point yesterday where my head was spinning so much that (don't laugh now) I was about to sell my PC, get an old laptop or tablet for the most necessary office work, and get a games console instead.
And then just forgot how complicated some things in IT have become. Honestly, I had (and still have) lost the motivation to continue working on system metrics such as CPU, GPU, RAM etc. as a result.
Because at the moment I still don't know which value is actually the one I can believe and really matches what the CPU is doing.
The whole thing was topped off by a YT video I watched last night. I actually wanted to switch off from Rainmeter, HWiNFO and co. ... then I saw in the said video that today there is not only the TDP value of a CPU, but also a PPT (Package Power Target) value. And in my mind's eye I saw my CPU meter, which only reads out the TDP value (CDW last bar) and was thinking about whether I should now make a PPT BAR shape.

I really had to mentally slap myself in the face at that moment. I haven't even finished my CPU meter yet, and there may still be errors in it and I don't even know how to get the values ​​read out under the current situation (Win11 problem), so my thoughts are already turning to expanding the CPU -meters.

Oh, so much texting again... Sorry O.O :oops:

Back to the topic/core problem.
As I said, I usually state or describe my problems precisely enough.
But when it comes to the MIN-Value problem, which as I said seems to have been written correctly by me in the code, I'm really at a loss. As you can see, it works. Just not on my system.
Therefore, I think neither you nor anyone else has to go through my code line by line, which would be unreasonable penal work given ~1917 lines spread across two files.
The problem is either in Win11, or my PC has a problem somewhere. I can also exclude HWiNFO as a value provider, since the USAGE values ​​come from the “UsageMonitor” plug-in and are then processed accordingly using other measures.

As for third-party programs, you're right. IF, and the emphasis here is on IF, the values ​​they provide are also correct, then even I, as an opponent of third-party programs, will soften here and use them after all.
But that's exactly what's making me ponder at the moment. I use HWiNFO and Co. to combat my inner bastard, only to realize that...
a) these programs sometimes read out so many values ​​that I actually don't even know what is what anymore.
b) When I look for help here in the forum or on the Internet, what I find confuses me even more, and...
c) then also read that the values ​​that come out of it are probably cheese at the moment, because the program manufacturers also have the same problem as the Rainmeter user these days.
And so my autistic streak comes out (once again), wondering what the point of it all is, and could scream and bite the keyboard.

Well, anyway, I think we can consider my not so clearly formulated question about the MIN value to be settled at this point. Because my code seems correct. And since none of you or I can clairvoyance, I'll probably have to live with it for the time being, as this problem seems to be limited to my PC and the problem/error can only be solved on this one.

Of course, I am always open to anything else relating to my CPU meter, such as criticism, ideas or suggestions.
I will continue to use this thread here for my current CPU meter in the future if there are updates etc.
- Win11 Pro x64 (23H2 - 22631.3085)
- Rainmeter 4.5.18
- Gigabyte B550i AORUS Pro AX V1.2
- Corsair Venegeance LPX 2x 16GB (32GB) DDR4 3200MHz
- RYZEN 7 5800X
- PowerColor RX570 8GB
- Samsung 980Pro 250GB (NVMe) - Drive C: Windows
- Kingston SNV2S1000G (NVMe) - Drive D: Rainmeter, Skins & Others - Drive D: Games
- NAS Synology DS216j - 2x 1GB HDDs - My Main Backup & Data Storage in my Home-Network
- Mon 1: 24" HP 24f (1920 x 1080 @ 75Hz) - Primary
- Mon 2: 22" Philips 226VL (1920 x 1080 @ 60Hz) - Secondary 1
- Mon 3: 50" Philips 50PUS7304/12 (3840 x 2160 @ 60Hz) - Secondary 2
- Corsair CX 650M Power Supply
- NZXT H210 Case
- ISP Vodafone with 1000/50 Mbit Cable Internet

The absolutly High-End Machine on 2024 ... at least the graphics card :oops: O.O :rofl:
User avatar
Yincognito
Rainmeter Sage
Posts: 7175
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Variable CPU data but fixed BAR width ... and a 2nd problem

Post by Yincognito »

Youkai1977 wrote: February 10th, 2024, 4:44 pm First of all, thank you for your answer [...] I will continue to use this thread here for my current CPU meter in the future if there are updates etc.
No worries, most of us (including me) can relate to most of your problems, even if some of us are more technically aware, so to speak. It's a fact of life that the technical specs of a modern device are not simple, and that there are many different (and at times, conflicting) ways to present the info on such specs, that sometimes not even the experts can decipher accurately. This often leads to an overcomplicated, chaotic and non-standard representation of what should be straightforward data about such a device, and this will get worse in the future. I'd say relax, stick to a couple of basic stuff about the device, and when in doubt, either try to replicate the most used similar utility by avoiding making a mish mash of different readings from different software, or devise a system where things would make sense overall. Obviously, the latter requires some technical background that is not that accessible or easily understood by the regular user.

It's ok, I'm not one of those people who can only read 140 characters and think even less (and I've been at times "guilty" of lengthier posts myself), the only thing to consider is that the information is relevant to the issue at hand. Regarding your MIN meter, I suggest looking at the measure feeding that meter with data and see if it's correctly written, grabs the correct stuff from the right gadget index in the registry, and provides the correct output to the meter (see the Log and the meter options). It's hard to believe that two instances of those measures + meters don't produce the same result, that's why I suggested simplifying things in a short sample skin with just those measures and meters and see if it happens there too. Personally, I'd bet it won't happen in the simplified version, and that can provide some hints on how to solve the issue in your actual / bigger skin. Mistakes are more difficult to identify in a more complex skin, but become quite obvious in a simpler one.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Youkai1977
Posts: 164
Joined: October 31st, 2018, 4:11 pm
Location: Germany

Re: Variable CPU data but fixed BAR width ... and a 2nd problem

Post by Youkai1977 »

I am already aware that a certain basic knowledge is a prerequisite. At 46, soon to be 47, and having owned my first computer (a C-16) at the age of 8, I think I can do a bit more than just switch a box on and off without an accident.
The problem for me today is rather that I realize that due to various other life circumstances I find the IT world and its development very fast-moving and therefore exhausting.
And then you're actually proud to understand Rainmeter, despite all the barriers and adverse circumstances that come with it for me, and then such a mess comes around the corner that I first have to do the professor, Dr. Dr. Dr. Einstein 2.0 after Summa Cum Laude, to find out how I can now correctly read out the value XY of my CPU and, above all, then implement it accordingly in my skins. This realization has caught me cold the last few days and knocked me off my Rainmeter throne.
So I'll probably have to work on my CPU skin again, if only because I want to make a few more code optimizations. That's always the final touch on a skin when it's otherwise finished and working.

But at the moment I need to take a break from this thing. I've been working on it for over 3 weeks -.-
By and large, as the tests on your systems show, the latest version uploaded here seems to work.
That's why I'm not stressing about it right now.
It's hard to believe that two instances of those measures + meters don't produce the same result, that's why I suggested simplifying things in a short sample skin with just those measures and meters and see if it happens there too.
Yes, if there is no other solution at all, I think I will give it a try.

The crude thing is that the other MIN value meters for V, W and °C work. It's only the CPU-Average Usage MIN-Value value that (on my PC) shows nothing except a permanent 0.00% ... unless I start a 2nd instance of my CPU meter.
Well ... :confused:
- Win11 Pro x64 (23H2 - 22631.3085)
- Rainmeter 4.5.18
- Gigabyte B550i AORUS Pro AX V1.2
- Corsair Venegeance LPX 2x 16GB (32GB) DDR4 3200MHz
- RYZEN 7 5800X
- PowerColor RX570 8GB
- Samsung 980Pro 250GB (NVMe) - Drive C: Windows
- Kingston SNV2S1000G (NVMe) - Drive D: Rainmeter, Skins & Others - Drive D: Games
- NAS Synology DS216j - 2x 1GB HDDs - My Main Backup & Data Storage in my Home-Network
- Mon 1: 24" HP 24f (1920 x 1080 @ 75Hz) - Primary
- Mon 2: 22" Philips 226VL (1920 x 1080 @ 60Hz) - Secondary 1
- Mon 3: 50" Philips 50PUS7304/12 (3840 x 2160 @ 60Hz) - Secondary 2
- Corsair CX 650M Power Supply
- NZXT H210 Case
- ISP Vodafone with 1000/50 Mbit Cable Internet

The absolutly High-End Machine on 2024 ... at least the graphics card :oops: O.O :rofl: