No subject


Fri Jul 2 11:13:49 CEST 2010


read data file with a formatted timestamp, from Nicolas it might be a
feature for the future.

I have tried to change the comment indicator to remove /.
I'm however afraid that this did not solve the problem. When I load the
file, I still get a vector with all 2010's. It does solve the interpretation
of the next columns (actual values).

I have made an example to show what I see.
The file temp_rt_plot_file_0.txt contains the data set:
*2010/06/24 09:54:32.761 32.84130859375000 32.21429443359375 *
*2010/06/24 09:54:33.763 35.84130859375000 31.90078735351562 *
*2010/06/24 09:54:34.762 37.84130859375000 32.21429443359375 *
*2010/06/24 09:54:35.762 39.84130859375000 31.90078735351562 *
*2010/06/24 09:54:36.761 31.84130859375000 31.90078735351562 *
*2010/06/24 09:54:37.760 33.84130859375000 31.58731079101562 *
*2010/06/24 09:54:37.768 34.84130859375000 31.58731079101562 *

The file tst_tmpp_kst_script.js contains a very simple version of the java
script I use.
*// grab the window*
*var w = Kst.windows[0];*
*
*
*// add a plot to the window*
*var p = new Plot(w);*
*
*
*// create new (editable) vectors.*
*// these could also be loaded from files.*
*//var v1 = new Vector(); var v2 = new Vector(); var v3 = new Vector();*
*
*
*var s = new DataSource("temp_rt_plot_file_0.txt");//specify a data source
file system. See the DataSource Class for details*
*
*
*s.setConfiguration("commentindicators","#")*
*
*
*v1 = new DataVector(s,"1");//construct a new vector v and set its value
from field 1 of the source file*
*v1.tagName = "vector1"; //give the vector a name in the Data Manager*
*
*
*v2 = new DataVector(s,"2");//construct a new vector v and set its value
from field 1 of the source file*
*v2.tagName = "vector2"; //give the vector a name in the Data Manager*
*
*
*v3 = new DataVector(s,"3");//construct a new vector v and set its value
from field 1 of the source file*
*v3.tagName = "vector3"; //give the vector a name in the Data Manager*
*
*
*c = new Curve(v3,v2); // to construct a new curve using xv and yv*
*c.tagName = "v3 vs v2"; //define the name for the curve in the data manager
*
*
*
*// using the append method in the CurveCollection Class to show the curve
in plot*
*p.curves.append(c);*
*
*
*// label the x-axis of our plot*
*p.xAxis.label = "Time (s)";*
*
*
*p.xAxis.interpretation.input = 0;*
*p.xAxis.interpretation.output = 0; //  the ?time? vector needs to be shown
in*
*//the format: DD/MM/YY HH:MM:SS.*
*p.xAxis.interpretation.active = true; //Active the interpretation*

If I load the javascript, then I can see 3 data vectors as expected. The
first one contains all 0's, the second all 9's, the third contains the
correct values.

What I would want is to have only 2 data vectors, the date and time in 1,
the data in 2. Does anyone know how I can achieve this?

All help is most welcome!

Thank you,

Stijn

--000e0cd29f20d766da048a65c575
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<span class=3D"Apple-style-span" style=3D"font-family: arial, sans-serif; f=
ont-size: 13px; border-collapse: collapse; ">Hi all,<div><br></div><div>Tha=
nk you for the replies.</div><div>From the answer from Andrew I understand =
that it is perfectly possible to read data file with a formatted timestamp,=
 from Nicolas it might be a feature for the future.</div>
<div><br></div><div>I have tried to change the comment indicator to remove =
/.</div><div>I&#39;m however afraid that this did not solve the problem. Wh=
en I load the file, I still get a vector with all 2010&#39;s. It does solve=
 the interpretation of the next columns (actual values).</div>
