Changeset 948


Ignore:
Timestamp:
May 26, 2020 2:26:54 PM (2 years ago)
Author:
ilavsky
Message:

GHInstaller version 1.11, added right click "make limits nice" function

Location:
trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Installers/GitHub/GHInstaller_main.ipf

    r861 r948  
    11#pragma TextEncoding = "UTF-8"          // For details execute DisplayHelpTopic "The TextEncoding Pragma"
    22#pragma rtGlobals=3             // Use modern global access method and strict wave access.
    3 #pragma version = 1.09
    4 #pragma IgorVersion = 7.05
     3#pragma version = 1.11
     4#pragma IgorVersion = 8.03
    55
    66
     
    1212Strconstant NameOfInstallMessageFile ="InstallMessage.ifn"
    1313
     14//1.11 critical upgrade, fix for bug in code which relies on bug in Igor behavior which will be fixed in Igor 8.05 and 9
     15//1.10 adds ability to delete folders on desktop
    1416//1.09 adds better unzip for Windows 8 and 10.
    1517//1.08 added better messages for failed installations.
  • trunk/Installers/GitHub/GHInstaller_support.ipf

    r861 r948  
    11#pragma TextEncoding = "UTF-8"         // For details execute DisplayHelpTopic "The TextEncoding Pragma"
    22#pragma rtGlobals=3             // Use modern global access method and strict wave access.
    3 #pragma version = 1.09
    4 
    5 
    6 //1.09 added for Windows 8+ uznip method using PowerShell per: https://www.wavemetrics.com/code-snippet/expand-zip-archive-platform-agnostic
     3#pragma version = 1.11
     4
     5
     6
     7//1.11 critical upgrade, fix for bug in code which relies on bug in Igor behavior which will be fixed in Igor 8.05 and 9
    78//1.08 added better messaging to user for failed installations
    89//1.05 minor fixes
     
    819820                                //HR Recurse only if S_aliasPath points to a folder. I don't really know what I'm doing here but this seems like it will prevent the infinite loop.
    820821                                GetFileFolderInfo/Z/Q/P=tempPath S_aliasPath   
    821                                 isItXOP = IamOnMac * stringmatch(S_aliasPath, "*xop*" )
     822                                isItXOP = IamOnMac * stringmatch(S_Path, "*xop*" )
    822823                                if (V_flag==0 && V_isFolder&&!isItXOP)          //this is folder, so all items in the folder are included... Except XOP is folder too...
    823                                         GHW_ListProcFiles(S_aliasPath, 0,LocateWhere)
     824                                        GHW_ListProcFiles(S_Path, 0,LocateWhere)
    824825                                elseif(V_flag==0 && (!V_isFolder || isItXOP))   //this is link to file. Need to include the info on the file...
    825826                                        //*************
    826827                                        Redimension/N=(numpnts(FileNames)+1) FileNames, PathToFiles,FileVersions
    827                                         tempFileName =stringFromList(ItemsInList(S_aliasPath,":")-1, S_aliasPath,":")
    828                                         tempPathStr = RemoveFromList(tempFileName, S_aliasPath,":")
     828                                        tempFileName =stringFromList(ItemsInList(S_Path,":")-1, S_Path,":")
     829                                        tempPathStr = RemoveFromList(tempFileName, S_Path,":")
    829830                                        FileNames[numpnts(FileNames)-1] = tempFileName
    830831                                        PathToFiles[numpnts(FileNames)-1] = tempPathStr
     
    14541455                GHW_MakeRecordOfProgress("Installation from local folder "+LocalFolderPath+" finished. All done. " )
    14551456                GHW_SubmitRecordToWeb(ListOfPackagesToInstall, SelectedReleaseName, "success")
    1456                 DoAlert /T="Installation succesfully finished" 0, "Requested Installation finished succesfully. Delete the distribution zip file, folder with unzipped data and InstallLog.txt, if you do not need them anymore."
     1457                DoAlert /T="Installation succesfully finished" 0, "Requested Installation finished succesfully. Igor will next try to delete distribution zip file, folder with unzipped data, and InstallLog.txt. Let it do so unless you expect to need them. "
     1458                DeleteFile /P=userDesktop/Z  InternalDataName+".zip"
     1459                DeleteFile /P=userDesktop/Z  "InstallRecord.log"
     1460                DeleteFolder /P=userDesktop/Z  InternalDataName
    14571461        endif   
    14581462        SetDataFolder saveDFR                                   // Restore current data folder
     
    29092913        if(V_Flag)
    29102914                DoWindow/F Inst_Help
    2911         else
    2912 
    2913         String nb = "Inst_Help"
    2914         NewNotebook/N=$nb/F=1/V=1/K=1/ENCG={3,1}/W=(311.25,40.25,882.75,792.5)
    2915         Notebook $nb defaultTab=36, magnification=100
    2916         Notebook $nb showRuler=1, rulerUnits=1, updating={1, 60}
    2917         Notebook $nb newRuler=Normal, justification=0, margins={0,0,468}, spacing={0,0,0}, tabs={}, rulerDefaults={"Arial",10,0,(0,0,0)}
    2918         Notebook $nb newRuler=Header, justification=1, margins={0,0,468}, spacing={0,0,0}, tabs={}, rulerDefaults={"Arial",10,0,(0,0,0)}
    2919         Notebook $nb ruler=Header, fSize=12, fStyle=1, text="Installer for Irena, Nika, and Indra packages\r"
    2920         Notebook $nb text="using Github depository.\r"
    2921         Notebook $nb text="https://github.com/jilavsky/SAXS_IgorCode\r"
    2922         Notebook $nb ruler=Normal, fSize=-1, fStyle=-1, text="\r"
    2923         Notebook $nb fStyle=2, text="Jan Ilavsky, September 2019\r"
    2924         Notebook $nb fStyle=-1, text="\r"
    2925         Notebook $nb fStyle=1, text="NOTE: ", fStyle=-1, text="Install ONLY packages you really need. Here are hints...\r"
    2926         Notebook $nb text="Irena ... package for modeling of small-angle scattering data (and reflectivity)\r"
    2927         Notebook $nb text="Nika ... package for reduction of data from area detectors (pinhole cameras) 2D -> 1D\r"
    2928         Notebook $nb text="Indra ... package for data reduction of USAXS data (NOTE: unless you measured on my instrument or own Ri"
    2929         Notebook $nb text="gaku USAXS, this is _NOT_ for you) \r"
    2930         Notebook $nb text="\r"
    2931         Notebook $nb fStyle=3, textRGB=(52428,1,1)
    2932         Notebook $nb text="Help:\r"
    2933         Notebook $nb fStyle=-1, textRGB=(0,0,0), text="\r"
    2934         Notebook $nb text="1. ", fStyle=4, textRGB=(0,0,65535), text="https://www.youtube.com/channel/UCDTzjGr3mAbRi3O4DJG7xHA\r"
    2935         Notebook $nb fStyle=-1, textRGB=(0,0,0), text="2. ", fStyle=4, textRGB=(0,0,65535)
    2936         Notebook $nb text="https://saxs-igorcodedocs.readthedocs.io/en/stable/Installation.html#instructions-for-installation\r"
    2937         Notebook $nb fStyle=-1, textRGB=(0,0,0), text="3. ", fStyle=4, textRGB=(0,0,65535)
    2938         Notebook $nb text="https://github.com/jilavsky/SAXS_IgorCode/wiki/Installation-Problems", fStyle=-1, textRGB=(0,0,0)
    2939         Notebook $nb text=" \r"
    2940         Notebook $nb text="\r"
    2941         Notebook $nb fStyle=1, text="Requirements", fStyle=-1, text=": \r"
    2942         Notebook $nb text="1.   Igor 7.05 and higher.  \r"
    2943         Notebook $nb text="2.   Access to the depository or downloaded zip file of a release from this depository ("
    2944         Notebook $nb fSize=9, fStyle=1, text="https://github.com/jilavsky/SAXS_IgorCode)\r"
    2945         Notebook $nb fSize=-1, fStyle=-1, text="\r"
    2946         Notebook $nb fStyle=1, textRGB=(65535,0,0), text="Use", fStyle=-1, textRGB=(0,0,0), text=": \r"
    2947         Notebook $nb text="Select from \"", fStyle=2, text="Instal Packages", fStyle=-1, text="\" the menu the option \"", fStyle=2
    2948         Notebook $nb text="Open GitHub GUI", fStyle=-1, text="\" to get the \"", fStyle=2, text="Install/Uninstall Package"
    2949         Notebook $nb fStyle=-1, text="\"  \r"
    2950         Notebook $nb text="Select location of distribution you want to use: \r"
    2951         Notebook $nb text="a/\tYou can use Github itself and this program will download zip file and install form it:\r"
    2952         Notebook $nb fStyle=3, text="\tIf selected, uncheck the \"Use Local Folder?\" and then push \"Check packages versions\". \r"
    2953         Notebook $nb fStyle=-1
    2954         Notebook $nb text="b/\tYou can use local copy of the depository. Download zip file with version of packages from Github manu"
    2955         Notebook $nb text="ally, unzip, and place the folder from inside of the zip frile (typically named SAXS_IgorCode_MonthYear)"
    2956         Notebook $nb text=" on the desktop together with this Igor Installer experiment. Run from there. ", fStyle=3
    2957         Notebook $nb text="\tCheck the \"Use Local Folder?\" and then push \"Check packages versions\"\r"
    2958         Notebook $nb fStyle=-1, text="\r"
    2959         Notebook $nb text="Installer will check what is available on your computer and in selected depository. It will offer table "
    2960         Notebook $nb text="with versions. \r"
    2961         Notebook $nb text="\tSelect package/releases to install (or unistall)  in \"", fStyle=2, text="Select release to install"
    2962         Notebook $nb fStyle=-1, text="\". \r"
    2963         Notebook $nb text="\tPush \"Install/Update\" or \"Unistall\" buttons as needed\r"
    2964         Notebook $nb text="\r"
    2965         Notebook $nb text="when succesfully finished, you will get \"All done.\" Alert window and message in the history area. \r"
    2966         Notebook $nb text="\r"
    2967         Notebook $nb fStyle=1, text="Beta versions", fStyle=-1
    2968         Notebook $nb text=": If you need/want latest beta version, check checkbox \"Include Beta releases\" and list in \"Select relea"
    2969         Notebook $nb text="se to install\" will include Beta versions and \"master\".  Beta versions are designated by depository main"
    2970         Notebook $nb text="tainer, \"", fStyle=1, text="master", fStyle=-1
    2971         Notebook $nb text="\" is latest version at the time of download available in the depository. Note, there are no guarrantees "
    2972         Notebook $nb text="the master will even work, that code is under developement! You may want to check with maintainer if it "
    2973         Notebook $nb text="is smart to install it. \r"
    2974         Notebook $nb text="\r"
    2975         Notebook $nb fStyle=3, textRGB=(52428,1,1)
    2976         Notebook $nb text="Master: Install Master only when instructed by auhtor. Typically because a bug you have issues with was"
    2977         Notebook $nb text=" fixed for you.", fStyle=1, text="  \r"
    2978         Notebook $nb fStyle=-1, textRGB=(0,0,0), text="\r"
    2979         Notebook $nb text="If there are problems, you will get error message with instructions. First follow instructions on :"
    2980         Notebook $nb fStyle=4, textRGB=(0,0,65535), text=" https://github.com/jilavsky/SAXS_IgorCode/wiki/Installation-Problems \r"
    2981         Notebook $nb fStyle=-1, textRGB=(0,0,0), text="\r"
    2982         Notebook $nb text="If that does not work, let me know and", textRGB=(0,1,2), text=", please, send me the log file \""
    2983         Notebook $nb textRGB=(0,0,0), text="InstallRecord.txt", textRGB=(0,1,2)
    2984         Notebook $nb text="\" from your desktop together with information on yoru computer - Windows version, path to your .../Wavem"
    2985         Notebook $nb text="etrics/Igor Pro User Files and anything else special on yrou computer.\r"
    2986         Notebook $nb textRGB=(0,0,0), text="\r"
    2987         Notebook $nb text="After sucessful installation, delete the distribution zip file, unzipped folder and the logfile (Install"
    2988         Notebook $nb text="Record.txt) file from desktop.\r"
    2989         Notebook $nb text="\r"
    2990         Notebook $nb text="note: download of distribution zip file may take a long time (they are around 100Mb). You may want to ke"
    2991         Notebook $nb text="ep it in case you want to reinstall in short future. If proper zip file is found on desktop, it will be "
    2992         Notebook $nb text="used even in subsequent installations. \r"
    2993         Notebook $nb text="\r"
    2994         Notebook $nb text="Install xop files based on bit-version you intend to use (or simply install both if you have 64-bit mach"
    2995         Notebook $nb text="ine). The xop packages are needed for any package.\r"
    2996         Notebook $nb text="\r"
    2997         Notebook $nb text="After any unistallation, you should reinstall packages you intend to use. Another words, since packages "
    2998         Notebook $nb text="share libraries, after any uninstallation of only one package the other packages are likely unusable. \r"
    2999         Notebook $nb text="\r"
    3000         Notebook $nb text="*** ", fSize=11, fStyle=1, textRGB=(52428,1,1)
    3001         Notebook $nb text="You can always update to the latest version of the packages using this experiment. When I update the on "
    3002         Notebook $nb text="line depository, this experiment will pick the listing and re-download ALL packages again. To check whic"
    3003         Notebook $nb text="h version is the last one available on the web, use button \"Check packages versions"
    3004         Notebook $nb fSize=-1, fStyle=-1, textRGB=(0,1,2), text="\".\r"
    3005         Notebook $nb text="\r"
    3006         Notebook $nb text="ilavsky@aps.anl.gov\r"
    3007         Notebook $nb selection={startOfFile,startOfFile}, findText={"",1}
     2915        else   
     2916                String nb = "Inst_Help"
     2917                NewNotebook/N=$nb/F=1/V=1/K=1/ENCG={3,1}/W=(159,40.25,652.5,736.25)
     2918                Notebook $nb defaultTab=36, magnification=100
     2919                Notebook $nb showRuler=1, rulerUnits=1, updating={1, 60}
     2920                Notebook $nb newRuler=Normal, justification=0, margins={0,0,468}, spacing={0,0,0}, tabs={}, rulerDefaults={"Arial",10,0,(0,0,0)}
     2921                Notebook $nb newRuler=Header, justification=1, margins={0,0,468}, spacing={0,0,0}, tabs={}, rulerDefaults={"Arial",10,0,(0,0,0)}
     2922                Notebook $nb ruler=Header, fSize=12, fStyle=1, text="Installer for Irena, Nika, and Indra packages\r"
     2923                Notebook $nb text="using Github depository.\r"
     2924                Notebook $nb text="https://github.com/jilavsky/SAXS_IgorCode\r"
     2925                Notebook $nb ruler=Normal, fSize=-1, fStyle=-1, text="\r"
     2926                Notebook $nb fStyle=2, text="Jan Ilavsky, May 2020\r"
     2927                Notebook $nb fStyle=-1, text="\r"
     2928                Notebook $nb fStyle=1, text="NOTE:", fSize=9, text=" ", fStyle=-1
     2929                Notebook $nb text="Install ONLY packages you really need. Here are hints...\r"
     2930                Notebook $nb text="Irena ... package for modeling of small-angle scattering data (and reflectivity)\r"
     2931                Notebook $nb text="Nika ...  package for reduction of data from area detectors (pinhole cameras) 2D -> 1D\r"
     2932                Notebook $nb text="Indra ... package for data reduction of USAXS data (unless you measured on APS USAXS or own Rigaku USAXS"
     2933                Notebook $nb text=", this is _NOT_ for you) \r"
     2934                Notebook $nb fSize=-1, text="\r"
     2935                Notebook $nb fStyle=3, textRGB=(52428,1,1), text="Help:\r"
     2936                Notebook $nb fStyle=-1, textRGB=(0,0,0), text="\r"
     2937                Notebook $nb text="1. ", fStyle=4, textRGB=(0,0,65535), text="https://www.youtube.com/channel/UCDTzjGr3mAbRi3O4DJG7xHA\r"
     2938                Notebook $nb fStyle=-1, textRGB=(0,0,0), text="2. ", fStyle=4, textRGB=(0,0,65535)
     2939                Notebook $nb text="https://saxs-igorcodedocs.readthedocs.io/en/stable/Installation.html#instructions-for-installation\r"
     2940                Notebook $nb fStyle=-1, textRGB=(0,0,0), text="3. ", fStyle=4, textRGB=(0,0,65535)
     2941                Notebook $nb text="https://github.com/jilavsky/SAXS_IgorCode/wiki/Installation-Problems", fStyle=-1, textRGB=(0,0,0)
     2942                Notebook $nb text=" \r"
     2943                Notebook $nb text="\r"
     2944                Notebook $nb fStyle=1, text="Requirements", fStyle=-1, text=": \r"
     2945                Notebook $nb fSize=9
     2946                Notebook $nb text="1.   Igor 8.04 or higher.  Igor 7.08 is end of life, upgrade (it may still work, but is untested now). \r"
     2947                Notebook $nb text="2.   Access to the depository or downloaded zip file of a release from this depository (", fStyle=1
     2948                Notebook $nb text="https://github.com/jilavsky/SAXS_IgorCode)\r"
     2949                Notebook $nb fSize=-1, fStyle=-1, text="\r"
     2950                Notebook $nb fStyle=1, textRGB=(65535,0,0), text="Use", fStyle=-1, textRGB=(0,0,0), text=": \r"
     2951                Notebook $nb text="1.\tSelect from \"", fStyle=2, text="Instal Packages", fStyle=-1, text="\" the menu the option \""
     2952                Notebook $nb fStyle=2, text="Open GitHub GUI", fStyle=-1, text="\" to get the \"", fStyle=2, text="Install/Uninstall Package"
     2953                Notebook $nb fStyle=-1, text="\"  Panel. \r"
     2954                Notebook $nb text="2.\tSelect method of distribution you want to use: \r"
     2955                Notebook $nb fSize=9, text="\ta/\t", fStyle=1, text="Default is Github", fStyle=-1
     2956                Notebook $nb text=". Installer will download zip file, unzip, and install from it. \r"
     2957                Notebook $nb text="\t\tMake sure the \"", fStyle=1, text="Use Local Folder", fStyle=-1, text="?\"checkbox is ", fStyle=5
     2958                Notebook $nb text="unchecked", fStyle=-1, text=".  \r"
     2959                Notebook $nb text="\t\tPush \"", fStyle=1, text="Check packages versions", fStyle=-1, text="\". \r"
     2960                Notebook $nb text="\tb/\t", fStyle=1, text="Optional is local copy", fStyle=-1, text=" of the depository. \r"
     2961                Notebook $nb text="\t\tMake sure the \"", fStyle=1, text="Use Local Folder", fStyle=-1, text="?\"checkbox is ", fStyle=5
     2962                Notebook $nb text="checked", fStyle=4, text=".\r"
     2963                Notebook $nb fStyle=-1, text="\t\tDownload zip file with version of packages from Github manually.\r"
     2964                Notebook $nb text="\t\tUnzip, and place the folder from inside of the zip file (typically named SAXS_IgorCode_MonthYear) \r"
     2965                Notebook $nb text="\t\t\ton the desktop together with this Igor Installer experiment.\r"
     2966                Notebook $nb text="\t\tPush \"", fStyle=1, text="Check packages versions", fStyle=-1, text="\"\r"
     2967                Notebook $nb fSize=-1, text="\r"
     2968                Notebook $nb text="3.\tInstaller will check what version is available. It will offer table with versions. \r"
     2969                Notebook $nb text="4.\tSelect package/releases to install (or unistall)  in \"", fStyle=3, text="Select release to install"
     2970                Notebook $nb fStyle=-1, text="\". \r"
     2971                Notebook $nb text="5.\tPush \"", fStyle=1, text="Install/Update", fStyle=-1, text="\" or \"", fStyle=1, text="Unistall"
     2972                Notebook $nb fStyle=-1, text="\" buttons as needed\r"
     2973                Notebook $nb text="\r"
     2974                Notebook $nb text="when succesfully finished, you will get \"All done.\" Alert window and message in the history area. \r"
     2975                Notebook $nb text="\r"
     2976                Notebook $nb fStyle=1, text="Beta versions", fStyle=-1, text=": \r"
     2977                Notebook $nb text="If you need/want latest beta version, check checkbox \"", fStyle=1, text="Include Beta releases"
     2978                Notebook $nb fStyle=-1, text="\" and list in \"", fStyle=1, text="Select release to install", fStyle=-1
     2979                Notebook $nb text="\" will include Beta versions and \"", fStyle=1, text="master", fStyle=-1
     2980                Notebook $nb text="\" (listed at the end of the list).  \r"
     2981                Notebook $nb text="\t", fStyle=1, text="Beta versions", fStyle=-1
     2982                Notebook $nb text=" are released as needed when code is relatively stable. \r"
     2983                Notebook $nb text="\t\"", fStyle=1, text="master", fStyle=-1
     2984                Notebook $nb text="\" is latest version at the time of download available in the depository. \r"
     2985                Notebook $nb text="Note, there are no guarrantees the master will even work, that code is under developement! "
     2986                Notebook $nb fStyle=3, textRGB=(52428,1,1)
     2987                Notebook $nb text="Install Master only when instructed by author. Typically because a bug you have issues with was fixed fo"
     2988                Notebook $nb text="r you.", fStyle=1, text="  \r"
     2989                Notebook $nb fStyle=-1, textRGB=(0,0,0), text="\r"
     2990                Notebook $nb text="If there are problems, you will get error message with instructions. First follow instructions on :"
     2991                Notebook $nb fStyle=4, textRGB=(0,0,65535), text=" https://github.com/jilavsky/SAXS_IgorCode/wiki/Installation-Problems \r"
     2992                Notebook $nb fStyle=-1, textRGB=(0,0,0), text="\r"
     2993                Notebook $nb text="If that does not work, let author know and", textRGB=(0,1,2), text=", please, send me the log file \""
     2994                Notebook $nb textRGB=(0,0,0), text="InstallRecord.txt", textRGB=(0,1,2)
     2995                Notebook $nb text="\" from your desktop together with information on yoru computer - Windows version, path to your .../Wavem"
     2996                Notebook $nb text="etrics/Igor Pro User Files and anything else special on yrou computer.\r"
     2997                Notebook $nb textRGB=(0,0,0), text="\r"
     2998                Notebook $nb text="After sucessful installation, code will attempt to delete the distribution zip file and the unzipped fol"
     2999                Notebook $nb text="der from desktop. It will ask for permissions to do it. If it fails - or you do not let it - do it manua"
     3000                Notebook $nb text="lly. You can delete also the logfile (InstallRecord.txt) file from desktop.\r"
     3001                Notebook $nb text="\r"
     3002                Notebook $nb text="note: download of distribution zip file may take a long time (they are around 100Mb). You may want to ke"
     3003                Notebook $nb text="ep it in case you want to reinstall in short future. If proper zip file is found on desktop, it will be "
     3004                Notebook $nb text="used even in subsequent installations. \r"
     3005                Notebook $nb text="\r"
     3006                Notebook $nb text="Install xop files based on bit-version you intend to use (or simply install both if you have 64-bit mach"
     3007                Notebook $nb text="ine). The xop packages are needed for any package.\r"
     3008                Notebook $nb text="\r"
     3009                Notebook $nb text="After any unistallation, you should reinstall packages you intend to use. Another words, since packages "
     3010                Notebook $nb text="share libraries, after any uninstallation of only one package the other packages are likely unusable. \r"
     3011                Notebook $nb text="\r"
     3012                Notebook $nb text="*** ", fSize=11, fStyle=1, textRGB=(52428,1,1)
     3013                Notebook $nb text="You can always update to the latest version of the packages using this experiment. When I update the on "
     3014                Notebook $nb text="line depository, this experiment will pick the listing and re-download ALL packages again. To check whic"
     3015                Notebook $nb text="h version is the last one available on the web, use button \"Check packages versions"
     3016                Notebook $nb fSize=-1, fStyle=-1, textRGB=(0,1,2), text="\".\r"
     3017                Notebook $nb text="\r"
     3018                Notebook $nb text="ilavsky@aps.anl.gov\r"
    30083019        endif
    30093020end
  • trunk/User Procedures/Indra 2/IN2_GeneralProcedures.ipf

    r945 r948  
    1 IN2G_FindNu#pragma rtGlobals=2          // Use modern global access method.
     1#pragma rtGlobals=2             // Use modern global access method.
    22#pragma version = 2.24
    33#pragma IgorVersion = 7.05
     
    507507       "Save as pxp", IN2G_SaveTopGraphPXP()
    508508       "Clone this window with data", IN2G_CloneWindow()
     509       "Make limits Nice", IN2G_MakeGrphLimitsNice()
    509510End
    510511
     
    15351536                                //Grep/P=$(PathStr)/Z/E="(?i)^#pragma[ ]*version[ ]*=[ ]*" tempFileName as "Clipboard"
    15361537                Grep/P=$(PathStr)/Z/Q/LIST/E="(?i)^#pragma[ ]*version[ ]*=[ ]*" tempFileName
    1537                                 //print S_Value
    1538                                 ///sleep/s (0.02)
     1538                //SVAR S_Value
    15391539                tempScraptext = S_Value //GetScrapText()
    15401540                if(strlen(tempScraptext)>10)            //found line with #pragma version"
     
    40684068        KillWaves/Z M_colors
    40694069end
     4070////*****************************************************************************************************************
     4071////*****************************************************************************************************************
     4072
     4073Function IN2G_MakeGrphLimitsNice([topGraphStr])
     4074        string topGraphStr
     4075
     4076        IN2G_PrintDebugStatement(IrenaDebugLevel, 5,"")
     4077        String topGraph
     4078        if(ParamIsDefault(topGraphStr))
     4079                topGraph=WinName(0,1)
     4080        else
     4081                topGraph=topGraphStr   
     4082        endif
     4083        //this will now set nice limits for the top graph
     4084        string AxisUsed=AxisList(topGraph)
     4085        string OneAxis, AxisInfoStr
     4086        variable i, isLog, CurMin, CurMax, newMin, newMax
     4087        For(i=0;i<ItemsInList(AxisUsed);i+=1)
     4088                OneAxis = stringFromList(i, AxisUsed)
     4089                AxisInfoStr= AxisInfo(topGraph, OneAxis )
     4090                isLog = NumberByKey("log(x)", AxisInfoStr, "=", ";")
     4091                GetAxis /W=$(topGraph)/Q $(OneAxis)
     4092                CurMin = V_min
     4093                CurMax = V_max
     4094                if(isLog)               
     4095                        newMin = IN2G_NiceSignificant(CurMin,1,0)
     4096                        newMax = IN2G_NiceSignificant(CurMax,1,1)
     4097                else
     4098                        newMin = IN2G_NiceSignificant(CurMin,1,0)
     4099                        newMax = IN2G_NiceSignificant(CurMax,1,1)
     4100                endif
     4101                SetAxis /W=$(topGraph) $(OneAxis), newMin, newMax
     4102
     4103        endfor
     4104end
     4105//*****************************************************************************************************************
     4106//*****************************************************************************************************************
     4107
     4108Function IN2G_NiceSignificant(val,N, UpDown)        // round val to N significant figures
     4109        Variable val                    // input value to round
     4110        Variable N                      // number of significant figures
     4111        variable UpDown                                    // 1 for up, 0 for down.
     4112
     4113                        IN2G_PrintDebugStatement(IrenaDebugLevel, 5,"")
     4114        if (val==0 || numtype(val))
     4115                return val
     4116        endif
     4117        Variable is,tens
     4118        is = sign(val)
     4119        val = abs(val)
     4120        tens = 10^(N-floor(log(val))-1)
     4121        if(UpDown)     
     4122         return is*ceil(val*tens)/tens
     4123       else
     4124         return is*floor(val*tens)/tens
     4125       endif
     4126End
     4127
    40704128////*****************************************************************************************************************
    40714129////*****************************************************************************************************************
Note: See TracChangeset for help on using the changeset viewer.