Uploaded image for project: 'GMAT'
  1. GMAT
  2. GMT-2906

Incorrect usage of relative paths when setting GmatFunction.FunctionPath

    Details

      Description

      The attached script sets GmatFunction.FunctionPath to a relative path, but this fails. It looks like ".." is getting interpreted as ".", or something similar.

        Gliffy Diagrams

          Attachments

          1. FunctionExample.script
            5 kB
          2. functions.zip
            0.9 kB
          3. mArray.m
            0.0 kB
          4. MatlabExample.script
            0.1 kB

            Activity

            Hide
            shughes Steven Hughes added a comment -

            Need to make sure that MATLAB functions get fixed here as well.

            CCB: P1 2013a

            Show
            shughes Steven Hughes added a comment - Need to make sure that MATLAB functions get fixed here as well. CCB: P1 2013a
            Hide
            djcinsb Darrel Conway added a comment -

            Is there a test case for MATLAB functions?

            Show
            djcinsb Darrel Conway added a comment - Is there a test case for MATLAB functions?
            Hide
            jjkparker Joel Parker added a comment -

            Same thing with MATLAB. Put mArray.m in <GMAT>/userfunctions/matlab. The error occurs when MATLAB_FUNCTION_PATH in the startup file does not point to the same path.

            Also, if you change this:
            mArray.FunctionPath = '..\userfunctions\matlab'
            to this:
            mArray.FunctionPath = '..\userfunctions\matlab\mArray.m'
            in the script, it tries to append another ".m" to the filename.

            Show
            jjkparker Joel Parker added a comment - Same thing with MATLAB. Put mArray.m in <GMAT> /userfunctions/matlab . The error occurs when MATLAB_FUNCTION_PATH in the startup file does not point to the same path. Also, if you change this: mArray.FunctionPath = '..\userfunctions\matlab' to this: mArray.FunctionPath = '..\userfunctions\matlab\mArray.m' in the script, it tries to append another ".m" to the filename.
            Hide
            djcinsb Darrel Conway added a comment -

            I found the (bad) assumption in the code that causes this for the GMAT functions. I'll look for the MATLAB side – it probably matches. The broken MATLAB interface on Linux makes it a little (but only a little) more difficult to check.

            Show
            djcinsb Darrel Conway added a comment - I found the (bad) assumption in the code that causes this for the GMAT functions. I'll look for the MATLAB side – it probably matches. The broken MATLAB interface on Linux makes it a little (but only a little) more difficult to check.
            Hide
            djcinsb Darrel Conway added a comment - - edited

            I think this is now fixed for both GMAT and MATLAB functions. I do see issues with the attached scripts – the GMAT function script is indexing incorrectly into the rv array, for example. I'm also getting a configuration error on my box for the MATLAB script, stating that the MATLAB engine fails to start (Win 7 64 bit, GMAT 32), but it does look like the relative-path specified function is found. Please confirm and close or reopen the issue.

            The code for this fix should be in builds made 7/31 or later.

            Show
            djcinsb Darrel Conway added a comment - - edited I think this is now fixed for both GMAT and MATLAB functions. I do see issues with the attached scripts – the GMAT function script is indexing incorrectly into the rv array, for example. I'm also getting a configuration error on my box for the MATLAB script, stating that the MATLAB engine fails to start (Win 7 64 bit, GMAT 32), but it does look like the relative-path specified function is found. Please confirm and close or reopen the issue. The code for this fix should be in builds made 7/31 or later.
            Hide
            jjkparker Joel Parker added a comment -

            Verified as fixed in 2012-08-24 build. Waiting for regression testing during the GmatFunction/MatlabFunction feature QA process to close.

            Show
            jjkparker Joel Parker added a comment - Verified as fixed in 2012-08-24 build. Waiting for regression testing during the GmatFunction/MatlabFunction feature QA process to close.
            Hide
            jjkparker Joel Parker added a comment -

            Tested in MatlabFunction_FunctionPath_Relative test case.

            Show
            jjkparker Joel Parker added a comment - Tested in MatlabFunction_FunctionPath_Relative test case.

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 3 hours
                  3h