<div><br></div><div>I have made an example to show what I see.</div><div>Th=
e file=A0temp_rt_plot_file_0.txt contains the data set:</div><div><div><i>2=
010/06/24 09:54:32.761 32.84130859375000 32.21429443359375=A0</i></div><div=
>
<i>2010/06/24 09:54:33.763 35.84130859375000 31.90078735351562=A0</i></div>=
<div><i>2010/06/24 09:54:34.762 37.84130859375000 32.21429443359375=A0</i><=
/div><div><i>2010/06/24 09:54:35.762 39.84130859375000 31.90078735351562=A0=
</i></div>
<div><i>2010/06/24 09:54:36.761 31.84130859375000 31.90078735351562=A0</i><=
/div><div><i>2010/06/24 09:54:37.760 33.84130859375000 31.58731079101562=A0=
</i></div><div><i>2010/06/24 09:54:37.768 34.84130859375000 31.587310791015=
62=A0</i></div>
</div><div><br></div><div>The file=A0tst_tmpp_kst_script.js contains a very=
 simple version of the java script I use.=A0</div><div><div><i>// grab the =
window</i></div><div><i>var w =3D Kst.windows[0];</i></div><div><i><br></i>=
</div>
<div><i>// add a plot to the window</i></div><div><i>var p =3D new Plot(w);=
</i></div><div><i><br></i></div><div><i>// create new (editable) vectors.</=
i></div><div><i>// these could also be loaded from files.</i></div><div><i>=
//var v1 =3D new Vector(); var v2 =3D new Vector(); var v3 =3D new Vector()=
;</i></div>
<div><i><br></i></div><div><i>var s =3D new DataSource(&quot;temp_rt_plot_f=
ile_0.txt&quot;);//specify a data source file system. See the DataSource Cl=
ass for details</i></div><div><i><br></i></div><div><i>s.setConfiguration(&=
quot;commentindicators&quot;,&quot;#&quot;)</i></div>
<div><i><br></i></div><div><i>v1 =3D new DataVector(s,&quot;1&quot;);//cons=
truct a new vector v and set its value from field 1 of the source file</i><=
/div><div><i>v1.tagName =3D &quot;vector1&quot;; //give the vector a name i=
n the Data Manager</i></div>
<div><i><br></i></div><div><i>v2 =3D new DataVector(s,&quot;2&quot;);//cons=
truct a new vector v and set its value from field 1 of the source file</i><=
/div><div><i>v2.tagName =3D &quot;vector2&quot;; //give the vector a name i=
n the Data Manager</i></div>
<div><i><br></i></div><div><i>v3 =3D new DataVector(s,&quot;3&quot;);//cons=
truct a new vector v and set its value from field 1 of the source file</i><=
/div><div><i>v3.tagName =3D &quot;vector3&quot;; //give the vector a name i=
n the Data Manager</i></div>
<div><i><br></i></div><div><i>c =3D new Curve(v3,v2); // to construct a new=
 curve using xv and yv</i></div><div><i>c.tagName =3D &quot;v3 vs v2&quot;;=
 //define the name for the curve in the data manager</i></div><div><i><br><=
/i></div>
<div><i>// using the append method in the CurveCollection Class to show the=
 curve in plot</i></div><div><i>p.curves.append(c);</i></div><div><i><br></=
i></div><div><i>// label the x-axis of our plot</i></div><div><i>p.xAxis.la=
bel =3D &quot;Time (s)&quot;;</i></div>
<div><i><br></i></div><div><i>p.xAxis.interpretation.input =3D 0;</i></div>=
<div><i>p.xAxis.interpretation.output =3D 0; // =A0the ?time? vector needs =
to be shown in</i></div><div><i>//the format: DD/MM/YY HH:MM:SS.</i></div><=
div>
<i>p.xAxis.interpretation.active =3D true; //Active the interpretation</i><=
/div></div><div><br></div><div>If I load the javascript, then I can see 3 d=
ata vectors as expected. The first one contains all 0&#39;s, the second all=
 9&#39;s, the third contains the correct values.</div>
<div><br></div><div>What I would want is to have only 2 data vectors, the d=
ate and time in 1, the data in 2. Does anyone know how I can achieve this?<=
/div><div><br></div><div>All help is most welcome!</div><div><br></div>
<div>Thank you,</div><div><br></div><div>Stijn</div></span>

--000e0cd29f20d766da048a65c575--


More information about the Kst mailing list