Ignore:
Timestamp:
Mar 19, 2020 4:35:21 PM (2 years ago)
Author:
srkline
Message:

A large number of changes to the size of panels to enable "Laptop Mode" where all of the panels and controls are scaled down so that they fit on screen and are still in correct proportion. For the laptop I'm using for testing, the resolution is 1920x1080. For this, a scaling of 0.7 seems to work. The on/off of the "laptop Mode" is controlled by a checkbox in the preference panel (under the General tab).

There are still more panels to update in the next commit.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_RealTimeUpdate.ipf

    r1242 r1246  
    126126//draws the RT panel and enforces bounds on the SetVariable controls for update period and timeout 
    127127// 
    128 Proc VSANS_RT_Panel()  
     128Proc VSANS_RT_Panel() 
     129        Variable sc = 1 
     130                         
     131        if(root:Packages:NIST:VSANS:Globals:gLaptopMode == 1) 
     132                sc = 0.7 
     133        endif 
     134  
    129135        PauseUpdate; Silent 1           // building window... 
    130         NewPanel /W=(300,350,602,580) /K=2              // force the user to close using done 
     136        NewPanel /W=(300*sc,350*sc,602*sc,580*sc) /K=2          // force the user to close using done 
    131137        DoWindow/C VSANS_RT_Panel 
    132138        DoWindow/T RT_Panel,"Real Time Display Controls" 
    133139        ModifyPanel cbRGB=(65535,52428,6168) 
    134140        SetDrawLayer UserBack 
    135         SetDrawEnv fstyle= 1 
    136         DrawText 26,21,"Enter values for real-time display" 
    137         Button bkgStart,pos={171,54},size={120,20},proc=V_UpdateHSTButton,title="Start Updating" 
     141        SetDrawEnv fstyle= 1,fsize=14*sc 
     142        DrawText 26*sc,21*sc,"Enter values for real-time display" 
     143        Button bkgStart,pos={sc*171,54*sc},size={sc*120,20*sc},proc=V_UpdateHSTButton,title="Start Updating" 
    138144        Button bkgStart,help={"Starts or stops the updating of the real-time SANS image"} 
    139 //      SetVariable setvar_0,pos={15,29},size={100,15},proc=RT_Param_SetVarProc,title="X Center" 
     145//      SetVariable setvar_0,pos={sc*15,29*sc},size={sc*100,15*sc},proc=RT_Param_SetVarProc,title="X Center" 
    140146//      SetVariable setvar_0,help={"Set this to the current beamcenter x-coordinate (in pixels)"} 
    141147//      SetVariable setvar_0,limits={0,128,0},value= root:myGlobals:RT:xCtr 
    142 //      SetVariable setvar_1,pos={14,46},size={100,15},proc=RT_Param_SetVarProc,title="Y Center" 
     148//      SetVariable setvar_1,pos={sc*14,46*sc},size={sc*100,15*sc},proc=RT_Param_SetVarProc,title="Y Center" 
    143149//      SetVariable setvar_1,help={"Set this to the current beamcenter y-coordinate (in pixels)"} 
    144150//      SetVariable setvar_1,limits={0,128,0},value= root:myGlobals:RT:yCtr 
    145 //      SetVariable setvar_2,pos={14,64},size={100,15},proc=RT_Param_SetVarProc,title="SDD (m)" 
     151//      SetVariable setvar_2,pos={sc*14,64*sc},size={sc*100,15*sc},proc=RT_Param_SetVarProc,title="SDD (m)" 
    146152//      SetVariable setvar_2,help={"Set this to the sample-to-detector distance of the current instrument configuration"} 
    147153//      SetVariable setvar_2,limits={0,1600,0},value= root:myGlobals:RT:SDD 
    148 //      SetVariable setvar_3,pos={15,82},size={100,15},proc=RT_Param_SetVarProc,title="Lambda (A)" 
     154//      SetVariable setvar_3,pos={sc*15,82*sc},size={sc*100,15*sc},proc=RT_Param_SetVarProc,title="Lambda (A)" 
    149155//      SetVariable setvar_3,help={"Set this to the wavelength of the current instrument configuration"} 
    150156//      SetVariable setvar_3,limits={0,30,0},value= root:myGlobals:RT:lambda 
    151         SetVariable setvar_4,pos={11,31},size={150,20},proc=V_UpdateInt_SetVarProc,title="Update Interval (s)" 
     157        SetVariable setvar_4,pos={sc*11,31*sc},size={sc*150,20*sc},proc=V_UpdateInt_SetVarProc,title="Update Interval (s)" 
    152158        SetVariable setvar_4,help={"This is the period of the update"} 
    153159        SetVariable setvar_4,limits={1,3600,0},value= root:Packages:NIST:VSANS:Globals:RT:updateInt 
    154 //      SetVariable setvar_5,pos={11,56},size={150,20},title="Timeout Interval (s)" 
     160//      SetVariable setvar_5,pos={sc*11,56*sc},size={sc*150,20*sc},title="Timeout Interval (s)" 
    155161//      SetVariable setvar_5,help={"After the timeout interval has expired, the update process will automatically stop"} 
    156162//      SetVariable setvar_5,limits={1,3600,0},value= root:myGlobals:RT:timeout 
    157         Button button_1,pos={170,29},size={120,20},proc=V_LoadRTButtonProc,title="Load Live Data" 
     163        Button button_1,pos={sc*170,29*sc},size={sc*120,20*sc},proc=V_LoadRTButtonProc,title="Load Live Data" 
    158164        Button button_1,help={"Load the data file for real-time display"} 
    159         Button button_2,pos={250,2},size={30,20},proc=V_RT_HelpButtonProc,title="?" 
     165        Button button_2,pos={sc*250,2*sc},size={sc*30,20*sc},proc=V_RT_HelpButtonProc,title="?" 
    160166        Button button_2,help={"Display the help file for real-time controls"} 
    161         Button button_3,pos={230,200},size={60,20},proc=V_RT_DoneButtonProc,title="Done" 
     167        Button button_3,pos={sc*230,200*sc},size={sc*60,20*sc},proc=V_RT_DoneButtonProc,title="Done" 
    162168        Button button_3,help={"Closes the panel and stops the updating process"} 
    163         SetVariable setvar_6,pos={11,105},size={250,20},title="Total Detector Counts" 
     169        SetVariable setvar_6,pos={sc*11,105*sc},size={sc*250,20*sc},title="Total Detector Counts" 
    164170        SetVariable setvar_6,help={"Total counts on the detector, as displayed"},noedit=1 
    165171        SetVariable setvar_6,limits={0,Inf,0},value= root:Packages:NIST:VSANS:Globals:RT:totalCounts 
    166         SetVariable setvar_7,pos={11,82},size={250,20},title="                  Count Time" 
     172        SetVariable setvar_7,pos={sc*11,82*sc},size={sc*250,20*sc},title="                  Count Time" 
    167173        SetVariable setvar_7,help={"Count time, as displayed"},noedit=1 
    168174        SetVariable setvar_7,limits={0,Inf,0},value= root:Packages:NIST:VSANS:Globals:RT:countTime 
    169         SetVariable setvar_8,pos={11,127},size={250,20},title="  Detector Count Rate" 
     175        SetVariable setvar_8,pos={sc*11,127*sc},size={sc*250,20*sc},title="  Detector Count Rate" 
    170176        SetVariable setvar_8,help={"Count rate, as displayed"},noedit=1 
    171177        SetVariable setvar_8,limits={0,Inf,0},value= root:Packages:NIST:VSANS:Globals:RT:countRate 
    172         SetVariable setvar_9,pos={11,149},size={250,20},title="           Monitor Counts" 
     178        SetVariable setvar_9,pos={sc*11,149*sc},size={sc*250,20*sc},title="           Monitor Counts" 
    173179        SetVariable setvar_9,help={"Count rate, as displayed"},noedit=1 
    174180        SetVariable setvar_9,limits={0,Inf,0},value= root:Packages:NIST:VSANS:Globals:RT:monitorCounts 
    175         SetVariable setvar_10,pos={11,171},size={250,20},title="    Monitor Count Rate" 
     181        SetVariable setvar_10,pos={sc*11,171*sc},size={sc*250,20*sc},title="    Monitor Count Rate" 
    176182        SetVariable setvar_10,help={"Count rate, as displayed"},noedit=1 
    177183        SetVariable setvar_10,limits={0,Inf,0},value= root:Packages:NIST:VSANS:Globals:RT:monitorCountRate 
     
    515521Function V_ShowOnlineReductionPanel() 
    516522 
     523        Variable sc = 1 
     524         
     525        NVAR gLaptopMode = root:Packages:NIST:VSANS:Globals:gLaptopMode 
     526                 
     527        if(gLaptopMode == 1) 
     528                sc = 0.7 
     529        endif 
     530 
    517531        //check for the path 
    518532        PathInfo catPathName 
     
    536550        // panel 
    537551        PauseUpdate; Silent 1 
    538         NewPanel /W=(300,350,702,481) /K=2              //K=2 to force exit using "done" button to exit the background procedure 
     552        NewPanel /W=(300*sc,350*sc,702*sc,481*sc) /K=2          //K=2 to force exit using "done" button to exit the background procedure 
    539553         
    540554        DoWindow/C V_ORPanel 
     
    546560 
    547561        // filename 
    548         GroupBox group_Flename          pos={6,top},            size={groupWidth,18+26},                title="select file for online reduction:" 
    549         PopupMenu popup_Filename        pos={12,top+18},        size={groupWidth-12-0,20},      title="" 
    550         PopupMenu popup_Filename        mode=1,                 value=V_GetRawDataFileList(),                   bodyWidth=groupWidth-12-0 
     562        GroupBox group_Flename          pos={sc*6,top*sc},              size={sc*groupWidth,(18+26)*sc},                title="select file for online reduction:" 
     563        PopupMenu popup_Filename        pos={sc*12,(top+18)*sc},        size={sc*(groupWidth-12-0),20*sc},      title="" 
     564        PopupMenu popup_Filename        mode=1,                 value=V_GetRawDataFileList(),                   bodyWidth=sc*(groupWidth-12-0) 
    551565        PopupMenu popup_Filename        proc=V_ORPopupSelectFileProc 
    552566         
     
    561575 
    562576        // protocol 
    563         GroupBox group_Protocol         pos={6,top},            size={groupWidth,18+22},                title="select protocol for online reduction:" 
    564         SetVariable setvar_Protocol     pos={12,top+18},        size={groupWidth-12-18,0},      title=" " 
     577        GroupBox group_Protocol         pos={sc*6,top*sc},              size={sc*groupWidth,(18+22)*sc},                title="select protocol for online reduction:" 
     578        SetVariable setvar_Protocol     pos={sc*12,(top+18)*sc},        size={sc*(groupWidth-12-18),0*sc},      title=" " 
    565579        SetVariable setvar_Protocol     value=root:Packages:NIST:VSANS:Globals:OnlineReduction:Protocol 
    566580         
    567         Button button_SelectProtocol pos={12+groupWidth-12-18,top+18-1}, size={18,18}, title="...", proc=V_ORButtonSelectProtocolProc 
     581        Button button_SelectProtocol pos={sc*(12+groupWidth-12-18),(top+18-1)*sc}, size={sc*18,18*sc}, title="...", proc=V_ORButtonSelectProtocolProc 
    568582 
    569583        top += 18+22+7 
     
    571585         
    572586        // sart, stop, done      
    573         Button button_Start     pos={left + 70 * 0, top},       size={60,20},   title="Start",  proc=V_ORButtonStartProc 
    574         Button button_Stop      pos={left + 70 * 1, top},       size={60,20},   title="Stop",   proc=V_ORButtonStopProc,        disable=2 
    575         Button button_Done      pos={left + 70 * 2, top},       size={60,20},   title="Done",   proc=V_ORButtonDoneProc 
     587        Button button_Start     pos={sc*(left + 70 * 0), top*sc},       size={sc*60,20*sc},     title="Start",  proc=V_ORButtonStartProc 
     588        Button button_Stop      pos={sc*(left + 70 * 1), top*sc},       size={sc*60,20*sc},     title="Stop",   proc=V_ORButtonStopProc,        disable=2 
     589        Button button_Done      pos={sc*(left + 70 * 2), top*sc},       size={sc*60,20*sc},     title="Done",   proc=V_ORButtonDoneProc 
    576590         
    577591end 
Note: See TracChangeset for help on using the changeset viewer.