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 @@ + <Icon Value="0"/> </General> <MacroValues Count="1"> <Macro1 Name="LCLWidgetType" Value="qt5"/> @@ -69,8 +70,10 @@ <ComponentName Value="OPFForm"/> <HasResources Value="True"/> <ResourceBaseClass Value="Form"/> - <TopLine Value="10"/> - <CursorPos X="50" Y="46"/> + <IsVisibleTab Value="True"/> + <EditorIndex Value="1"/> + <TopLine Value="19"/> + <CursorPos X="54" Y="48"/> <UsageCount Value="200"/> <Loaded Value="True"/> <LoadedDesigner Value="True"/> @@ -365,7 +368,7 @@ <ResourceBaseClass Value="Form"/> <EditorIndex Value="3"/> <CursorPos X="44" Y="38"/> - <UsageCount Value="114"/> + <UsageCount Value="117"/> <Loaded Value="True"/> <LoadedDesigner Value="True"/> </Unit47> @@ -547,9 +550,9 @@ <HasResources Value="True"/> <ResourceBaseClass Value="Form"/> <EditorIndex Value="2"/> - <TopLine Value="186"/> + <TopLine Value="185"/> <CursorPos X="20" Y="181"/> - <UsageCount Value="23"/> + <UsageCount Value="26"/> <Loaded Value="True"/> <LoadedDesigner Value="True"/> </Unit73> @@ -588,11 +591,9 @@ <ComponentName Value="BeamForm"/> <HasResources Value="True"/> <ResourceBaseClass Value="Form"/> - <IsVisibleTab Value="True"/> - <EditorIndex Value="1"/> <TopLine Value="82"/> - <CursorPos X="38" Y="103"/> - <UsageCount Value="22"/> + <CursorPos X="92" Y="100"/> + <UsageCount Value="25"/> <Loaded Value="True"/> <LoadedDesigner Value="True"/> </Unit78> @@ -600,123 +601,123 @@ <JumpHistory Count="30" HistoryIndex="29"> <Position1> <Filename Value="opfunit.pas"/> - <Caret Line="445" Column="10" TopLine="413"/> + <Caret Line="525" Column="13" TopLine="493"/> </Position1> <Position2> <Filename Value="opfunit.pas"/> - <Caret Line="446" Column="10" TopLine="414"/> + <Caret Line="527" Column="13" TopLine="495"/> </Position2> <Position3> <Filename Value="opfunit.pas"/> - <Caret Line="525" Column="13" TopLine="493"/> + <Caret Line="528" Column="32" TopLine="496"/> </Position3> <Position4> <Filename Value="opfunit.pas"/> - <Caret Line="527" Column="13" TopLine="495"/> + <Caret Line="529" Column="13" TopLine="503"/> </Position4> <Position5> <Filename Value="opfunit.pas"/> - <Caret Line="528" Column="32" TopLine="496"/> + <Caret Line="148" Column="51" TopLine="119"/> </Position5> <Position6> <Filename Value="opfunit.pas"/> - <Caret Line="529" Column="13" TopLine="503"/> + <Caret Line="825" Column="22" TopLine="816"/> </Position6> <Position7> <Filename Value="opfunit.pas"/> - <Caret Line="148" Column="51" TopLine="119"/> + <Caret Line="870" Column="11" TopLine="837"/> </Position7> <Position8> <Filename Value="opfunit.pas"/> - <Caret Line="825" Column="22" TopLine="816"/> + <Caret Line="849" Column="37" TopLine="829"/> </Position8> <Position9> <Filename Value="opfunit.pas"/> - <Caret Line="870" Column="11" TopLine="837"/> + <Caret Line="10" Column="20"/> </Position9> <Position10> <Filename Value="opfunit.pas"/> - <Caret Line="849" Column="37" TopLine="829"/> + <Caret Line="18" Column="31"/> </Position10> <Position11> <Filename Value="opfunit.pas"/> - <Caret Line="10" Column="20"/> + <Caret Line="254" Column="69" TopLine="222"/> </Position11> <Position12> <Filename Value="opfunit.pas"/> - <Caret Line="18" Column="31"/> + <Caret Line="255" Column="63" TopLine="223"/> </Position12> <Position13> <Filename Value="opfunit.pas"/> - <Caret Line="254" Column="69" TopLine="222"/> + <Caret Line="355" Column="9" TopLine="323"/> </Position13> <Position14> <Filename Value="opfunit.pas"/> - <Caret Line="255" Column="63" TopLine="223"/> + <Caret Line="369" Column="6" TopLine="337"/> </Position14> <Position15> <Filename Value="opfunit.pas"/> - <Caret Line="355" Column="9" TopLine="323"/> + <Caret Line="504" Column="12" TopLine="472"/> </Position15> <Position16> <Filename Value="opfunit.pas"/> - <Caret Line="369" Column="6" TopLine="337"/> + <Caret Line="600" Column="32" TopLine="568"/> </Position16> <Position17> <Filename Value="opfunit.pas"/> - <Caret Line="504" Column="12" TopLine="472"/> + <Caret Line="606" Column="19" TopLine="568"/> </Position17> <Position18> <Filename Value="opfunit.pas"/> - <Caret Line="600" Column="32" TopLine="568"/> + <Caret Line="606" Column="29" TopLine="586"/> </Position18> <Position19> <Filename Value="opfunit.pas"/> - <Caret Line="606" Column="19" TopLine="568"/> + <Caret Line="111" Column="19" TopLine="88"/> </Position19> <Position20> <Filename Value="opfunit.pas"/> - <Caret Line="606" Column="29" TopLine="586"/> + <Caret Line="422" Column="4" TopLine="420"/> </Position20> <Position21> <Filename Value="opfunit.pas"/> - <Caret Line="111" Column="19" TopLine="88"/> + <Caret Line="441" TopLine="421"/> </Position21> <Position22> <Filename Value="opfunit.pas"/> - <Caret Line="422" Column="4" TopLine="420"/> + <Caret Line="436" TopLine="421"/> </Position22> <Position23> <Filename Value="opfunit.pas"/> - <Caret Line="441" TopLine="421"/> + <Caret Line="427" Column="28" TopLine="408"/> </Position23> <Position24> <Filename Value="opfunit.pas"/> - <Caret Line="436" TopLine="421"/> + <Caret Line="434" Column="33" TopLine="414"/> </Position24> <Position25> <Filename Value="opfunit.pas"/> - <Caret Line="427" Column="28" TopLine="408"/> + <Caret Line="55" Column="4" TopLine="28"/> </Position25> <Position26> <Filename Value="opfunit.pas"/> - <Caret Line="434" Column="33" TopLine="414"/> + <Caret Line="44" Column="31" TopLine="29"/> </Position26> <Position27> <Filename Value="opfunit.pas"/> - <Caret Line="55" Column="4" TopLine="28"/> + <Caret Line="304" Column="16" TopLine="290"/> </Position27> <Position28> - <Filename Value="opfunit.pas"/> - <Caret Line="44" Column="31" TopLine="29"/> + <Filename Value="beamunit.pas"/> + <Caret Line="11" Column="50"/> </Position28> <Position29> <Filename Value="opfunit.pas"/> - <Caret Line="304" Column="16" TopLine="290"/> + <Caret Line="995" TopLine="976"/> </Position29> <Position30> - <Filename Value="beamunit.pas"/> - <Caret Line="11" Column="50"/> + <Filename Value="opfunit.pas"/> + <Caret Line="445" Column="47" TopLine="430"/> </Position30> </JumpHistory> </ProjectOptions> 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}