Icon that indicates a drive read or write operation?

For discussions about security.
Message
Author
Jasper

#21 Post by Jasper »

Hi Karl.

Thank you very much for your update; but (because of my defencies) I do not understand if you regard it as essential, as opposed to desirable.

Your new download shows numeric usage, but nothing shows in my graph (using Precise 5.6) whereas it does with your previous download which seemed perfect.

My regards and thanks

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#22 Post by Karl Godt »

Hi Jasper ! It's because of the Puppy Philosophy to try to strip down as much as possible !

Likely

the first had a 10MB graph
xosview*diskBandwidth: 10000000 ! 10MB/s should be reasonable today for
and this one a 100MB graph
xosview*diskBandwidth: 100000000 ! 100MB/s

so tiny transfers of 4MB/s to slow SD cards would not show as graph .

Should show for huge transfers from HDD to HDD then .

Regards .

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#23 Post by Karl Godt »

HACK - Bletchley Park I'm comming !

Code: Select all

void MeterMaker::makeMeters(void){
  if (_xos->isResourceTrue("disk100"))
      push(new DiskMeter(_xos, "100M/s", atof(_xos->getResource("diskBandwidth100"))));
  if (_xos->isResourceTrue("disk10"))
      push(new DiskMeter(_xos, " 10M/s", atof(_xos->getResource("diskBandwidth10"))));
  if (_xos->isResourceTrue("disk2"))
      push(new DiskMeter(_xos, "  2M/s", atof(_xos->getResource("diskBandwidth2"))));
}

Code: Select all

   public:
        DiskMeter( XOSView *parent, const char *label, float max );
        ~DiskMeter( void );

Code: Select all

DiskMeter::DiskMeter( XOSView *parent, const char *label, float max ) : FieldMeterGraph(
  parent, 3, label, "READ/WRITE/IDLE"), _vmstat(false),
  _statFileName("/proc/stat")

Code: Select all

#endif
#if !defined(__hpux__) && !defined(__hpux)
//  Disk Meter Options
{ "-disk2", "*disk2", XrmoptionNoArg, "False" },
{ "+disk2", "*disk2", XrmoptionNoArg, "True" },
{ "-disk10", "*disk10", XrmoptionNoArg, "False" },
{ "+disk10", "*disk10", XrmoptionNoArg, "True" },
{ "-disk100", "*disk100", XrmoptionNoArg, "False" },
{ "+disk100", "*disk100", XrmoptionNoArg, "True" },
#endif
#ifdef ALLEVERYTHING

Code: Select all

void XOSView::figureSize ( void ) {
  if ( legend_ ){
    if ( !usedlabels_ )
      xoff_ = textWidth( "XXXXXXX" );
    else
      xoff_ = textWidth( "XXXXXXXXXXX" );

Code: Select all

    int offset;
    if ( dousedlegends_ )
      offset = parent_->textWidth( "XXXXXXXXXXX" );
    else
      offset = parent_->textWidth( "XXXXXXX" );
compiled on Puppy 4.3 glibc-2.6.1 as the first one .
To disable one of the meters : xosview -disk100 | -disk10 | -disk2
Attachments
xosview3diskmeters.jpg
(10.79 KiB) Downloaded 313 times
xosview-1.14_diskmeter2_10_100.bz2
(30.18 KiB) Downloaded 294 times

Jasper

#24 Post by Jasper »

Hi again Karl,

Bletchley Park is near to my home and yet so far away - I'm glad you were able to disclose your secret code - personally, I would never have been able to decode a single word of your message - so now I really appreciate both your code and your explanation.

My regards and special thanks

Also - greetings and thanks to SFR, another ace coder, for his contribution here.

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#25 Post by Karl Godt »

Hi Jasper !

In 2010 when I started to fiddle around with xosview , I was not able to get more than four letters to work in the label part . Now I figured out that the part
that I altered that time in xosview.cc occurs several times in different files :
bitfieldmeter.cc
bitmeter.cc
fieldmeter.cc

Code: Select all

int offset;
    if ( dousedlegends_ )
      offset = parent_->textWidth( "XXXXXXXXXXX" );
    else
      offset = parent_->textWidth( "XXXXXXX" );
where the "XXXXX*" strings apparently indicate each X for a letter minus one X for linefeed or whatever (\0) .
I have left the four letters for the
void BitFieldMeter::drawused( int manditory ){
-function in bitfieldmeter.cc and fieldmeter.cc :
static const int onechar = parent_->textWidth( "X" );
static int xoffset = parent_->textWidth( "XXXXX" );

as is .
Here is some crytic explanation further down the file in the autoscale part :
/* For now, we can only print 3 characters, plus the optional
* suffix, without overprinting the legends. Thus, we can
* print 965, or we can print 34, but we can't print 34.7 (the
* decimal point takes up one character). bgrayson */


( That gbrew in my brain : proud : )

Added the const char *label, to linux/diskmeter.cc and linux/diskmeter.h , which I looked up in lmstemp.cc , since I knew it is possible tho change the label for it in Xdefaults .

:oops: Forgot to present Xdefaults :

Code: Select all

 ! Disk Meter Resources
xosview*diskUsedColor:      yellow
xosview*diskIdleColor:      LightGreen
xosview*diskWriteColor:     DarkRed
xosview*diskReadColor:      orange2
xosview*diskPriority:       10
xosview*diskDecay:          True
xosview*diskUsedFormat:     autoscale
xosview*diskGraph:          True

xosview*disk100:            True
xosview*diskBandwidth100:   100000000 ! 100MB/s
xosview*disk10:             True
xosview*diskBandwidth10:    10000000 ! 10MB/s
xosview*disk2:              True
xosview*diskBandwidth2:     2000000 ! 2MB/s
I have chosen 2M for the USB1.1 specification .
In version 1.8.3 xosview*diskBandwidth was set to 10MB/s by default, now they increased it to 100MB/s , which I did not check before . But since you wanted it for USB mainly :oops:
But it is difficult to http://en.wikipedia.org/wiki/Trust,_but_verify which we know it as Faith is good, control is better ( http://de.wikipedia.org/wiki/Vertrauen_ ... ist_besser![/url] -the ! seems to choke the BBcode [url] tag )

And in the Xrmcommandline.h there I disabled the possibility to fiddle with other meters now by wrapping them into the unset
#ifdef ALLEVERYTHING variable .

Todo would be to implement an option for +disk like
+disk DISKBANDWITH
, so that no hardcoded diskbandwithes in the configuration files needed .
-network maxbandwidth seems to have that already .

Hope that explains it a little .

Post Reply