Ignore:
Timestamp:
Jun 5, 2019 4:48:14 PM (4 years ago)
Author:
krzywon
Message:

Change the data output from a checkbox to a radio button. Tie the writer into base 'Reduce a File' method. Tested and working.

Location:
sans/Dev/branches/nxcansas_writer/NCNR_User_Procedures
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/branches/nxcansas_writer/NCNR_User_Procedures/Common/Packages/PlotManager/PlotUtilsMacro_v40.ipf

    r1161 r1165  
    13811381        if(V_flag==0) 
    13821382                // only re-initialize if the variables don't exist, so you don't overwrite what users have changed 
    1383                 if( exists("root:Packages:NIST:gXML_Write") != 2 )              //if the global variable does not exist, initialize 
     1383                if( exists("root:Packages:NIST:gASCII_Write") != 2 || exists("root:Packages:NIST:gXML_Write") != 2 || exists("root:Packages:NIST:gNXcanSAS_Write") != 2)                //if the global variable does not exist, initialize 
    13841384                        Initialize_Preferences() 
    13851385                endif 
     
    14331433         
    14341434        /// items for everyone 
     1435        val = NumVarOrDefault("root:Packages:NIST:gASCII_Write", 1 ) 
     1436        if (val == 1) 
     1437                WritePref("PrefCtrl_0",1) 
     1438        endif 
     1439        Variable/G root:Packages:NIST:gASCII_Write = val 
    14351440        val = NumVarOrDefault("root:Packages:NIST:gXML_Write", 0 ) 
     1441        if (val == 1) 
     1442                WritePref("PrefCtrl_0a",1) 
     1443        endif 
    14361444        Variable/G root:Packages:NIST:gXML_Write = val 
    1437          
     1445        val = NumVarOrDefault("root:Packages:NIST:gNXcanSAS_Write", 0 ) 
     1446        if (val == 1) 
     1447                WritePref("PrefCtrl_0b",1) 
     1448        endif 
     1449        Variable/G root:Packages:NIST:gNXcanSAS_Write = val 
    14381450         
    14391451end 
     
    14651477End 
    14661478 
    1467 Function XMLWritePref(ctrlName,checked) : CheckBoxControl 
     1479Function WritePref(ctrlName,checked) : CheckBoxControl 
    14681480        String ctrlName 
    14691481        Variable checked 
    14701482         
    1471         NVAR gVal = root:Packages:NIST:gXML_Write 
    1472         gVal = checked 
    1473 End 
    1474  
    1475 Function NXWritePref(ctrlName,checked) : CheckBoxControl 
    1476         String ctrlName 
    1477         Variable checked 
    1478          
    1479         NVAR gVal = root:Packages:NIST:gNXcanSAS_Write 
    1480         gVal = checked 
     1483        NVAR asciiVal = root:Packages:NIST:gASCII_Write 
     1484        NVAR xmlVal = root:Packages:NIST:gXML_Write 
     1485        NVAR nxVal = root:Packages:NIST:gNXcanSAS_Write 
     1486         
     1487        strswitch (ctrlName) 
     1488                case "PrefCtrl_0": 
     1489                        CheckBox PrefCtrl_0,value=1 
     1490                        asciiVal = checked 
     1491                        CheckBox PrefCtrl_0a,value=0 
     1492                        xmlVal = 0 
     1493                        CheckBox PrefCtrl_0b,value=0 
     1494                        nxVal = 0 
     1495                        break 
     1496                case "PrefCtrl_0a": 
     1497                        CheckBox PrefCtrl_0,value=0 
     1498                        asciiVal = 0 
     1499                        CheckBox PrefCtrl_0a,value=1 
     1500                        xmlVal = checked 
     1501                        CheckBox PrefCtrl_0b,value=0 
     1502                        nxVal = 0 
     1503                        break 
     1504                case "PrefCtrl_0b": 
     1505                        CheckBox PrefCtrl_0,value=0 
     1506                        asciiVal = 0 
     1507                        CheckBox PrefCtrl_0a,value=0 
     1508                        xmlVal = 0 
     1509                        CheckBox PrefCtrl_0b,value=1 
     1510                        nxVal = checked 
     1511        endswitch 
    14811512End 
    14821513 
     
    15481579         
    15491580//on tab(0) - General - initially visible 
    1550         CheckBox PrefCtrl_0a,pos={21,96},size={124,14},proc=XMLWritePref,title="Use canSAS XML Output" 
    1551         CheckBox PrefCtrl_0a,help={"Checking this will set the default output format to be canSAS XML rather than NIST 6 column"} 
     1581        CheckBox PrefCtrl_0,pos={21,100},size={124,14},proc=WritePref,title="Use ASCII 6-column Output (default)",mode=1 
     1582        CheckBox PrefCtrl_0,help={"Checking this will set the default output to the NIST 6 column format"} 
     1583        CheckBox PrefCtrl_0,value= root:Packages:NIST:gASCII_Write 
     1584        CheckBox PrefCtrl_0a,pos={21,120},size={124,14},proc=WritePref,title="Use canSAS XML Output",mode=1 
     1585        CheckBox PrefCtrl_0a,help={"Checking this will set the default output to be canSAS XML format"} 
    15521586        CheckBox PrefCtrl_0a,value= root:Packages:NIST:gXML_Write 
    1553         CheckBox PrefCtrl_0a,pos={21,116},size={124,14},proc=NXWritePref,title="Use NXcanSAS HDF5 Output" 
    1554         CheckBox PrefCtrl_0a,help={"Checking this will set the default output format to be NXcanSAS HDF5 rather than NIST 6 column"} 
    1555         CheckBox PrefCtrl_0a,value= root:Packages:NIST:gNXcanSAS_Write 
    1556  
     1587        CheckBox PrefCtrl_0b,pos={21,140},size={124,14},proc=WritePref,title="Use NXcanSAS HDF5 Output",mode=1 
     1588        CheckBox PrefCtrl_0b,help={"Checking this will set the default output to be NXcanSAS HDF5 format"} 
     1589        CheckBox PrefCtrl_0b,value= root:Packages:NIST:gNXcanSAS_Write 
    15571590 
    15581591//on tab(1) - SANS 
  • sans/Dev/branches/nxcansas_writer/NCNR_User_Procedures/Reduction/SANS/AvgGraphics.ipf

    r1161 r1165  
    160160                                if (useXMLOutput == 1) 
    161161                                        WriteXMLWaves_W_Protocol(type,"",1) 
    162                                 else if (useNXcanSASOutput == 1) 
     162                                elseif (useNXcanSASOutput == 1) 
    163163                                        WriteNxCanSAS1D(type,"",1) 
    164164                                else 
    165165                                        WriteWaves_W_Protocol(type,"",1)                //"" is an empty path, 1 will force a dialog 
    166166                                endif 
     167                endswitch 
    167168        EndIf 
    168169         
  • sans/Dev/branches/nxcansas_writer/NCNR_User_Procedures/Reduction/SANS/NCNR_Includes_v520.ipf

    r950 r1165  
    9898//#include "MC_Script_Panels" 
    9999 
     100// JRK JUN 2019 -- import NXcanSAS writer 
     101#include "WriteHDF5" 
     102 
    100103// a simple list of items to add to the Beta menu 
    101104// to allow testing of these features 
  • sans/Dev/branches/nxcansas_writer/NCNR_User_Procedures/Reduction/SANS/ProtocolAsPanel.ipf

    r1042 r1165  
    14771477         
    14781478        NVAR useXMLOutput = root:Packages:NIST:gXML_Write 
     1479        NVAR useNXcanSASOutput = root:Packages:NIST:gNXcanSAS_Write 
    14791480         
    14801481        //Parse the instructions in the prot wave 
     
    19151916                        if(useXMLOutput == 1) 
    19161917                                exten += "x" 
     1918                        elseif(useNXcanSASOutput == 1) 
     1919                                exten = "h5" 
    19171920                        endif 
    19181921                endif 
     
    19541957                                if (useXMLOutput == 1) 
    19551958                                        WriteXMLWaves_W_Protocol(activeType,fullPath,dialog) 
     1959                                elseif (useNXcanSASOutput == 1) 
     1960                                        WriteNxCanSAS1D(activeType,fullPath,dialog) 
    19561961                                else 
    19571962                                        WriteWaves_W_Protocol(activeType,fullpath,dialog) 
Note: See TracChangeset for help on using the changeset viewer.