HSPポータル
サイトマップ お問い合わせ


HSPTV!掲示板


未解決 解決 停止 削除要請

2011
0326
panda東電-電力使用量 表示機1解決


panda

リンク

2011/3/26(Sat) 11:56:41|NO.37892

東京電力がCSVを公開しましたね。
http://t.co/wgHS1D4

腕に自信のある方は利用ソフトを作って東電に知らせてみてはいかがでしょうか。
私は全く自信がないので応募しませんが…。(弱腰) 一応取得までは書いてみました。



#include "hspda.as" #module inet #uselib "wininet" #cfunc _IO "InternetOpenA" int,int,int,int,int #cfunc _IOUrl "InternetOpenUrlA" int,str,int,int,int,int #func _IQDA "InternetQueryDataAvailable" int,int,int,int #func _IRF "InternetReadFile" int,var,int,var #func _ICH "InternetCloseHandle" int #defcfunc load str URL hSes = _IO(0,0,0,0,0) : abSz=0 if(hSes){ hSrv = _IOUrl(hSes,URL, 0, 0,0x80000000, 0) if(hSrv){ _IQDA hSrv,varptr(abSz),0,0 : sdim buf, abSz + 1 repeat:_IRF hSrv,buf,abSz,d:if stat:break:else:memset buf, 0, abSz:await 0:loop _ICH hSrv}_ICH hSes} return buf #global screen 0,136*2,30 sdim data,1024*5:sdim res,1024*5:d="" repeat data = load("http://www.tepco.co.jp/forecast/html/images/juyo-j.csv") notesel data:repeat notemax noteget tmp,cnt:split tmp,",",c1 ps="ピーク時供給力(万kW)" if(c1=ps){noteget tmp,cnt+1:split tmp,",",peak:peak=int(peak):break}:loop csvsel data:csvres res:csvfind ""+gettime(0)+"/"+gettime(1)+"/"+gettime(3) noteget last,0:notesel res : repeat notemax-1,1 : noteget tmp,cnt split tmp,",",d,d,tday:if(int(tday)=0):noteget tmp,cnt-1:new=cnt:break:else:loop split tmp,",",date,time,tday,yday:tday=double(tday):peak=double(peak):i=tday/peak prc=int(i*100):i=int(136.0*i):boxf 0,0,136,30:x=0:y=0:redraw 0 repeat i,55:hsvcolor 191-cnt,255,255:repeat 30:boxf x,y,x+1,y:y++:loop:y=0:x++:loop syscolor 8:pos 148,7:mes ""+int(tday)+"/"+int(peak)+"("+prc+"%)":redraw 1 repeat 10;更新間隔(5分) if(cnt\4=0):title "電気供給量(万kW)" if(cnt\4=1):title ""+(new-2)+":00 現在" if(cnt\4=2):title strmid(last,9,strlen(last)-9) if(cnt\4=3):title "前日:"+yday+"("+int(tday-yday)+")" wait 750 loop:loop



この記事に返信する


who

リンク

2011/3/27(Sun) 14:26:27|NO.37913

更新したとき表示がおかしくなります。



ONION software Copyright 1997-2023(c) All rights reserved.