XWidgetSoft Forum

XWidget & XLaunchpad , Desktop customization
It is currently May 8th, 2025, 8:59 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: April 29th, 2013, 7:35 pm 
Offline
User avatar

Joined: March 22nd, 2013, 3:49 am
Posts: 154
Hello,

can I please request to implement the following feature into one of the next versions of xwidget?

There is a little program called HDD LED (444 KB) ▶ click. It shows a little rectangular box for each storage device (SSD, HDD, USB Key, etc) attached to the PC. Everytime the device is reading, the color changes to (for example) green and when it's writing, it becomes red. It would be awesome, if future xwidgets could have this feature.

By the way, there is also a Windows Standard Gadget existing, that shows Disk Activity ▶ click.

Thank you!
Image


Top
 Profile  
 
PostPosted: May 24th, 2013, 7:07 am 
Offline

Joined: May 23rd, 2013, 11:17 pm
Posts: 5
I used to do this using the so-called "Performance Monitor" under Samurize, and still am trying to figure it out how I can do this with XWidgets. Performance Monitor meters are very powerful and give you not only this information, but a lot more too. To monitor disk activity, you could use "\PhysicalDisk(_Total)\% Disk Time", or "\PhysicalDisk(1 C:)\% Disk Time" for only first HDD, or "\Paging File(*)\% Usage" for total swap file usage, etc.

If I may suggest a new feature to the developers, then it would be definitely the general-purpose "PerfMon counters".


Top
 Profile  
 
PostPosted: May 25th, 2013, 2:35 am 
Offline

Joined: May 23rd, 2013, 11:17 pm
Posts: 5
Not knowing Chinese made things a bit hard but I figured it out :D At least how to show a histogram (aka chart) of disk activity.

Put a new timer core into your widget and set it to update every sec. Then a chart control. The JS code will query WMI to get the disk activity and add the value to the chart. In my case it's a percentage (0-100) where 100% would mean the hard disk is spending 100% of its time with read or write, doesn't matter which. Of course you can convert it to a LED or a progress bar, include other drives (instance names are machine-specific but you can use where name="_Total" for all), set up alerts (e.g. if activity > 50 do something), etc. Unfortunately I don't know any easy-to-use WMI tool for experimentation. I used BGInfo and Samurize's own WMI explorers.

Code:
var wmi = GetObject("winmgmts:{impersonationLevel=impersonate}!\\\\.\\root\\cimv2");
function timercore1OnUpdate(Sender)
{
  var perc_val = new Enumerator(wmi.ExecQuery("SELECT PercentDiskTime FROM Win32_PerfFormattedData_PerfDisk_PhysicalDisk where Name = '1 C: D:'"));
  metDiskActivity.add(perc_val.item().PercentDiskTime);
}


Check out the attached file.
Attachment:
File comment: sample_widget
cyxw_-_copy.XWidgetPkg [2.33 KiB]
Downloaded 381 times


Top
 Profile  
 
PostPosted: May 25th, 2013, 2:48 am 
Offline
User avatar

Joined: March 22nd, 2013, 3:49 am
Posts: 154
Hello cyxw,

I just downloaded your sample widget:

Image

This is like thin hair and I fail to see any changes.
Could you possibly make it more visible please?

Thanks
Image


Top
 Profile  
 
PostPosted: May 25th, 2013, 3:41 am 
Offline

Joined: May 23rd, 2013, 11:17 pm
Posts: 5
Well I wasn't trying to supply a fully usable widget and I'm definitely not a good graphics designer :D So it was more like a template for your experimentation, but maybe later I can publish a widget like you want. Nevertheless, try replacing the '1 C: D:' with the '_Total' in the source code. Then start simply a file search, zipping whole C: drive or something to produce some disk load, then it should show some activity.

This is what I see in my config (work in progress, with many layers). Note the red chart in background is the disk activity; dark blue in foreground is CPU and upper vertical bar is the free memory with some tiny little fonts for net traffic and IP.


Attachments:
20130525-133246.png
20130525-133246.png [ 1.28 KiB | Viewed 5720 times ]
Top
 Profile  
 
PostPosted: May 25th, 2013, 3:48 am 
Offline
User avatar

Joined: March 22nd, 2013, 3:49 am
Posts: 154
Ah, now I see.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 56 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB® Forum Software © phpBB Group