Changeset 19
- Timestamp:
- Apr 6, 2013 4:42:18 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
User Procedures/Irena/IR1_Main.ipf
r6 r19 1 1 #pragma rtGlobals=1 // Use modern global access method. 2 #pragma version=2.5 12 #pragma version=2.52 3 3 4 4 … … 9 9 //*************************************************************************/ 10 10 11 //2.52 added check for update to run every 30 days and remind users about proper citations. 11 12 //2.51 added Guinier-Porod model (beta version of the tool) 12 13 //2.50 major update, added uncertainity estimation to Sizes and Modeling II. Reflectivity changes. … … 127 128 "About", IR1_AboutPanel() 128 129 help={"Get Panel with info about this release of Irena macros"} 130 "Check for updates", IR2C_CheckIrenaUpdate(1) 131 help={"Run Check for update and present citations to use in publications"} 129 132 "Open Irena pdf manual", IR2_OpenIrenaManual() 130 133 help={"Opens your pdf reader (Acrobat) with Irena manual in it"} … … 167 170 168 171 IR2C_CheckWIndowsProcVersions(WindowProcNames) 169 172 IR2C_CheckIrenaUpdate(0) 170 173 end 171 174 //**************************************************************************************** … … 316 319 int16 LegendUseFolderName //font size as integer 317 320 int16 LegendUseWaveName //font size as integer 321 variable LastUpdateCheck 318 322 uint32 reserved[100] // Reserved for future use 319 323 … … 344 348 print "Note that this may have changed font size and type selection originally saved with the existing experiment." 345 349 print "To change them please use \"Configure default fonts and names\"" 346 if(Defs.Version==1 ) //Lets declare the one we know as 1350 if(Defs.Version==1 || Defs.Version==2) //Lets declare the one we know as 1 347 351 DefaultFontType=Defs.PanelFontType 348 352 DefaultFontSize = Defs.defaultFontSize … … 393 397 SVAR FontType=root:Packages:IrenaConfigFolder:FontType 394 398 395 Defs.Version = 1399 Defs.Version = 2 396 400 Defs.PanelFontType = DefaultFontType 397 401 Defs.defaultFontSize = DefaultFontSize … … 2047 2051 2048 2052 2053 //**************************************************************** 2054 //**************************************************************** 2055 //*********************************** 2056 //*********************************** 2057 2058 Function IR2C_CheckIrenaUpdate(CalledFromMenu) 2059 variable CalledFromMenu 2060 //CalledFromMenu=1 run always... 2061 struct IrenaPanelDefaults Defs 2062 LoadPackagePreferences /MIS=1 "Irena" , "IrenaDefaultPanelControls.bin", 0 , Defs 2063 if(V_Flag==0 && CalledFromMenu==0) 2064 //print Defs 2065 if(Defs.Version==2) //Lets declare the one we know as 1 2066 if(datetime - Defs.LastUpdateCheck >30 * 24 * 60 * 60 || CalledFromMenu) 2067 //call check version procedure and advise user on citations 2068 IR2C_CheckVersions() 2069 Defs.LastUpdateCheck = datetime 2070 SavePackagePreferences /FLSH=1 "Irena" , "IrenaDefaultPanelControls.bin", 0 , Defs 2071 endif 2072 else 2073 Defs.Version = 2 2074 Defs.LastUpdateCheck = datetime 2075 IR2C_CheckVersions() 2076 SavePackagePreferences /FLSH=1 "Irena" , "IrenaDefaultPanelControls.bin", 0 , Defs 2077 endif 2078 else //either preferences do not exist or user asked for the check 2079 Defs.Version = 2 2080 Defs.LastUpdateCheck = datetime 2081 IR2C_CheckVersions() 2082 SavePackagePreferences /FLSH=1 "Irena" , "IrenaDefaultPanelControls.bin", 0 , Defs 2083 endif 2084 2085 end 2086 2087 //**************************************************************** 2088 //**************************************************************** 2089 static Function IR2C_CheckVersions() 2090 string PackageString 2091 //create list of Igor procedure files on this machine 2092 IR2C_ListIgorProcFiles() 2093 DoWIndow CheckForUpdatePanel 2094 if(V_Flag) 2095 DoWIndow/F CheckForUpdatePanel 2096 else 2097 Execute("CheckForUpdatePanel()") 2098 endif 2099 //Irena code 2100 string OldDf=GetDataFolder(1) 2101 //create location for the results waves... 2102 NewDataFolder/O/S root:Packages 2103 NewDataFolder/O/S root:Packages:UseProcedureFiles 2104 variable/g InstalledIrenaVersion 2105 variable/g WebIrenaVersion 2106 InstalledIrenaVersion = IR2C_FindFileVersion("Boot Irena1 modeling.ipf") 2107 //now get the web based version. 2108 NewPath /O/Q TempPath (SpecialDirPath("temporary", 0, 0, 0 )) 2109 //download the file 2110 variable InstallHadFatalError 2111 InstallHadFatalError = IR2C_DownloadFile("IgorCode/Igor Procedures/Boot Irena1 modeling.ipf","TempPath", "Boot Irena1 modeling.ipf") 2112 sleep/s 1 2113 WebIrenaVersion = IR2C_FindVersionOfSingleFile("Boot Irena1 modeling.ipf","TempPath") 2114 if(InstallHadFatalError || numtype(WebIrenaVersion)!=0) 2115 DoAlert 0, "Check for latest Irena version failed. Check you Internet connection. Try later again..." 2116 endif 2117 DeleteFile /Z /P=tempPath "Boot Irena1 modeling.ipf" 2118 SetDataFOlder OldDf 2119 end 2120 //**************************************************************** 2121 //**************************************************************** 2122 static Function IR2C_FindFileVersion(FilenameStr) 2123 string FilenameStr 2124 2125 Wave/T PathToFIles= root:Packages:UseProcedureFiles:PathToFIles 2126 Wave/T FileNames=root:Packages:UseProcedureFiles:FileNames 2127 Wave FileVersions =root:Packages:UseProcedureFiles:FileVersions 2128 variable i, imax=Numpnts(FileNames), versionFound 2129 string tempname 2130 versionFound=-1 2131 For(i=0;i<imax;i+=1) 2132 tempname = FileNames[i] 2133 if(stringmatch(tempname,FileNameStr)) 2134 versionFound = FileVersions[i] 2135 return versionFound 2136 endif 2137 endfor 2138 return -1 2139 end 2140 //**************************************************************** 2141 //**************************************************************** 2142 //**************************************************************** 2143 //**************************************************************** 2144 2145 static Function IR2C_FindVersionOfSingleFile(tempFileName,PathStr) 2146 string tempFileName, PathStr 2147 2148 string tempScraptext 2149 Grep/P=$(PathStr)/Z/E="(?i)^#pragma[ ]*version[ ]*=[ ]*" tempFileName as "Clipboard" 2150 sleep/s (0.02) 2151 tempScraptext = GetScrapText() 2152 if(strlen(tempScraptext)>10) //found line with #pragma version" 2153 tempScraptext = replaceString("#pragma",tempScraptext,"") //remove #pragma 2154 tempScraptext = replaceString("version",tempScraptext,"") //remove version 2155 tempScraptext = replaceString("=",tempScraptext,"") //remove = 2156 tempScraptext = replaceString("\t",tempScraptext," ") //remove optional tabulators, some actually use them. 2157 tempScraptext = RemoveEnding(tempScraptext,"\r") //remove optional tabulators, some actually use them. 2158 //forget about the comments behind the text. 2159 //str2num is actually quite clever in this and converts start of the string which makes sense. 2160 return str2num(tempScraptext) 2161 else //no version found, set to NaN 2162 return NaN 2163 endif 2164 2165 end 2166 2167 2168 //**************************************************************** 2169 //**************************************************************** 2170 //**************************************************************** 2171 //**************************************************************** 2172 static Function IR2C_ListIgorProcFiles() 2173 GetFileFolderInfo/Q/Z/P=Igor "Igor Procedures" 2174 if(V_Flag==0) 2175 IR2C_ListProcFiles(S_Path,1 ) 2176 endif 2177 GetFileFolderInfo/Q/Z IR2C_GetIgorUserFilesPath()+"Igor Procedures:" 2178 if(V_Flag==0) 2179 IR2C_ListProcFiles(IR2C_GetIgorUserFilesPath()+"Igor Procedures:",0) 2180 endif 2181 KillPath/Z tempPath 2182 end 2183 //**************************************************************** 2184 //**************************************************************** 2185 //**************************************************************** 2186 //**************************************************************** 2187 static Function IR2C_ListProcFiles(PathStr, resetWaves) 2188 string PathStr 2189 variable resetWaves 2190 2191 String abortMessage //HR Used if we have to abort because of an unexpected error 2192 2193 string OldDf=GetDataFolder(1) 2194 //create location for the results waves... 2195 NewDataFolder/O/S root:Packages 2196 NewDataFolder/O/S root:Packages:UseProcedureFiles 2197 //if this is top call to the routine we need to wipe out the waves so we remove old junk 2198 string CurFncName=GetRTStackInfo(1) 2199 string CallingFncName=GetRTStackInfo(2) 2200 variable runningTopLevel=0 2201 if(!stringmatch(CurFncName,CallingFncName)) 2202 runningTopLevel=1 2203 endif 2204 if(resetWaves) 2205 Make/O/N=0/T FileNames 2206 Make/O/N=0/T PathToFiles 2207 Make/O/N=0 FileVersions 2208 endif 2209 2210 2211 //if this was first call, now the waves are gone. 2212 //and now we need to create the output waves 2213 Wave/Z/T FileNames 2214 Wave/Z/T PathToFiles 2215 Wave/Z FIleVersions 2216 If(!WaveExists(FileNames) || !WaveExists(PathToFiles) || !WaveExists(FIleVersions)) 2217 Make/O/T/N=0 FileNames, PathToFIles 2218 Make/O/N=0 FileVersions 2219 Wave/T FileNames 2220 Wave/T PathToFiles 2221 Wave FileVersions 2222 //I am not sure if we really need all of those declarations, but, well, it should not hurt... 2223 endif 2224 2225 //this is temporary path to the place we are looking into now... 2226 NewPath/Q/O tempPath, PathStr 2227 if (V_flag != 0) //HR Add error checking to prevent infinite loop 2228 sprintf abortMessage, "Unexpected error creating a symbolic path pointing to \"%s\"", PathStr 2229 Print abortMessage // To make debugging easier 2230 Abort abortMessage 2231 endif 2232 2233 //list al items in this path 2234 string ItemsInTheFolder= IndexedFile(tempPath,-1,"????")+IndexedDir(tempPath, -1, 0 ) 2235 2236 //HR If there is a shortcut in "Igor Procedures", ItemsInTheFolder will include something like "HDF5 Browser.ipf.lnk". Windows shortcuts are .lnk files. 2237 2238 //remove all . files. 2239 ItemsInTheFolder = GrepList(ItemsInTheFolder, "^\." ,1) 2240 //Now we removed all junk files on Macs (starting with .) 2241 //now lets check what each of these files are and add to the right lists or follow... 2242 variable i, imax=ItemsInList(ItemsInTheFolder) 2243 string tempFileName, tempScraptext, tempPathStr 2244 variable IamOnMac, isItXOP 2245 if(stringmatch(IgorInfo(2),"Windows")) 2246 IamOnMac=0 2247 else 2248 IamOnMac=1 2249 endif 2250 For(i=0;i<imax;i+=1) 2251 tempFileName = stringfromlist(i,ItemsInTheFolder) 2252 GetFileFolderInfo/Z/Q/P=tempPath tempFileName 2253 isItXOP = IamOnMac * stringmatch(tempFileName, "*xop*" ) 2254 2255 if(V_isAliasShortcut) 2256 //HR If tempFileName is "HDF5 Browser.ipf.lnk", or any other shortcut to a file, S_aliasPath is a path to a file, not a folder. 2257 //HR Thus the "NewPath tempPath" command will fail. 2258 //HR Thus tempPath will retain its old value, causing you to recurse the same folder as before, resulting in an infinite loop. 2259 2260 //is alias, need to follow and look further. Use recursion... 2261 if(strlen(S_aliasPath)>3) //in case user has stale alias, S_aliasPath has 0 length. Need to skip this pathological case. 2262 //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. 2263 GetFileFolderInfo/Z/Q/P=tempPath S_aliasPath 2264 isItXOP = IamOnMac * stringmatch(S_aliasPath, "*xop*" ) 2265 if (V_flag==0 && V_isFolder&&!isItXOP) //this is folder, so all items in the folder are included... Except XOP is folder too... 2266 IR2C_ListProcFiles(S_aliasPath, 0) 2267 elseif(V_flag==0 && (!V_isFolder || isItXOP)) //this is link to file. Need to include the info on the file... 2268 //************* 2269 Redimension/N=(numpnts(FileNames)+1) FileNames, PathToFiles,FileVersions 2270 tempFileName =stringFromList(ItemsInList(S_aliasPath,":")-1, S_aliasPath,":") 2271 tempPathStr = RemoveFromList(tempFileName, S_aliasPath,":") 2272 FileNames[numpnts(FileNames)] = tempFileName 2273 PathToFiles[numpnts(FileNames)] = tempPathStr 2274 //try to get version from #pragma version = ... This seems to be the most robust way I found... 2275 if(stringmatch(tempFileName, "*.ipf")) 2276 Grep/P=tempPath/E="(?i)^#pragma[ ]*version[ ]*=[ ]*" tempFileName as "Clipboard" 2277 sleep/s (0.02) 2278 tempScraptext = GetScrapText() 2279 if(strlen(tempScraptext)>10) //found line with #pragma version" 2280 tempScraptext = replaceString("#pragma",tempScraptext,"") //remove #pragma 2281 tempScraptext = replaceString("version",tempScraptext,"") //remove version 2282 tempScraptext = replaceString("=",tempScraptext,"") //remove = 2283 tempScraptext = replaceString("\t",tempScraptext," ") //remove optional tabulators, some actually use them. 2284 tempScraptext = removeending(tempScraptext," \r") //remove optional tabulators, some actually use them. 2285 //forget about the comments behind the text. 2286 //str2num is actually quite clever in this and converts start of the string which makes sense. 2287 FileVersions[numpnts(FileNames)]=str2num(tempScraptext) 2288 else //no version found, set to NaN 2289 FileVersions[numpnts(FileNames)]=NaN 2290 endif 2291 else //no version for non-ipf files 2292 FileVersions[numpnts(FileNames)]=NaN 2293 endif 2294 //************ 2295 2296 2297 endif 2298 endif 2299 //and now when we got back, fix the path definition to previous or all will crash... 2300 NewPath/Q/O tempPath, PathStr 2301 if (V_flag != 0) //HR Add error checking to prevent infinite loop 2302 sprintf abortMessage, "Unexpected error creating a symbolic path pointing to \"%s\"", PathStr 2303 Print abortMessage // To make debugging easier 2304 Abort abortMessage 2305 endif 2306 elseif(V_isFolder&&!isItXOP) 2307 //is folder, need to follow into it. Use recursion. 2308 IR2C_ListProcFiles(PathStr+tempFileName+":", 0) 2309 //and fix the path back or all will fail... 2310 NewPath/Q/O tempPath, PathStr 2311 if (V_flag != 0) //HR Add error checking to prevent infinite loop 2312 sprintf abortMessage, "Unexpected error creating a symbolic path pointing to \"%s\"", PathStr 2313 Print abortMessage // To make debugging easier 2314 Abort abortMessage 2315 endif 2316 elseif(V_isFile||isItXOP) 2317 //this is real file. Store information as needed. 2318 Redimension/N=(numpnts(FileNames)+1) FileNames, PathToFiles,FileVersions 2319 FileNames[numpnts(FileNames)-1] = tempFileName 2320 PathToFiles[numpnts(FileNames)-1] = PathStr 2321 //try to get version from #pragma version = ... This seems to be the most robust way I found... 2322 if(stringmatch(tempFileName, "*.ipf")) 2323 Grep/P=tempPath/E="(?i)^#pragma[ ]*version[ ]*=[ ]*" tempFileName as "Clipboard" 2324 sleep/s(0.02) 2325 tempScraptext = GetScrapText() 2326 if(strlen(tempScraptext)>10) //found line with #pragma version" 2327 tempScraptext = replaceString("#pragma",tempScraptext,"") //remove #pragma 2328 tempScraptext = replaceString("version",tempScraptext,"") //remove version 2329 tempScraptext = replaceString("=",tempScraptext,"") //remove = 2330 tempScraptext = replaceString("\t",tempScraptext," ") //remove optional tabulators, some actually use them. 2331 //forget about the comments behind the text. 2332 //str2num is actually quite clever in this and converts start of the string which makes sense. 2333 FileVersions[numpnts(FileNames)-1]=str2num(tempScraptext) 2334 else //no version found, set to NaN 2335 FileVersions[numpnts(FileNames)-1]=NaN 2336 endif 2337 else //no version for non-ipf files 2338 FileVersions[numpnts(FileNames)-1]=NaN 2339 endif 2340 endif 2341 endfor 2342 // if(runningTopLevel) 2343 // //some output here... 2344 // print "Found "+num2str(numpnts(FileNames))+" files in "+PathStr+" folder, its subfolders and linked folders and subfolders" 2345 // KillPath/Z tempPath 2346 // endif 2347 2348 setDataFolder OldDf 2349 end 2350 2351 2352 //*********************************** 2353 //*********************************** 2354 //*********************************** 2355 //*********************************** 2356 static Function /S IR2C_Windows2IgorPath(pathIn) 2357 String pathIn 2358 String pathOut = ParseFilePath(5, pathIn, ":", 0, 0) 2359 return pathOut 2360 End 2361 //*********************************** 2362 //*********************************** 2363 //*********************************** 2364 //*********************************** 2365 2366 static Function/S IR2C_GetIgorUserFilesPath() 2367 // This should be a Macintosh path but, because of a bug prior to Igor Pro 6.20B03 2368 // it may be a Windows path. 2369 String path = SpecialDirPath("Igor Pro User Files", 0, 0, 0) 2370 path = IR2C_Windows2IgorPath(path) 2371 return path 2372 End 2373 2374 //*********************************** 2375 //*********************************** 2376 //**************************************************************** 2377 //**************************************************************** 2378 2379 static Function IR2C_DownloadFile(StringWithPathAndname,LocalPath, LocalName) 2380 string StringWithPathAndname, LocalPath, LocalName 2381 2382 variable InstallUsingLocalCopy = 0 2383 variable InstallUsinghttp = 1 2384 variable i 2385 variable APSError=0 2386 variable OtherError=0 2387 if(InstallUsingLocalCopy) 2388 string tempFldrNm 2389 tempFldrNm = removeFromList("IgorCode",StringWithPathAndname,"/") 2390 PathInfo LocalCopyForInstallation 2391 if(V_Flag==0) //local copy path was not found. 2392 //let's try to find in where Igor experiment started from, that path is known as "home" 2393 string ItemsInTheFolder= IndexedDir(home, -1, 0 ) 2394 if(stringmatch(ItemsInTheFolder, "*IgorCode;*" )) 2395 PathInfo/S home 2396 NewPath /C/O/Q LocalCopyForInstallation, S_Path+"IgorCode:" 2397 Print "Found IgorCode folder in location where this experiment started, using that folder as file source" 2398 else 2399 NewPath /C/M="Find Folder called \"IgorCode\""/O/Q LocalCopyForInstallation 2400 if(V_Flag!=0) 2401 abort "Local copy of Installation files not found and user cancelled. Visit: http://usaxs.xray.aps.anl.gov/staff/ilavsky/irena.html if you want to download it" 2402 endif 2403 endif 2404 endif 2405 PathInfo LocalCopyForInstallation 2406 GetFileFolderInfo /P=$(LocalPath) /Q /Z S_Path+ReplaceString("/", tempFldrNm, ":") 2407 if(V_Flag!=0) 2408 NewPath /C/M="Find Folder called \"IgorCode\""/O/Q LocalCopyForInstallation 2409 endif 2410 PathInfo LocalCopyForInstallation 2411 CopyFile /O/P=$(LocalPath)/Z S_Path+ReplaceString("/", tempFldrNm, ":") as LocalName 2412 // Remove ReadOnly property from the file. This is important on WIndows when copying from CD or DVD 2413 SetFileFolderInfo/P=$(LocalPath)/RO=0 LocalName 2414 elseif(!InstallUsinghttp) 2415 string httpurl="http://ftp.xray.aps.anl.gov/usaxs/" 2416 //string url="http://ftp.xray.aps.anl.gov/usaxs/" //this is http address for future use with URLencode, URLdecode, and FetchURL 2417 String httpPath = httpurl+StringWithPathAndname //HR Use local variable for easier debugging. 2418 //HR Print ftpPath //HR For debugging 2419 //// Get a binary image file from a web server and then 2420 //// save the image to a file on the desktop. 2421 httpPath = ReplaceString(" ", httpPath, "%20") //handle just spaces here... 2422 String fileBytes, tempPathStr 2423 Variable error = GetRTError(1) 2424 i=0 2425 Do 2426 fileBytes = FetchURL(httpPath) 2427 error = GetRTError(1) 2428 sleep/S 0.2 2429 if(error!=0) 2430 print "file: "+httpPath+" download FAILED, this was http download attempt No: "+num2str(i) 2431 // print "file: "+httpPath+" downloaded "+num2str(i+1)+" times" 2432 print "Trying to download same file using ftp" 2433 tempPathStr = ReplaceString("http://ftp.xray.aps.anl.gov/usaxs/", httpPath, "ftp://ftp.xray.aps.anl.gov/pub/usaxs/") 2434 fileBytes = FetchURL(tempPathStr) 2435 error = GetRTError(1) 2436 sleep/S 0.2 2437 if(error!=0) 2438 print "file: "+tempPathStr+" download FAILED, this was ftp download attempt No: "+num2str(i+1) 2439 else 2440 print "file: "+tempPathStr+" downloaded succesfully by ftp, this was ftp download attempt No: "+num2str(i+1) 2441 endif 2442 endif 2443 i+=1 2444 while((error!=0 || GrepString(fileBytes, "ERROR: Proxy Error" ))&& i<5) 2445 if ( error != 0 || GrepString(fileBytes, "ERROR: Proxy Error" ) || i>=5) 2446 if(GrepString(fileBytes, "ERROR: Proxy Error" ) ) 2447 Print "******************** APS Proxy error *******************" 2448 Print "**** Please, try installing later again or try using ftp protocol or local copy method." 2449 Print "**** Also, report problem to ilavsky@aps.anl.gov the following, so we can get this fixed:" 2450 Print "APS proxy error has consistently produced error while trying to download following file:"+StringWithPathAndname 2451 Print Date() +" "+time() 2452 print "Igor version :"+IgorInfo(3) 2453 APSError+=1 2454 elseif(error != 0 || i>=5) 2455 Print "************* S E R V E R E R R O R ****************" 2456 Print "**** Please, report problem to ilavsky@aps.anl.gov the following:" 2457 Print "Failed to get from http/ftp server following file..... " + StringWithPathAndname 2458 Print Date() +" "+time() 2459 print "Igor version :"+IgorInfo(3) 2460 endif 2461 print "******************** end of error message ********************" 2462 OtherError=1 2463 else 2464 Variable refNum 2465 Open/P=$(LocalPath) refNum as LocalName 2466 FBinWrite refNum, fileBytes 2467 Close refNum 2468 SetFileFolderInfo/P=$(LocalPath)/RO=0 LocalName 2469 endif 2470 //FTPDownload /O/V=0/P=$(LocalPath)/Z ftpPath, LocalName 2471 else 2472 string url="ftp://ftp.xray.aps.anl.gov/pub/usaxs/" 2473 //string url="http://ftp.xray.aps.anl.gov/usaxs/" //this is http address for future use with URLencode, URLdecode, and FetchURL 2474 String ftpPath = url+StringWithPathAndname //HR Use local variable for easier debugging. 2475 //HR Print ftpPath //HR For debugging 2476 //ftpPath = ReplaceString("GenCurvefit", ftpPath, "GenCurveFit", 1) //HR Quick and Dirty fix - change spelling so we find the file on the FTP server. 2477 FTPDownload /O/V=0/P=$(LocalPath)/Z ftpPath, LocalName 2478 2479 if(V_flag!=0) //ftp failed... 2480 Print "************* E R R O R ****************" 2481 Print "**** Please, report problem to ilavsky@aps.anl.gov the following:" 2482 Print "Failed to load from ftp server following file..... " + StringWithPathAndname 2483 Print Date() +" "+time() 2484 print "Igor version :"+IgorInfo(3) 2485 print "******************** end of error message ********************" 2486 else //ftyp success, change the read only flag here... 2487 // Remove ReadOnly property from the file: 2488 SetFileFolderInfo/P=$(LocalPath)/RO=0 LocalName 2489 endif 2490 endif 2491 variable nosuccess 2492 if(V_Flag!=0) 2493 nosuccess=1 2494 endif 2495 return OtherError+APSError 2496 2497 end 2498 2499 //**************************************************************** 2500 //**************************************************************** 2501 //*********************************** 2502 //*********************************** 2503 2504 2505 //Motofit paper [J. Appl. Cryst. 39, 273-276] 2506 //http://scripts.iucr.org/cgi-bin/paper?S0021889806005073 2507 //J. Appl. Cryst. (2006). 39, 273-276 [ doi:10.1107/S0021889806005073 ] 2508 //A. Nelson, Co-refinement of multiple-contrast neutron/X-ray reflectivity data using MOTOFIT 2509 // 2510 2511 2512 2513 Function IR2C_CheckVersionButtonProc(ba) : ButtonControl 2514 STRUCT WMButtonAction &ba 2515 2516 switch( ba.eventCode ) 2517 case 2: // mouse up 2518 // click code here 2519 if(stringmatch(ba.ctrlName,"OpenIrenaWebPage")) 2520 //open web page with Irena 2521 BrowseURL "http://usaxs.xray.aps.anl.gov/staff/ilavsky/irena.html" 2522 endif 2523 if(stringmatch(ba.ctrlName,"OpenIrenaManuscriptWebPage")) 2524 //open web page with Irena 2525 BrowseURL "http://dx.doi.org/10.1107/S0021889809002222" 2526 endif 2527 if(stringmatch(ba.ctrlName,"OpenGCManuscriptWebPage")) 2528 //doi:10.1007/s11661-009-9950-x 2529 BrowseURL "http://www.jomgateway.net/ArticlePage.aspx?DOI=10.1007/s11661-009-9950-x" 2530 endif 2531 if(stringmatch(ba.ctrlName,"OpenMotofitManuscriptWebPage")) 2532 //doi:10.1007/s11661-009-9950-x 2533 BrowseURL "http://scripts.iucr.org/cgi-bin/paper?S0021889806005073" 2534 endif 2535 if(stringmatch(ba.ctrlName,"OpenUFManuscriptWebPage")) 2536 BrowseURL "http://scripts.iucr.org/cgi-bin/paper?S0021889895005292" 2537 endif 2538 2539 break 2540 case -1: // control being killed 2541 break 2542 endswitch 2543 2544 return 0 2545 End 2546 //**************************************************************** 2547 //**************************************************************** 2548 //*********************************** 2549 //*********************************** 2550 2551 Window CheckForUpdatePanel() : Panel 2552 PauseUpdate; Silent 1 // building window... 2553 NewPanel /W=(116,68,880,550)/K=1 as "Irena check for updates" 2554 SetDrawLayer UserBack 2555 SetDrawEnv fsize= 20,fstyle= 3,textrgb= (0,0,65535) 2556 DrawText 114,37,"Once-per-month reminder to check for Irena update" 2557 SetDrawEnv fsize= 14,fstyle= 3,textrgb= (65535,0,0) 2558 DrawText 27,110,"Reminder: When publishing data analyzed using Irena package, please cite following manuscripts:" 2559 SetDrawEnv textrgb= (0,0,65535) 2560 DrawText 27,133,"J. Ilavsky and P. Jemian, Irena: tool suite for modeling and analysis of small- angle scattering " 2561 SetDrawEnv textrgb= (0,0,65535) 2562 DrawText 27,158,"J. Appl. Cryst. (2009). 42, 347Ð353" 2563 SetDrawEnv textrgb= (0,0,65535) 2564 DrawText 27,205,"Glassy Carbon Absolute Int. Calibration: F. Zhang, J. Ilavsky, G. G. Long, J. P.G. Quintana, " 2565 SetDrawEnv textrgb= (0,0,65535) 2566 DrawText 27,230,"A. J. Allen, and P. Jemian, Glassy Carbon as an Absolute Intensity Calibration Standard" 2567 SetDrawEnv textrgb= (0,0,65535) 2568 DrawText 27,255,"for Small-Angle Scattering, MMTA, DOI: 10.1007/s11661-009-9950-x" 2569 SetDrawEnv textrgb= (0,0,65535) 2570 DrawText 27,320,"Reflectivity: A. Nelson, Co-refinement of multiple-contrast neutron/X-ray reflectivity" 2571 SetDrawEnv textrgb= (0,0,65535) 2572 DrawText 27,345,"data using MOTOFIT, Appl. Cryst. (2006). 39, 273-276" 2573 SetDrawEnv textrgb= (0,0,65535) 2574 DrawText 27,390,"Unified Fit: G. Beaucage, Approximations Leading to a Unified Exponential/Power-Law " 2575 SetDrawEnv textrgb= (0,0,65535) 2576 DrawText 27,415,"Approach to Small-Angle Scattering, J. Appl. Cryst. (1995). 28, 717-728" 2577 2578 SetDrawEnv fstyle= 2,fsize= 10,textrgb= (0,0,0) 2579 DrawText 10,470,"This tool runs automatically every 30 days on each computer. It can be also called from the SAS sub-menu as \"Check for updates\"" 2580 2581 SetVariable InstalledIrenaVersion,pos={48,56},size={199,15},bodyWidth=100,title="Installed Irena Version" 2582 SetVariable InstalledIrenaVersion,help={"This is the current Irena version installed"} 2583 SetVariable InstalledIrenaVersion,fStyle=1 2584 SetVariable InstalledIrenaVersion,limits={0,0,0},value= root:Packages:UseProcedureFiles:InstalledIrenaVersion,noedit= 1 2585 SetVariable WebIrenaVersion,pos={297,56},size={183,15},bodyWidth=100,title="Web Irena Version" 2586 SetVariable WebIrenaVersion,help={"This is the current Irena version installed"} 2587 SetVariable WebIrenaVersion,fStyle=1 2588 SetVariable WebIrenaVersion,limits={0,0,0},value= root:Packages:UseProcedureFiles:WebIrenaVersion,noedit= 1 2589 Button OpenIrenaWebPage,pos={551,53},size={150,20},proc=IR2C_CheckVersionButtonProc,title="Open Irena web page" 2590 Button OpenIrenaManuscriptWebPage,pos={551,143},size={150,20},proc=IR2C_CheckVersionButtonProc,title="Manuscript web page" 2591 Button OpenGCManuscriptWebPage,pos={551,240},size={150,20},proc=IR2C_CheckVersionButtonProc,title="Manuscript web page" 2592 Button OpenMotofitManuscriptWebPage,pos={551,325},size={150,20},proc=IR2C_CheckVersionButtonProc,title="Manuscript web page" 2593 Button OpenUFManuscriptWebPage,pos={551,402},size={150,20},proc=IR2C_CheckVersionButtonProc,title="Manuscript web page" 2594 EndMacro 2595 //**************************************************************** 2596 //**************************************************************** 2597 //*********************************** 2598 //***********************************
Note: See TracChangeset
for help on using the changeset viewer.