Skip to content

Commit

Permalink
Merge pull request #342 from dannyparsons/stevenndungu-RainFallDlg
Browse files Browse the repository at this point in the history
group_by check modified
  • Loading branch information
stevenndungu authored Jun 21, 2019
2 parents b49403f + 48a04f6 commit a778ff7
Showing 1 changed file with 24 additions and 28 deletions.
52 changes: 24 additions & 28 deletions instat/dlgPICSARainfall.vb
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ Public Class dlgPICSARainfall
Private Sub cmdPICSAOptions_Click(sender As Object, e As EventArgs) Handles cmdPICSAOptions.Click
sdgPICSARainfallGraph.SetRCode(clsNewOperator:=ucrBase.clsRsyntax.clsBaseOperator, clsNewPipeOperator:=clsPipeOperator, dctNewThemeFunctions:=dctThemeFunctions, clsNewLabsFunction:=clsLabsFunction, clsNewThemeFunction:=clsThemeFunction, clsNewXScaleContinuousFunction:=clsXScalecontinuousFunction, clsNewYScaleContinuousFunction:=clsYScalecontinuousFunction, clsNewGeomhlineMean:=clsGeomHlineMean, clsNewGeomhlineMedian:=clsGeomHlineMedian, clsNewGeomhlineLowerTercile:=clsGeomHlineLowerTercile, clsNewGeomhlineUpperTercile:=clsGeomHlineUpperTercile, clsNewXLabsFunction:=clsXLabsFunction, clsNewYLabsFunction:=clsYLabsFunction, clsNewRaesFunction:=clsRaesFunction, clsNewAsDate:=clsAsDate, clsNewAsDateYLimit:=clsAsDateYLimit, clsNewAsNumeric:=clsAsNumeric, clsNewYScaleDateFunction:=clsYScaleDateFunction, clsNewDatePeriodOperator:=clsDatePeriodOperator, clsNewGeomTextLabelMeanLine:=clsGeomTextLabelMeanLine, clsNewRoundMeanY:=clsRoundMeanY, clsNewPasteRoundMeanY:=clsPasteRoundMeanY, clsNewPasteMeanY:=clsPasteMeanY, clsNewGeomTextLabelMedianLine:=clsGeomTextLabelMedianLine, clsNewRoundMedianY:=clsRoundMedianY, clsNewPasteMedianY:=clsPasteMedianY, clsNewGeomTextLabelLowerTercileLine:=clsGeomTextLabelLowerTercileLine, clsNewRoundLowerTercileY:=clsRoundLowerTercileY, clsNewPasteLowerTercileY:=clsPasteLowerTercileY, clsNewGeomTextLabelUpperTercileLine:=clsGeomTextLabelUpperTercileLine, clsNewRoundUpperTercileY:=clsRoundUpperTercileY, clsNewPasteUpperTercileY:=clsPasteUpperTercileY, strXAxisType:=ucrReceiverX.strCurrDataType, clsNewMutateFunction:=clsMutateFunction, clsNewMeanFunction:=clsMeanFunction, clsNewMedianFunction:=clsMedianFunction, clsNewLowerTercileFunction:=clsLowerTercileFunction, clsNewUpperTercileFunction:=clsUpperTercileFunction, clsNewAsDateMeanY:=clsAsDateMeanY, clsNewAsDateMedianY:=clsAsDateMedianY, clsNewAsDateLowerTercileY:=clsAsDateLowerTercileY, clsNewAsDateUpperTercileY:=clsAsDateUpperTercileY, clsNewFormatMeanY:=clsFormatMeanY, clsNewFormatMedianY:=clsFormatMedianY, clsNewFormatLowerTercileY:=clsFormatLowerTercileY, clsNewFormatUpperTercileY:=clsFormatUpperTercileY, clsNewYLimitsYDate:=clsYLimitsYDate, bReset:=bResetSubdialog)
sdgPICSARainfallGraph.ShowDialog()
AddRemoveGroupByAndHlines()
AddRemoveGroupBy()
bResetSubdialog = False
End Sub

