Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
Common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Skyward
Matlab dependencies
Common
Commits
e8796ac4
Commit
e8796ac4
authored
4 weeks ago
by
Marco Luigi Gaibotti
Browse files
Options
Downloads
Patches
Plain Diff
[handle-value-conversion][Motor] Added input sanitisation for tank length and chamber pressure
parent
671da2f4
No related branches found
Branches containing commit
No related tags found
1 merge request
!17
Convertion from handle to value type classes
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
classes/bays/@Motor/Motor.m
+3
-5
3 additions, 5 deletions
classes/bays/@Motor/Motor.m
classes/bays/@Motor/loadData.m
+4
-3
4 additions, 3 deletions
classes/bays/@Motor/loadData.m
with
7 additions
and
8 deletions
classes/bays/@Motor/Motor.m
+
3
−
5
View file @
e8796ac4
...
...
@@ -35,7 +35,7 @@ classdef Motor < Bay
chamberPressure
(
1
,
:)
double
% [Pa] Pressure inside combustion chamber
pe
(
1
,
:)
double
% [Pa] Eflux pressure
time
(
1
,
:)
double
% [s] Engine time vector
cutoffTime
(
1
,
1
)
double
% [s] Shutdown time
cutoffTime
double
% [s] Shutdown time
ignitionTransient
(
1
,
1
)
double
% [s] Ignition transient duration
cutoffTransient
(
1
,
1
)
double
% [s] Cutoff transient duration
tankLength
(
1
,
1
)
double
% [m] Tank length
...
...
@@ -73,8 +73,7 @@ classdef Motor < Bay
end
%% Bay implementation
% Getters
methods
methods
% Getters
function
value
=
get
.
name
(
obj
)
value
=
obj
.
NAME
;
end
...
...
@@ -92,8 +91,7 @@ classdef Motor < Bay
end
end
% Setters
methods
methods
% Setters
function
obj
=
set
.
name
(
obj
,
name
)
obj
.
NAME
=
name
;
obj
=
obj
.
loadData
();
...
...
This diff is collapsed.
Click to expand it.
classes/bays/@Motor/loadData.m
+
4
−
3
View file @
e8796ac4
...
...
@@ -27,9 +27,10 @@ end
if obj.type == "Hybrid"
obj.length = chosenMotor.L;
obj.tankLength = chosenMotor.Ltank;
if isempty(obj.tankLength)
if isempty(chosenMotor.Ltank)
obj.tankLength = chosenMotor.LtankPr + chosenMotor.LtankOx;
else
obj.tankLength = chosenMotor.Ltank;
end
obj.fuelMass = chosenMotor.mFu;
obj.oxidizerMass = chosenMotor.mOx;
...
...
@@ -39,7 +40,7 @@ if obj.type == "Hybrid"
obj.pe = chosenMotor.Pe(iUniqueTime);
obj.ae = chosenMotor.Ae;
obj.fuselageMass = chosenMotor.mFus;
if is
field
(chosenMotor
, '
Pc
'
)
if
~
is
empty
(chosenMotor
.
Pc)
obj.chamberPressure = chosenMotor.Pc;
end
obj.MASS = obj.propellantMass + obj.structureMass;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment