Skip to content

Commit a2e7053

Browse files
authored
Remove WLTP simulation case (#30)
* Remove WLTP simulation case and impacted files. Make all tests pass.
1 parent 33be6e2 commit a2e7053

File tree

411 files changed

+6027
-5576
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

411 files changed

+6027
-5576
lines changed

BEV/BEV_system_model.mdl

Lines changed: 300 additions & 282 deletions
Large diffs are not rendered by default.
7 Bytes
Binary file not shown.

BEV/Test/BEV_UnitTest_MQC.m

Lines changed: 112 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -1,123 +1,119 @@
11
classdef BEV_UnitTest_MQC < BEVTestCase
2-
%% Class implementation of unit test
3-
%
4-
% These are tests to achieve the Minimum Quality Criteria (MQC).
5-
% MQC is achieved when all runnables (models, scripts, functions) run
6-
% without any errors.
7-
%
8-
% You can run this test by opening in MATLAB Editor and clicking
9-
% Run Tests button or Run Current Test button.
10-
% You can also run this test using test runner (the *_runtests.m script)
11-
% which can not only run tests but also generates test summary and
12-
% a code coverage report.
13-
14-
% Copyright 2022-2023 The MathWorks, Inc.
2+
%% Class implementation of unit test
3+
%
4+
% These are tests to achieve the Minimum Quality Criteria (MQC).
5+
% MQC is achieved when all runnables (models, scripts, functions) run
6+
% without any errors.
7+
%
8+
% You can run this test by opening in MATLAB Editor and clicking
9+
% Run Tests button or Run Current Test button.
10+
% You can also run this test using test runner (the *_runtests.m script)
11+
% which can not only run tests but also generates test summary and
12+
% a code coverage report.
13+
14+
% Copyright 2022-2024 The MathWorks, Inc.
15+
16+
methods (Test)
17+
18+
%% Top folder
19+
20+
function MQC_TopFolder_1(~)
21+
BEV_main_script
22+
end
23+
24+
function MQC_TopFolder_2(~)
25+
mdl = "BEV_system_model";
26+
load_system(mdl)
27+
BEV_setup
28+
end
29+
30+
function MQC_TopFolder_3(~)
31+
mdl = "BEV_system_model";
32+
load_system(mdl)
33+
sim(mdl);
34+
end
35+
36+
%% SimlationCases folder
37+
38+
function MQC_SimulationCases_1_1(~)
39+
BEV_Case_Constant_Basic
40+
end
41+
42+
function MQC_SimulationCases_1_2(~)
43+
BEV_Case_FTP75_Basic
44+
end
45+
46+
function MQC_SimulationCases_1_3(~)
47+
BEV_Case_HighSpeed_Basic
48+
end
49+
50+
function MQC_SimulationCases_1_4(~)
51+
BEV_Case_SimpleDrivePattern_Basic
52+
end
53+
54+
function MQC_SimulationCases_2_1(~)
55+
BEV_Case_Constant_Thermal
56+
end
57+
58+
function MQC_SimulationCases_2_2(~)
59+
BEV_Case_SimpleDrivePattern_Thermal
60+
end
61+
62+
%% Utility > Configuration folder
63+
64+
function MQC_Configuration_1(~)
65+
load_system("BEV_system_model")
66+
BEV_useComponents_Basic
67+
end
68+
69+
function MQC_Configuration_2(~)
70+
load_system("BEV_system_model")
71+
BEV_useComponents_Thermal
72+
end
73+
74+
%% Utility folder
75+
76+
function MQC_Utility_1(~)
77+
BEV_getMotorSpeedFromVehicleSpeed
78+
end
79+
80+
function MQC_Utility_2(~)
81+
mdl = "BEV_system_model";
82+
load_system(mdl)
83+
simOut = sim(mdl);
84+
simData = extractTimetable(simOut.logsout);
85+
% Test target
86+
BEV_plotResultsCompact(SimData = simData);
87+
end
88+
89+
end % methods (Test)
90+
91+
%% Test callback buttons
92+
93+
properties
94+
FilesAndFolders {mustBeText} = ""
95+
end
96+
97+
methods (TestClassSetup)
98+
99+
function buildFilesFoldersList(testCase)
100+
%%
101+
projectFiles = [currentProject().Files.Path]';
102+
% logical index
103+
lix = not(contains(projectFiles, [".git", "resources", "simcache"]));
104+
testCase.FilesAndFolders = projectFiles(lix);
105+
end % function
15106

16-
methods (Test)
17-
18-
%% Top folder
19-
20-
function MQC_TopFolder_1(~)
21-
BEV_main_script
22-
end
23-
24-
function MQC_TopFolder_2(~)
25-
mdl = "BEV_system_model";
26-
load_system(mdl)
27-
BEV_setup
28-
end
29-
30-
function MQC_TopFolder_3(~)
31-
mdl = "BEV_system_model";
32-
load_system(mdl)
33-
sim(mdl);
34-
end
35-
36-
%% SimlationCases folder
37-
38-
function MQC_SimulationCases_1_1(~)
39-
BEV_Case_Constant_Basic
40-
end
41-
42-
function MQC_SimulationCases_1_2(~)
43-
BEV_Case_FTP75_Basic
44-
end
45-
46-
function MQC_SimulationCases_1_3(~)
47-
BEV_Case_HighSpeed_Basic
48-
end
49-
50-
function MQC_SimulationCases_1_4(~)
51-
BEV_Case_SimpleDrivePattern_Basic
52-
end
53-
54-
function MQC_SimulationCases_1_5(~)
55-
BEV_Case_WLTP_Basic
56-
end
57-
58-
function MQC_SimulationCases_2_1(~)
59-
BEV_Case_Constant_Thermal
60-
end
61-
62-
function MQC_SimulationCases_2_2(~)
63-
BEV_Case_SimpleDrivePattern_Thermal
64-
end
65-
66-
%% Utility > Configuration folder
67-
68-
function MQC_Configuration_1(~)
69-
load_system("BEV_system_model")
70-
BEV_useComponents_Basic
71-
end
72-
73-
function MQC_Configuration_2(~)
74-
load_system("BEV_system_model")
75-
BEV_useComponents_Thermal
76-
end
77-
78-
%% Utility folder
79-
80-
function MQC_Utility_1(~)
81-
BEV_getMotorSpeedFromVehicleSpeed
82-
end
83-
84-
function MQC_Utility_2(~)
85-
mdl = "BEV_system_model";
86-
load_system(mdl)
87-
simOut = sim(mdl);
88-
simData = extractTimetable(simOut.logsout);
89-
% Test target
90-
BEV_plotResultsCompact(SimData = simData);
91-
end
92-
93-
end % methods (Test)
94-
95-
%% Test callback buttons
96-
97-
properties
98-
FilesAndFolders {mustBeText} = ""
99-
end
100-
101-
methods (TestClassSetup)
102-
103-
function buildFilesFoldersList(testCase)
104-
%%
105-
projectFiles = [currentProject().Files.Path]';
106-
% logical index
107-
lix = not(contains(projectFiles, [".git", "resources", "simcache"]));
108-
testCase.FilesAndFolders = projectFiles(lix);
109-
end % function
107+
end % methods
110108

111-
end % methods
109+
methods (Test)
112110

113-
methods (Test)
111+
function MQC_CallbackButtons_1(testCase)
112+
mdl = "BEV_system_model";
113+
load_system(mdl)
114+
checkCallbackButton(mdl, testCase.FilesAndFolders)
115+
end
114116

115-
function MQC_CallbackButtons_1(testCase)
116-
mdl = "BEV_system_model";
117-
load_system(mdl)
118-
checkCallbackButton(mdl, testCase.FilesAndFolders)
119-
end
120-
121-
end % methods
117+
end % methods
122118

123119
end % classdef
2.72 KB
Loading

BEVProjectNavigator.m

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -74,18 +74,6 @@
7474
row = NewRow(layout, column);
7575
LiteAppComponent.Label(NewSlot(layout, row, Width=indent), Text="");
7676

77-
target_BEV_Case_WLTP_Basic = "BEV_Case_WLTP_Basic";
78-
[~, error_message] = LiteAppUtility.GetFileFolderPath(target_BEV_Case_WLTP_Basic);
79-
assert(error_message == "", error_message)
80-
81-
link_ui = LiteAppComponent.Hyperlink(NewSlot(layout, row));
82-
link_ui.HyperlinkText = "Simulation case: WLTP";
83-
link_ui.HyperlinkClickedCallback = @() open_target_script(target_BEV_Case_WLTP_Basic);
84-
85-
%%
86-
row = NewRow(layout, column);
87-
LiteAppComponent.Label(NewSlot(layout, row, Width=indent), Text="");
88-
8977
target_BEV_Case_FTP75_Basic = "BEV_Case_FTP75_Basic";
9078
[~, error_message] = LiteAppUtility.GetFileFolderPath(target_BEV_Case_FTP75_Basic);
9179
assert(error_message == "", error_message)

ChangeLog.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
# Change Log
22

3-
## Version 2.3.0 (July, 2023)
3+
## Version 2.3.3 (wip)
4+
5+
## Version 2.3.2 (August, 2024)
6+
7+
- Make sure buildtool-based tests all pass.
8+
- Update live script to markdown.
9+
- Add the project navigator app. Clean up project shortcuts.
10+
11+
## Version 2.3.1 (June, 2024)
12+
13+
- Use easy-to-find locations to store markdowns generated from live scripts.
14+
- Add a project shortcut to Vehicle1D performance design app.
15+
16+
## Version 2.3.0 (June, 2024)
417

518
App
619

Binary file not shown.

Components/ControllerAndEnvironment/SimulationCases/CtrlEnv_Case_test.m

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@ function MQC_SimpleDrivePattern_1(~)
4040
CtrlEnv_Case_SimpleDrivePattern
4141
end
4242

43-
function MQC_WLTP_1(~)
44-
CtrlEnv_Case_WLTP
45-
end
46-
4743
end % methods
4844

4945
methods(TestMethodSetup)

Components/ControllerAndEnvironment/Test/CtrlEnv_UnitTest_MQC.m

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,6 @@ function MQC_SimulationCase_4(~)
4545
CtrlEnv_Case_SimpleDrivePattern
4646
end
4747

48-
function MQC_SimulationCase_5(~)
49-
CtrlEnv_Case_WLTP
50-
end
51-
5248
%% Utility > Configuration folder
5349

5450
function MQC_Configuration_1(~)
@@ -76,11 +72,6 @@ function MQC_Configuration_5(~)
7672
CtrlEnv_loadCase_SimpleDrivePattern
7773
end
7874

79-
function MQC_Configuration_6(~)
80-
load_system("CtrlEnv_harness_model")
81-
CtrlEnv_loadCase_WLTP
82-
end
83-
8475
%% Utility folder
8576

8677
function MQC_Utility_1(~)

Components/ControllerAndEnvironment/Test/CtrlEnv_runtests.m

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,12 @@
5353
fullfile(TopFolder, "SimulationCases", "CtrlEnv_Case_FTP75.mlx")
5454
fullfile(TopFolder, "SimulationCases", "CtrlEnv_Case_HighSpeed.mlx")
5555
fullfile(TopFolder, "SimulationCases", "CtrlEnv_Case_SimpleDrivePattern.mlx")
56-
fullfile(TopFolder, "SimulationCases", "CtrlEnv_Case_WLTP.mlx")
5756
...
5857
fullfile(TopFolder, "Utility", "Configuration", "CtrlEnv_loadCase.m")
5958
fullfile(TopFolder, "Utility", "Configuration", "CtrlEnv_loadCase_Constant.m")
6059
fullfile(TopFolder, "Utility", "Configuration", "CtrlEnv_loadCase_FTP75.m")
6160
fullfile(TopFolder, "Utility", "Configuration", "CtrlEnv_loadCase_HighSpeed.m")
6261
fullfile(TopFolder, "Utility", "Configuration", "CtrlEnv_loadCase_SimpleDrivePattern.m")
63-
fullfile(TopFolder, "Utility", "Configuration", "CtrlEnv_loadCase_WLTP.m")
6462
...
6563
fullfile(TopFolder, "Utility", "CtrlEnv_plotResults.m")
6664
], ...

0 commit comments

Comments
 (0)