| |
|
|
- Page 1 - |
|
KHR | Hello together,
.
i want a large crowd Meßdaten aufbereiten and then as curve(n) present. The data go a File read and Arrays zwischengelagert
circa heavy flackernde Meßwerte in a übersichtlichen curve present to would like I these over Durchschnittsbildung calm the whole should then in the finished Program for five zahlenreihen weg
yet make I the in something so:
there's 5 arrays with 100 elementen Float-variables , with beginn with 0 filled
One set Meßwerte becomes read, each aray sustain one element registered
for each aray becomes the average determined,
The jeweiligen spots go geplottet
and moreover goes it with the next Datensatz Meßwerte.
Since I yet whom average with while-wend creep errechne, becomes everything infinite slow. self with Profan2cpp lasts it minutes To the screen vollgekritzelt is.
here time one integrally kurzer statement the data How tappt im dunkeln exist. real having The Files often over ten- or quite zwanzigtausend Datensätze (Lines)
25.07.2007;08:22:53;1874;63.3;0.019387;0.023140;0.024151;0.022312;-----;----- 25.07.2007;08:22:54;1871;63.3;0.028538;0.022725;0.025337;0.022793;-----;----- 25.07.2007;08:22:55;1914;63.3;0.024311;0.023610;0.022366;0.022739;-----;----- 25.07.2007;08:22:56;1889;63.3;0.021887;0.023453;0.019952;0.022303;-----;----- 25.07.2007;08:22:57;1895;63.3;0.027712;0.023644;0.021144;0.022193;-----;----- 25.07.2007;08:22:58;1902;63.3;0.023383;0.023765;0.022752;0.022195;-----;----- 25.07.2007;08:22:59;1891;63.3;0.026178;0.023538;0.022319;0.022224;-----;----- 25.07.2007;08:23:00;1912;63.3;0.024255;0.023965;0.021904;0.022195;-----;----- 25.07.2007;08:23:01;1898;63.3;0.021041;0.023673;0.024442;0.022237;-----;----- 25.07.2007;08:23:02;1895;63.3;0.024243;0.023550;0.022202;0.022322;-----;----- 25.07.2007;08:23:03;1919;63.3;0.029875;0.023874;0.022494;0.022521;-----;----- 25.07.2007;08:23:04;1930;63.3;0.027768;0.024126;0.022018;0.022461;-----;----- 25.07.2007;08:23:05;1914;63.3;0.020411;0.023905;0.020469;0.022334;-----;----- 25.07.2007;08:23:06;1915;63.3;0.027465;0.023837;0.023016;0.022474;-----;----- 25.07.2007;08:23:07;1924;63.3;0.020727;0.023959;0.023631;0.022536;-----;----- 25.07.2007;08:23:08;1891;63.3;0.020876;0.023436;0.021933;0.022374;-----;----- 25.07.2007;08:23:09;1867;63.3;0.020627;0.023159;0.020591;0.022087;-----;----- .... the first both Split Date and Time are uninteressant, first thereafter GEHTS correctly. go.
to lauter frustration over my Ideenlosigkeit Have I The recent Codes deleted has there someone ne idea, How so what faster weg could??
be hold unfortunately still no Programmer separate only one Profan-Wurschtler. |
|
|
| Gruß Karl-Heinz WIN XP home/Pro / XPROFAN 11 / P2CPP ATMEL + BASCOM Fan | 06/03/08 ▲ |
|
|
|
|
| |
|
- Page 2 - |
|
Thomas Freier | @Frank, then offering us still Please The story-function of/ one slot (max., mins. and amount having we already). And if possible a function, The The Number of with Values gefüllten Items of/ one slot determined. |
|
|
| Gruß Thomas Windows XP SP2, XProfan X2 | 06/04/08 ▲ |
|
|
|
|
| here the Source to that Image...
contain a function createHPicByStats(data$,xx,yy) and supply one Bildhandle the Statistik back. The Ausgabegrösse can by Pixel xx and yy tuned go. with the function can too to Laufzeit by String such one à ¶ Open produce. in the cover standing The Number of required Millisekunden.
Orginalcode: [...]
without xpse CompileMarkSeparationWINDOW 100,100 - 700,500
CLS $888888
var TME&=&GETTICKCOUNT
var HPIC&=CREATEHPICBYSTATS(FILE_GET_CONTENTS(fme-300-test.txt),600,420)
SETTEXT %HWND,STR$(&GETTICKCOUNT-TME&)+ ms
DRAWPIC HPIC&,10,10;0
USERMESSAGES $0014
WHILE 1
WAITINPUT
ENDWHILE
end
proc CREATEHPICBYSTATS
PARAMETERS S$,XX&,YY&
DECLARE LN$[],HDR$[],ENTI$[]
LN$[]=EXPLODE(S$+
,
)
var C&=SIZEOF(LN$[])
HDR$[]=EXPLODE(LN$[0],;)
var HDRC&=SIZEOF(HDR$[])
var F!=0
var F2!=0
DECLARE VMIN![HDRC&],VMAX![HDRC&],V![HDRC&,C&],VMM![HDRC&],COL&[IF(HDRC&>7,HDRC&,8)],COLB&[HDRC&],OLDF![HDRC&]
MAT VMIN![]=999999999999999
MAT VMAX![]=-999999999999999
DEC HDRC&
DEC C&
COL&[0]=$FF0000
COL&[1]=$00FF00
COL&[2]=$0000FF
COL&[3]=$880000
COL&[4]=$008800
COL&[5]=$000088
COL&[6]=$FF8800
COL&[7]=$00FF88
var CL&=0
WHILE 1
INC CL&
IFNOT CL&<C&
BREAK
ENDIF
ENTI$[]=EXPLODE(LN$[CL&],;)
SETSIZE ENTI$[],HDRC&+1
WHILELOOP 0,HDRC&
F!=VAL(ENTI$[&LOOP])
V![&LOOP,CL&]=F!
IF VMIN![&LOOP]>F!
VMIN![&LOOP]=F!
ENDIF
IF VMAX![&LOOP]<F!
VMAX![&LOOP]=F!
ENDIF
ENDWHILE
ENDWHILE
var I&=0
var A!=0
WHILELOOP 0,HDRC&
VMM![&LOOP]=(VMAX![&LOOP]-VMIN![&LOOP])
A!=V![&LOOP,1]
F!=VMM![&LOOP]
IF F!=0
CONTINUE
ENDIF
F2!=A!-VMIN![&LOOP]
IF F2!=0
CONTINUE
ENDIF
OLDF![&LOOP]=(F2!/F!*YY&)
ENDWHILE
var Y!=0
var HOP!=C&/XX&
var XH!=1
var YYHOP!=YY&*0.1
var X&=0
var HPIC&=CREATE(hNewPic,XX&,YY&,$FFFFFF)
STARTPAINT HPIC&
WHILE 1
INC X&
WHILELOOP 0,HDRC&
F!=VMM![&LOOP]
IFNOT F!=0
F2!=V![&LOOP,XH!]-VMIN![&LOOP]
IFNOT F2!=0
F!=(OLDF![&LOOP]*0.9)+(F2!/F!*YYHOP!)
ELSE
F!=(OLDF![&LOOP]*0.9)
ENDIF
USEPEN 0,0,COL&[&LOOP]
LINE (X&-1),(YY&-OLDF![&LOOP]) - (X&),(YY&-F!)
OLDF![&LOOP]=F!
ENDIF
ENDWHILE
XH!=XH!+HOP!
IF XH!>C&
BREAK
ENDIF
ENDWHILE
ENDPAINT
RETURN HPIC&
endproc
proc FILE_GET_CONTENTS
PARAMETERS FLE$
var B&=FILESIZE(FLE$)
IF B&<1
RETURN
ENDIF
DECLARE MEM#
DIM MEM#,B&
var R&=BLOCKREAD(FLE$,MEM#,0,B&)
var S$=CHAR$(MEM#,0,R&)
DISPOSE MEM#
RETURN S$
endproc
proc FILE_PUT_CONTENTS
PARAMETERS FLE$,S$
var L&=LEN(S$)
IF L&=0
var FH&=ASSIGN(FLE$)
REWRITE FH&
CLOSE FH&
ASSIGN FH&,
RETURN
ENDIF
DECLARE MEM#
DIM MEM#,L&+1
STRING MEM#,0=S$
BLOCKWRITE FLE$,MEM#,0,L&
DISPOSE MEM#
endproc
proc RGB.MIX
PARAMETERS COL1&,COL2&,TRANSL!
RETURN RGB(GETRVALUE(COL1&)*(1-TRANSL!)+GETRVALUE(COL2&)*(TRANSL!),GETGVALUE(COL1&)*(1-TRANSL!)+GETGVALUE(COL2&)*(TRANSL!),GETBVALUE(COL1&)*(1-TRANSL!)+GETBVALUE(COL2&)*(< TRANSL! ))
endproc
end
If I now considerate thats method too slot 1 and column 2 mitberechnet (but here no numbers finds) then could I me present, that with small optimization To this point Perhaps even 4 To 5 instead of 6,8 sec access go can.
@KHR: How long needed the Algo for complete File? |
|
|
| |
|
|
|
| hey typical - on my Notebook with 2,4GHz even only 6.2 sec, instead of as well as my DesktopPC with 3,2 GhZ 6.8 sec. has yet someone NEN 486dx4/100 herumzugammeln? |
|
|
| |
|
|
|
Thomas Freier | One quick zusammengestrickter Test over a doWhile- Loop is neither straight slow (here only for 4 Reihen with story/sec and over a *.dbf) . |
|
|
| Gruß Thomas Windows XP SP2, XProfan X2 | 06/05/08 ▲ |
|
|
|
|
| it sees so from as though You The Skalen not normalisierst - get the still fix installed?
and for a Performancevergleich would it imho necessary any 10 Split To mind. (the power my example too, though it with Date and Time naturally only 0 evaluiert and uses.)
means Skalen normalisieren (x and y) and any Split mind and then: duration abandon for Codeperformancevergleich. |
|
|
| |
|
|
|
Thomas Freier | @iF: from Zeitgründen have I it with 6 Values leave. The Hauptzeit becomes at create the *.dbf verbraten. here would one comparison to that Or list view GridBoxen yet interestingly. The Skalierung, if I tappt im dunkeln correctly. hinbekommen have, cost ca. 300ms with of/ one Endzeit of 3734 ms. On my computer lying both Applications sure on same Höhe, if The further 4 values moreover come. |
|
|
| Gruß Thomas Windows XP SP2, XProfan X2 | 06/05/08 ▲ |
|
|
|
|
| Hm, something is correct not the Normalisierung - The must automatically certainly go for each slot self-contained. in example have You a black Line in the middle, The is sozuagen not the whole Y-spectrum displayed. an Umrechnung to of/ one einstellbaren Ausgabegröße missing there too yet drin. ^^ |
|
|
| |
|
|
|
Thomas Freier | @ iF: The black line is the temperature (in fme-300-Test.txt is max=64.8° - min=63.9°) . with of my Skalierung corresponds to 1° = 13.9 spots. More deflection comes there not out. its Temperaturanzeige goes of 44° To 80°. there helps only a filigranere graphic How with you. was but not my target . |
|
|
| Gruß Thomas Windows XP SP2, XProfan X2 | 06/05/08 ▲ |
|
|
|
|
| I saw strain that I supra whom incorrect code posted having, the was a Vorversion.
The Orginalcode under [...] was/is however the right.
I have whom without xpse-code supra korrigiert - now stimmts with Exe and Screenshot überein.
KHR had it strike must. |
|
|
| |
|
|
| |
|
- Page 3 - |
|
|
KHR | Hello together,
first time many Thanks for Your trouble and sorry, that I toter man speile.
i'm momentarily professional on the way and I through unfavourable circumstances only very begrentzen access to that internet and To my Notebokk, there it dauernd on the equipment one customers depends and keen data mitschreiben must
I login me again, if I again Normalzustand have.
Thank you and nice Regards |
|
|
| Gruß Karl-Heinz WIN XP home/Pro / XPROFAN 11 / P2CPP ATMEL + BASCOM Fan | 06/09/08 ▲ |
|
|
|
|
Thomas Freier | Hmm iF, somehow are The Kurven of showdata2.exe not nachvollziehbar. |
|
|
| Gruß Thomas Windows XP SP2, XProfan X2 | 06/11/08 ▲ |
|
|
|
|
| has your Attachment something with ShowData2.Exe To do? (because me not so shining...)
Concerning not nachvollziehbar - inwiefern?
The of it begot Kurven [...] . |
|
|
| |
|
|