Skip to content

Commit

Permalink
Merge pull request #513 from IDEMSInternational/master
Browse files Browse the repository at this point in the history
updates my master
  • Loading branch information
Patowhiz authored Feb 25, 2025
2 parents de133cf + b993868 commit 87d89e8
Show file tree
Hide file tree
Showing 56 changed files with 3,831 additions and 1,562 deletions.
63 changes: 31 additions & 32 deletions instat/DlgDefineClimaticData.vb
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,6 @@ Public Class DlgDefineClimaticData
clsDummyFunction = New RFunction
clsNewDefautFunction = New RFunction

ucrSelectorDefineClimaticData.Reset()
ucrSelectorLinkedDataFrame.Reset()
ucrInputCheckInput.Reset()
ucrReceiverDate.SetMeAsReceiver()

Expand Down Expand Up @@ -230,17 +228,17 @@ Public Class DlgDefineClimaticData
Dim bFound As Boolean = False

ucrCurrentReceiver = ucrSelectorDefineClimaticData.CurrentReceiver

Dim strData As String = ucrSelectorDefineClimaticData.ucrAvailableDataFrames.cboAvailableDataFrames.Text
For Each ucrTempReceiver As ucrReceiver In lstReceivers
ucrTempReceiver.SetMeAsReceiver()
lstRecognisedValues = GetRecognisedValues(ucrTempReceiver.Tag)

If lstRecognisedValues.Count > 0 Then
For Each lviTempVariable As ListViewItem In ucrSelectorDefineClimaticData.lstAvailableVariable.Items
Dim strClimaticType As String = GetClimaticTypeFromRCommand(lviTempVariable.Text)
Dim strClimaticType As String = GetClimaticTypeFromRCommand(lviTempVariable.Text, strData)
For Each strValue As String In lstRecognisedValues
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)
ucrTempReceiver.Add(lviTempVariable.Text, strData)
bFound = True
Exit For
End If
Expand All @@ -263,43 +261,46 @@ Public Class DlgDefineClimaticData
Dim ucrCurrentReceiver As ucrReceiver
Dim bFound As Boolean = False

ucrCurrentReceiver = ucrSelectorLinkedDataFrame.CurrentReceiver

For Each ucrTempReceiver As ucrReceiver In lstNewReceivers
ucrTempReceiver.SetMeAsReceiver()
lstRecognisedValues = GetNewRecognisedValues(ucrTempReceiver.Tag)

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) OrElse (strClimaticType IsNot Nothing AndAlso strClimaticType.Contains(strValue)) Then
ucrTempReceiver.Add(lviTempVariable.Text, ucrSelectorLinkedDataFrame.ucrAvailableDataFrames.cboAvailableDataFrames.Text)
bFound = True
If ucrChkLinkedMetaData.Checked Then
ucrCurrentReceiver = ucrSelectorLinkedDataFrame.CurrentReceiver
Dim strData As String = ucrSelectorLinkedDataFrame.ucrAvailableDataFrames.cboAvailableDataFrames.Text

For Each ucrTempReceiver As ucrReceiver In lstNewReceivers
ucrTempReceiver.SetMeAsReceiver()
lstRecognisedValues = GetNewRecognisedValues(ucrTempReceiver.Tag)

If lstRecognisedValues.Count > 0 Then
For Each lviTempVariable As ListViewItem In ucrSelectorLinkedDataFrame.lstAvailableVariable.Items
Dim strClimaticType As String = GetClimaticTypeFromRCommand(lviTempVariable.Text, strData)
For Each strValue As String In lstRecognisedValues
If Regex.Replace(lviTempVariable.Text.ToLower(), "[^\w]|_", String.Empty).Contains(strValue) OrElse (strClimaticType IsNot Nothing AndAlso strClimaticType.Contains(strValue)) Then
ucrTempReceiver.Add(lviTempVariable.Text, strData)
bFound = True
Exit For
End If
Next
If bFound Then
bFound = False
Exit For
End If
Next
If bFound Then
bFound = False
Exit For
End If
Next
End If
Next
End If
Next

If ucrCurrentReceiver IsNot Nothing Then
ucrCurrentReceiver.SetMeAsReceiver()
If ucrCurrentReceiver IsNot Nothing Then
ucrCurrentReceiver.SetMeAsReceiver()
End If
End If
End Sub

Private Function GetClimaticTypeFromRCommand(strName As String) As String
Private Function GetClimaticTypeFromRCommand(strName As String, strDataName 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))
clsGetClimaticTypeFunction.AddParameter("data_name", Chr(34) & strDataName & Chr(34))

