Skip to content

Commit

Permalink
updates to efit routine
Browse files Browse the repository at this point in the history
  • Loading branch information
marcdegraef committed Feb 1, 2024
1 parent 521eb17 commit d50c973
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 21 deletions.
19 changes: 16 additions & 3 deletions IDL/pro/Efit.pro
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ common CommonCore, status, logmode, logunit
common FitParameters, nFit, fitName, defValue, fitValue, fitStep, fitOnOff, fitManualStep, fitManualUpDown, fitUserLabel, fitStepLabel, fitOnOffLabel, fitUpLabel, fitDownLabel, fitManualStepLabel, fitIterations
common getenv_common, librarylocation

librarylocation = Core_getenv(/lib)

; before we do anything, we make sure that the location of the app_user_dir is set
res = file_test('~/.idl',/directory)
if (res ne 1) then begin
Expand Down Expand Up @@ -190,6 +192,7 @@ Efitwidget_s = {widgetstruct, $

; data structure
Efitdata = {Efitdatastruct, $
os_family:'',
scrdimx:fix(0), $
scrdimy:fix(0), $
xlocation:fix(0), $
Expand Down Expand Up @@ -299,6 +302,10 @@ Efitdata.appdir = Efitdata.appdir+Efitdata.foldersep

print,'appdir = ', Efitdata.appdir

; get the platform
Efitdata.os_family = 'unix'
if (!version.os_family ne Efitdata.os_family) then Efitdata.os_family = 'windows'

;------------------------------------------------------------
; get the display window size to 80% of the current screen size (but be careful with double screens ... )
; We'll need to guess whether or not the user has a double screen: if the aspect ratio is larger than 16/9,
Expand Down Expand Up @@ -374,9 +381,15 @@ fitManualStep[7] = Efitdata.detmphi2
fitManualStep[8] = Efitdata.detmtheta

; a few font strings (this will need to be redone for Windows systems)
fontstr='-adobe-new century schoolbook-bold-r-normal--14-100-100-100-p-87-iso8859-1'
fontstrlarge='-adobe-new century schoolbook-medium-r-normal--20-140-100-100-p-103-iso8859-1'
fontstrsmall='-adobe-new century schoolbook-medium-r-normal--14-100-100-100-p-82-iso8859-1'
if (Efitdata.os_family eq 'unix') then begin
fontstr='-adobe-new century schoolbook-bold-r-normal--14-100-100-100-p-87-iso8859-1'
fontstrlarge='-adobe-new century schoolbook-medium-r-normal--20-140-100-100-p-103-iso8859-1'
fontstrsmall='-adobe-new century schoolbook-medium-r-normal--14-100-100-100-p-82-iso8859-1'
end else begin
fontstr='Garamond*ITALIC*14'
fontstrlarge='Garamond*ITALIC*20'
fontstrsmall='Garamond*ITALIC*14'
end

;------------------------------------------------------------
; create the top level widget
Expand Down
10 changes: 5 additions & 5 deletions IDL/pro/Efit_constrainedupdate.pro
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,13 @@ end else fpar[5] = fitValue[8]

; initialize the simulated pattern array
EBSDpattern = fltarr(Efitdata.detnumsx,Efitdata.detnumsy)
Efit_getEBSDpattern, ipar, fpar, quats
;Efit_getEBSDpattern, ipar, fpar, quats

; callname = 'getEBSDPatternsWrapper'
; faccum_e = float(accum_e)
callname = 'getEBSDPatternsWrapper'
faccum_e = float(accum_e)

; res = call_external(librarylocation+'/libEMsoftLib.dylib', callname, $
; ipar, fpar, EBSDpattern, quats, faccum_e, mLPNH, mLPSH, /F_VALUE, /VERBOSE, /SHOW_ALL_OUTPUT)
res = call_external(librarylocation+'/libEMsoftLib.dylib', callname, $
ipar, fpar, EBSDpattern, quats, faccum_e, mLPNH, mLPSH, /F_VALUE, /VERBOSE, /SHOW_ALL_OUTPUT)

; if (res ne 1.0) then begin
; Core_print,'getEBSDPatternsWrapper return code = '+string(res,format="(F4.1)")
Expand Down
14 changes: 7 additions & 7 deletions IDL/pro/Efit_update.pro
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,14 @@ end else fpar[5] = fitValue[8]

; initialize the simulated pattern array
EBSDpattern = fltarr(Efitdata.detnumsx,Efitdata.detnumsy)
Efit_getEBSDpattern, ipar, fpar, quats
;Efit_getEBSDpattern, ipar, fpar, quats

; callname = 'getEBSDPatternsWrapper'
; faccum_e = float(accum_e)
; if (!version.os eq 'darwin') then begin
; res = call_external(librarylocation+'/libEMsoftLib.dylib', callname, $
; ipar, fpar, EBSDpattern, quats, faccum_e, mLPNH, mLPSH, /F_VALUE, /VERBOSE, /SHOW_ALL_OUTPUT)
; endif
callname = 'getEBSDPatternsWrapper'
faccum_e = float(accum_e)
if (!version.os eq 'darwin') then begin
res = call_external(librarylocation+'/libEMsoftLib.dylib', callname, $
ipar, fpar, EBSDpattern, quats, faccum_e, mLPNH, mLPSH, /F_VALUE, /VERBOSE, /SHOW_ALL_OUTPUT)
endif

; if (!version.os eq 'Win32') then begin
; res = call_external(librarylocation+'/EMsoftLib.dll', callname, $
Expand Down
12 changes: 6 additions & 6 deletions IDL/pro/Efitcalc.pro
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,14 @@ fpar[8] = Efitdata.detdwelltime
quats = Efitdata.quaternion

EBSDpattern = fltarr(Efitdata.detnumsx,Efitdata.detnumsy)
Efit_getEBSDpattern, ipar, fpar, quats
;Efit_getEBSDpattern, ipar, fpar, quats

; callname = 'getEBSDPatternsWrapper'
callname = 'getEBSDPatternsWrapper'

; if (!version.os eq 'darwin') then begin
; res = call_external(librarylocation+'/libEMsoftLib.dylib', callname, $
; ipar, fpar, EBSDpattern, quats, float(accum_e), mLPNH, mLPSH, /F_VALUE, /VERBOSE, /SHOW_ALL_OUTPUT)
; endif
if (!version.os eq 'darwin') then begin
res = call_external(librarylocation+'/libEMsoftLib.dylib', callname, $
ipar, fpar, EBSDpattern, quats, float(accum_e), mLPNH, mLPSH, /F_VALUE, /VERBOSE, /SHOW_ALL_OUTPUT)
endif

; if (!version.os eq 'Win32') then begin
; res = call_external(librarylocation+'/EMsoftLib.dll', callname, $
Expand Down

0 comments on commit d50c973

Please sign in to comment.