diff --git a/opf b/opf
index 488c3b0..e2e8e59 100755
Binary files a/opf and b/opf differ
diff --git a/opf.exe b/opf.exe
old mode 100644
new mode 100755
index e7cc87d..697c1d2
Binary files a/opf.exe and b/opf.exe differ
diff --git a/opf.lpi b/opf.lpi
index 70b4043..cb8d5a4 100644
--- a/opf.lpi
+++ b/opf.lpi
@@ -8,6 +8,7 @@
+
@@ -69,8 +70,10 @@
-
-
+
+
+
+
@@ -365,7 +368,7 @@
-
+
@@ -547,9 +550,9 @@
-
+
-
+
@@ -588,11 +591,9 @@
-
-
-
-
+
+
@@ -600,123 +601,123 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
+
+
-
+
-
-
+
+
diff --git a/opf.res b/opf.res
index 74b723d..0ff9f20 100644
Binary files a/opf.res and b/opf.res differ
diff --git a/opfunit.pas b/opfunit.pas
index ca218c3..b0241b0 100644
--- a/opfunit.pas
+++ b/opfunit.pas
@@ -44,7 +44,8 @@
5/2/2020 remove expiry check
7//2/2020 fix save as file name error
update statusbar messaging system and refactor
- implemented login module}
+ implemented login module
+17/3/2020 add refresh linac list on beam module exit}
{$mode DELPHI}{$H+}
@@ -264,6 +265,7 @@ TOPFForm = class(TForm)
procedure OPFFormCloseQuery(Sender: TObject; var CanClose: boolean);
procedure OpenMenuClick(Sender: TObject);
procedure ReadLinac(FileName:string);
+ procedure ListLinacs;
procedure OPFFormCreate(Sender: TObject);
procedure PutData(var PatRec:TPatRec);
function GetData(var PatRec:TPatRec):boolean;
@@ -421,14 +423,26 @@ procedure TOpfForm.StatusBarDrawPanel(SBar: TStatusBar;Panel: TStatusPanel;
procedure TOPFForm.miManageClick(Sender: TObject);
-var BeamForm: TBeamForm;
+var BeamForm :TBeamForm;
+ Current :string;
+
begin
+ClearStatus;
+Current := cbMachine.Text;
try
BeamForm := TBeamForm.Create(self);
BeamForm.ShowModal;
finally
BeamForm.Free;
end;
+ListLinacs;
+cbMachine.ItemIndex := cbMachine.Items.IndexOf(Current);
+if cbMachine.ItemIndex < 0 then
+ begin
+ OPFError('Could not find previous machine.');
+ cbMachine.ItemIndex := 0;
+ end;
+ReadLinac(cbMachine.Items[cbMachine.ItemIndex]);
end;
@@ -645,6 +659,22 @@ procedure TOpfForm.ReadLinac(FileName:string);
end;
+procedure TOPFForm.ListLinacs;
+var SearchRec :TSearchRec;
+ FileName :string;
+
+begin
+CBMachine.Items.Clear;
+if FindFirst('*.bdf',0,SearchRec)=0 then
+ repeat
+ FileName := ExtractFileName(SearchRec.Name);
+ FileName := Copy(FileName,1,length(FileName) - 4);
+ CBMachine.Items.Add(FileName);
+ until FindNext(SearchRec)<>0;
+FindClose(SearchRec);
+end;
+
+
procedure TOPFForm.OPFFormClose(Sender: TObject; var CloseAction: TCloseAction);
begin
if Pat <> nil then Pat.Free;
@@ -921,9 +951,7 @@ procedure TOPFForm.OpenMenuClick(Sender: TObject);
procedure TOPFForm.OPFFormCreate(Sender: TObject);
-var SearchRec: TSearchRec;
- FileName,
- sExePath: string;
+var sExePath: string;
begin
Linac := nil;
@@ -976,14 +1004,7 @@ procedure TOPFForm.OPFFormCreate(Sender: TObject);
FileHandler.DirIndexList.Add('index.cgi');
FileHandler.RegisterHandler(PHPCGIHandler);
-CBMachine.Items.Clear;
-if FindFirst('*.bdf',0,SearchRec)=0 then
- repeat
- FileName := ExtractFileName(SearchRec.Name);
- FileName := Copy(FileName,1,length(FileName) - 4);
- CBMachine.Items.Add(FileName);
- until FindNext(SearchRec)<>0;
-FindClose(SearchRec);
+ListLinacs;
if CBMachine.Items.Count <> 0 then
begin
cbMachine.ItemIndex := 0;
@@ -991,8 +1012,9 @@ procedure TOPFForm.OPFFormCreate(Sender: TObject);
end
else
begin
- ShowMessage('No beam data files exist! Please create a file using Beam.');
- Halt;
+ Fault := true;
+ OPFError('No beam data files exist! Please create a file using Beam.');
+ {Halt};
end;
{check if server is running}