Dim result As SymbolicExpression
result = frmMain.clsRLink.RunInternalScriptGetValue(clsGetClimaticTypeFunction.ToScript())
Expand Down Expand Up @@ -402,13 +403,11 @@ Public Class DlgDefineClimaticData
strCurrentDataframeName = ucrSelectorDefineClimaticData.strCurrentDataFrame
clsGetColFunction.AddParameter("data_name", Chr(34) & strCurrentDataframeName & Chr(34), iPosition:=0)
AutoFillReceivers()
SetRSelector()
End Sub

Private Sub ucrSelectorLinkedDataFrame_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSelectorLinkedDataFrame.ControlValueChanged
Private Sub ucrSelectorLinkedDataFrame_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSelectorLinkedDataFrame.ControlValueChanged, ucrChkLinkedMetaData.ControlValueChanged
clsGetColFunction.AddParameter("data_name", Chr(34) & ucrSelectorLinkedDataFrame.strCurrentDataFrame & Chr(34), iPosition:=1)
NewAutoFillReceivers()
NewSetRSelector()
End Sub

Private Sub Controls_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverDate.ControlContentsChanged
Expand Down
2 changes: 2 additions & 0 deletions instat/Interface/IDataViewGrid.vb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ Public Interface IDataViewGrid

Sub Focus()

Sub RemoveAllBackgroundColors()

Function GetSelectedColumns() As List(Of clsColumnHeaderDisplay)

Function GetFirstRowHeader() As String
Expand Down
1 change: 1 addition & 0 deletions instat/Model/DataFrame/clsDataFrame.vb
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ Public Class clsDataFrame
Else
bRefreshed = False
End If
_clsVisibleDataFramePage.HasDataChangedForAutoSave = True
End If
_clsColumnMetaData.RefreshData()
Return bRefreshed
Expand Down
15 changes: 15 additions & 0 deletions instat/Model/DataFrame/clsDataFramePage.vb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Public Class clsDataFramePage
Private _lstColumns As List(Of clsColumnHeaderDisplay)
Private _hasChanged As Boolean
Private _useColumnSelectionInDataView As Boolean
Private _HasDataChangedForAutoSave As Boolean

Private ReadOnly Property iColumnIncrements As Integer
Get
Expand Down Expand Up @@ -140,6 +141,19 @@ Public Class clsDataFramePage
End Set
End Property

''' <summary>
''' holds whether the dataframe is different from visual grid component and trigger auto save
''' </summary>
''' <returns></returns>
Public Property HasDataChangedForAutoSave() As Boolean
Get
Return _HasDataChangedForAutoSave
End Get
Set(ByVal value As Boolean)
_HasDataChangedForAutoSave = value
End Set
End Property

''' <summary>
''' Create a new instance of a dataframe page
''' </summary>
Expand All @@ -152,6 +166,7 @@ Public Class clsDataFramePage
_iColumnStart = 1
_iRowStart = 1
_hasChanged = True
_HasDataChangedForAutoSave = True
_useColumnSelectionInDataView = True
End Sub

Expand Down
4 changes: 4 additions & 0 deletions instat/UserControls/DataGrid/Linux/ucrDataViewLinuxGrid.vb
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@ Public Class ucrDataViewLinuxGrid
dataGrid.Rows(iRow).Cells(iColumn).Value = GetCurrentDataFrameFocus.DisplayedData(iRow, iColumn)
End Sub

Private Sub RemoveAllBackgroundColors() Implements IDataViewGrid.RemoveAllBackgroundColors

End Sub

Public Sub SearchRowInGrid(rowNumbers As List(Of Integer), strColumn As String, Optional iRow As Integer = 0,
Optional bApplyToRows As Boolean = False) Implements IDataViewGrid.SearchRowInGrid
End Sub
Expand Down
9 changes: 9 additions & 0 deletions instat/UserControls/DataGrid/ReoGrid/ucrDataViewReoGrid.vb
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,15 @@ Public Class ucrDataViewReoGrid
Next
End Sub

Private Sub RemoveAllBackgroundColors() Implements IDataViewGrid.RemoveAllBackgroundColors
For rowNumber As Integer = 0 To grdData.CurrentWorksheet.RowCount - 1
For colIndex As Integer = 0 To grdData.CurrentWorksheet.ColumnCount - 1
grdData.CurrentWorksheet.Cells(rowNumber, colIndex).Style.BackColor = Color.Transparent
Next
Next
grdData.CurrentWorksheet.RequestInvalidate()
End Sub

Public Sub SearchRowInGrid(rowNumbers As List(Of Integer), strColumn As String, Optional iRow As Integer = 0,
Optional bApplyToRows As Boolean = False) Implements IDataViewGrid.SearchRowInGrid
Dim currSheet = grdData.CurrentWorksheet
Expand Down
116 changes: 113 additions & 3 deletions instat/UserTables/dlgGeneralTable.Designer.vb

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

Loading

0 comments on commit 87d89e8

Please sign in to comment.