Major changes to v3.xx The base version when Ken Aikin's code, and I then tried to merge in Donna's code. The code requires Igor 7 or later. Menu Cleaned up the menu so it hopefully is a little easier to use. Changed CreateICARTT1001 so it takes a mode variable and a file path string. The mode determines the behavior (1=load parameters from file, 2=make generic panel, and anything else will bring up the prompt to ask the user what they want to do). The file path can be used with mode=1 to programmatically create the panel and populate it with parameters from a file. If CreateICARTT1001 is called with the user prompt and the user then clicks cancel, nothing happens (previously the panel would get killed and then recreated). Panel: All controls on the panel were renamed so they start with the tab number, which greatly simplifies the tab controller function. Two control names were tweaked so they were less than 32 characters. Several controls were renamed to better conform to the naming convention (TX_setVar[Global string/var name]). Changed the size of the panel and various controls for better layout. Added controls for the various parts of the file name, as well as a button to create the file name. Added a checker for the inputs to file name parts. Changed all functions for controls to use the more modern STRUCTs instead of strings and vars. Added help text for many controls with a reference to the appropriate section of the ICARTT standard. Added buttons to open the help notebook, which will hopefully have more documentation than can be included on the front panel. Added a checkbox to prevent overwriting if an ICARTT file with the same name already exists. Back end: Short names are either 31 characters for versions of Igor older than 8, and 255 characters for Igor 8 and newer. Added several constants and strconstants instead of hardcoding things (e.g. the max number of parameters). Added support for ICARTT v2.0, while maintaining support for v1.1. Added the functions from the General Macros to the ICARTT ipf and renamed those functions to avoid conflict with the GM ipf. The assumption is that the GM functions are stable and won't need updating, and by including those functions in the ICARTT ipf you only need to keep track of one ipf. Removed the LOD and flagged data globals, since those are now part of the table on the first tab. Better messages in the Abort windows. The function name and line number are now displayed. There is also a constant that can be set to bring up the offending line in the ipf for easier debugging. The global VariableNamesList is now always just the dependent variables. Some previous versions set this to all parameters when loading data. Redid the part of Load_LoadHeader1001 that deals with the normal comments section to deal with carriage returns in that section and hopefully make the function more robust File creation: Added more checks when making the files, including Checks for the various parts of the file name (no illegal in the various parts) Checks for the time interval and the order of time waves (based on rules from the NASA website) Added support for having different flags (missing data, LOD) for different columns, e.g. for a mix of decimal and exponential data. There might still be some issues related to the picky fixes. Added code to replace +/-Inf in the data waves with the LOD flags (-7s and -8s). Loading: Added a string constant so the user can define the note format. The note is now no longer the entire header, which was really inconvenient for large headers. Added support for LOD flags when loading data. The default is to convert LOD flags to NaNs, but there is also a constant to convert LOD flags to +/-Inf. Change log: //2022.11.04 KJZ: Renamed all the controls to T[Tab number]_[Old name]. Changed the names of two controls and one function so they are less than 32 characters. Code requires Igor 7 or later. // Redid the tab controller function to use a STRUCT and to take advantage of the more sensible control names. Made the panel wider to make room for all the required columns in the // listbox on Tab0. Changed the font size and the color of the buttons that you need to push to make the file. Made a lot of the controls on T1 and T2 wider. Made the file path // tittlebox(?) deeper and wider to handle more folder levels. Changes to WaveListTextWaveMatrix so column3 is the standard name and column 4 is the optional name. Added a button // and function to update the revision date. Added a button with the link to the NASA variable standard names. Removed all the calls to time2yyyymmddhhmmss (in the GM ipf) since // they are unneeded. Added help text for certain controls. // Eliminated a call to List2TextWaveNoCreate (in the GM ipf) since it's not needed. Eliminated LoadICARTT1001 since it's not needed. You can pass input parameters in menu calls. // Eliminated LoadICARTTDataOnly1001 since you can pass input parameters in menu calls. // Added all needed functions from the General Macros ipf. Added "GM_" to the start of the function names to avoid conflicts with the General Macros ipfs. Eliminated some GM calls since they weren't needed. // Used MatrixOp to remove NaNs for factor of 10 increase in speed. Changed Load_SetUnitsInLoadedWaves so it writes the wave note, which is no longer the entire header. Commented out Load_HeadertoWaveNote. // Added help text to many controls pointing to the relevant section in the ICARTT document. // Added the version number to the header. Added a popup menu with the version number, along with a function to set the values of the version number and version string. // Changed how the variable parameters are written so standard names are ONLY written for ICARTT v2.0. I think it works... //2022.11.07 KJZ: Changed the appearance tag to {os9,all} for the buttons to make the panel transfer between MacOS and Windows. //2022.11.14 KJZ: Added checks to make sure there are no underscores in the dataID or locationID. Added constants for the maximum length for the file name, the variable short name, // and variable long name. Made the Data start date box non-editable, with an optional checkbox to enable editing. Maybe fixed the bug related to loading v1.1 files //2022.11.29 KJZ: Using a constant (kvMax_Num_Parameters) for the number of dependent variables. Mismatch in Load_LoadHeader and Format From Top Table about the max number of dependent vars. // Added a constant for the maximum precision on time waves. Added a check for the number of digits for time waves, and a prompt for the user if the format of the time wave in the table exceeds the max precision. // Implemented Donna's fix for when variables have non-Igor legal names. //2022.11.30 KJZ: Changed many instances of num2str to num2istr based on changes in Donna's code. Changes to the format string code. //2022.12.06 KJZ: Made the list box bigger to accommodate LLOD and ULOD columns. Added a constant for the number of columns in the listbox wave in case it changes yet again... //2023.01.06 KJZ: Added a constant to enforce the naming of the time waves (Time_Start, Time_Stop, Time_Mid). Can also set the constant to 0 to ignore this. //2023.01.09 KJZ: Changed all controls to use STRUCTs. Error checking for the time interval and time waves. Data intervals of 0 (start/stop data) now require multiple time waves, as do intervals longer than 1 second. // Renamed a few controls to better conform with the name convention (TX_setVar[Global string/var name]). //2023.04.30 KJZ: Added a function and a static strconstant to hold the wavenote format. Users can now define the wavenote as they see fit (mostly). //2023.05.01 KJZ: Added a global that controls whether duplicate waves get automatically overwritten when loading data. //2023.05.23 KJZ: v3.01: Fixed a bug found by Ken Aikin in v3.0. Removed kvVariable_ShortName_Max_Length from the constants and added code that checks the Igor // version and uses a length appropriate for the version of Igor you are using. Renumbered the steps so they start at 1. Added a help notebook with a section // for each step, and section 0 for ICARTT web resources. Added buttons to open the help notebook to the appropriate section. //2023.05.24 KJZ: v3.02: Hopefully fixed issues with loading the missing data flags from an already created ICARTT file. Rearranged the menus to hopefully be a little easier to use. Made // a new version of CreateICARTT1001 that plays nicer with the menu. Redid CreateICARTT1001 so if the user clicks cancel than nothing happens. Updated the revision date when loading // the header from a pre-existing file. Properly initialized several string globals. //2023.05.24 KJZ: v3.03: Cleaned up the functions that check the components of the file name. Reordered the controls on Tab 1 for more logical flow. //2023.05.25 KJZ: v3.04: Again moved controls around. Moved the file name controls to tab 3, which makes more sense. Added a checker for the inputs to the parts of the file name. // Made the path control much wider. Fixed a couple of bugs. Added a string input to CreateICARTT1001 so you can programatically make the panel and load parameters from a file. //2023.05.25 KJZ: v3.05: Replaced all the calls to GetRTStackInfo with ICARTT_Return_Abort_Info(1, 2), which provides the function name and the line number. //2023.05.26 KJZ: v3.06: Added a check to see if the ICARTT file already exists, and added a checkbox to prevent overwrites if desired. //2023.05.30 KJZ: v3.0.7: Bug fixes related to forgetting that ICARTT uses comma delimited lists. //2023.05.30 KJZ: v3.0.8: Removed the LOD and flagged data globals. Replaced ICARTT_IsATimeString with is ICARTT_IsATimeWave, which is a little more flexible. //2023.06.02 KJZ: v3.0.9: Support for the LOD flags when creating and loading data. Added a global to optionally go to the line that triggered the abort message (easier debugging). // Minor UI changes, better help text. Added a constant to control the help notebook font size. //2023.06.08 KJZ: v3.0.10: Added checks to FormatViaTable for issues with dependent variable time waves (Time_Stop and Time_Mid). Cleaned up the LOD flag code in CreateHeader //2023.06.09 KJZ: v3.1.0: Added in Donna's code for handling scale factors. Added some checks for the number of ULOD and LLOD flags. //2023.06.11 KJZ: v3.2.0: Rewrote the part of Load_LoadHeader1001 that handles the normal comments section. Now should be able to handle carriage returns in those entries, and should be immune to many other issues. //2023.06.12 KJZ: v3.2.1: Fixed a small issue in Load_LoadHeader1001. The GUI separates the column titles with a comma and space, but other files just use a comma. Added a check for this. //2023.06.12 KJZ: v3.2.2: More general fix to the issue above. //2023.06.13 KJZ: v3.2.3: Added check for bad characters in standard names //2023.08.04 KJZ: v3.3.0: Added a window hook for vertical and horizontal scrolling in the listbox. Fixed some text in the help notebook and help boxes. Commented out the check for all the sections in the second part of the header //2023.08.08 KJZ: v3.3.1: Fixed a bug related to getting the LODs when loading from a template (ULOD and LLOD were swapped). //2023.08.09 KJZ: v3.4.0: Modified LoadICARTT1001_WithAccessType to include an optional input to force the ICARTT version to that specified by the user. Changed Load_LoadHeader1001 so it no // longer calls Load_GetNumHeaderLinesFileTyp. Added a constant for the defualt ICARTT version number that will get used when loading header values from an existing file. //2023.08.10 KJZ: v3.4.1: Added the LLOD and ULOD (if they exist) to the wave note when loading. //2023.08.11 KJZ: v3.4.2: Removed the version number from the file name. Version number is now just in the #pragma. //2023.10.19 KJZ: v3.4.3: Made the external links in the help notebook have a yellow background. Changed the names of the help functions. //2023.10.31 KJZ: v3.4.4: Added some more text to the help notebook, moved some controls around on the front tab and made some font sizes bigger. //2023.11.01 KJZ: v3.6.0: Changed the function that makes the file so all checks that could cause an abort happen BEFORE you start making the data file. Added a check to make sure you have an LOD value // if there are points that get LOD flagged. //2023.11.03 KJZ: v3.6.1: Added Return 1 to the actions in the panel hook. //2023.11.15 KJZ: v3.7.0: Changed the code for the radio buttons to remove hardcoded control names. Changed the name of T2_radioRevisionComments to T2_radioRevision. // Added a hook for the edit parameter notebook to ask the user if they want to update the text when closing the notebook. Changed the notebook to formatted. // Added code so you can't change the radio button if the edit parameter notebook is open. Go rid of the accept button. //2024.01.02 KJZ: v3.7.1: Fixed a bug related to revision numbers greater than 9. //2025.02.27 KJZ: v3.8.G: Fixed a bug caused by the revision comments being in the wrong order (e.g. oldest comment was first). Cleaned up the code for parsing the normal comments. // Fixed a bug where the number of header lines wasn't properly set if the number in the file was different from the number in reality. Added support for multiple // lines starting with the same normal comment field. Add code to correct for the number of special comment lines being wrong. The total number of header lines, the // number of special comment lines, and the number of normal comment lines can all be wrong, and the code should be able to correct for that. Better formatting for the // warning messages. Added code to handle multiple entries on the revision line (e.g. REVISION: R0, RA). Added code to handle missing revision comments. Better // navigation in the help notebook that avoids creating global system variables in the data browser. Added checks for the wrong number of header lines. Fixes to the wave // note creator to better handle special comments. Cleaned up the case in the names of various functions.