Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update #308

Merged
merged 22 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
581b5f6
Merge pull request #263 from IDEMSInternational/master
MeSophie Oct 15, 2024
c0b46ff
Have the summary variables filled in automatically in the Climograph …
MeSophie Oct 16, 2024
ef752df
Merge pull request #267 from IDEMSInternational/master
MeSophie Oct 30, 2024
2963a32
Change made
MeSophie Oct 31, 2024
2b211c7
code improvement
N-thony Oct 31, 2024
1fa9c1e
Merge pull request #270 from N-thony/MeSophie-SummaryClimaticissue9067
MeSophie Oct 31, 2024
960d70e
minor change made
MeSophie Oct 31, 2024
1b7a15e
Merge pull request #275 from IDEMSInternational/master
MeSophie Nov 11, 2024
d5ce96a
Merge pull request #278 from IDEMSInternational/master
MeSophie Nov 25, 2024
fbf212f
Added min and max recongnition auto fill in define climatic dialogue
N-thony Nov 25, 2024
9ae2d14
tab orders
N-thony Nov 25, 2024
6d5b4a0
using metadata to autofill receivers
N-thony Nov 26, 2024
a48762a
Fixed Station autofill issue
MeSophie Nov 26, 2024
6928710
Implementated Output Naming System for One Variable Graph
derekagorhom Nov 27, 2024
526d44a
Change made
MeSophie Nov 28, 2024
0fd5a5d
minor change made
MeSophie Nov 29, 2024
d876dba
minor change made
MeSophie Dec 2, 2024
34c55bb
Change made
MeSophie Dec 3, 2024
40978a9
Merge pull request #9281 from derekagorhom/Output_system_OneVar_Graph
N-thony Dec 5, 2024
f8bdb78
Merge pull request #9275 from N-thony/added_minmax_autofill
N-thony Dec 5, 2024
cf748ee
Merge pull request #9279 from MeSophie/FillGapIssue9271
N-thony Dec 6, 2024
20d148a
Merge pull request #9192 from MeSophie/SummaryClimaticissue9067
N-thony Dec 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
365 changes: 200 additions & 165 deletions instat/DlgDefineClimaticData.Designer.vb

Large diffs are not rendered by default.

45 changes: 36 additions & 9 deletions instat/DlgDefineClimaticData.vb
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,18 @@ Public Class DlgDefineClimaticData
Dim kvpLongitude As KeyValuePair(Of String, List(Of String)) = New KeyValuePair(Of String, List(Of String))("lon", {"lon", "lont", "longitude"}.ToList())
Dim kvpLatitude As KeyValuePair(Of String, List(Of String)) = New KeyValuePair(Of String, List(Of String))("lat", {"lat", "latitude"}.ToList())
Dim kvpCloudCover As KeyValuePair(Of String, List(Of String)) = New KeyValuePair(Of String, List(Of String))("cloud_cover", {"cloud", "cldtot"}.ToList())
Dim kvpTempMax As KeyValuePair(Of String, List(Of String)) = New KeyValuePair(Of String, List(Of String))("temp_max", {"tmax", "tx", "tempmax", "tmp_max", "tmpmax"}.ToList())
Dim kvpTempMin As KeyValuePair(Of String, List(Of String)) = New KeyValuePair(Of String, List(Of String))("temp_min", {"tmin", "tn", "tempmin", "tmp_min", "tmpmin"}.ToList())
Dim kvpTempMax As KeyValuePair(Of String, List(Of String)) = New KeyValuePair(Of String, List(Of String))("temp_max", {"temp_max", "tmax", "tx", "tempmax", "tmp_max", "tmpmax"}.ToList())
Dim kvpTempMin As KeyValuePair(Of String, List(Of String)) = New KeyValuePair(Of String, List(Of String))("temp_min", {"temp_min", "tmin", "tn", "tempmin", "tmp_min", "tmpmin"}.ToList())
Dim kvpRadiation As KeyValuePair(Of String, List(Of String)) = New KeyValuePair(Of String, List(Of String))("radiation", {"radiation", "rad", "radgls", "radsky", "radres", "radnaw", "raddwn", "radup", "raddsl"}.ToList())
Dim kvpSunshineHours As KeyValuePair(Of String, List(Of String)) = New KeyValuePair(Of String, List(Of String))("sunshine_hours", {"sunshine", "sunh", "sunhrs", "sun"}.ToList())
Dim kvpWindDirection As KeyValuePair(Of String, List(Of String)) = New KeyValuePair(Of String, List(Of String))("wind_direction", {"winddirection", "pkgstd"}.ToList())
Dim kvpWindSpeed As KeyValuePair(Of String, List(Of String)) = New KeyValuePair(Of String, List(Of String))("wind_speed", {"windspeed", "wndspd", "pkgust", "pkgstd", "wndmil"}.ToList())
Dim kvpSunshineHours As KeyValuePair(Of String, List(Of String)) = New KeyValuePair(Of String, List(Of String))("sunshine_hours", {"sunshine_hours", "sunshine", "sunh", "sunhrs", "sun"}.ToList())
Dim kvpWindDirection As KeyValuePair(Of String, List(Of String)) = New KeyValuePair(Of String, List(Of String))("wind_direction", {"wind_direction", "winddirection", "pkgstd"}.ToList())
Dim kvpWindSpeed As KeyValuePair(Of String, List(Of String)) = New KeyValuePair(Of String, List(Of String))("wind_speed", {"wind_speed", "windspeed", "wndspd", "pkgust", "pkgstd", "wndmil"}.ToList())
Dim kvpYear As KeyValuePair(Of String, List(Of String)) = New KeyValuePair(Of String, List(Of String))("year", {"year"}.ToList())
Dim kvpMonth As KeyValuePair(Of String, List(Of String)) = New KeyValuePair(Of String, List(Of String))("month", {"month"}.ToList())
Dim kvpDay As KeyValuePair(Of String, List(Of String)) = New KeyValuePair(Of String, List(Of String))("day", {"day"}.ToList())
Dim kvpDOY As KeyValuePair(Of String, List(Of String)) = New KeyValuePair(Of String, List(Of String))("doy", {"doy", "doy_366"}.ToList())
Dim kvpMinRH As KeyValuePair(Of String, List(Of String)) = New KeyValuePair(Of String, List(Of String))("hum_min", {"minhum", "hmin", "hn", "rhmin"}.ToList())
Dim kvpMaxRH As KeyValuePair(Of String, List(Of String)) = New KeyValuePair(Of String, List(Of String))("hum_max", {"maxhum", "hmax", "hx", "rhmax"}.ToList())
Dim kvpMinRH As KeyValuePair(Of String, List(Of String)) = New KeyValuePair(Of String, List(Of String))("hum_min", {"hum_min", "minhum", "hmin", "hn", "rhmin"}.ToList())
Dim kvpMaxRH As KeyValuePair(Of String, List(Of String)) = New KeyValuePair(Of String, List(Of String))("hum_max", {"hum_max", "maxhum", "hmax", "hx", "rhmax"}.ToList())

