%Initializes MyDaq Gui. Needs no inputs, but should be modified if you wish %to change the callbacks etc. function initGui(this) %Close request function is set to delete function of the class this.Gui.figure1.CloseRequestFcn=@(hObject,eventdata)... closeFigure(this, hObject, eventdata); %Sets callback for the edit box of the base directory this.Gui.BaseDir.Callback=@(hObject, eventdata)... baseDirCallback(this, hObject, eventdata); %Sets callback for the session name edit box this.Gui.SessionName.Callback=@(hObject, eventdata)... sessionNameCallback(this, hObject, eventdata); %Sets callback for the file name edit box this.Gui.FileName.Callback=@(hObject, eventdata) ... fileNameCallback(this, hObject,eventdata); %Sets callback for the save data button this.Gui.SaveData.Callback=@(hObject, eventdata) ... saveCallback(this, hObject,eventdata); %Sets callback for the save ref button this.Gui.SaveRef.Callback=@(hObject, eventdata)... saveCallback(this, hObject, eventdata); %Sets callback for the show data button this.Gui.ShowData.Callback=@(hObject, eventdata)... showDataCallback(this, hObject, eventdata); %Sets callback for the show reference button this.Gui.ShowRef.Callback=@(hObject, eventdata)... showRefCallback(this, hObject, eventdata); %Sets callback for the data to reference button this.Gui.DataToRef.Callback=@(hObject, eventdata)... dataToRefCallback(this, hObject, eventdata); %Sets callback for the LogY button this.Gui.LogY.Callback=@(hObject, eventdata) ... logYCallback(this, hObject, eventdata); %Sets callback for the LogX button this.Gui.LogX.Callback=@(hObject, eventdata)... logXCallback(this, hObject, eventdata); %Sets callback for the data to background button this.Gui.DataToBg.Callback=@(hObject, eventdata) ... dataToBgCallback(this, hObject,eventdata); %Sets callback for the ref to background button this.Gui.RefToBg.Callback=@(hObject, eventdata) ... refToBgCallback(this, hObject,eventdata); %Sets callback for the clear background button this.Gui.ClearBg.Callback=@(hObject, eventdata)... clearBgCallback(this, hObject,eventdata); %Sets callback for the select trace popup menu this.Gui.SelTrace.Callback=@(hObject,eventdata)... selTraceCallback(this, hObject,eventdata); %Sets callback for the vertical cursor button this.Gui.VertDataButton.Callback=@(hObject, eventdata)... cursorButtonCallback(this, hObject,eventdata); %Sets callback for the horizontal cursors button this.Gui.HorzDataButton.Callback=@(hObject, eventdata)... cursorButtonCallback(this, hObject,eventdata); %Sets callback for the reference cursors button this.Gui.VertRefButton.Callback=@(hObject, eventdata)... cursorButtonCallback(this, hObject,eventdata); %Sets callback for the center cursors button this.Gui.CenterCursors.Callback=@(hObject,eventdata)... centerCursorsCallback(this,hObject,eventdata); %Sets callback for the center cursors button this.Gui.CopyPlot.Callback=@(hObject,eventdata)... copyPlotCallback(this,hObject,eventdata); %Sets callback for load trace button this.Gui.LoadButton.Callback=@(hObject,eventdata)... loadDataCallback(this,hObject,eventdata); %Sets callback for open directory button this.Gui.OpenFolderButton.Callback=@(hObject,eventdata)... openFolderCallback(this,hObject,eventdata); %Initializes the AnalyzeMenu this.Gui.AnalyzeMenu.Callback=@(hObject, eventdata)... analyzeMenuCallback(this, hObject,eventdata); %List of available analysis routines this.Gui.AnalyzeMenu.String={'Select a routine...',... 'Linear Fit','Quadratic Fit','Exponential Fit',... 'Gaussian Fit','Lorentzian Fit','Double Lorentzian Fit',... 'g0 Calibration','Beta Calibration'}; %Tooltips for AnalyzeMenu standard_tip=['Generate initial parameters with gen. init. param. \n',... 'Press Analyze to fit. Move the sliders or enter numbers to',... ' change initial parameters.\n']; this.Gui.AnalyzeTip{1}='Select a routine to open it.'; this.Gui.AnalyzeTip{2}=standard_tip; this.Gui.AnalyzeTip{3}=standard_tip; this.Gui.AnalyzeTip{4}=[standard_tip,... 'Calculation of the quality factor (assuming amplitude ringdown) ',... 'is included']; this.Gui.AnalyzeTip{5}=standard_tip; this.Gui.AnalyzeTip{6}=... [standard_tip,... 'To calibrate optical linewidths, move the reference cursors to',... ' have the correct number of resonances between them \n',... 'The number of resonances can be changed by changing the number of ',... 'lines in the GUI. \n The FSR is entered in the line spacing field \n',... 'The tab for mechanics is automatically populated and calculated.']; this.Gui.AnalyzeTip{7}= [standard_tip,... 'To calibrate optical linewidths, move the reference cursors to',... ' have the correct number of resonances between them \n',... 'The number of resonances can be changed by changing the number of ',... 'lines in the GUI. \n The FSR is entered in the line spacing field \n',... 'The modal spacing is automatically calculated']; this.Gui.AnalyzeTip{8}=['Put calibration tone between reference cursors.\n',... 'Put mechanical mode signal between vertical cursors.\n',... 'Enter the correct temperature and beta, then press analyze to find g0.']; this.Gui.AnalyzeTip{9}=['Automatically calculates beta based on first ',... 'and second order phase modulation sidebands']; %Initializes the InstrMenu this.Gui.InstrMenu.Callback=@(hObject,eventdata) ... instrMenuCallback(this,hObject,eventdata); %Initializes the axis this.main_plot.Box='on'; this.main_plot.XLabel.String='x'; this.main_plot.YLabel.String='y'; end