Skip to content

Commit

Permalink
refined some code
Browse files Browse the repository at this point in the history
added a "refined" version of the GetAvailableFuels code
  • Loading branch information
mreed72 committed Oct 17, 2024
1 parent 73444d6 commit 5d0e027
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 22 deletions.
Binary file not shown.
Binary file not shown.
Binary file modified xFuels/.vs/xFuels/v17/.suo
Binary file not shown.
8 changes: 6 additions & 2 deletions xFuels/.vs/xFuels/v17/DocumentLayout.backup.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 0,
"SelectedChildIndex": 1,
"Children": [
{
"$type": "Bookmark",
"Name": "ST:0:0:{aa2115a1-9712-457b-9047-dbb71ca2cdd2}"
},
{
"$type": "Document",
"DocumentIndex": 0,
Expand All @@ -24,7 +28,7 @@
"RelativeDocumentMoniker": "ClassFuels.vb",
"ToolTip": "C:\\Users\\mreed\\OneDrive - State of Arkansas\\Documents\\GitHub\\pToolz\\xFuels\\ClassFuels.vb",
"RelativeToolTip": "ClassFuels.vb",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAAEAAABIAAAA",
"ViewState": "AgIAAAIAAAAAAAAAAAAmwHkHAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003361|",
"WhenOpened": "2023-02-23T16:03:08.551Z",
"EditorCaption": ""
Expand Down
22 changes: 2 additions & 20 deletions xFuels/.vs/xFuels/v17/DocumentLayout.json
Original file line number Diff line number Diff line change
@@ -1,37 +1,19 @@
{
"Version": 1,
"WorkspaceRootPath": "C:\\Users\\mreed\\OneDrive - State of Arkansas\\Documents\\GitHub\\pToolz\\xFuels\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{C08D1F28-53CC-4777-83F4-45179C0A61D1}|xFuels.vbproj|c:\\users\\mreed\\onedrive - state of arkansas\\documents\\github\\ptoolz\\xfuels\\classfuels.vb||{2C015C70-C72C-11D0-88C3-00A0C9110049}",
"RelativeMoniker": "D:0:0:{C08D1F28-53CC-4777-83F4-45179C0A61D1}|xFuels.vbproj|solutionrelative:classfuels.vb||{2C015C70-C72C-11D0-88C3-00A0C9110049}"
}
],
"Documents": [],
"DocumentGroupContainers": [
{
"Orientation": 0,
"VerticalTabListWidth": 256,
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 1,
"SelectedChildIndex": -1,
"Children": [
{
"$type": "Bookmark",
"Name": "ST:0:0:{aa2115a1-9712-457b-9047-dbb71ca2cdd2}"
},
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "ClassFuels.vb",
"DocumentMoniker": "C:\\Users\\mreed\\OneDrive - State of Arkansas\\Documents\\GitHub\\pToolz\\xFuels\\ClassFuels.vb",
"RelativeDocumentMoniker": "ClassFuels.vb",
"ToolTip": "C:\\Users\\mreed\\OneDrive - State of Arkansas\\Documents\\GitHub\\pToolz\\xFuels\\ClassFuels.vb",
"RelativeToolTip": "ClassFuels.vb",
"ViewState": "AgIAAAIAAAAAAAAAAAAmwHkHAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003361|",
"WhenOpened": "2023-02-23T16:03:08.551Z",
"EditorCaption": ""
}
]
}
Expand Down
32 changes: 32 additions & 0 deletions xFuels/ClassFuels.vb
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,38 @@ Public Class ClassFuels
End Select
End Function

''' <summary>
''' Get Available Fuels (Refined Version)
''' </summary>
''' <param name="cTypx">Fuel Type</param>
''' <param name="cLoad">Fuel Load</param>
''' <returns>DOUBLE: value represents the available fuels for a burn.</returns>
Public Function GetFuels(ByVal cTypx As String, ByVal cLoad As String) As Double
Dim fuelValues As New Dictionary(Of String, Dictionary(Of String, Double)) From {
{"1-Shortleaf Pine with Oak", New Dictionary(Of String, Double) From {{"Low", 3.0}, {"Moderate", 4.0}, {"Heavy", 4.4}}},
{"2-Shortleaf Pine Regeneration", New Dictionary(Of String, Double) From {{"Low", 2.6}, {"Moderate", 3.8}, {"Heavy", 5.1}}},
{"3-Loblolly Pine with Oak", New Dictionary(Of String, Double) From {{"Low", 6.4}, {"Moderate", 6.8}, {"Heavy", 7.9}}},
{"4-Loblolly Pine Regeneration", New Dictionary(Of String, Double) From {{"Low", 4.4}, {"Moderate", 7.6}, {"Heavy", 8.5}}},
{"5-Hardwood Leaf Litter", New Dictionary(Of String, Double) From {{"Low", 0.8}, {"Moderate", 1.5}, {"Heavy", 2.5}}},
{"6-Grass or Brush", New Dictionary(Of String, Double) From {{"Low", 2.0}, {"Moderate", 3.0}, {"Heavy", 5.0}}},
{"7-Dispersed Slash", New Dictionary(Of String, Double) From {{"Low", 4.0}, {"Moderate", 6.0}, {"Heavy", 8.0}}},
{"8-Piled Debris", New Dictionary(Of String, Double) From {{"Low", 5.0}, {"Moderate", 7.5}, {"Heavy", 10.0}}},
{"9-Shortleaf Loblolly with Grass", New Dictionary(Of String, Double) From {{"Low", 1.5}, {"Moderate", 3.8}, {"Heavy", 5.9}}},
{"10-Corn", New Dictionary(Of String, Double) From {{"Low", 3.1}, {"Moderate", 4.7}, {"Heavy", 6.2}}},
{"11-Cotton", New Dictionary(Of String, Double) From {{"Low", 0.8}, {"Moderate", 1.1}, {"Heavy", 1.5}}},
{"12-Rice", New Dictionary(Of String, Double) From {{"Low", 2.5}, {"Moderate", 3.7}, {"Heavy", 4.9}}},
{"13-Soybean", New Dictionary(Of String, Double) From {{"Low", 2.9}, {"Moderate", 4.3}, {"Heavy", 5.7}}},
{"14-Wheat", New Dictionary(Of String, Double) From {{"Low", 0.9}, {"Moderate", 1.4}, {"Heavy", 1.9}}}
}

If fuelValues.ContainsKey(cTypx) AndAlso fuelValues(cTypx).ContainsKey(cLoad) Then
Return fuelValues(cTypx)(cLoad)
Else
Return 0 ' or some default value or action in case of an unknown cTypx/cLoad
End If
End Function


''' <summary>
''' Main Smoke Guidelines Calculation Code
''' </summary>
Expand Down

0 comments on commit 5d0e027

Please sign in to comment.