forked from hbkworld/open-api-time-data-recorder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
InitializeModuleIPTable.m
58 lines (41 loc) · 1.59 KB
/
InitializeModuleIPTable.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
function [ModuleIPTableColumnFormat,ModuleIPTableData] = InitializeModuleIPTable(NumberOfModuleIPTableColumns,NumberOfModules,HardwareType)
% Bruel & Kjaer LAN-XI Open Application Programming Interface
% MATLAB Simple Recorder GUI Version 1.0 (September 15, 2021)
% By Matthew Houtteman and Gert Nyrup
% +1 800-332-2040
% TechnicalSalesSupport.US@hbkworld.com
% Developed in MATLAB R2021a with LAN-XI Firmware 2.10.0.501
% This function populates data and formats columns of ModuleIPTable based
% on the user selections from HardwareDropDown and NumberofModulesEditField
% in the main app file. Note that the command module is always assigned
% number 1 regardless of whether the setup uses a frame or switch hardware.
ModuleIPTableData = cell(NumberOfModules,NumberOfModuleIPTableColumns);
if string(HardwareType) == "Frame"
for ii = 1:1:NumberOfModules
if ii == 1
ModuleIPTableData(ii,:) = {ii 'Command' []};
else
ModuleIPTableData(ii,:) = {ii 'Service' []};
end
end
ModuleIPTableColumnFormat = ({[] ...
{'Command' 'Service'} ...
[]});
elseif string(HardwareType) == "Switch"
for ii = 1:1:NumberOfModules
if ii == 1
ModuleIPTableData(ii,:) = {ii 'Command' []};
else
ModuleIPTableData(ii,:) = {ii 'Service' []};
end
end
ModuleIPTableColumnFormat = ({[] ...
{'Command' 'Service'} ...
[]});
else
ModuleIPTableData(1,:) = {1 'Stand-alone' []};
ModuleIPTableColumnFormat = ({[] ...
{'Stand-alone'} ...
[]});
end
end