summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2014-09-24 13:39:31 +0200
committerErich Eckner <git@eckner.net>2014-09-24 13:39:31 +0200
commitdf39e91c2ceba6bc3595e9b718bf513599e6fab7 (patch)
tree833906a8bc0503ab41189b630d674b40330fbd4e
parentb6bfd64c48c34334c58be8db33a0f8a4626a4d27 (diff)
downloadROM-df39e91c2ceba6bc3595e9b718bf513599e6fab7.tar.xz
shell-environment-Variablen (abrufbar über ${Name})
einfache Vergleiche als Schalter (? a = b : Befehl)
-rw-r--r--ROM.lpr45
-rw-r--r--ROM.lps98
-rw-r--r--romunit.pas14
3 files changed, 88 insertions, 69 deletions
diff --git a/ROM.lpr b/ROM.lpr
index 1249b26..98ead8c 100644
--- a/ROM.lpr
+++ b/ROM.lpr
@@ -12,12 +12,12 @@ uses
{ you can add units after this },
SysUtils,ROMunit, mathunit, Math;
-var inPulsO,inPuls,refPulsO,refPuls,surTraj,cRefPuls: tExtPointArray;
- smooth,betaSmooth: longint;
- tmax,wmax,absShift,betaBound: extended;
- force,fourier: boolean;
- f: textfile;
- s,lpicIn,rohIn,rohRef,outIn,outRef,outRefC,outSur: string;
+var inPulsO,inPuls,refPulsO,refPuls,surTraj,cRefPuls: tExtPointArray;
+ smooth,betaSmooth: longint;
+ tmax,wmax,absShift,betaBound: extended;
+ force,fourier: boolean;
+ f: textfile;
+ s,t,u,lpicIn,rohIn,rohRef,outIn,outRef,outRefC,outSur: string;
//const Verwendung='Verwendung: ROM ($Einfallspuls_Datei $Ausfallspuls_Datei)/(- $trace-Datei-Prefix) $output_inPuls $output_refPuls $output_Trajektorie $output_cRefPuls '+
// '[-s/--smooth $n] [-f/--force] [-t/--tmax $t] [-w/--wmax $w] [-F/--FFT] [-d/--dt $dt]';
@@ -47,10 +47,22 @@ begin
reset(f);
while not eof(f) do begin
readln(f,s);
+ s:=shellSubst(s);
if pos('#',s)>0 then
delete(s,pos('#',s),length(s));
s:=trim(s);
if s='' then continue;
+ if pos('?',s)=1 then begin
+ delete(s,1,1);
+ t:=trim(leftStr(s,pos('=',s)-1));
+ delete(s,1,pos('=',s));
+ u:=trim(leftStr(s,pos(':',s)-1));
+ delete(s,1,pos(':',s));
+ s:=trim(s);
+ if t<>u then
+ continue;
+ end;
+
if s='mit Gewalt' then begin
force:=true;
continue;
@@ -113,44 +125,37 @@ begin
end;
if pos('lpic-Quelle:',s)=1 then begin
delete(s,1,pos(':',s));
- s:=trim(s);
- lpicIn:=s;
+ lpicIn:=trim(s);
continue;
end;
if pos('in-Quelle:',s)=1 then begin
delete(s,1,pos(':',s));
- s:=trim(s);
- rohIn:=s;
+ rohIn:=trim(s);
continue;
end;
if pos('reflex-Quelle:',s)=1 then begin
delete(s,1,pos(':',s));
- s:=trim(s);
- rohRef:=s;
+ rohRef:=trim(s);
continue;
end;
if pos('in-Ziel:',s)=1 then begin
delete(s,1,pos(':',s));
- s:=trim(s);
- outIn:=s;
+ outIn:=trim(s);
continue;
end;
if pos('reflex-Ziel:',s)=1 then begin
delete(s,1,pos(':',s));
- s:=trim(s);
- outRef:=s;
+ outRef:=trim(s);
continue;
end;
if pos('reflex-Approx-Ziel:',s)=1 then begin
delete(s,1,pos(':',s));
- s:=trim(s);
- outRefC:=s;
+ outRefC:=trim(s);
continue;
end;
if pos('trajektorie-Ziel:',s)=1 then begin
delete(s,1,pos(':',s));
- s:=trim(s);
- outSur:=s;
+ outSur:=trim(s);
continue;
end;
Fehler('Unbekannter Parameter '''+s+''' in Inputdatei '''+paramstr(1)+'''!');
diff --git a/ROM.lps b/ROM.lps
index 089957b..6c4702e 100644
--- a/ROM.lps
+++ b/ROM.lps
@@ -11,8 +11,8 @@
<IsVisibleTab Value="True"/>
<EditorIndex Value="0"/>
<WindowIndex Value="0"/>
- <TopLine Value="73"/>
- <CursorPos X="28" Y="77"/>
+ <TopLine Value="36"/>
+ <CursorPos X="25" Y="59"/>
<UsageCount Value="94"/>
<Loaded Value="True"/>
</Unit0>
@@ -22,9 +22,9 @@
<UnitName Value="romunit"/>
<EditorIndex Value="1"/>
<WindowIndex Value="0"/>
- <TopLine Value="628"/>
- <CursorPos X="133" Y="1005"/>
- <FoldState Value=" T3iC041 pkRkZ0Y2]9clZ093 piXj70G]Rj3jN0w6]9UlG0S[I4Ck10P116k"/>
+ <TopLine Value="689"/>
+ <CursorPos X="1" Y="1019"/>
+ <FoldState Value=" T3iD041 pkRkZ0Y2]9clZ093 piXj70G]Rj3jN0w6]9UlG0S[I4Ck10P7]aejg]+l"/>
<UsageCount Value="94"/>
<Loaded Value="True"/>
</Unit1>
@@ -34,7 +34,7 @@
<UnitName Value="mathunit"/>
<EditorIndex Value="2"/>
<WindowIndex Value="0"/>
- <TopLine Value="3"/>
+ <TopLine Value="4"/>
<CursorPos X="1" Y="43"/>
<UsageCount Value="93"/>
<Loaded Value="True"/>
@@ -46,123 +46,123 @@
<JumpHistory Count="30" HistoryIndex="29">
<Position1>
<Filename Value="romunit.pas"/>
- <Caret Line="724" Column="24" TopLine="688"/>
+ <Caret Line="1001" Column="69" TopLine="946"/>
</Position1>
<Position2>
<Filename Value="romunit.pas"/>
- <Caret Line="33" Column="1" TopLine="22"/>
+ <Caret Line="987" Column="11" TopLine="947"/>
</Position2>
<Position3>
<Filename Value="romunit.pas"/>
- <Caret Line="1099" Column="1" TopLine="1057"/>
+ <Caret Line="32" Column="33" TopLine="22"/>
</Position3>
<Position4>
<Filename Value="romunit.pas"/>
- <Caret Line="1001" Column="69" TopLine="946"/>
+ <Caret Line="992" Column="42" TopLine="947"/>
</Position4>
<Position5>
<Filename Value="romunit.pas"/>
- <Caret Line="987" Column="11" TopLine="947"/>
+ <Caret Line="1003" Column="53" TopLine="973"/>
</Position5>
<Position6>
<Filename Value="romunit.pas"/>
- <Caret Line="32" Column="33" TopLine="22"/>
+ <Caret Line="1001" Column="79" TopLine="719"/>
</Position6>
<Position7>
- <Filename Value="romunit.pas"/>
- <Caret Line="992" Column="42" TopLine="947"/>
+ <Filename Value="ROM.lpr"/>
+ <Caret Line="20" Column="55" TopLine="10"/>
</Position7>
<Position8>
- <Filename Value="romunit.pas"/>
- <Caret Line="1003" Column="53" TopLine="973"/>
+ <Filename Value="ROM.lpr"/>
+ <Caret Line="24" Column="52" TopLine="5"/>
</Position8>
<Position9>
- <Filename Value="romunit.pas"/>
- <Caret Line="1001" Column="79" TopLine="719"/>
+ <Filename Value="ROM.lpr"/>
+ <Caret Line="20" Column="24" TopLine="12"/>
</Position9>
<Position10>
<Filename Value="ROM.lpr"/>
- <Caret Line="20" Column="55" TopLine="10"/>
+ <Caret Line="38" Column="14" TopLine="24"/>
</Position10>
<Position11>
<Filename Value="ROM.lpr"/>
- <Caret Line="24" Column="52" TopLine="5"/>
+ <Caret Line="163" Column="40" TopLine="121"/>
</Position11>
<Position12>
<Filename Value="ROM.lpr"/>
- <Caret Line="20" Column="24" TopLine="12"/>
+ <Caret Line="206" Column="1" TopLine="191"/>
</Position12>
<Position13>
<Filename Value="ROM.lpr"/>
- <Caret Line="38" Column="14" TopLine="24"/>
+ <Caret Line="20" Column="56" TopLine="1"/>
</Position13>
<Position14>
<Filename Value="ROM.lpr"/>
- <Caret Line="163" Column="40" TopLine="121"/>
+ <Caret Line="196" Column="45" TopLine="175"/>
</Position14>
<Position15>
<Filename Value="ROM.lpr"/>
- <Caret Line="206" Column="1" TopLine="191"/>
+ <Caret Line="199" Column="15" TopLine="178"/>
</Position15>
<Position16>
<Filename Value="ROM.lpr"/>
- <Caret Line="20" Column="56" TopLine="1"/>
+ <Caret Line="201" Column="15" TopLine="180"/>
</Position16>
<Position17>
<Filename Value="ROM.lpr"/>
- <Caret Line="196" Column="45" TopLine="175"/>
+ <Caret Line="203" Column="34" TopLine="182"/>
</Position17>
<Position18>
<Filename Value="ROM.lpr"/>
- <Caret Line="199" Column="15" TopLine="178"/>
+ <Caret Line="208" Column="18" TopLine="187"/>
</Position18>
<Position19>
<Filename Value="ROM.lpr"/>
- <Caret Line="201" Column="15" TopLine="180"/>
+ <Caret Line="157" Column="45" TopLine="127"/>
</Position19>
<Position20>
- <Filename Value="ROM.lpr"/>
- <Caret Line="203" Column="34" TopLine="182"/>
+ <Filename Value="romunit.pas"/>
+ <Caret Line="1005" Column="6" TopLine="816"/>
</Position20>
<Position21>
- <Filename Value="ROM.lpr"/>
- <Caret Line="208" Column="18" TopLine="187"/>
+ <Filename Value="romunit.pas"/>
+ <Caret Line="990" Column="1" TopLine="974"/>
</Position21>
<Position22>
- <Filename Value="ROM.lpr"/>
- <Caret Line="157" Column="45" TopLine="127"/>
+ <Filename Value="romunit.pas"/>
+ <Caret Line="994" Column="45" TopLine="973"/>
</Position22>
<Position23>
<Filename Value="romunit.pas"/>
- <Caret Line="1005" Column="6" TopLine="816"/>
+ <Caret Line="1003" Column="86" TopLine="974"/>
</Position23>
<Position24>
- <Filename Value="romunit.pas"/>
- <Caret Line="990" Column="1" TopLine="974"/>
+ <Filename Value="ROM.lpr"/>
+ <Caret Line="208" Column="1" TopLine="204"/>
</Position24>
<Position25>
- <Filename Value="romunit.pas"/>
- <Caret Line="994" Column="45" TopLine="973"/>
+ <Filename Value="ROM.lpr"/>
+ <Caret Line="207" Column="47" TopLine="186"/>
</Position25>
<Position26>
- <Filename Value="romunit.pas"/>
- <Caret Line="1003" Column="86" TopLine="974"/>
+ <Filename Value="ROM.lpr"/>
+ <Caret Line="70" Column="7" TopLine="28"/>
</Position26>
<Position27>
- <Filename Value="ROM.lpr"/>
- <Caret Line="208" Column="1" TopLine="204"/>
+ <Filename Value="romunit.pas"/>
+ <Caret Line="987" Column="101" TopLine="520"/>
</Position27>
<Position28>
- <Filename Value="ROM.lpr"/>
- <Caret Line="207" Column="47" TopLine="186"/>
+ <Filename Value="romunit.pas"/>
+ <Caret Line="1028" Column="50" TopLine="521"/>
</Position28>
<Position29>
- <Filename Value="ROM.lpr"/>
- <Caret Line="70" Column="7" TopLine="28"/>
+ <Filename Value="romunit.pas"/>
+ <Caret Line="1024" Column="23" TopLine="759"/>
</Position29>
<Position30>
- <Filename Value="romunit.pas"/>
- <Caret Line="987" Column="101" TopLine="520"/>
+ <Filename Value="ROM.lpr"/>
+ <Caret Line="63" Column="18" TopLine="25"/>
</Position30>
</JumpHistory>
</ProjectSession>
diff --git a/romunit.pas b/romunit.pas
index 8d48b62..5e1bf79 100644
--- a/romunit.pas
+++ b/romunit.pas
@@ -30,6 +30,7 @@ procedure fft(var dat: tExtPointArray);
procedure interpoliere(var dat: tExtPointArray);
procedure normiere(var dat: tExtPointArray);
procedure berechneRefPuls(inPuls,surTraj: tExtPointArray; betaGlaette: longint; betaBound: extended; out cRefPuls: tExtPointArray);
+function shellSubst(s: string): string;
type
tSortThread = class(tThread)
@@ -1015,6 +1016,19 @@ begin
setlength(cRefPuls,anz);
end;
+function shellSubst(s: string): string;
+var name: string;
+begin
+ result:=s;
+ while pos('${',result)>0 do begin
+ s:=leftStr(result,pos('${',result)-1);
+ delete(result,1,pos('${',result)-1+length('${'));
+ name:=leftStr(result,pos('}',result)-1);
+ delete(result,1,length(name+'}'));
+ result:=s+GetEnvironmentVariable(name)+result;
+ end;
+end;
+
// tSortThread *****************************************************************
constructor tSortThread.create(pd: pTExtPointArray; sta, sto: longint);