/////////////////////////////////////////////////////////////////////////////
 	TTcylStation = class
   	sMD,sTVD,oMD,oTVD,Azi,HS,c2c,AllowDev: double;
    procedure input(sMD,sTVD,oMD,oTVD,Azi,HS,c2c,AllowDev: double);
 	TTcylScan := class
   	company,field,refWell,scanMethod: string;
     procedure setComp(company: string);
     procedure setField(field: string);
     procedure setRefWell(refWell: string);
     procedure setScanMethod(scanMethod: string);
   end;
/////////////////////////////////////////////////////////////////////////////
  procedure TTcylStation.input(sMD1,sTVD1,oMD1,oTVD1,Azi1,HS1,c2c1,AllowDev1: float);
  begin
  	sMD  := sMD1;
    sTVD := sTVD1;
    oMD  := oMD1;
    oTVD := oTVD1;
    Azi  := Azi1;
    HS   := HS1;
    c2c  := c2c1;
    AllowDev := AllowDev1;
	end;
  procedure TTcylScan.setComp(company1: string);
  begin
  	company := company1;
	end;
  procedure TTcylScan.setField(Field1: string);
  begin
  	Field := Field1;
	end;
  procedure TTcylScan.setRefWell(RefWell1: string);
  begin
  	RefWell := RefWell1;
	end;
  procedure TTcylScan.setScanMethod(ScanMethod1: string);
  begin
  	ScanMethod := ScanMethod1;
	end;

procedure TFMain.BBConvertClick(Sender: TObject);
{------------------------------------------------------------------------------
This procedure validates input and calls the workhorse subroutines.
First, it calls the appropriate procedure to read the data file
Next, if calls the DXF writing routine
Finally, if requested to do so, it will call the DesignCAD OLE commands
         necessary to put the drawing together and ready for the Well Planner.
------------------------------------------------------------------------------}
var  SuccessfulCompletion: boolean;
begin
  if (eTCylFile.Text <> 'D:\Temp\Test.txt') then eTCylFile.Text := 'D:\Temp\Test.txt';
  SuccessfulCompletion := ReadCompassData(sender);
  if (not SuccessfulCompletion) then
     StatusBar1.Panels[0].Text := 'Status: Died while reading Compass data'
  else
    begin
      if (CBDesignCadYes.Checked) then
      begin
      	SuccessfulCompletion := MakeDW2File(Sender);
	  		if (not SuccessfulCompletion) then
  	    	StatusBar1.Panels[0].Text := 'Status: Died while making DesignCAD file'
        else
          StatusBar1.Panels[0].Text := 'Status: Done';
      end
      else StatusBar1.Panels[0].Text := 'Status: Done';
     end;
end;