Expand Down Expand Up @@ -701,7 +701,7 @@ Public Class dlgPICSARainfall
clsFacetOperator.AddParameter("var2", ".", iPosition:=0)
clsBaseOperator.AddParameter("facets", clsRFunctionParameter:=clsFacetFunction, iPosition:=30)
End If
AddRemoveGroupByAndHlines()
AddRemoveGroupBy()
End Sub

Private Sub AutoFacetStation()
Expand All @@ -714,54 +714,50 @@ Public Class dlgPICSARainfall
If ucrCurrentReceiver IsNot Nothing Then
ucrCurrentReceiver.SetMeAsReceiver()
End If
AddRemoveGroupByAndHlines()
AddRemoveGroupBy()
End Sub

Private Sub ucrVariablesAsFactorForPicsa_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrVariablesAsFactorForPicsa.ControlValueChanged, ucrReceiverColourBy.ControlValueChanged, ucrReceiverFacetBy.ControlValueChanged
AddRemoveGroupByAndHlines()
AddRemoveGroupBy()
End Sub

Private Sub ucrSelectorPICSARainfall_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSelectorPICSARainfall.ControlValueChanged
AutoFacetStation()
SetPipeAssignTo()
End Sub

Private Sub AddRemoveGroupByAndHlines()
Private Sub AddRemoveGroupBy()
Dim i As Integer = 0

clsGroupByFunction.ClearParameters()
If clsPipeOperator.ContainsParameter("mutate") Then
clsGroupByFunction.ClearParameters()
If clsBaseOperator.ContainsParameter("facets") Then
For Each clsTempParam As RParameter In clsFacetOperator.clsParameters
If clsTempParam.strArgumentValue <> "" AndAlso clsTempParam.strArgumentValue <> "." Then
clsGroupByFunction.AddParameter(i, clsTempParam.strArgumentValue, bIncludeArgumentName:=False, iPosition:=i)
i = i + 1
End If
Next
End If

If clsBaseOperator.ContainsParameter("facets") Then
For Each clsTempParam As RParameter In clsFacetOperator.clsParameters
If clsTempParam.strArgumentValue <> "" AndAlso clsTempParam.strArgumentValue <> "." Then
clsGroupByFunction.AddParameter(i, clsTempParam.strArgumentValue, bIncludeArgumentName:=False, iPosition:=i)
End If
If clsRaesFunction.ContainsParameter("colour") Then
clsGroupByFunction.AddParameter(i, ucrReceiverColourBy.GetVariableNames(bWithQuotes:=False), bIncludeArgumentName:=False, iPosition:=0)
i = i + 1
Next
End If

clsPipeOperator.AddParameter("group_by", clsRFunctionParameter:=clsGroupByFunction, iPosition:=1)
clsGroupByFunction.AddParameter("1", ucrReceiverFacetBy.GetVariableNames(bWithQuotes:=False), bIncludeArgumentName:=False, iPosition:=0)
Else
clsGroupByFunction.RemoveParameterByName("1")
If Not ucrVariablesAsFactorForPicsa.bSingleVariable Then
clsGroupByFunction.AddParameter(i, "variable", bIncludeArgumentName:=False, iPosition:=0)
i = i + 1
End If

If clsRaesFunction.ContainsParameter("colour") Then
If clsGroupByFunction.iParameterCount > 0 Then
clsPipeOperator.AddParameter("group_by", clsRFunctionParameter:=clsGroupByFunction, iPosition:=1)
clsGroupByFunction.AddParameter("0", ucrReceiverColourBy.GetVariableNames(bWithQuotes:=False), bIncludeArgumentName:=False, iPosition:=0)
Else
clsGroupByFunction.RemoveParameterByName("0")
End If


If Not ucrVariablesAsFactorForPicsa.bSingleVariable Then
clsPipeOperator.AddParameter("group_by", clsRFunctionParameter:=clsGroupByFunction, iPosition:=1)
clsGroupByFunction.AddParameter("0", "variable", bIncludeArgumentName:=False, iPosition:=0)
Else
If ucrReceiverFacetBy.IsEmpty AndAlso ucrReceiverColourBy.IsEmpty Then
clsPipeOperator.RemoveParameterByName("group_by")
End If
Else
clsPipeOperator.RemoveParameterByName("group_by")
End If

SetPipeAssignTo()
End Sub

Expand Down

0 comments on commit a778ff7

Please sign in to comment.