lstRecognisedTypes.AddRange({kvpRain, kvpDistrict, kvpCloudCover, kvpTempMax, kvpTempMin, kvpRadiation, kvpSunshineHours, kvpStation, kvpAltitude, kvpLatitude, kvpLongitude,
kvpWindDirection, kvpWindSpeed, kvpYear, kvpMonth, kvpDay, kvpDOY, kvpDate, kvpMinRH, kvpMaxRH})
Expand Down Expand Up @@ -237,8 +237,9 @@ Public Class DlgDefineClimaticData

If lstRecognisedValues.Count > 0 Then
For Each lviTempVariable As ListViewItem In ucrSelectorDefineClimaticData.lstAvailableVariable.Items
Dim strClimaticType As String = GetClimaticTypeFromRCommand(lviTempVariable.Text)
For Each strValue As String In lstRecognisedValues
If Regex.Replace(lviTempVariable.Text.ToLower(), "[^\w]|_", String.Empty).Contains(strValue) Then
If Regex.Replace(lviTempVariable.Text.ToLower(), "[^\w]|_", String.Empty).Contains(strValue) OrElse (strClimaticType IsNot Nothing AndAlso strClimaticType.Contains(strValue)) Then
ucrTempReceiver.Add(lviTempVariable.Text, ucrSelectorDefineClimaticData.ucrAvailableDataFrames.cboAvailableDataFrames.Text)
bFound = True
Exit For
Expand Down Expand Up @@ -270,8 +271,9 @@ Public Class DlgDefineClimaticData

If lstRecognisedValues.Count > 0 Then
For Each lviTempVariable As ListViewItem In ucrSelectorLinkedDataFrame.lstAvailableVariable.Items
Dim strClimaticType As String = GetClimaticTypeFromRCommand(lviTempVariable.Text)
For Each strValue As String In lstRecognisedValues
If Regex.Replace(lviTempVariable.Text.ToLower(), "[^\w]|_", String.Empty).Contains(strValue) Then
If Regex.Replace(lviTempVariable.Text.ToLower(), "[^\w]|_", String.Empty).Contains(strValue) OrElse (strClimaticType IsNot Nothing AndAlso strClimaticType.Contains(strValue)) Then
ucrTempReceiver.Add(lviTempVariable.Text, ucrSelectorLinkedDataFrame.ucrAvailableDataFrames.cboAvailableDataFrames.Text)
bFound = True
Exit For
Expand All @@ -290,6 +292,31 @@ Public Class DlgDefineClimaticData
End If
End Sub

Private Function GetClimaticTypeFromRCommand(strName As String) As String
Try
Dim clsGetClimaticTypeFunction As New RFunction

clsGetClimaticTypeFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$get_column_climatic_type")
clsGetClimaticTypeFunction.AddParameter("attr_name", Chr(34) & "Climatic_Type" & Chr(34))
clsGetClimaticTypeFunction.AddParameter("col_name", Chr(34) & strName & Chr(34))
clsGetClimaticTypeFunction.AddParameter("data_name", Chr(34) & ucrSelectorLinkedDataFrame.strCurrentDataFrame & Chr(34))

Dim result As SymbolicExpression
result = frmMain.clsRLink.RunInternalScriptGetValue(clsGetClimaticTypeFunction.ToScript())

' Check if result is Nothing or has no values before trying to access
If result IsNot Nothing AndAlso result.Type <> Internals.SymbolicExpressionType.Null Then
Dim strClimaticType As String = result.AsCharacter(0)
If Not String.IsNullOrEmpty(strClimaticType) Then
Return strClimaticType
End If
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
Return String.Empty
End Function

Private Function GetRecognisedValues(strVariable As String) As List(Of String)
Dim lstValues As New List(Of String)

Expand Down
46 changes: 45 additions & 1 deletion instat/dlgClimograph.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading