Code development platform for open source projects from the European Union institutions
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Vecto
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stefanos DOUMPOULAKIS
Vecto
Commits
ef48ec40
Commit
ef48ec40
authored
8 years ago
by
Michael KRISPER
Browse files
Options
Downloads
Patches
Plain Diff
added payloads
parent
4f0ddcbb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
VectoCore/VectoCore/Models/Declaration/Payloads.cs
+63
-0
63 additions, 0 deletions
VectoCore/VectoCore/Models/Declaration/Payloads.cs
VectoCore/VectoCore/Resources/Declaration/Payloads.csv
+3
-0
3 additions, 0 deletions
VectoCore/VectoCore/Resources/Declaration/Payloads.csv
with
66 additions
and
0 deletions
VectoCore/VectoCore/Models/Declaration/Payloads.cs
0 → 100644
+
63
−
0
View file @
ef48ec40
using
System
;
using
System.Data
;
using
System.Linq
;
using
TUGraz.VectoCommon.Utils
;
using
TUGraz.VectoCore.Utils
;
namespace
TUGraz.VectoCore.Models.Declaration
{
internal
sealed
class
Payloads
:
LookupData
<
Kilogram
,
Payloads
.
PayloadEntry
>
{
internal
sealed
class
PayloadEntry
{
public
Kilogram
Payload50Percent
;
public
Kilogram
Payload75Percent
;
}
private
const
string
ResourceId
=
"TUGraz.VectoCore.Resources.Declaration.Payloads.csv"
;
public
Payloads
()
{
ParseData
(
ReadCsvResource
(
ResourceId
));
}
[
Obsolete
(
"Call Lookup50Percent, Lookup75Percent or LookupTrailer!"
,
true
)]
private
new
PayloadEntry
Lookup
(
Kilogram
grossVehicleWeight
)
{
throw
new
NotImplementedException
(
"Call Lookup50Percent, Lookup75Percent or LookupTrailer!"
);
}
public
Kilogram
Lookup50Percent
(
Kilogram
grossVehicleWeight
)
{
var
section
=
Data
.
GetSection
(
d
=>
d
.
Key
>
grossVehicleWeight
);
return
VectoMath
.
Interpolate
(
section
.
Item1
.
Key
,
section
.
Item2
.
Key
,
section
.
Item1
.
Value
.
Payload50Percent
,
section
.
Item2
.
Value
.
Payload50Percent
,
grossVehicleWeight
);
}
public
Kilogram
Lookup75Percent
(
Kilogram
grossVehicleWeight
)
{
var
section
=
Data
.
GetSection
(
d
=>
d
.
Key
>
grossVehicleWeight
);
return
VectoMath
.
Interpolate
(
section
.
Item1
.
Key
,
section
.
Item2
.
Key
,
section
.
Item1
.
Value
.
Payload75Percent
,
section
.
Item2
.
Value
.
Payload75Percent
,
grossVehicleWeight
);
}
public
Kilogram
LookupTrailer
(
Kilogram
grossVehicleWeight
,
Kilogram
curbWeight
)
{
return
0.75
*
(
grossVehicleWeight
-
curbWeight
);
}
protected
override
void
ParseData
(
DataTable
table
)
{
NormalizeTable
(
table
);
Data
=
table
.
Rows
.
Cast
<
DataRow
>()
.
ToDictionary
(
kv
=>
kv
.
ParseDouble
(
"grossvehicleweight"
).
SI
<
Kilogram
>(),
kv
=>
new
PayloadEntry
{
Payload50Percent
=
kv
.
ParseDouble
(
"payload50%"
).
SI
<
Kilogram
>(),
Payload75Percent
=
kv
.
ParseDouble
(
"payload75%"
).
SI
<
Kilogram
>()
});
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
VectoCore/VectoCore/Resources/Declaration/Payloads.csv
0 → 100644
+
3
−
0
View file @
ef48ec40
Gross Vehicle Weight,Payload 50%,Payload 75%
7500,1250,1900
16000,4600,6900
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