Newer
Older
classdef test_structbus < SCDtest
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
59
60
61
62
63
64
65
66
67
68
69
70
71
properties
testBus = test_structbus.getTestBus();
end
methods(Test,TestTags={'Unit'})
function testDifferentStruct(testCase)
mystruct = struct('a',1);
testCase.assertFalse(SCDconf_structbuscmp(mystruct,testCase.testBus));
end
function testSameStruct(testCase)
mystruct = SCDconf_createstructfrombus(testCase.testBus); % generate to match bus
areequal = SCDconf_structbuscmp(mystruct,testCase.testBus);
testCase.assertTrue(areequal);
end
end
methods(Static)
function testBus = getTestBus()
testBus = Simulink.Bus;
testBus.Description = '';
testBus.DataScope = 'Auto';
testBus.HeaderFile = '';
testBus.Alignment = -1;
saveVarsTmp{1} = Simulink.BusElement;
saveVarsTmp{1}.Name = 'a';
saveVarsTmp{1}.Complexity = 'real';
saveVarsTmp{1}.Dimensions = 24;
saveVarsTmp{1}.DataType = 'single';
saveVarsTmp{1}.Min = [];
saveVarsTmp{1}.Max = [];
saveVarsTmp{1}.DimensionsMode = 'Fixed';
saveVarsTmp{1}.SamplingMode = 'Sample based';
saveVarsTmp{1}.SampleTime = -1;
saveVarsTmp{1}.DocUnits = 'varies';
saveVarsTmp{1}.Description = ['References for observable errors coming ' ...
'from the A matrix'];
saveVarsTmp{1}(2, 1) = Simulink.BusElement;
saveVarsTmp{1}(2, 1).Name = 'b';
saveVarsTmp{1}(2, 1).Complexity = 'real';
saveVarsTmp{1}(2, 1).Dimensions = 8;
saveVarsTmp{1}(2, 1).DataType = 'single';
saveVarsTmp{1}(2, 1).Min = [];
saveVarsTmp{1}(2, 1).Max = [];
saveVarsTmp{1}(2, 1).DimensionsMode = 'Fixed';
saveVarsTmp{1}(2, 1).SamplingMode = 'Sample based';
saveVarsTmp{1}(2, 1).SampleTime = -1;
saveVarsTmp{1}(2, 1).DocUnits = 'V';
saveVarsTmp{1}(2, 1).Description = ['Feed-forwards for SCR E converters' ...
' voltage commands'];
saveVarsTmp{1}(3, 1) = Simulink.BusElement;
saveVarsTmp{1}(3, 1).Name = 'hyb_FF_f_u';
saveVarsTmp{1}(3, 1).Complexity = 'real';
saveVarsTmp{1}(3, 1).Dimensions = 8;
saveVarsTmp{1}(3, 1).DataType = 'single';
saveVarsTmp{1}(3, 1).Min = [];
saveVarsTmp{1}(3, 1).Max = [];
saveVarsTmp{1}(3, 1).DimensionsMode = 'Fixed';
saveVarsTmp{1}(3, 1).SamplingMode = 'Sample based';
saveVarsTmp{1}(3, 1).SampleTime = -1;
saveVarsTmp{1}(3, 1).DocUnits = 'V';
saveVarsTmp{1}(3, 1).Description = ['Feed-forwards for SCR F converters' ...
' voltage commands'];
testBus.Elements = saveVarsTmp{1};
end
end
end