Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ This library facilitates access to scientific data hosted by [Ocean Networks Can

This repository is synchronized to the [MATLAB ONC API Client Add-On](https://www.mathworks.com/matlabcentral/fileexchange/74065-ocean-networks-canada-api-client-library) which can be installed from the MATLAB Add-on explorer (please search for the "onc" Add-on).

## Requirements

* **MATLAB Version:** The MATLAB API client has been tested on MATLAB R2022b.
* **Possible Compatibility:** Basic unit testing on MATLAB R2018a indicates general compatibility with this version. While the client may work on versions newer than R2018a, compatibility with versions other than R2022b has not been explicitly verified.
* **Unsupported Versions:** MATLAB versions older than R2018a are not supported.


## Documentation

For complete documentation and examples, visit [ONC File Exchange](https://www.mathworks.com/matlabcentral/fileexchange/74065-ocean-networks-canada-api-client-library)
Expand Down
7 changes: 7 additions & 0 deletions doc/GettingStarted.html
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ <h2 id ="2">Contents</h2>
<p><b>To navigate directly to a specific part of the documentation (use the internal links), right-click on the section you're interested and select "Open" or "Open in New Tab".</b></p>
<div>
<ul>
<li><a href="#req">Requirements</a></li>
<li><a href="#3">Before using the library (How to get token)</a></li>
<li><a href="#4">General Tutorial - 1. Searching with discovery services</a>
<ul>
Expand All @@ -164,6 +165,12 @@ <h2 id ="2">Contents</h2>

</ul>
</div>

<h2 id="req">Requirements</h2>
<p>The MATLAB API client has been tested on <b>MATLAB R2022b</b>.</p>
<p>Basic unit testing on MATLAB R2018a indicates general compatibility with this version. While the client may work on versions newer than R2018a, compatibility with versions other than R2022b has not been explicitly verified.</p>
<p>MATLAB versions older than R2018a are <b>not supported</b>.</p>

<h2 id="3">Before using the library</h2>
<p>You'll need a token to access all the web services. </p>
<div class="highlighted">
Expand Down
4 changes: 2 additions & 2 deletions onc/+ext/ConsoleProgressBar.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
percent double = 0.0
segments uint32 = 10
chHead char = '>'
chBody char = '='
chTrack char = '·'
chBody char = '#'
chTrack char = '-'
chLeft char = '['
chRight char = ']'
prepend char = []
Expand Down
2 changes: 1 addition & 1 deletion onc/+onc/DataProductFile.m
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
{'complete', 'running', 'no content', 'error', 'unauthorized', 'not found', ...
'gone', 'server error', 'skipped'});

txtStatus = errorCodes(string(this.status));
txtStatus = errorCodes(num2str(this.status));

filename = this.fileName;
if isempty(this.fileName)
Expand Down
49 changes: 30 additions & 19 deletions onc/+util/extract_tree.m
Original file line number Diff line number Diff line change
Expand Up @@ -143,27 +143,38 @@
%
% Modify Date/Author: 20241218, S. Plovie, A. Slonimer
%---------------------------------------------------------------------

persistent CHAR_REPLACEMENT
% Constants
CHAR_REPLACEMENT = {...
'áàâäãå', 'a'; ...
'ÁÀÂÄÃÅ', 'A'; ...
'œéèêë', 'e'; ...
'ÉÈÊË', 'E'; ...
'íìîï', 'i'; ...
'ÍÌÎÏ', 'I'; ...
'óòôöõø', 'o'; ...
'ÓÒÔÖÕØ', 'O'; ...
'úùûü', 'u'; ...
'ÚÙÛÜ', 'U'; ...
'ýÿ', 'y'; ...
'Ý', 'Y'; ...
'ç', 'c'; ...
'Ç', 'C'; ...
'ñ', 'n'; ...
'Ñ', 'N'; ...
% Special characters need to be stored as encoded byte sequences and then
% decoded, because MATLAB versions older than 2019b use a different default
% encoding
% Typing special characters directly in an .m file may cause issues due to
% encoding mismatches
CHAR_REPLACEMENT_BYTES = { ...
[195 161 195 160 195 162 195 164 195 163 195 165], 97; ... 'áàâäãå', 'a'
[195 129 195 128 195 130 195 132 195 131 195 133], 65; ... 'ÁÀÂÄÃÅ', 'A'
[197 147 195 169 195 168 195 170 195 171], 101; ... 'œéèêë', 'e'
[195 137 195 136 195 138 195 139], 69; ... 'ÉÈÊË', 'E'
[195 173 195 172 195 174 195 175], 105; ... 'íìîï', 'i'
[195 141 195 140 195 142 195 143], 73; ... 'ÍÌÎÏ', 'I'
[195 179 195 178 195 180 195 182 195 181 195 184], 111; ... 'óòôöõø', 'o'
[195 147 195 146 195 148 195 150 195 149 195 152], 79; ... 'ÓÒÔÖÕØ', 'O'
[195 186 195 185 195 187 195 188], 117; ... 'úùûü', 'u'
[195 154 195 153 195 155 195 156], 85; ... 'ÚÙÛÜ', 'U'
[195 189 195 191], 121; ... 'ýÿ', 'y'
[195 157], 89; ... 'Ý', 'Y'
[195 167], 99; ... 'ç', 'c'
[195 135], 67; ... 'Ç', 'C'
[195 177], 110; ... 'ñ', 'n'
[195 145], 78; ... 'Ñ', 'N'
};

if isempty(CHAR_REPLACEMENT)
CHAR_REPLACEMENT = cellfun( ...
@(x) native2unicode(x, 'UTF-8'), ...
CHAR_REPLACEMENT_BYTES, ...
'UniformOutput', false ...
);
end
%% Replace accented characters
outputStr = inputStr;
if any(~isempty(intersect(inputStr, strjoin(CHAR_REPLACEMENT(:, 1), ''))))
Expand Down