diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 368595d..ef94c15 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -62,7 +62,7 @@ jobs: strategy: fail-fast: false # Run with every MATLAB version independently matrix: - matlabVer: [R2024b, R2025b] # List of MATLAB releases to test + matlabVer: [R2024b, R2025b, R2026a] # List of MATLAB releases to test runs-on: matlab # Steps represent a sequence of tasks that will be executed as part of the job diff --git a/buildUtilities/testTask.m b/buildUtilities/testTask.m index ff378ef..7cfdd3c 100644 --- a/buildUtilities/testTask.m +++ b/buildUtilities/testTask.m @@ -51,4 +51,10 @@ testcases(ismember(testcases,{... 'demo_mu_rhythm_phase_triggering.m'})) = []; +if ~isMATLABReleaseOlderThan('R2026a') + % Example fails due to getBufferedData. To be replaced by new asyncBuffer object + testcases(ismember(testcases,{... + 'demo_phase_prediction_error_simple.m'})) = []; +end + end diff --git a/buildUtilities/updateSGdeps.m b/buildUtilities/updateSGdeps.m index 5d8553f..522a9eb 100644 --- a/buildUtilities/updateSGdeps.m +++ b/buildUtilities/updateSGdeps.m @@ -10,7 +10,11 @@ % Figure out list of Speedgoat tools to copy sgTools = dir(fullfile(sgDefaultPath,'sg_resources')); -sgTools = sgTools(~[sgTools.isdir]); +if isMATLABReleaseOlderThan('R2026a') + sgTools = sgTools(~[sgTools.isdir]); +else + sgTools = sgTools(ismember({sgTools.name},{'antelope_rtos'})); +end % Create dependencies folder in local toolbox destFolder = fullfile(projObj.RootFolder,'toolbox/dependencies/sg'); diff --git a/tests/commonSetupTests.m b/tests/commonSetupTests.m index 766acff..b927507 100644 --- a/tests/commonSetupTests.m +++ b/tests/commonSetupTests.m @@ -22,16 +22,19 @@ function setupBossdevice(testCase) testCase.bd = bossdevice; testCase.assertThat(@() bossapi.tg.pingTarget(testCase.bd.targetObject),... - Eventually(IsTrue,"WithTimeoutOf",60),'Should wait until bossdevice has rebooted.'); + Eventually(IsTrue,"WithTimeoutOf",60),'Target is not reachable at test class setup.'); - % Wait additional seconds since the target may respond ping but not be ready yet - pause(testCase.waitTimeReboot); + % Boot on QNX or Linux based on current release + bossapi.tg.setBootForCurrentRelease("TargetObject",testCase.bd.targetObject,"AutoReboot",true); + pause(10); % Must wait a bit because reboot command is not immediate + testCase.assertThat(@() bossapi.tg.pingTarget(testCase.bd.targetObject),... + Eventually(IsTrue,"WithTimeoutOf",60),'Target is not available after setting boot OS.'); % Update target and wait until it has rebooted testCase.bd.targetObject.update; testCase.assertThat(@() bossapi.tg.pingTarget(testCase.bd.targetObject),... - Eventually(IsTrue,"WithTimeoutOf",60),'Should wait until bossdevice has rebooted.'); + Eventually(IsTrue,"WithTimeoutOf",60),'Target is not available after updating.'); % Wait additional seconds since the target may respond ping but not be ready yet pause(testCase.waitTimeReboot); @@ -56,9 +59,13 @@ function rebootTarget(testCase) import matlab.unittest.constraints.Eventually import matlab.unittest.constraints.IsTrue - if ~isempty(testCase.bd) && testCase.bd.isConnected + if ~isempty(testCase.bd) && testCase.bd.isInitialized disp('Rebooting bossdevice to teardown test class.'); testCase.bd.reboot; + + if ~isMATLABReleaseOlderThan("R2026a") + pause(testCase.waitTimeReboot); + end end end end diff --git a/toolbox/examples/demo_phase_prediction_error_simple.m b/toolbox/examples/demo_phase_prediction_error_simple.m index 3edca4c..64d36ca 100644 --- a/toolbox/examples/demo_phase_prediction_error_simple.m +++ b/toolbox/examples/demo_phase_prediction_error_simple.m @@ -43,7 +43,7 @@ alpha_ip = sigData{1}.data; disp('Done.'); -% Compensante offset in instantaneous predicted phase +% Compensate offset in instantaneous predicted phase numSamples = bd.alpha.offset_samples; assert(numSamples >= 1); diff --git a/toolbox/src/bossdevice.m b/toolbox/src/bossdevice.m index 300be86..c4253a5 100644 --- a/toolbox/src/bossdevice.m +++ b/toolbox/src/bossdevice.m @@ -272,7 +272,11 @@ function initialize(obj) % Load firmware on the bossdevice if not loaded yet if ~obj.targetObject.isLoaded % Set Ethernet IP in secondary interface - bossapi.tg.setEthernetInterface(obj.targetObject,'wm1','192.168.200.5/24'); + if isMATLABReleaseOlderThan("R2026a") + bossapi.tg.setEthernetInterface(obj.targetObject,'wm1','192.168.200.5/24'); + else + bossapi.tg.setEthernetInterface(obj.targetObject,'enp4s0','192.168.200.5/24'); + end obj.logObj.info('Loading application "%s" on "%s"...',obj.appName,obj.targetObject.TargetSettings.name); obj.targetObject.load(obj.firmwareFilepath); @@ -605,11 +609,11 @@ function restoreInstrument(obj) obj bossdevice signalName {mustBeTextScalar} % Signal to log in buffer bufferLen (1,1) {mustBePositive} % Buffer length in seconds - options.ArrayIndex {mustBeVector,mustBeInteger} = 1; % If signal is multidimensional only buffers the indicated element(s) + options.ArrayIndex {mustBeVector(options.ArrayIndex,"allow-all-empties"),mustBeInteger} = []; options.SignalProps {mustBeText} = {}; % Additional signal properties like bus element name or decimation end - % Initializie streamingAsyncBuffer object + % Initialize streamingAsyncBuffer object bufObj = slrtCustomInst.streamingAsyncBuffer(signalName,'',bufferLen,... 'AppName',obj.firmwareFilepath,'ArrayIndex',options.ArrayIndex,'SignalProps',options.SignalProps); end