View Single Post
No!No!No!Yes!'s Avatar
Posts: 700 | Thanked: 846 times | Joined on Nov 2009
#105
This is in very early stages of development so it doesn't deserve its proper thread...
It's just a proof of concept for handling persistency of configuration data across multiple command executions... Furthermore PR1.2 is supposed to bring changes to counters position so... let's wait a little bit more for final version.

Customize Queen BeeCon Widget (>=v0.1.4) to display:
GPRS Compact Data Monitor

The Beecon will show plenty of Data Plan information and statistics, plus changes background according to data plan capacity consumption.






Code:
[queen-beecon-header]
version=1,000000
checksum=5739874
[queen-beecon-exported-instance]
widgetType=0
operationalStatus=0
hideCanvas=true
snippetBgRGB=0
beecon_lt0_ImgZoom=0
beecon_lt0_BgRGB=2
beecon_lt0_ImgFilename=queen-beecon-syserr.png
beecon_eq0_ImgZoom=0
beecon_eq0_BgRGB=3
beecon_eq0_ImgFilename=gprsmon-green.png
beecon_eq1_ImgZoom=0
beecon_eq1_BgRGB=4
beecon_eq1_ImgFilename=gprsmon-yellow.png
beecon_ge2_ImgZoom=0
beecon_ge2_BgRGB=5
beecon_ge2_ImgFilename=gprsmon-red.png
beecon_idxge2_ImgZoom=0
beecon_idxge2_BgRGB=11
beecon_idxge2_ImgFilename=queen-beecon-index.png
widWidth=175
widHeight=110
instanceTitle=Gprs Compact Data Monitor
instanceCmd=SD=20100414;RP=2M;U=0;D=0;T=600;red=95;yellow=90;echo `gconftool-2 --get /system/osso/connectivity/network_type/GPRS/gprs_reset_time` `gconftool-2 --get /system/osso/connectivity/network_type/GPRS/gprs_tx_bytes` `gconftool-2 --get /system/osso/connectivity/network_type/GPRS/gprs_rx_bytes` | awk -v r=$red -v y=$yellow -v U=$U -v D=$D -v T=$T -v SD=$SD -v RP=$RP -v N=$(date -d "`echo $SD | cut -c 5-6` `echo $SD | cut -c 7-8` `echo $SD | cut -c 1-4`" +%s) -v CD=`date "+%Y%m%d"` '{x=0;M=1048576;SDd=substr(SD,7,2);SDm=substr(SD,5,2);SDy=substr(SD,1,4);i=substr(RP,1,length(RP)-1);u=$2/M;if(U>0)Uu=($2/M)/U*100;d=$3/M;if(D>0)Dd=($3/M)/D*100;t=($2+$3)/M;if(T>0)Tt=($2+$3)/M/T*100;Xm=nXm(SDd,SDm,SDy,i,RP,N);LR=strftime("%Y%m%d@%H%M",$1);if(Uu>=y||Dd>=y||Tt>=y)x++;if(Uu>=r||Dd>=r||Tt>=r)x++;if(x>2)x=2;printf("SD:%s RP:%3s\\nNR:%s\\nU%4dM(%4dM-%3d%%)\\nD%4dM(%4dM-%3d%%)\\nT%4dM(%4dM-%3d%%)\\nLR:%s\\n",SD,RP,Xm,u,U,Uu,d,D,Dd,t,T,Tt,LR);exit x;}function Dy(d,m,y){m=(m+9)%12;y=int(y-m/10);return 365*y+y/4-y/100+y/400+(m*306+5)/10+(d-1);}function nXm(d,m,y,i,RP,N){split("31,28,31,30,31,30,31,31,30,31,30,31",dm,",");CDd=substr(CD,7,2);CDm=substr(CD,5,2);CDy=substr(CD,1,4);if(index(RP,"D")>0){s=strftime("%Y%m%d",N+86400*(i-1));od=substr(s,7,2);om=substr(s,5,2);oy=substr(s,1,4);} else {om=(m+i)%12;oy=y+int((m+i)/12);od=d;while(od>dm[om])od--;if (((oy%4==0&&oy%100!=0)||(oy%400==0))&&om==2&&d>28)then od++;}return sprintf("%4d%02d%02d D:%4d",oy,om,od,-1*int(Dy(od,om,oy)-Dy(CDd,CDm,CDy)));}'
cmdImgFilename=gprsmon.png
cmdImgZoom=0
cmdFgRGB=1
cmdVisibilityPosition=0
cmdImgVisibilityPosition=5
cmdJustify=0
cmdFontName=3
cmdFontSize=12
resImgFilename=queen-beecon-resimg.png
resImgZoom=0
resFgRGB=0
resVisibilityPosition=5
resImgVisibilityPosition=5
resJustify=0
resFontName=14
resFontSize=11
updOnStartup=false
updOnClick=true
updOnDesktop=false
delayIndex=4
updNeworkPolicy=0
Change specific parameters (explained inside the image above) at the very beginning of the command line...
Attached Files
File Type: zip gprsmon-images.zip (29.4 KB, 139 views)
__________________
Have a look at Queen BeeCon Widget (WIKI) Customizable and flexible widget-based multi-instance monitoring, alerting and interactive tool for the N900
Please provide comments and feedback for having QBW supported and enhanced further - (DONATE) - v1.3.3devel / v1.3.3testing / v1.3.3extras

Last edited by No!No!No!Yes!; 2010-05-05 at 20:30.
 

The Following 4 Users Say Thank You to No!No!No!Yes! For This Useful Post: