summaryrefslogtreecommitdiff
path: root/valuesunit.pas
diff options
context:
space:
mode:
Diffstat (limited to 'valuesunit.pas')
-rw-r--r--valuesunit.pas25
1 files changed, 25 insertions, 0 deletions
diff --git a/valuesunit.pas b/valuesunit.pas
index a571955..0d0a28e 100644
--- a/valuesunit.pas
+++ b/valuesunit.pas
@@ -25,6 +25,7 @@ type
function count: int64;
function timeInterval: tInt64Point;
procedure intersect(v: tValues);
+ procedure writeCombined(v: tValues; dat: string);
end;
function interpolate(w1,w2: tWert; x: extended): tWert; inline;
@@ -204,6 +205,30 @@ begin
v.intersect(self);
end;
+procedure tValues.writeCombined(v: tValues; dat: string);
+var
+ i: int64;
+ f: textfile;
+begin
+ if timeInterval <> v.timeInterval then
+ raise exception.create('Unequal time intervals - can''t writeCombined.');
+ if count <> v.count then
+ raise exception.create('Unequal number of values - can''t writeCombined.');
+ assignFile(f,dat);
+ rewrite(f);
+ for i:=0 to count-1 do
+ writeln(f,
+ intToStr(werte[i].time)
+ +#9+floatToStr(werte[i].vec['x'])
+ +#9+floatToStr(werte[i].vec['y'])
+ +#9+floatToStr(werte[i].vec['z'])
+ +#9+floatToStr(v.werte[i].vec['x'])
+ +#9+floatToStr(v.werte[i].vec['y'])
+ +#9+floatToStr(v.werte[i].vec['z'])
+ );
+ closefile(f);
+end;
+
// general functions ***********************************************************
function interpolate(w1,w2: tWert; x: extended): tWert; inline;