diff --git a/instat/dlgCompareSummary.Designer.vb b/instat/dlgCompareSummary.Designer.vb index 4f3b174a353..cbc6d4778fb 100644 --- a/instat/dlgCompareSummary.Designer.vb +++ b/instat/dlgCompareSummary.Designer.vb @@ -22,18 +22,240 @@ Partial Class dlgCompareSummary 'Do not modify it using the code editor. _ Private Sub InitializeComponent() + Me.lblStation = New System.Windows.Forms.Label() + Me.lblFactors = New System.Windows.Forms.Label() + Me.lblSatellite = New System.Windows.Forms.Label() + Me.rdoContinuous = New System.Windows.Forms.RadioButton() + Me.rdoCategorical = New System.Windows.Forms.RadioButton() + Me.rdoBinary = New System.Windows.Forms.RadioButton() + Me.cmdSummaries = New System.Windows.Forms.Button() + Me.ucrChkPrintOutput = New instat.ucrCheck() + Me.ucrChkIgnoreMissing = New instat.ucrCheck() + Me.ucrPnlObservationType = New instat.UcrPanel() + Me.ucrReceiverMultipleFactors = New instat.ucrReceiverMultiple() + Me.ucrReceiverSatellite = New instat.ucrReceiverSingle() + Me.ucrReceiverStation = New instat.ucrReceiverSingle() + Me.ucrSelectorVerificationSummary = New instat.ucrSelectorByDataFrameAddRemove() + Me.ucrBase = New instat.ucrButtons() + Me.ucrChkStoreResults = New instat.ucrCheck() Me.SuspendLayout() ' + 'lblStation + ' + Me.lblStation.AutoSize = True + Me.lblStation.Location = New System.Drawing.Point(273, 76) + Me.lblStation.Name = "lblStation" + Me.lblStation.Size = New System.Drawing.Size(56, 13) + Me.lblStation.TabIndex = 5 + Me.lblStation.Text = "Observed:" + ' + 'lblFactors + ' + Me.lblFactors.AutoSize = True + Me.lblFactors.Location = New System.Drawing.Point(273, 172) + Me.lblFactors.Name = "lblFactors" + Me.lblFactors.Size = New System.Drawing.Size(45, 13) + Me.lblFactors.TabIndex = 9 + Me.lblFactors.Text = "Factors:" + ' + 'lblSatellite + ' + Me.lblSatellite.AutoSize = True + Me.lblSatellite.Location = New System.Drawing.Point(273, 126) + Me.lblSatellite.Name = "lblSatellite" + Me.lblSatellite.Size = New System.Drawing.Size(56, 13) + Me.lblSatellite.TabIndex = 7 + Me.lblSatellite.Text = "Estimated:" + ' + 'rdoContinuous + ' + Me.rdoContinuous.Appearance = System.Windows.Forms.Appearance.Button + Me.rdoContinuous.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoContinuous.FlatAppearance.BorderSize = 2 + Me.rdoContinuous.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoContinuous.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.rdoContinuous.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.rdoContinuous.Location = New System.Drawing.Point(62, 12) + Me.rdoContinuous.Name = "rdoContinuous" + Me.rdoContinuous.Size = New System.Drawing.Size(98, 27) + Me.rdoContinuous.TabIndex = 1 + Me.rdoContinuous.TabStop = True + Me.rdoContinuous.Text = "Continuous" + Me.rdoContinuous.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoContinuous.UseVisualStyleBackColor = True + ' + 'rdoCategorical + ' + Me.rdoCategorical.Appearance = System.Windows.Forms.Appearance.Button + Me.rdoCategorical.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoCategorical.FlatAppearance.BorderSize = 2 + Me.rdoCategorical.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoCategorical.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.rdoCategorical.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.rdoCategorical.Location = New System.Drawing.Point(254, 12) + Me.rdoCategorical.Name = "rdoCategorical" + Me.rdoCategorical.Size = New System.Drawing.Size(98, 27) + Me.rdoCategorical.TabIndex = 3 + Me.rdoCategorical.TabStop = True + Me.rdoCategorical.Text = "Categorical" + Me.rdoCategorical.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoCategorical.UseVisualStyleBackColor = True + ' + 'rdoBinary + ' + Me.rdoBinary.Appearance = System.Windows.Forms.Appearance.Button + Me.rdoBinary.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoBinary.FlatAppearance.BorderSize = 2 + Me.rdoBinary.FlatAppearance.CheckedBackColor = System.Drawing.SystemColors.ActiveCaption + Me.rdoBinary.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.rdoBinary.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.rdoBinary.Location = New System.Drawing.Point(158, 12) + Me.rdoBinary.Name = "rdoBinary" + Me.rdoBinary.Size = New System.Drawing.Size(98, 27) + Me.rdoBinary.TabIndex = 2 + Me.rdoBinary.TabStop = True + Me.rdoBinary.Text = "Binary" + Me.rdoBinary.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + Me.rdoBinary.UseVisualStyleBackColor = True + ' + 'cmdSummaries + ' + Me.cmdSummaries.Location = New System.Drawing.Point(273, 291) + Me.cmdSummaries.Name = "cmdSummaries" + Me.cmdSummaries.Size = New System.Drawing.Size(120, 23) + Me.cmdSummaries.TabIndex = 14 + Me.cmdSummaries.Text = "Summaries" + Me.cmdSummaries.UseVisualStyleBackColor = True + ' + 'ucrChkPrintOutput + ' + Me.ucrChkPrintOutput.Checked = False + Me.ucrChkPrintOutput.Location = New System.Drawing.Point(10, 281) + Me.ucrChkPrintOutput.Name = "ucrChkPrintOutput" + Me.ucrChkPrintOutput.Size = New System.Drawing.Size(148, 20) + Me.ucrChkPrintOutput.TabIndex = 12 + ' + 'ucrChkIgnoreMissing + ' + Me.ucrChkIgnoreMissing.Checked = False + Me.ucrChkIgnoreMissing.Location = New System.Drawing.Point(10, 307) + Me.ucrChkIgnoreMissing.Name = "ucrChkIgnoreMissing" + Me.ucrChkIgnoreMissing.Size = New System.Drawing.Size(197, 20) + Me.ucrChkIgnoreMissing.TabIndex = 13 + ' + 'ucrPnlObservationType + ' + Me.ucrPnlObservationType.Location = New System.Drawing.Point(58, 4) + Me.ucrPnlObservationType.Name = "ucrPnlObservationType" + Me.ucrPnlObservationType.Size = New System.Drawing.Size(300, 50) + Me.ucrPnlObservationType.TabIndex = 0 + ' + 'ucrReceiverMultipleFactors + ' + Me.ucrReceiverMultipleFactors.frmParent = Me + Me.ucrReceiverMultipleFactors.Location = New System.Drawing.Point(273, 188) + Me.ucrReceiverMultipleFactors.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverMultipleFactors.Name = "ucrReceiverMultipleFactors" + Me.ucrReceiverMultipleFactors.Selector = Nothing + Me.ucrReceiverMultipleFactors.Size = New System.Drawing.Size(120, 100) + Me.ucrReceiverMultipleFactors.strNcFilePath = "" + Me.ucrReceiverMultipleFactors.TabIndex = 10 + Me.ucrReceiverMultipleFactors.ucrSelector = Nothing + ' + 'ucrReceiverSatellite + ' + Me.ucrReceiverSatellite.frmParent = Me + Me.ucrReceiverSatellite.Location = New System.Drawing.Point(273, 142) + Me.ucrReceiverSatellite.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverSatellite.Name = "ucrReceiverSatellite" + Me.ucrReceiverSatellite.Selector = Nothing + Me.ucrReceiverSatellite.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverSatellite.strNcFilePath = "" + Me.ucrReceiverSatellite.TabIndex = 8 + Me.ucrReceiverSatellite.ucrSelector = Nothing + ' + 'ucrReceiverStation + ' + Me.ucrReceiverStation.frmParent = Me + Me.ucrReceiverStation.Location = New System.Drawing.Point(273, 93) + Me.ucrReceiverStation.Margin = New System.Windows.Forms.Padding(0) + Me.ucrReceiverStation.Name = "ucrReceiverStation" + Me.ucrReceiverStation.Selector = Nothing + Me.ucrReceiverStation.Size = New System.Drawing.Size(120, 20) + Me.ucrReceiverStation.strNcFilePath = "" + Me.ucrReceiverStation.TabIndex = 6 + Me.ucrReceiverStation.ucrSelector = Nothing + ' + 'ucrSelectorVerificationSummary + ' + Me.ucrSelectorVerificationSummary.bDropUnusedFilterLevels = False + Me.ucrSelectorVerificationSummary.bShowHiddenColumns = False + Me.ucrSelectorVerificationSummary.bUseCurrentFilter = True + Me.ucrSelectorVerificationSummary.Location = New System.Drawing.Point(10, 57) + Me.ucrSelectorVerificationSummary.Margin = New System.Windows.Forms.Padding(0) + Me.ucrSelectorVerificationSummary.Name = "ucrSelectorVerificationSummary" + Me.ucrSelectorVerificationSummary.Size = New System.Drawing.Size(210, 180) + Me.ucrSelectorVerificationSummary.TabIndex = 4 + ' + 'ucrBase + ' + Me.ucrBase.Location = New System.Drawing.Point(10, 337) + Me.ucrBase.Name = "ucrBase" + Me.ucrBase.Size = New System.Drawing.Size(410, 52) + Me.ucrBase.TabIndex = 15 + ' + 'ucrChkStoreResults + ' + Me.ucrChkStoreResults.Checked = False + Me.ucrChkStoreResults.Location = New System.Drawing.Point(10, 255) + Me.ucrChkStoreResults.Name = "ucrChkStoreResults" + Me.ucrChkStoreResults.Size = New System.Drawing.Size(148, 20) + Me.ucrChkStoreResults.TabIndex = 11 + ' 'dlgCompareSummary ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(432, 384) + Me.ClientSize = New System.Drawing.Size(419, 397) + Me.Controls.Add(Me.ucrChkStoreResults) + Me.Controls.Add(Me.ucrChkPrintOutput) + Me.Controls.Add(Me.ucrChkIgnoreMissing) + Me.Controls.Add(Me.cmdSummaries) + Me.Controls.Add(Me.rdoBinary) + Me.Controls.Add(Me.rdoCategorical) + Me.Controls.Add(Me.rdoContinuous) + Me.Controls.Add(Me.ucrPnlObservationType) + Me.Controls.Add(Me.lblSatellite) + Me.Controls.Add(Me.lblFactors) + Me.Controls.Add(Me.lblStation) + Me.Controls.Add(Me.ucrReceiverMultipleFactors) + Me.Controls.Add(Me.ucrReceiverSatellite) + Me.Controls.Add(Me.ucrReceiverStation) + Me.Controls.Add(Me.ucrSelectorVerificationSummary) + Me.Controls.Add(Me.ucrBase) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow Me.Name = "dlgCompareSummary" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen - Me.Text = "Summary" + Me.Text = "Verification Summaries" Me.ResumeLayout(False) + Me.PerformLayout() End Sub + + Friend WithEvents ucrBase As ucrButtons + Friend WithEvents ucrSelectorVerificationSummary As ucrSelectorByDataFrameAddRemove + Friend WithEvents ucrReceiverStation As ucrReceiverSingle + Friend WithEvents ucrReceiverMultipleFactors As ucrReceiverMultiple + Friend WithEvents ucrReceiverSatellite As ucrReceiverSingle + Friend WithEvents lblSatellite As Label + Friend WithEvents lblFactors As Label + Friend WithEvents lblStation As Label + Friend WithEvents ucrPnlObservationType As UcrPanel + Friend WithEvents rdoBinary As RadioButton + Friend WithEvents rdoCategorical As RadioButton + Friend WithEvents rdoContinuous As RadioButton + Friend WithEvents cmdSummaries As Button + Friend WithEvents ucrChkIgnoreMissing As ucrCheck + Friend WithEvents ucrChkPrintOutput As ucrCheck + Friend WithEvents ucrChkStoreResults As ucrCheck End Class diff --git a/instat/dlgCompareSummary.vb b/instat/dlgCompareSummary.vb index 03dbebb16e3..990f329d0fc 100644 --- a/instat/dlgCompareSummary.vb +++ b/instat/dlgCompareSummary.vb @@ -1,5 +1,184 @@ -Public Class dlgCompareSummary +' R- Instat +' Copyright (C) 2015-2017 +' +' This program is free software: you can redistribute it and/or modify +' it under the terms of the GNU General Public License as published by +' the Free Software Foundation, either version 3 of the License, or +' (at your option) any later version. +' +' This program is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU General Public License for more details. +' +' You should have received a copy of the GNU General Public License +' along with this program. If not, see . + +Imports instat.Translations +Public Class dlgCompareSummary + Private bFirstLoad As Boolean = True + Private bReset As Boolean = True + Private bResetSubdialog = False + Private iTabIndexSelected As Integer = 0 + Private clsSummaryFunction As New RFunction + Private clsListFunction As New RFunction Private Sub dlgCompareSummary_Load(sender As Object, e As EventArgs) Handles MyBase.Load + autoTranslate(Me) + If bFirstLoad Then + InitialiseDialog() + bFirstLoad = False + End If + If bReset Then + SetDefaults() + End If + SetRcodeForControls(bReset) + bReset = False + TestOkEnabled() + End Sub + + Private Sub InitialiseDialog() + ucrSelectorVerificationSummary.SetParameter(New RParameter("data_name", 0)) + ucrSelectorVerificationSummary.SetParameterIsString() + + ucrPnlObservationType.SetParameter(New RParameter("obs.type", 1)) + ucrPnlObservationType.AddRadioButton(rdoContinuous, Chr(34) & "'cont'" & Chr(34)) + ucrPnlObservationType.AddRadioButton(rdoCategorical, Chr(34) & "'cat'" & Chr(34)) + ucrPnlObservationType.AddRadioButton(rdoBinary, Chr(34) & "'binary'" & Chr(34)) + + ucrReceiverStation.SetParameter(New RParameter("columns_to_summarise", 2)) + ucrReceiverStation.Selector = ucrSelectorVerificationSummary + ucrReceiverStation.SetParameterIsString() + + ucrReceiverSatellite.SetParameter(New RParameter("y", 3)) + ucrReceiverSatellite.Selector = ucrSelectorVerificationSummary + ucrReceiverSatellite.SetParameterIsString() + + ucrReceiverMultipleFactors.SetParameter(New RParameter("factors", 4)) + ucrReceiverMultipleFactors.Selector = ucrSelectorVerificationSummary + ucrReceiverMultipleFactors.strSelectorHeading = "Factors" + ucrReceiverMultipleFactors.SetParameterIsString() + ucrReceiverMultipleFactors.SetIncludedDataTypes({"factor"}, bStrict:=True) + + ucrChkIgnoreMissing.SetParameter(New RParameter("na.rm", 7)) + ucrChkIgnoreMissing.SetValuesCheckedAndUnchecked("TRUE", "FALSE") + ucrChkIgnoreMissing.SetRDefault("FALSE") + ucrChkIgnoreMissing.SetText("Omit Missing Values") + + ucrChkPrintOutput.SetParameter(New RParameter("return_output", 4)) + ucrChkPrintOutput.SetText("Print Results to Output Window") + ucrChkPrintOutput.SetValuesCheckedAndUnchecked("TRUE", "FALSE") + ucrChkPrintOutput.SetRDefault("FALSE") + + ucrChkStoreResults.SetParameter(New RParameter("store_results", 9)) + ucrChkStoreResults.SetText("Store Results") + ucrChkStoreResults.SetValuesCheckedAndUnchecked("TRUE", "FALSE") + ucrChkStoreResults.SetRDefault("TRUE") + End Sub + + Private Sub SetDefaults() + clsSummaryFunction = New RFunction + clsListFunction = New RFunction + + ucrSelectorVerificationSummary.Reset() + ucrReceiverStation.SetMeAsReceiver() + + clsSummaryFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$calculate_summary") + clsSummaryFunction.AddParameter("obs.type", Chr(34) & "'cont'" & Chr(34), iPosition:=1) + clsSummaryFunction.AddParameter("summaries", clsRFunctionParameter:=clsListFunction, iPosition:=6) + clsListFunction.AddParameter("summary_cor", Chr(34) & "summary_cor" & Chr(34), bIncludeArgumentName:=False, iPosition:=20) + + clsListFunction.SetRCommand("c") + + bResetSubdialog = True + ucrBase.clsRsyntax.SetBaseRFunction(clsSummaryFunction) + End Sub + + Private Sub SetRcodeForControls(bReset As Boolean) + SetRCode(Me, ucrBase.clsRsyntax.clsBaseFunction, bReset) + End Sub + + Private Sub cmdSummaries_Click(sender As Object, e As EventArgs) Handles cmdSummaries.Click + sdgVerificationSummaries.SetRFunction(clsNewSummaryFunction:=clsSummaryFunction, clsNewListFunction:=clsListFunction, iNewTabIndexSelected:=iTabIndexSelected, bReset:=bResetSubdialog) + sdgVerificationSummaries.ShowDialog() + bResetSubdialog = False + AddRemoveUseParameter() + TestOkEnabled() + End Sub + + Private Sub TestOkEnabled() + If ucrReceiverSatellite.IsEmpty OrElse ucrReceiverStation.IsEmpty OrElse clsListFunction.clsParameters.Count = 0 OrElse Not (ucrChkStoreResults.Checked OrElse ucrChkPrintOutput.Checked) Then + ucrBase.OKEnabled(False) + Else + ucrBase.OKEnabled(True) + End If + End Sub + + Private Sub ucrBase_ClickReset(sender As Object, e As EventArgs) Handles ucrBase.ClickReset + SetDefaults() + SetRcodeForControls(True) + TestOkEnabled() + End Sub + + Private Sub ucrPnlObservationType_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrPnlObservationType.ControlValueChanged + SetSelectorDataTypes() + ucrReceiverSatellite.Clear() + ucrReceiverStation.Clear() + ucrReceiverStation.SetMeAsReceiver() + If rdoContinuous.Checked Then + iTabIndexSelected = 0 + clsSummaryFunction.AddParameter("frcst.type", Chr(34) & "'cont'" & Chr(34), iPosition:=5) + sdgVerificationSummaries.EnableDisableTabs(True, False, False) + ElseIf rdoBinary.Checked Then + iTabIndexSelected = 1 + clsSummaryFunction.AddParameter("frcst.type", Chr(34) & "'binary'" & Chr(34), iPosition:=5) + sdgVerificationSummaries.EnableDisableTabs(False, True, False) + ElseIf rdoCategorical.Checked Then + iTabIndexSelected = 2 + clsSummaryFunction.AddParameter("frcst.type", Chr(34) & "'cat'" & Chr(34), iPosition:=5) + sdgVerificationSummaries.EnableDisableTabs(False, False, True) + End If + End Sub + + Private Sub ucrReceiverStation_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrReceiverStation.ControlValueChanged, ucrReceiverSatellite.ControlValueChanged + SetSelectorDataTypes() + End Sub + + Private Sub SetSelectorDataTypes() + If rdoContinuous.Checked Then + ucrReceiverSatellite.SetIncludedDataTypes({"numeric"}, bStrict:=True) + ucrReceiverSatellite.strSelectorHeading = "Numerics" + ucrReceiverStation.SetIncludedDataTypes({"numeric"}, bStrict:=True) + ucrReceiverStation.strSelectorHeading = "Numerics" + ElseIf rdoBinary.Checked Then + ucrReceiverSatellite.SetIncludedDataTypes({"logical", "numeric"}, bStrict:=True) + ucrReceiverSatellite.strSelectorHeading = "Logical and Numerics" + ucrReceiverStation.SetIncludedDataTypes({"logical", "numeric"}, bStrict:=True) + ucrReceiverStation.strSelectorHeading = "Logical and Numeric" + ElseIf rdoCategorical.Checked Then + ucrReceiverSatellite.SetIncludedDataTypes({"logical", "factor"}, bStrict:=True) + ucrReceiverSatellite.strSelectorHeading = "Logical and Factors" + ucrReceiverStation.SetIncludedDataTypes({"logical", "factor"}, bStrict:=True) + ucrReceiverStation.strSelectorHeading = "Logical and Factors" + End If + End Sub + + Private Sub ucrChkPrintOutput_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkPrintOutput.ControlValueChanged + ucrBase.clsRsyntax.iCallType = If(ucrChkPrintOutput.Checked, 2, 0) + End Sub + + Private Sub AddRemoveUseParameter() + If ucrChkIgnoreMissing.Checked AndAlso clsListFunction.ContainsParameter("summary_cor") Then + clsSummaryFunction.AddParameter("use", Chr(34) & "'complete.obs'" & Chr(34), iPosition:=8) + Else + clsSummaryFunction.RemoveParameterByName("use") + End If + End Sub + + Private Sub ucrChkIgnoreMissing_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkIgnoreMissing.ControlValueChanged + AddRemoveUseParameter() + End Sub + Private Sub ucrReceiverStation_ControlContentsChanged(ucrChangedControl As ucrCore) Handles ucrReceiverStation.ControlContentsChanged, ucrReceiverSatellite.ControlContentsChanged, ucrChkPrintOutput.ControlContentsChanged, ucrChkStoreResults.ControlContentsChanged + TestOkEnabled() End Sub End Class \ No newline at end of file diff --git a/instat/sdgVerificationSummaries.Designer.vb b/instat/sdgVerificationSummaries.Designer.vb index 79c9b62b5dd..e2d189ca8f2 100644 --- a/instat/sdgVerificationSummaries.Designer.vb +++ b/instat/sdgVerificationSummaries.Designer.vb @@ -1,9 +1,9 @@ - _ + Partial Class sdgVerificationSummaries Inherits System.Windows.Forms.Form 'Form overrides dispose to clean up the component list. - _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Then @@ -20,23 +20,256 @@ Partial Class sdgVerificationSummaries 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. - _ + Private Sub InitializeComponent() Me.ucrBase = New instat.ucrButtonsSubdialogue() + Me.tbSummaries = New System.Windows.Forms.TabControl() + Me.tbContinuous = New System.Windows.Forms.TabPage() + Me.ucrContinuousVerification = New instat.ucrContinuousVerification() + Me.tbBinary = New System.Windows.Forms.TabPage() + Me.grpOrdinary = New System.Windows.Forms.GroupBox() + Me.ucrChkHitRate = New instat.ucrCheck() + Me.ucrChkFalseAlarmRatio = New instat.ucrCheck() + Me.ucrChkBias = New instat.ucrCheck() + Me.ucrChkHeidkeSkillScore = New instat.ucrCheck() + Me.ucrChkEquitableThreatScore = New instat.ucrCheck() + Me.ucrChkPercentCorrect = New instat.ucrCheck() + Me.ucrChkThreatScore = New instat.ucrCheck() + Me.grpExtreme = New System.Windows.Forms.GroupBox() + Me.ucrChkSymmetricExtremeDependencyScore = New instat.ucrCheck() + Me.ucrChkExremalDependencyIndex = New instat.ucrCheck() + Me.ucrChkExtremeDependencyScore = New instat.ucrCheck() + Me.ucrChkSymmetricExtremalDependenceIndex = New instat.ucrCheck() + Me.tbCategorical = New System.Windows.Forms.TabPage() + Me.ucrChkCatPercentCorrect = New instat.ucrCheck() + Me.ucrChkCatHeidkeSkillScore = New instat.ucrCheck() + Me.ucrChkCatPierceSkillScore = New instat.ucrCheck() + Me.ucrChkGerrityScore = New instat.ucrCheck() + Me.tbSummaries.SuspendLayout() + Me.tbContinuous.SuspendLayout() + Me.tbBinary.SuspendLayout() + Me.grpOrdinary.SuspendLayout() + Me.grpExtreme.SuspendLayout() + Me.tbCategorical.SuspendLayout() Me.SuspendLayout() ' 'ucrBase ' - Me.ucrBase.Location = New System.Drawing.Point(114, 298) + Me.ucrBase.Location = New System.Drawing.Point(212, 268) Me.ucrBase.Name = "ucrBase" - Me.ucrBase.Size = New System.Drawing.Size(142, 30) - Me.ucrBase.TabIndex = 0 + Me.ucrBase.Size = New System.Drawing.Size(154, 30) + Me.ucrBase.TabIndex = 1 + ' + 'tbSummaries + ' + Me.tbSummaries.Controls.Add(Me.tbContinuous) + Me.tbSummaries.Controls.Add(Me.tbBinary) + Me.tbSummaries.Controls.Add(Me.tbCategorical) + Me.tbSummaries.Location = New System.Drawing.Point(12, 12) + Me.tbSummaries.Name = "tbSummaries" + Me.tbSummaries.SelectedIndex = 0 + Me.tbSummaries.Size = New System.Drawing.Size(557, 255) + Me.tbSummaries.TabIndex = 0 + ' + 'tbContinuous + ' + Me.tbContinuous.Controls.Add(Me.ucrContinuousVerification) + Me.tbContinuous.Location = New System.Drawing.Point(4, 22) + Me.tbContinuous.Name = "tbContinuous" + Me.tbContinuous.Padding = New System.Windows.Forms.Padding(3) + Me.tbContinuous.Size = New System.Drawing.Size(549, 229) + Me.tbContinuous.TabIndex = 0 + Me.tbContinuous.Text = "Continuous" + Me.tbContinuous.UseVisualStyleBackColor = True + ' + 'ucrContinuousVerification + ' + Me.ucrContinuousVerification.Location = New System.Drawing.Point(-1, 6) + Me.ucrContinuousVerification.Name = "ucrContinuousVerification" + Me.ucrContinuousVerification.Size = New System.Drawing.Size(544, 192) + Me.ucrContinuousVerification.TabIndex = 0 + ' + 'tbBinary + ' + Me.tbBinary.Controls.Add(Me.grpOrdinary) + Me.tbBinary.Controls.Add(Me.grpExtreme) + Me.tbBinary.Location = New System.Drawing.Point(4, 22) + Me.tbBinary.Name = "tbBinary" + Me.tbBinary.Padding = New System.Windows.Forms.Padding(3) + Me.tbBinary.Size = New System.Drawing.Size(549, 229) + Me.tbBinary.TabIndex = 1 + Me.tbBinary.Text = "Binary" + Me.tbBinary.UseVisualStyleBackColor = True + ' + 'grpOrdinary + ' + Me.grpOrdinary.Controls.Add(Me.ucrChkHitRate) + Me.grpOrdinary.Controls.Add(Me.ucrChkFalseAlarmRatio) + Me.grpOrdinary.Controls.Add(Me.ucrChkBias) + Me.grpOrdinary.Controls.Add(Me.ucrChkHeidkeSkillScore) + Me.grpOrdinary.Controls.Add(Me.ucrChkEquitableThreatScore) + Me.grpOrdinary.Controls.Add(Me.ucrChkPercentCorrect) + Me.grpOrdinary.Controls.Add(Me.ucrChkThreatScore) + Me.grpOrdinary.Location = New System.Drawing.Point(6, 6) + Me.grpOrdinary.Name = "grpOrdinary" + Me.grpOrdinary.Size = New System.Drawing.Size(537, 104) + Me.grpOrdinary.TabIndex = 13 + Me.grpOrdinary.TabStop = False + Me.grpOrdinary.Text = "Ordinary" + ' + 'ucrChkHitRate + ' + Me.ucrChkHitRate.Checked = False + Me.ucrChkHitRate.Location = New System.Drawing.Point(6, 19) + Me.ucrChkHitRate.Name = "ucrChkHitRate" + Me.ucrChkHitRate.Size = New System.Drawing.Size(136, 20) + Me.ucrChkHitRate.TabIndex = 4 + ' + 'ucrChkFalseAlarmRatio + ' + Me.ucrChkFalseAlarmRatio.Checked = False + Me.ucrChkFalseAlarmRatio.Location = New System.Drawing.Point(6, 79) + Me.ucrChkFalseAlarmRatio.Name = "ucrChkFalseAlarmRatio" + Me.ucrChkFalseAlarmRatio.Size = New System.Drawing.Size(118, 20) + Me.ucrChkFalseAlarmRatio.TabIndex = 1 + ' + 'ucrChkBias + ' + Me.ucrChkBias.Checked = False + Me.ucrChkBias.Location = New System.Drawing.Point(185, 59) + Me.ucrChkBias.Name = "ucrChkBias" + Me.ucrChkBias.Size = New System.Drawing.Size(100, 20) + Me.ucrChkBias.TabIndex = 6 + ' + 'ucrChkHeidkeSkillScore + ' + Me.ucrChkHeidkeSkillScore.Checked = False + Me.ucrChkHeidkeSkillScore.Location = New System.Drawing.Point(185, 19) + Me.ucrChkHeidkeSkillScore.Name = "ucrChkHeidkeSkillScore" + Me.ucrChkHeidkeSkillScore.Size = New System.Drawing.Size(100, 20) + Me.ucrChkHeidkeSkillScore.TabIndex = 8 + ' + 'ucrChkEquitableThreatScore + ' + Me.ucrChkEquitableThreatScore.Checked = False + Me.ucrChkEquitableThreatScore.Location = New System.Drawing.Point(6, 59) + Me.ucrChkEquitableThreatScore.Name = "ucrChkEquitableThreatScore" + Me.ucrChkEquitableThreatScore.Size = New System.Drawing.Size(136, 20) + Me.ucrChkEquitableThreatScore.TabIndex = 2 + ' + 'ucrChkPercentCorrect + ' + Me.ucrChkPercentCorrect.Checked = False + Me.ucrChkPercentCorrect.Location = New System.Drawing.Point(185, 39) + Me.ucrChkPercentCorrect.Name = "ucrChkPercentCorrect" + Me.ucrChkPercentCorrect.Size = New System.Drawing.Size(100, 20) + Me.ucrChkPercentCorrect.TabIndex = 7 + ' + 'ucrChkThreatScore + ' + Me.ucrChkThreatScore.Checked = False + Me.ucrChkThreatScore.Location = New System.Drawing.Point(6, 39) + Me.ucrChkThreatScore.Name = "ucrChkThreatScore" + Me.ucrChkThreatScore.Size = New System.Drawing.Size(136, 20) + Me.ucrChkThreatScore.TabIndex = 3 + ' + 'grpExtreme + ' + Me.grpExtreme.Controls.Add(Me.ucrChkSymmetricExtremeDependencyScore) + Me.grpExtreme.Controls.Add(Me.ucrChkExremalDependencyIndex) + Me.grpExtreme.Controls.Add(Me.ucrChkExtremeDependencyScore) + Me.grpExtreme.Controls.Add(Me.ucrChkSymmetricExtremalDependenceIndex) + Me.grpExtreme.Location = New System.Drawing.Point(6, 109) + Me.grpExtreme.Name = "grpExtreme" + Me.grpExtreme.Size = New System.Drawing.Size(537, 71) + Me.grpExtreme.TabIndex = 12 + Me.grpExtreme.TabStop = False + Me.grpExtreme.Text = "Extreme" + ' + 'ucrChkSymmetricExtremeDependencyScore + ' + Me.ucrChkSymmetricExtremeDependencyScore.Checked = False + Me.ucrChkSymmetricExtremeDependencyScore.Location = New System.Drawing.Point(6, 19) + Me.ucrChkSymmetricExtremeDependencyScore.Name = "ucrChkSymmetricExtremeDependencyScore" + Me.ucrChkSymmetricExtremeDependencyScore.Size = New System.Drawing.Size(171, 20) + Me.ucrChkSymmetricExtremeDependencyScore.TabIndex = 10 + ' + 'ucrChkExremalDependencyIndex + ' + Me.ucrChkExremalDependencyIndex.Checked = False + Me.ucrChkExremalDependencyIndex.Location = New System.Drawing.Point(185, 45) + Me.ucrChkExremalDependencyIndex.Name = "ucrChkExremalDependencyIndex" + Me.ucrChkExremalDependencyIndex.Size = New System.Drawing.Size(181, 20) + Me.ucrChkExremalDependencyIndex.TabIndex = 9 + ' + 'ucrChkExtremeDependencyScore + ' + Me.ucrChkExtremeDependencyScore.Checked = False + Me.ucrChkExtremeDependencyScore.Location = New System.Drawing.Point(6, 45) + Me.ucrChkExtremeDependencyScore.Name = "ucrChkExtremeDependencyScore" + Me.ucrChkExtremeDependencyScore.Size = New System.Drawing.Size(171, 20) + Me.ucrChkExtremeDependencyScore.TabIndex = 11 + ' + 'ucrChkSymmetricExtremalDependenceIndex + ' + Me.ucrChkSymmetricExtremalDependenceIndex.Checked = False + Me.ucrChkSymmetricExtremalDependenceIndex.Location = New System.Drawing.Point(185, 19) + Me.ucrChkSymmetricExtremalDependenceIndex.Name = "ucrChkSymmetricExtremalDependenceIndex" + Me.ucrChkSymmetricExtremalDependenceIndex.Size = New System.Drawing.Size(179, 20) + Me.ucrChkSymmetricExtremalDependenceIndex.TabIndex = 5 + ' + 'tbCategorical + ' + Me.tbCategorical.Controls.Add(Me.ucrChkCatPercentCorrect) + Me.tbCategorical.Controls.Add(Me.ucrChkCatHeidkeSkillScore) + Me.tbCategorical.Controls.Add(Me.ucrChkCatPierceSkillScore) + Me.tbCategorical.Controls.Add(Me.ucrChkGerrityScore) + Me.tbCategorical.Location = New System.Drawing.Point(4, 22) + Me.tbCategorical.Name = "tbCategorical" + Me.tbCategorical.Padding = New System.Windows.Forms.Padding(3) + Me.tbCategorical.Size = New System.Drawing.Size(549, 229) + Me.tbCategorical.TabIndex = 2 + Me.tbCategorical.Text = "Categorical" + Me.tbCategorical.UseVisualStyleBackColor = True + ' + 'ucrChkCatPercentCorrect + ' + Me.ucrChkCatPercentCorrect.Checked = False + Me.ucrChkCatPercentCorrect.Location = New System.Drawing.Point(14, 18) + Me.ucrChkCatPercentCorrect.Name = "ucrChkCatPercentCorrect" + Me.ucrChkCatPercentCorrect.Size = New System.Drawing.Size(100, 20) + Me.ucrChkCatPercentCorrect.TabIndex = 4 + ' + 'ucrChkCatHeidkeSkillScore + ' + Me.ucrChkCatHeidkeSkillScore.Checked = False + Me.ucrChkCatHeidkeSkillScore.Location = New System.Drawing.Point(14, 40) + Me.ucrChkCatHeidkeSkillScore.Name = "ucrChkCatHeidkeSkillScore" + Me.ucrChkCatHeidkeSkillScore.Size = New System.Drawing.Size(100, 20) + Me.ucrChkCatHeidkeSkillScore.TabIndex = 3 + ' + 'ucrChkCatPierceSkillScore + ' + Me.ucrChkCatPierceSkillScore.Checked = False + Me.ucrChkCatPierceSkillScore.Location = New System.Drawing.Point(135, 18) + Me.ucrChkCatPierceSkillScore.Name = "ucrChkCatPierceSkillScore" + Me.ucrChkCatPierceSkillScore.Size = New System.Drawing.Size(100, 20) + Me.ucrChkCatPierceSkillScore.TabIndex = 2 + ' + 'ucrChkGerrityScore + ' + Me.ucrChkGerrityScore.Checked = False + Me.ucrChkGerrityScore.Location = New System.Drawing.Point(135, 42) + Me.ucrChkGerrityScore.Name = "ucrChkGerrityScore" + Me.ucrChkGerrityScore.Size = New System.Drawing.Size(100, 20) + Me.ucrChkGerrityScore.TabIndex = 1 ' 'sdgVerificationSummaries ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(387, 340) + Me.ClientSize = New System.Drawing.Size(578, 300) + Me.Controls.Add(Me.tbSummaries) Me.Controls.Add(Me.ucrBase) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow Me.MaximizeBox = False @@ -44,9 +277,37 @@ Partial Class sdgVerificationSummaries Me.Name = "sdgVerificationSummaries" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Summaries" + Me.tbSummaries.ResumeLayout(False) + Me.tbContinuous.ResumeLayout(False) + Me.tbBinary.ResumeLayout(False) + Me.grpOrdinary.ResumeLayout(False) + Me.grpExtreme.ResumeLayout(False) + Me.tbCategorical.ResumeLayout(False) Me.ResumeLayout(False) End Sub Friend WithEvents ucrBase As ucrButtonsSubdialogue + Friend WithEvents tbSummaries As TabControl + Friend WithEvents tbContinuous As TabPage + Friend WithEvents tbBinary As TabPage + Friend WithEvents tbCategorical As TabPage + Friend WithEvents ucrChkHitRate As ucrCheck + Friend WithEvents ucrChkThreatScore As ucrCheck + Friend WithEvents ucrChkEquitableThreatScore As ucrCheck + Friend WithEvents ucrChkFalseAlarmRatio As ucrCheck + Friend WithEvents ucrChkCatPercentCorrect As ucrCheck + Friend WithEvents ucrChkCatHeidkeSkillScore As ucrCheck + Friend WithEvents ucrChkCatPierceSkillScore As ucrCheck + Friend WithEvents ucrChkGerrityScore As ucrCheck + Friend WithEvents ucrContinuousVerification As ucrContinuousVerification + Friend WithEvents ucrChkHeidkeSkillScore As ucrCheck + Friend WithEvents ucrChkPercentCorrect As ucrCheck + Friend WithEvents ucrChkBias As ucrCheck + Friend WithEvents ucrChkSymmetricExtremalDependenceIndex As ucrCheck + Friend WithEvents ucrChkExtremeDependencyScore As ucrCheck + Friend WithEvents ucrChkSymmetricExtremeDependencyScore As ucrCheck + Friend WithEvents ucrChkExremalDependencyIndex As ucrCheck + Friend WithEvents grpExtreme As GroupBox + Friend WithEvents grpOrdinary As GroupBox End Class diff --git a/instat/sdgVerificationSummaries.vb b/instat/sdgVerificationSummaries.vb index 5354a8150bb..c5a8731f6dd 100644 --- a/instat/sdgVerificationSummaries.vb +++ b/instat/sdgVerificationSummaries.vb @@ -13,9 +13,100 @@ ' ' You should have received a copy of the GNU General Public License ' along with this program. If not, see . +Imports instat.Translations Public Class sdgVerificationSummaries + Private bControlsInitialised As Boolean = True + Private bResetSubdialog As Boolean = False + Private lstSummaryCheckboxes As New List(Of ucrCheck) + Private clsListFunction As New RFunction Private Sub sdgVerificationSummaries_Load(sender As Object, e As EventArgs) Handles MyBase.Load + autoTranslate(Me) + End Sub + + Private Sub InitialiseControls() + ucrChkHitRate.SetParameter(New RParameter("PODy", 21), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:=Chr(34) & "PODy" & Chr(34), strNewValueIfUnchecked:=Chr(34) & Chr(34)) + ucrChkHitRate.SetText("Hit Rate") + + ucrChkThreatScore.SetParameter(New RParameter("TS", 22), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:=Chr(34) & "TS" & Chr(34), strNewValueIfUnchecked:=Chr(34) & Chr(34)) + ucrChkThreatScore.SetText("Threat Score") + + ucrChkEquitableThreatScore.SetParameter(New RParameter("ETS", 23), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:=Chr(34) & "ETS" & Chr(34), strNewValueIfUnchecked:=Chr(34) & Chr(34)) + ucrChkEquitableThreatScore.SetText("Equitable Threat Score") + + ucrChkFalseAlarmRatio.SetParameter(New RParameter("FAR", 24), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:=Chr(34) & "FAR" & Chr(34), strNewValueIfUnchecked:=Chr(34) & Chr(34)) + ucrChkFalseAlarmRatio.SetText("False Alarm Ratio") + + ucrChkHeidkeSkillScore.SetParameter(New RParameter("HSS", 25), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:=Chr(34) & "HSS" & Chr(34), strNewValueIfUnchecked:=Chr(34) & Chr(34)) + ucrChkHeidkeSkillScore.SetText("Heidke Skill Score") + + ucrChkPercentCorrect.SetParameter(New RParameter("PC", 26), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:=Chr(34) & "PC" & Chr(34), strNewValueIfUnchecked:=Chr(34) & Chr(34)) + ucrChkPercentCorrect.SetText("Percent Correct") + + ucrChkBias.SetParameter(New RParameter("BIAS", 27), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:=Chr(34) & "BIAS" & Chr(34), strNewValueIfUnchecked:=Chr(34) & Chr(34)) + ucrChkBias.SetText("Bias") + + ucrChkExtremeDependencyScore.SetParameter(New RParameter("EDS", 28), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:=Chr(34) & "EDS" & Chr(34), strNewValueIfUnchecked:=Chr(34) & Chr(34)) + ucrChkExtremeDependencyScore.SetText("Extreme Dependency Score") + + ucrChkSymmetricExtremeDependencyScore.SetParameter(New RParameter("SEDS", 29), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:=Chr(34) & "SEDS" & Chr(34), strNewValueIfUnchecked:=Chr(34) & Chr(34)) + ucrChkSymmetricExtremeDependencyScore.SetText("Symmetric Extreme Dependency Score") + + ucrChkExremalDependencyIndex.SetParameter(New RParameter("EDI", 30), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:=Chr(34) & "EDI" & Chr(34), strNewValueIfUnchecked:=Chr(34) & Chr(34)) + ucrChkExremalDependencyIndex.SetText("Exremal Dependency Index") + + ucrChkSymmetricExtremalDependenceIndex.SetParameter(New RParameter("SEDI", 31), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:=Chr(34) & "SEDI" & Chr(34), strNewValueIfUnchecked:=Chr(34) & Chr(34)) + ucrChkSymmetricExtremalDependenceIndex.SetText("Symmetric Extremal Dependence Index") + + ucrChkCatPercentCorrect.SetParameter(New RParameter("pc", 32), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:=Chr(34) & "pc" & Chr(34), strNewValueIfUnchecked:=Chr(34) & Chr(34)) + ucrChkCatPercentCorrect.SetText("Percent Correct") + + ucrChkCatHeidkeSkillScore.SetParameter(New RParameter("hss", 33), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:=Chr(34) & "hss" & Chr(34), strNewValueIfUnchecked:=Chr(34) & Chr(34)) + ucrChkCatHeidkeSkillScore.SetText("Heidke Skill Score") + + ucrChkCatPierceSkillScore.SetParameter(New RParameter("pss", 34), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:=Chr(34) & "pss" & Chr(34), strNewValueIfUnchecked:=Chr(34) & Chr(34)) + ucrChkCatPierceSkillScore.SetText("Pierce Skill Score") + + ucrChkGerrityScore.SetParameter(New RParameter("GS", 35), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:=Chr(34) & "GS" & Chr(34), strNewValueIfUnchecked:=Chr(34) & Chr(34)) + ucrChkGerrityScore.SetText("Gerrity Score") + + lstSummaryCheckboxes.AddRange({ucrChkHitRate, ucrChkThreatScore, ucrChkEquitableThreatScore, ucrChkFalseAlarmRatio, ucrChkHeidkeSkillScore, ucrChkPercentCorrect, ucrChkBias, ucrChkExtremeDependencyScore, ucrChkSymmetricExtremeDependencyScore, ucrChkExremalDependencyIndex, ucrChkSymmetricExtremalDependenceIndex, ucrChkCatPercentCorrect, ucrChkCatHeidkeSkillScore, ucrChkCatPierceSkillScore, ucrChkGerrityScore}) + + For Each ctr In lstSummaryCheckboxes + ctr.SetParameterIncludeArgumentName(False) + ctr.SetRDefault(Chr(34) & Chr(34)) + Next + End Sub + + Public Sub SetRFunction(clsNewSummaryFunction As RFunction, clsNewListFunction As RFunction, Optional iNewTabIndexSelected As Integer = 0, Optional bReset As Boolean = False) + If bControlsInitialised Then + InitialiseControls() + bControlsInitialised = False + End If + clsListFunction = clsNewListFunction + + For Each ctr In lstSummaryCheckboxes + ctr.SetRCode(clsNewListFunction, bReset) + If ctr.Enabled = False Then + ctr.Checked = False + End If + Next + bResetSubdialog = bReset + + ucrContinuousVerification.SetRCodeForControls(clsNewSummaryFunction:=clsNewSummaryFunction, clsNewListFunction:=clsNewListFunction, bReset:=bResetSubdialog) + + tbSummaries.SelectedIndex = iNewTabIndexSelected + End Sub + + Private Sub ucrBase_ClickReturn(sender As Object, e As EventArgs) Handles ucrBase.ClickReturn + If clsListFunction.clsParameters.Count = 0 Then + MsgBox("No verification summary selected. Ok will not be enabled on the main dialog.", Title:="No verification summary selected", Buttons:=MsgBoxStyle.Information) + End If + End Sub + Public Sub EnableDisableTabs(bEnabledDisabledContinuous As Boolean, bEnabledDisabledBinary As Boolean, bEnabledDisabledCategorical As Boolean) + tbContinuous.Enabled = bEnabledDisabledContinuous + tbBinary.Enabled = bEnabledDisabledBinary + tbCategorical.Enabled = bEnabledDisabledCategorical End Sub End Class \ No newline at end of file diff --git a/instat/static/InstatObject/R/Backend_Components/summary_functions.R b/instat/static/InstatObject/R/Backend_Components/summary_functions.R index d6adae93254..6911a6b445b 100644 --- a/instat/static/InstatObject/R/Backend_Components/summary_functions.R +++ b/instat/static/InstatObject/R/Backend_Components/summary_functions.R @@ -1009,7 +1009,7 @@ me <- function(x, y, na.rm = FALSE, na_type = "", ...){ if(na.rm && na_type != "" && !na_check(x, na_type = na_type, ...)) return(NA) else{ if(length(x[is.na(x)])==length(x)||length(y[is.na(y)])==length(y)) return(NA) - return(hydroGOF::me(sim = x, obs = y, na.rm = na.rm)) + return(hydroGOF::me(sim = y, obs = x, na.rm = na.rm)) } } @@ -1018,7 +1018,7 @@ mae <- function(x, y, na.rm = FALSE, na_type = "", ...){ if(na.rm && na_type != "" && !na_check(x, na_type = na_type, ...)) return(NA) else{ if(length(x[is.na(x)])==length(x)||length(y[is.na(y)])==length(y)) return(NA) - return(hydroGOF::mae(sim = x, obs = y, na.rm = na.rm)) + return(hydroGOF::mae(sim = y, obs = x, na.rm = na.rm)) } } @@ -1027,7 +1027,7 @@ rmse <- function(x, y, na.rm = FALSE, na_type = "", ...){ if(na.rm && na_type != "" && !na_check(x, na_type = na_type, ...)) return(NA) else{ if(length(x[is.na(x)])==length(x)||length(y[is.na(y)])==length(y)) return(NA) - return(hydroGOF::rmse(sim = x, obs = y, na.rm = na.rm)) + return(hydroGOF::rmse(sim = y, obs = x, na.rm = na.rm)) } } @@ -1036,7 +1036,7 @@ nrmse <- function(x, y, na.rm = FALSE, na_type = "", ...){ if(na.rm && na_type != "" && !na_check(x, na_type = na_type, ...)) return(NA) else{ if(length(x[is.na(x)])==length(x)||length(y[is.na(y)])==length(y)) return(NA) - return(hydroGOF::nrmse(sim = x, obs = y, na.rm = na.rm)) + return(hydroGOF::nrmse(sim = y, obs = x, na.rm = na.rm)) } } @@ -1045,7 +1045,7 @@ PBIAS <- function(x, y, na.rm = FALSE, na_type = "", ...){ if(na.rm && na_type != "" && !na_check(x, na_type = na_type, ...)) return(NA) else{ if(length(x[is.na(x)])==length(x)||length(y[is.na(y)])==length(y)) return(NA) - return(hydroGOF::pbias(sim = x, obs = y, na.rm = na.rm)) + return(hydroGOF::pbias(sim = y, obs = x, na.rm = na.rm)) } } @@ -1054,7 +1054,7 @@ NSE <- function(x, y, na.rm = FALSE, na_type = "", ...){ if(na.rm && na_type != "" && !na_check(x, na_type = na_type, ...)) return(NA) else{ if(length(x[is.na(x)])==length(x)||length(y[is.na(y)])==length(y)) return(NA) - return(hydroGOF::NSeff(sim = x, obs = y, na.rm = na.rm)) + return(hydroGOF::NSeff(sim = y, obs = x, na.rm = na.rm)) } } @@ -1063,7 +1063,7 @@ mNSE <- function(x, y, j = 1, na.rm = FALSE, na_type = "", ...){ if(na.rm && na_type != "" && !na_check(x, na_type = na_type, ...)) return(NA) else{ if(length(x[is.na(x)])==length(x)||length(y[is.na(y)])==length(y)) return(NA) - return(hydroGOF::mNSE(sim = x, obs = y, j = j, na.rm = na.rm)) + return(hydroGOF::mNSE(sim = y, obs = x, j = j, na.rm = na.rm)) } } @@ -1072,7 +1072,7 @@ rNSE <- function(x, y, na.rm = FALSE, na_type = "", ...){ if(na.rm && na_type != "" && !na_check(x, na_type = na_type, ...)) return(NA) else{ if(length(x[is.na(x)])==length(x)||length(y[is.na(y)])==length(y)) return(NA) - return(hydroGOF::rNSeff(sim = x, obs = y, na.rm = na.rm)) + return(hydroGOF::rNSeff(sim = y, obs = x, na.rm = na.rm)) } } @@ -1081,16 +1081,16 @@ d <- function(x, y, na.rm = FALSE, na_type = "", ...){ if(na.rm && na_type != "" && !na_check(x, na_type = na_type, ...)) return(NA) else{ if(length(x[is.na(x)])==length(x)||length(y[is.na(y)])==length(y)) return(NA) - return(hydroGOF::d(sim = x, obs = y, na.rm = na.rm)) + return(hydroGOF::d(sim = y, obs = x, na.rm = na.rm)) } } -#Modified index of aggrement +#Modified index of agreement md <- function(x, y, j = 1, na.rm = FALSE, na_type = "", ...){ if(na.rm && na_type != "" && !na_check(x, na_type = na_type, ...)) return(NA) else{ if(length(x[is.na(x)])==length(x)||length(y[is.na(y)])==length(y)) return(NA) - return(hydroGOF::md(sim = x, obs = y, j = j, na.rm = na.rm)) + return(hydroGOF::md(sim = y, obs = x, j = j, na.rm = na.rm)) } } @@ -1100,7 +1100,7 @@ rd <- function(x, y, na.rm = FALSE, na_type = "", ...){ if(na.rm && na_type != "" && !na_check(x, na_type = na_type, ...)) return(NA) else{ if(length(x[is.na(x)])==length(x)||length(y[is.na(y)])==length(y)) return(NA) - return(hydroGOF::rd(sim = x, obs = y, na.rm = na.rm)) + return(hydroGOF::rd(sim = y, obs = x, na.rm = na.rm)) } } @@ -1110,7 +1110,7 @@ R2 <- function(x, y, na.rm = FALSE, na_type = "", ...){ if(na.rm && na_type != "" && !na_check(x, na_type = na_type, ...)) return(NA) else{ if(length(x[is.na(x)])==length(x)||length(y[is.na(y)])==length(y)) return(NA) - return(hydroGOF::br2(sim = x, obs = y, na.rm = na.rm)) + return(hydroGOF::br2(sim = y, obs = x, na.rm = na.rm)) } } @@ -1119,7 +1119,7 @@ cp <- function(x, y, na.rm = FALSE, na_type = "", ...){ if(na.rm && na_type != "" && !na_check(x, na_type = na_type, ...)) return(NA) else{ if(length(unique(y))==1||length(x[is.na(x)])==length(x)||length(y[is.na(y)])==length(y)) return(NA) - return(hydroGOF::cp(sim = x, obs = y, na.rm = na.rm)) + return(hydroGOF::cp(sim = y, obs = x, na.rm = na.rm)) } } @@ -1128,7 +1128,7 @@ KGE <- function(x, y, na.rm = FALSE, na_type = "", ...){ if(na.rm && na_type != "" && !na_check(x, na_type = na_type, ...)) return(NA) else{ if(length(x[is.na(x)])==length(x)||length(y[is.na(y)])==length(y)) return(NA) - return(hydroGOF::KGE(sim = x, obs = y, na.rm = na.rm)) + return(hydroGOF::KGE(sim = y, obs = x, na.rm = na.rm)) } } @@ -1137,7 +1137,7 @@ mse <- function(x, y, na.rm = FALSE, na_type = "", ...){ if(na.rm && na_type != "" && !na_check(x, na_type = na_type, ...)) return(NA) else{ if(length(x[is.na(x)])==length(x)||length(y[is.na(y)])==length(y)) return(NA) - return(hydroGOF::mse(sim = x, obs = y, na.rm = na.rm)) + return(hydroGOF::mse(sim = y, obs = x, na.rm = na.rm)) } } @@ -1147,7 +1147,7 @@ rSD <- function(x, y, na.rm = FALSE, na_type = "", ...){ if(na.rm && na_type != "" && !na_check(x, na_type = na_type, ...)) return(NA) else{ if(length(x[is.na(x)])==length(x)||length(y[is.na(y)])==length(y)) return(NA) - return(hydroGOF::rSD(sim = x, obs = y, na.rm = na.rm)) + return(hydroGOF::rSD(sim = y, obs = x, na.rm = na.rm)) } } @@ -1156,7 +1156,7 @@ rsr <- function(x, y, na.rm = FALSE, na_type = "", ...){ if(na.rm && na_type != "" && !na_check(x, na_type = na_type, ...)) return(NA) else{ if(length(x[is.na(x)])==length(x)||length(y[is.na(y)])==length(y)) return(NA) - return(hydroGOF::rsr(sim = x, obs = y, na.rm = na.rm)) + return(hydroGOF::rsr(sim = y, obs = x, na.rm = na.rm)) } } @@ -1165,7 +1165,7 @@ ssq <- function(x, y, na.rm = FALSE, na_type = "", ...){ if(na.rm && na_type != "" && !na_check(x, na_type = na_type, ...)) return(NA) else{ if(length(x[is.na(x)])==length(x)||length(y[is.na(y)])==length(y)) return(NA) - return(hydroGOF::ssq(sim = x, obs = y, na.rm = na.rm)) + return(hydroGOF::ssq(sim = y, obs = x, na.rm = na.rm)) } } @@ -1174,10 +1174,109 @@ VE <- function(x, y, na.rm = FALSE, na_type = "", ...){ if(na.rm && na_type != "" && !na_check(x, na_type = na_type, ...)) return(NA) else{ if(length(x[is.na(x)])==length(x)||length(y[is.na(y)])==length(y)) return(NA) - return(hydroGOF::VE(sim = x, obs = y, na.rm = na.rm)) + return(hydroGOF::VE(sim = y, obs = x, na.rm = na.rm)) } } +#Verification package + +#Categorical/Categorical + +##Percent Correct +pc <- function(x, y, frcst.type, obs.type, ...){ + A <- verification::verify(obs = x, pred = y, frcst.type = frcst.type, obs.type = obs.type) + return(A$pc) +} + +##Heidke Skill Score +hss <- function(x, y, frcst.type, obs.type, ...){ + A <- verification::verify(obs = x, pred = y, frcst.type = frcst.type, obs.type = obs.type) + return(A$hss) +} + +##Pierce Skill Score +pss <- function(x, y, frcst.type, obs.type, ...){ + A <- verification::verify(obs = x, pred = y, frcst.type = frcst.type, obs.type = obs.type) + return(A$pss) +} + +##Gerrity Score +GS <- function(x, y, frcst.type, obs.type, ...){ + A <- verification::verify(obs = x, pred = y, frcst.type = frcst.type, obs.type = obs.type) + return(A$gs) +} + +#Binary/Binary + +##Hit rate aka PODy +PODy <- function(x, y, frcst.type, obs.type, ...){ + A <- verification::verify(obs = x, pred = y, frcst.type = frcst.type, obs.type = obs.type) + return(A$POD) +} + +##Threat score +TS <- function(x, y, frcst.type, obs.type, ...){ + A <- verification::verify(obs = x, pred = y, frcst.type = frcst.type, obs.type = obs.type) + return(A$TS) +} + +##Equitable threat score +ETS <- function(x, y, frcst.type, obs.type, ...){ + A <- verification::verify(obs = x, pred = y, frcst.type = frcst.type, obs.type = obs.type) + return(A$ETS) +} + +##False alarm ratio +FAR <- function(x, y, frcst.type, obs.type, ...){ + A <- verification::verify(obs = x, pred = y, frcst.type = frcst.type, obs.type = obs.type) + return(A$FAR) +} + +##Heidke skill score +HSS <- function(x, y, frcst.type, obs.type, ...){ + A <- verification::verify(obs = x, pred = y, frcst.type = frcst.type, obs.type = obs.type) + return(A$HSS) +} + +##Percent correct +PC <- function(x, y, frcst.type, obs.type, ...){ + A <- verification::verify(obs = x, pred = y, frcst.type = frcst.type, obs.type = obs.type) + return(A$PC) +} + +##Bias +BIAS <- function(x, y, frcst.type, obs.type, ...){ + A <- verification::verify(obs = x, pred = y, frcst.type = frcst.type, obs.type = obs.type) + return(A$BIAS) +} + +##Extreme dependency score +EDS <- function(x, y, frcst.type, obs.type, ...){ + A <- verification::verify(obs = x, pred = y, frcst.type = frcst.type, obs.type = obs.type) + return(A$eds) +} + +##Symmetric extreme dependency score +SEDS <- function(x, y, frcst.type, obs.type, ...){ + A <- verification::verify(obs = x, pred = y, frcst.type = frcst.type, obs.type = obs.type) + return(A$seds) +} + +##Extremal dependency index +EDI <- function(x, y, frcst.type, obs.type, ...){ + A <- verification::verify(obs = x, pred = y, frcst.type = frcst.type, obs.type = obs.type) + return(A$EDI) +} + +##Symmetric Extremal dependence index +SEDI <- function(x, y, frcst.type, obs.type, ...){ + A <- verification::verify(obs = x, pred = y, frcst.type = frcst.type, obs.type = obs.type) + return(A$SEDI) +} + +##TODO:Check if there are summaries that only apply to (Probabilistic-binary) types. + + DataBook$set("public", "summary_table", function(data_name, columns_to_summarise = NULL, summaries, factors = c(), n_column_factors = 1, store_results = TRUE, drop = TRUE, na.rm = FALSE, summary_name = NA, include_margins = FALSE, return_output = TRUE, treat_columns_as_factor = FALSE, page_by = "default", as_html = TRUE, signif_fig = 2, na_display = "", na_level_display = "NA", weights = NULL, caption = NULL, result_names = NULL, percentage_type = "none", perc_total_columns = NULL, perc_total_factors = c(), perc_total_filter = NULL, perc_decimal = FALSE, margin_name = "(All)", additional_filter, ...) { if(n_column_factors == 1 && length(factors) == 0) n_column_factors <- 0 if(n_column_factors > length(factors)) stop("n_column_factors must be <= number of factors specified.") diff --git a/instat/ucrContinuousVerification.Designer.vb b/instat/ucrContinuousVerification.Designer.vb index 09c77de22f4..26be1f288bd 100644 --- a/instat/ucrContinuousVerification.Designer.vb +++ b/instat/ucrContinuousVerification.Designer.vb @@ -22,8 +22,7 @@ Partial Class ucrContinuousVerification 'Do not modify it using the code editor. _ Private Sub InitializeComponent() - Me.ucrChkME = New instat.ucrCheck() - Me.grpHyroGOF = New System.Windows.Forms.GroupBox() + Me.components = New System.ComponentModel.Container() Me.lblJmia = New System.Windows.Forms.Label() Me.ucrInputJmia = New instat.ucrInputTextBox() Me.ucrChkRelativeIndexOfAgreement = New instat.ucrCheck() @@ -46,68 +45,27 @@ Partial Class ucrContinuousVerification Me.ucrChkNormRootMeanSquaredError = New instat.ucrCheck() Me.ucrChkMeanAbsoluteError = New instat.ucrCheck() Me.ucrChkIndexOfAgreement = New instat.ucrCheck() + Me.ttVerificationSummaries = New System.Windows.Forms.ToolTip(Me.components) Me.ucrChkSelectAll = New instat.ucrCheck() - Me.ucrChkMAE = New instat.ucrCheck() - Me.ucrChkMSE = New instat.ucrCheck() - Me.grpVerification = New System.Windows.Forms.GroupBox() - Me.grpHyroGOF.SuspendLayout() + Me.ucrChkCorrelations = New instat.ucrCheck() Me.SuspendLayout() ' - 'ucrChkME - ' - Me.ucrChkME.Checked = False - Me.ucrChkME.Location = New System.Drawing.Point(22, 41) - Me.ucrChkME.Name = "ucrChkME" - Me.ucrChkME.Size = New System.Drawing.Size(100, 20) - Me.ucrChkME.TabIndex = 7 - ' - 'grpHyroGOF - ' - Me.grpHyroGOF.Controls.Add(Me.lblJmia) - Me.grpHyroGOF.Controls.Add(Me.ucrInputJmia) - Me.grpHyroGOF.Controls.Add(Me.ucrChkRelativeIndexOfAgreement) - Me.grpHyroGOF.Controls.Add(Me.ucrChkRatioOfStandardDeviation) - Me.grpHyroGOF.Controls.Add(Me.ucrChkCoefDetermination) - Me.grpHyroGOF.Controls.Add(Me.ucrChkRatioOfRootMeanSquaredError) - Me.grpHyroGOF.Controls.Add(Me.ucrChkRelativeNashSutcliffeEff) - Me.grpHyroGOF.Controls.Add(Me.ucrChkModifiedIndexOfAgreement) - Me.grpHyroGOF.Controls.Add(Me.ucrChkCoefPersistence) - Me.grpHyroGOF.Controls.Add(Me.ucrChkNashSutcliffeEfficiency) - Me.grpHyroGOF.Controls.Add(Me.ucrChkSumOfSquaredResiduals) - Me.grpHyroGOF.Controls.Add(Me.ucrChkKlingGuptaEfficiency) - Me.grpHyroGOF.Controls.Add(Me.ucrChkVolumetricEfficiency) - Me.grpHyroGOF.Controls.Add(Me.ucrChkPercentBias) - Me.grpHyroGOF.Controls.Add(Me.ucrChkModNashSutcliffeEff) - Me.grpHyroGOF.Controls.Add(Me.ucrChkMeanError) - Me.grpHyroGOF.Controls.Add(Me.ucrChkMeanSquaredError) - Me.grpHyroGOF.Controls.Add(Me.ucrChkRootMeanSquaredError) - Me.grpHyroGOF.Controls.Add(Me.cmdHelp) - Me.grpHyroGOF.Controls.Add(Me.ucrChkNormRootMeanSquaredError) - Me.grpHyroGOF.Controls.Add(Me.ucrChkMeanAbsoluteError) - Me.grpHyroGOF.Controls.Add(Me.ucrChkIndexOfAgreement) - Me.grpHyroGOF.Location = New System.Drawing.Point(11, 111) - Me.grpHyroGOF.Name = "grpHyroGOF" - Me.grpHyroGOF.Size = New System.Drawing.Size(409, 145) - Me.grpHyroGOF.TabIndex = 11 - Me.grpHyroGOF.TabStop = False - Me.grpHyroGOF.Text = "HydroGOF" - ' 'lblJmia ' Me.lblJmia.AutoSize = True Me.lblJmia.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.lblJmia.Location = New System.Drawing.Point(284, 125) + Me.lblJmia.Location = New System.Drawing.Point(423, 176) Me.lblJmia.Name = "lblJmia" - Me.lblJmia.Size = New System.Drawing.Size(12, 13) + Me.lblJmia.Size = New System.Drawing.Size(15, 13) Me.lblJmia.TabIndex = 20 - Me.lblJmia.Text = "j:" + Me.lblJmia.Text = "J:" ' 'ucrInputJmia ' Me.ucrInputJmia.AddQuotesIfUnrecognised = True Me.ucrInputJmia.IsMultiline = False Me.ucrInputJmia.IsReadOnly = False - Me.ucrInputJmia.Location = New System.Drawing.Point(299, 122) + Me.ucrInputJmia.Location = New System.Drawing.Point(442, 172) Me.ucrInputJmia.Name = "ucrInputJmia" Me.ucrInputJmia.Size = New System.Drawing.Size(32, 21) Me.ucrInputJmia.TabIndex = 21 @@ -115,153 +73,153 @@ Partial Class ucrContinuousVerification 'ucrChkRelativeIndexOfAgreement ' Me.ucrChkRelativeIndexOfAgreement.Checked = False - Me.ucrChkRelativeIndexOfAgreement.Location = New System.Drawing.Point(204, 75) + Me.ucrChkRelativeIndexOfAgreement.Location = New System.Drawing.Point(183, 146) Me.ucrChkRelativeIndexOfAgreement.Margin = New System.Windows.Forms.Padding(5) Me.ucrChkRelativeIndexOfAgreement.Name = "ucrChkRelativeIndexOfAgreement" - Me.ucrChkRelativeIndexOfAgreement.Size = New System.Drawing.Size(87, 20) + Me.ucrChkRelativeIndexOfAgreement.Size = New System.Drawing.Size(191, 20) Me.ucrChkRelativeIndexOfAgreement.TabIndex = 13 ' 'ucrChkRatioOfStandardDeviation ' Me.ucrChkRatioOfStandardDeviation.Checked = False - Me.ucrChkRatioOfStandardDeviation.Location = New System.Drawing.Point(94, 54) + Me.ucrChkRatioOfStandardDeviation.Location = New System.Drawing.Point(14, 168) Me.ucrChkRatioOfStandardDeviation.Margin = New System.Windows.Forms.Padding(5) Me.ucrChkRatioOfStandardDeviation.Name = "ucrChkRatioOfStandardDeviation" - Me.ucrChkRatioOfStandardDeviation.Size = New System.Drawing.Size(87, 20) + Me.ucrChkRatioOfStandardDeviation.Size = New System.Drawing.Size(159, 20) Me.ucrChkRatioOfStandardDeviation.TabIndex = 7 ' 'ucrChkCoefDetermination ' Me.ucrChkCoefDetermination.Checked = False - Me.ucrChkCoefDetermination.Location = New System.Drawing.Point(204, 116) + Me.ucrChkCoefDetermination.Location = New System.Drawing.Point(14, 146) Me.ucrChkCoefDetermination.Margin = New System.Windows.Forms.Padding(5) Me.ucrChkCoefDetermination.Name = "ucrChkCoefDetermination" - Me.ucrChkCoefDetermination.Size = New System.Drawing.Size(87, 20) + Me.ucrChkCoefDetermination.Size = New System.Drawing.Size(159, 20) Me.ucrChkCoefDetermination.TabIndex = 15 ' 'ucrChkRatioOfRootMeanSquaredError ' Me.ucrChkRatioOfRootMeanSquaredError.Checked = False - Me.ucrChkRatioOfRootMeanSquaredError.Location = New System.Drawing.Point(94, 34) + Me.ucrChkRatioOfRootMeanSquaredError.Location = New System.Drawing.Point(376, 36) Me.ucrChkRatioOfRootMeanSquaredError.Margin = New System.Windows.Forms.Padding(5) Me.ucrChkRatioOfRootMeanSquaredError.Name = "ucrChkRatioOfRootMeanSquaredError" - Me.ucrChkRatioOfRootMeanSquaredError.Size = New System.Drawing.Size(87, 20) + Me.ucrChkRatioOfRootMeanSquaredError.Size = New System.Drawing.Size(179, 20) Me.ucrChkRatioOfRootMeanSquaredError.TabIndex = 6 ' 'ucrChkRelativeNashSutcliffeEff ' Me.ucrChkRelativeNashSutcliffeEff.Checked = False - Me.ucrChkRelativeNashSutcliffeEff.Location = New System.Drawing.Point(94, 115) + Me.ucrChkRelativeNashSutcliffeEff.Location = New System.Drawing.Point(183, 80) Me.ucrChkRelativeNashSutcliffeEff.Margin = New System.Windows.Forms.Padding(5) Me.ucrChkRelativeNashSutcliffeEff.Name = "ucrChkRelativeNashSutcliffeEff" - Me.ucrChkRelativeNashSutcliffeEff.Size = New System.Drawing.Size(87, 20) + Me.ucrChkRelativeNashSutcliffeEff.Size = New System.Drawing.Size(152, 20) Me.ucrChkRelativeNashSutcliffeEff.TabIndex = 10 ' 'ucrChkModifiedIndexOfAgreement ' Me.ucrChkModifiedIndexOfAgreement.Checked = False - Me.ucrChkModifiedIndexOfAgreement.Location = New System.Drawing.Point(204, 36) + Me.ucrChkModifiedIndexOfAgreement.Location = New System.Drawing.Point(183, 102) Me.ucrChkModifiedIndexOfAgreement.Margin = New System.Windows.Forms.Padding(5) Me.ucrChkModifiedIndexOfAgreement.Name = "ucrChkModifiedIndexOfAgreement" - Me.ucrChkModifiedIndexOfAgreement.Size = New System.Drawing.Size(87, 20) + Me.ucrChkModifiedIndexOfAgreement.Size = New System.Drawing.Size(183, 20) Me.ucrChkModifiedIndexOfAgreement.TabIndex = 11 ' 'ucrChkCoefPersistence ' Me.ucrChkCoefPersistence.Checked = False - Me.ucrChkCoefPersistence.Location = New System.Drawing.Point(204, 95) + Me.ucrChkCoefPersistence.Location = New System.Drawing.Point(183, 168) Me.ucrChkCoefPersistence.Margin = New System.Windows.Forms.Padding(5) Me.ucrChkCoefPersistence.Name = "ucrChkCoefPersistence" - Me.ucrChkCoefPersistence.Size = New System.Drawing.Size(87, 20) + Me.ucrChkCoefPersistence.Size = New System.Drawing.Size(152, 20) Me.ucrChkCoefPersistence.TabIndex = 14 ' 'ucrChkNashSutcliffeEfficiency ' Me.ucrChkNashSutcliffeEfficiency.Checked = False - Me.ucrChkNashSutcliffeEfficiency.Location = New System.Drawing.Point(94, 75) + Me.ucrChkNashSutcliffeEfficiency.Location = New System.Drawing.Point(183, 36) Me.ucrChkNashSutcliffeEfficiency.Margin = New System.Windows.Forms.Padding(5) Me.ucrChkNashSutcliffeEfficiency.Name = "ucrChkNashSutcliffeEfficiency" - Me.ucrChkNashSutcliffeEfficiency.Size = New System.Drawing.Size(87, 20) + Me.ucrChkNashSutcliffeEfficiency.Size = New System.Drawing.Size(152, 20) Me.ucrChkNashSutcliffeEfficiency.TabIndex = 8 ' 'ucrChkSumOfSquaredResiduals ' Me.ucrChkSumOfSquaredResiduals.Checked = False - Me.ucrChkSumOfSquaredResiduals.Location = New System.Drawing.Point(306, 100) + Me.ucrChkSumOfSquaredResiduals.Location = New System.Drawing.Point(376, 124) Me.ucrChkSumOfSquaredResiduals.Margin = New System.Windows.Forms.Padding(5) Me.ucrChkSumOfSquaredResiduals.Name = "ucrChkSumOfSquaredResiduals" - Me.ucrChkSumOfSquaredResiduals.Size = New System.Drawing.Size(87, 20) + Me.ucrChkSumOfSquaredResiduals.Size = New System.Drawing.Size(188, 20) Me.ucrChkSumOfSquaredResiduals.TabIndex = 19 ' 'ucrChkKlingGuptaEfficiency ' Me.ucrChkKlingGuptaEfficiency.Checked = False - Me.ucrChkKlingGuptaEfficiency.Location = New System.Drawing.Point(306, 38) + Me.ucrChkKlingGuptaEfficiency.Location = New System.Drawing.Point(376, 58) Me.ucrChkKlingGuptaEfficiency.Margin = New System.Windows.Forms.Padding(5) Me.ucrChkKlingGuptaEfficiency.Name = "ucrChkKlingGuptaEfficiency" - Me.ucrChkKlingGuptaEfficiency.Size = New System.Drawing.Size(87, 20) + Me.ucrChkKlingGuptaEfficiency.Size = New System.Drawing.Size(188, 20) Me.ucrChkKlingGuptaEfficiency.TabIndex = 16 ' 'ucrChkVolumetricEfficiency ' Me.ucrChkVolumetricEfficiency.Checked = False - Me.ucrChkVolumetricEfficiency.Location = New System.Drawing.Point(306, 58) + Me.ucrChkVolumetricEfficiency.Location = New System.Drawing.Point(376, 80) Me.ucrChkVolumetricEfficiency.Margin = New System.Windows.Forms.Padding(5) Me.ucrChkVolumetricEfficiency.Name = "ucrChkVolumetricEfficiency" - Me.ucrChkVolumetricEfficiency.Size = New System.Drawing.Size(87, 20) + Me.ucrChkVolumetricEfficiency.Size = New System.Drawing.Size(188, 20) Me.ucrChkVolumetricEfficiency.TabIndex = 17 ' 'ucrChkPercentBias ' Me.ucrChkPercentBias.Checked = False - Me.ucrChkPercentBias.Location = New System.Drawing.Point(8, 116) + Me.ucrChkPercentBias.Location = New System.Drawing.Point(376, 146) Me.ucrChkPercentBias.Margin = New System.Windows.Forms.Padding(5) Me.ucrChkPercentBias.Name = "ucrChkPercentBias" - Me.ucrChkPercentBias.Size = New System.Drawing.Size(87, 20) + Me.ucrChkPercentBias.Size = New System.Drawing.Size(188, 20) Me.ucrChkPercentBias.TabIndex = 5 ' 'ucrChkModNashSutcliffeEff ' Me.ucrChkModNashSutcliffeEff.Checked = False - Me.ucrChkModNashSutcliffeEff.Location = New System.Drawing.Point(94, 95) + Me.ucrChkModNashSutcliffeEff.Location = New System.Drawing.Point(183, 58) Me.ucrChkModNashSutcliffeEff.Margin = New System.Windows.Forms.Padding(5) Me.ucrChkModNashSutcliffeEff.Name = "ucrChkModNashSutcliffeEff" - Me.ucrChkModNashSutcliffeEff.Size = New System.Drawing.Size(87, 20) + Me.ucrChkModNashSutcliffeEff.Size = New System.Drawing.Size(152, 20) Me.ucrChkModNashSutcliffeEff.TabIndex = 9 ' 'ucrChkMeanError ' Me.ucrChkMeanError.Checked = False - Me.ucrChkMeanError.Location = New System.Drawing.Point(8, 34) + Me.ucrChkMeanError.Location = New System.Drawing.Point(14, 58) Me.ucrChkMeanError.Margin = New System.Windows.Forms.Padding(5) Me.ucrChkMeanError.Name = "ucrChkMeanError" - Me.ucrChkMeanError.Size = New System.Drawing.Size(87, 20) + Me.ucrChkMeanError.Size = New System.Drawing.Size(159, 20) Me.ucrChkMeanError.TabIndex = 1 ' 'ucrChkMeanSquaredError ' Me.ucrChkMeanSquaredError.Checked = False - Me.ucrChkMeanSquaredError.Location = New System.Drawing.Point(306, 79) + Me.ucrChkMeanSquaredError.Location = New System.Drawing.Point(376, 102) Me.ucrChkMeanSquaredError.Margin = New System.Windows.Forms.Padding(5) Me.ucrChkMeanSquaredError.Name = "ucrChkMeanSquaredError" - Me.ucrChkMeanSquaredError.Size = New System.Drawing.Size(87, 20) + Me.ucrChkMeanSquaredError.Size = New System.Drawing.Size(188, 20) Me.ucrChkMeanSquaredError.TabIndex = 18 ' 'ucrChkRootMeanSquaredError ' Me.ucrChkRootMeanSquaredError.Checked = False - Me.ucrChkRootMeanSquaredError.Location = New System.Drawing.Point(8, 74) + Me.ucrChkRootMeanSquaredError.Location = New System.Drawing.Point(14, 102) Me.ucrChkRootMeanSquaredError.Margin = New System.Windows.Forms.Padding(5) Me.ucrChkRootMeanSquaredError.Name = "ucrChkRootMeanSquaredError" - Me.ucrChkRootMeanSquaredError.Size = New System.Drawing.Size(87, 20) + Me.ucrChkRootMeanSquaredError.Size = New System.Drawing.Size(159, 20) Me.ucrChkRootMeanSquaredError.TabIndex = 3 ' 'cmdHelp ' Me.cmdHelp.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.cmdHelp.Location = New System.Drawing.Point(331, 120) + Me.cmdHelp.Location = New System.Drawing.Point(474, 170) Me.cmdHelp.Name = "cmdHelp" - Me.cmdHelp.Size = New System.Drawing.Size(68, 23) + Me.cmdHelp.Size = New System.Drawing.Size(65, 23) Me.cmdHelp.TabIndex = 22 Me.cmdHelp.Text = "Help" Me.cmdHelp.UseVisualStyleBackColor = True @@ -269,84 +227,82 @@ Partial Class ucrContinuousVerification 'ucrChkNormRootMeanSquaredError ' Me.ucrChkNormRootMeanSquaredError.Checked = False - Me.ucrChkNormRootMeanSquaredError.Location = New System.Drawing.Point(8, 95) + Me.ucrChkNormRootMeanSquaredError.Location = New System.Drawing.Point(14, 124) Me.ucrChkNormRootMeanSquaredError.Margin = New System.Windows.Forms.Padding(5) Me.ucrChkNormRootMeanSquaredError.Name = "ucrChkNormRootMeanSquaredError" - Me.ucrChkNormRootMeanSquaredError.Size = New System.Drawing.Size(87, 20) + Me.ucrChkNormRootMeanSquaredError.Size = New System.Drawing.Size(159, 20) Me.ucrChkNormRootMeanSquaredError.TabIndex = 4 ' 'ucrChkMeanAbsoluteError ' Me.ucrChkMeanAbsoluteError.Checked = False - Me.ucrChkMeanAbsoluteError.Location = New System.Drawing.Point(8, 54) + Me.ucrChkMeanAbsoluteError.Location = New System.Drawing.Point(14, 80) Me.ucrChkMeanAbsoluteError.Margin = New System.Windows.Forms.Padding(5) Me.ucrChkMeanAbsoluteError.Name = "ucrChkMeanAbsoluteError" - Me.ucrChkMeanAbsoluteError.Size = New System.Drawing.Size(87, 20) + Me.ucrChkMeanAbsoluteError.Size = New System.Drawing.Size(159, 20) Me.ucrChkMeanAbsoluteError.TabIndex = 2 ' 'ucrChkIndexOfAgreement ' Me.ucrChkIndexOfAgreement.Checked = False - Me.ucrChkIndexOfAgreement.Location = New System.Drawing.Point(204, 57) + Me.ucrChkIndexOfAgreement.Location = New System.Drawing.Point(183, 124) Me.ucrChkIndexOfAgreement.Margin = New System.Windows.Forms.Padding(5) Me.ucrChkIndexOfAgreement.Name = "ucrChkIndexOfAgreement" - Me.ucrChkIndexOfAgreement.Size = New System.Drawing.Size(87, 20) + Me.ucrChkIndexOfAgreement.Size = New System.Drawing.Size(152, 20) Me.ucrChkIndexOfAgreement.TabIndex = 12 ' 'ucrChkSelectAll ' Me.ucrChkSelectAll.Checked = False - Me.ucrChkSelectAll.Location = New System.Drawing.Point(19, 1) + Me.ucrChkSelectAll.Location = New System.Drawing.Point(14, 6) Me.ucrChkSelectAll.Margin = New System.Windows.Forms.Padding(5) Me.ucrChkSelectAll.Name = "ucrChkSelectAll" - Me.ucrChkSelectAll.Size = New System.Drawing.Size(87, 20) + Me.ucrChkSelectAll.Size = New System.Drawing.Size(121, 20) Me.ucrChkSelectAll.TabIndex = 8 ' - 'ucrChkMAE - ' - Me.ucrChkMAE.Checked = False - Me.ucrChkMAE.Location = New System.Drawing.Point(22, 71) - Me.ucrChkMAE.Name = "ucrChkMAE" - Me.ucrChkMAE.Size = New System.Drawing.Size(154, 20) - Me.ucrChkMAE.TabIndex = 10 - ' - 'ucrChkMSE + 'ucrChkCorrelations ' - Me.ucrChkMSE.Checked = False - Me.ucrChkMSE.Location = New System.Drawing.Point(162, 41) - Me.ucrChkMSE.Name = "ucrChkMSE" - Me.ucrChkMSE.Size = New System.Drawing.Size(161, 20) - Me.ucrChkMSE.TabIndex = 9 - ' - 'grpVerification - ' - Me.grpVerification.Location = New System.Drawing.Point(11, 25) - Me.grpVerification.Name = "grpVerification" - Me.grpVerification.Size = New System.Drawing.Size(409, 81) - Me.grpVerification.TabIndex = 12 - Me.grpVerification.TabStop = False - Me.grpVerification.Text = "Verification" + Me.ucrChkCorrelations.Checked = False + Me.ucrChkCorrelations.Location = New System.Drawing.Point(14, 36) + Me.ucrChkCorrelations.Margin = New System.Windows.Forms.Padding(5) + Me.ucrChkCorrelations.Name = "ucrChkCorrelations" + Me.ucrChkCorrelations.Size = New System.Drawing.Size(159, 20) + Me.ucrChkCorrelations.TabIndex = 23 ' 'ucrContinuousVerification ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.Controls.Add(Me.ucrChkME) - Me.Controls.Add(Me.grpHyroGOF) + Me.Controls.Add(Me.ucrChkCorrelations) + Me.Controls.Add(Me.lblJmia) + Me.Controls.Add(Me.ucrInputJmia) Me.Controls.Add(Me.ucrChkSelectAll) - Me.Controls.Add(Me.ucrChkMAE) - Me.Controls.Add(Me.ucrChkMSE) - Me.Controls.Add(Me.grpVerification) + Me.Controls.Add(Me.ucrChkRelativeIndexOfAgreement) + Me.Controls.Add(Me.ucrChkCoefPersistence) + Me.Controls.Add(Me.ucrChkRatioOfStandardDeviation) + Me.Controls.Add(Me.ucrChkIndexOfAgreement) + Me.Controls.Add(Me.ucrChkCoefDetermination) + Me.Controls.Add(Me.ucrChkMeanAbsoluteError) + Me.Controls.Add(Me.ucrChkRatioOfRootMeanSquaredError) + Me.Controls.Add(Me.ucrChkNormRootMeanSquaredError) + Me.Controls.Add(Me.ucrChkRelativeNashSutcliffeEff) + Me.Controls.Add(Me.cmdHelp) + Me.Controls.Add(Me.ucrChkModifiedIndexOfAgreement) + Me.Controls.Add(Me.ucrChkRootMeanSquaredError) + Me.Controls.Add(Me.ucrChkMeanSquaredError) + Me.Controls.Add(Me.ucrChkNashSutcliffeEfficiency) + Me.Controls.Add(Me.ucrChkMeanError) + Me.Controls.Add(Me.ucrChkSumOfSquaredResiduals) + Me.Controls.Add(Me.ucrChkModNashSutcliffeEff) + Me.Controls.Add(Me.ucrChkKlingGuptaEfficiency) + Me.Controls.Add(Me.ucrChkPercentBias) + Me.Controls.Add(Me.ucrChkVolumetricEfficiency) Me.Name = "ucrContinuousVerification" - Me.Size = New System.Drawing.Size(430, 265) - Me.grpHyroGOF.ResumeLayout(False) - Me.grpHyroGOF.PerformLayout() + Me.Size = New System.Drawing.Size(574, 198) Me.ResumeLayout(False) + Me.PerformLayout() End Sub - - Friend WithEvents ucrChkME As ucrCheck - Friend WithEvents grpHyroGOF As GroupBox Friend WithEvents lblJmia As Label Friend WithEvents ucrInputJmia As ucrInputTextBox Friend WithEvents ucrChkRelativeIndexOfAgreement As ucrCheck @@ -370,7 +326,6 @@ Partial Class ucrContinuousVerification Friend WithEvents ucrChkMeanAbsoluteError As ucrCheck Friend WithEvents ucrChkIndexOfAgreement As ucrCheck Friend WithEvents ucrChkSelectAll As ucrCheck - Friend WithEvents ucrChkMAE As ucrCheck - Friend WithEvents ucrChkMSE As ucrCheck - Friend WithEvents grpVerification As GroupBox + Friend WithEvents ttVerificationSummaries As ToolTip + Friend WithEvents ucrChkCorrelations As ucrCheck End Class diff --git a/instat/ucrContinuousVerification.resx b/instat/ucrContinuousVerification.resx index 1af7de150c9..5973f6d753d 100644 --- a/instat/ucrContinuousVerification.resx +++ b/instat/ucrContinuousVerification.resx @@ -117,4 +117,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 17, 17 + \ No newline at end of file diff --git a/instat/ucrContinuousVerification.vb b/instat/ucrContinuousVerification.vb index 9619827070d..6046357d835 100644 --- a/instat/ucrContinuousVerification.vb +++ b/instat/ucrContinuousVerification.vb @@ -1,5 +1,151 @@ -Public Class ucrContinuousVerification - Private Sub ucrContinuousVerification_Load(sender As Object, e As EventArgs) Handles MyBase.Load +' R- Instat +' Copyright (C) 2015-2017 +' +' This program is free software: you can redistribute it and/or modify +' it under the terms of the GNU General Public License as published by +' the Free Software Foundation, either version 3 of the License, or +' (at your option) any later version. +' +' This program is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU General Public License for more details. +' +' You should have received a copy of the GNU General Public License +' along with this program. If not, see . +Imports instat.Translations +Public Class ucrContinuousVerification + Private bControlsInitialised As Boolean = True + Private lstContinuousCheckboxes As New List(Of ucrCheck) + + Private Sub InitialiseControls() + 'HydroGOF Options + ucrChkMeanError.SetParameter(New RParameter("me", 1), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:=Chr(34) & "me" & Chr(34), strNewValueIfUnchecked:=Chr(34) & Chr(34)) + ucrChkMeanError.SetText("Mean error") + + ucrChkMeanAbsoluteError.SetParameter(New RParameter("mae", 2), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:=Chr(34) & "mae" & Chr(34), strNewValueIfUnchecked:=Chr(34) & Chr(34)) + ucrChkMeanAbsoluteError.SetText("Mean absolute error") + + ucrChkRootMeanSquaredError.SetParameter(New RParameter("rmse", 3), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:=Chr(34) & "rmse" & Chr(34), strNewValueIfUnchecked:=Chr(34) & Chr(34)) + ucrChkRootMeanSquaredError.SetText("Root mean squared error") + + ucrChkNormRootMeanSquaredError.SetParameter(New RParameter("nrmse", 4), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:=Chr(34) & "nrmse" & Chr(34), strNewValueIfUnchecked:=Chr(34) & Chr(34)) + ucrChkNormRootMeanSquaredError.SetText("Normalized root mean squared error") + + ucrChkPercentBias.SetParameter(New RParameter("PBIAS", 5), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:=Chr(34) & "PBIAS" & Chr(34), strNewValueIfUnchecked:=Chr(34) & Chr(34)) + ucrChkPercentBias.SetText("Percent bias") + + ucrChkRatioOfRootMeanSquaredError.SetParameter(New RParameter("rsr", 6), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:=Chr(34) & "rsr" & Chr(34), strNewValueIfUnchecked:=Chr(34) & Chr(34)) + ucrChkRatioOfRootMeanSquaredError.SetText("Ratio of root mean square error") + + ucrChkRatioOfStandardDeviation.SetParameter(New RParameter("rSD", 7), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:=Chr(34) & "rSD" & Chr(34), strNewValueIfUnchecked:=Chr(34) & Chr(34)) + ucrChkRatioOfStandardDeviation.SetText("Ratio of standard deviations") + + ucrChkNashSutcliffeEfficiency.SetParameter(New RParameter("NSE", 8), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:=Chr(34) & "NSE" & Chr(34), strNewValueIfUnchecked:=Chr(34) & Chr(34)) + ucrChkNashSutcliffeEfficiency.SetText("Nash-Sutcliffe efficiency") + + ucrChkModNashSutcliffeEff.SetParameter(New RParameter("mNSE", 9), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:=Chr(34) & "mNSE" & Chr(34), strNewValueIfUnchecked:=Chr(34) & Chr(34)) + ucrChkModNashSutcliffeEff.SetText("Modified Nash-Sutcliffe efficiency") + + ucrChkRelativeNashSutcliffeEff.SetParameter(New RParameter("rNSE", 10), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:=Chr(34) & "rNSE" & Chr(34), strNewValueIfUnchecked:=Chr(34) & Chr(34)) + ucrChkRelativeNashSutcliffeEff.SetText("Relative Nash-Sutcliffe efficiency") + + ucrChkModifiedIndexOfAgreement.SetParameter(New RParameter("md", 11), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:=Chr(34) & "md" & Chr(34), strNewValueIfUnchecked:=Chr(34) & Chr(34)) + ucrChkModifiedIndexOfAgreement.SetText("Modified index of agreement") + + ucrChkModifiedIndexOfAgreement.AddToLinkedControls(ucrInputJmia, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:=1) + ucrChkModNashSutcliffeEff.AddToLinkedControls(ucrInputJmia, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True) + ucrInputJmia.SetLinkedDisplayControl(lblJmia) + + ucrChkIndexOfAgreement.SetParameter(New RParameter("d", 12), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:=Chr(34) & "d" & Chr(34), strNewValueIfUnchecked:=Chr(34) & Chr(34)) + ucrChkIndexOfAgreement.SetText("Index of agreement") + + ucrChkRelativeIndexOfAgreement.SetParameter(New RParameter("rd", 13), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:=Chr(34) & "rd" & Chr(34), strNewValueIfUnchecked:=Chr(34) & Chr(34)) + ucrChkRelativeIndexOfAgreement.SetText("Relative index of agreement") + + ucrChkCoefPersistence.SetParameter(New RParameter("cp", 14), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:=Chr(34) & "cp" & Chr(34), strNewValueIfUnchecked:=Chr(34) & Chr(34)) + ucrChkCoefPersistence.SetText("Coefficient of persistence") + + ucrChkCoefDetermination.SetParameter(New RParameter("R2", 15), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:=Chr(34) & "R2" & Chr(34), strNewValueIfUnchecked:=Chr(34) & Chr(34)) + ucrChkCoefDetermination.SetText("Coefficient of determination") + + ucrChkKlingGuptaEfficiency.SetParameter(New RParameter("KGE", 16), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:=Chr(34) & "KGE" & Chr(34), strNewValueIfUnchecked:=Chr(34) & Chr(34)) + ucrChkKlingGuptaEfficiency.SetText("Kling-Gupta efficiency") + + ucrChkVolumetricEfficiency.SetParameter(New RParameter("VE", 17), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:=Chr(34) & "VE" & Chr(34), strNewValueIfUnchecked:=Chr(34) & Chr(34)) + ucrChkVolumetricEfficiency.SetText("Volumetric efficiency") + + ucrChkMeanSquaredError.SetParameter(New RParameter("mse", 18), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:=Chr(34) & "mse" & Chr(34), strNewValueIfUnchecked:=Chr(34) & Chr(34)) + ucrChkMeanSquaredError.SetText("Mean squared error") + + ucrChkSumOfSquaredResiduals.SetParameter(New RParameter("ssq", 19), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:=Chr(34) & "ssq" & Chr(34), strNewValueIfUnchecked:=Chr(34) & Chr(34)) + ucrChkSumOfSquaredResiduals.SetText("Sum of squared residuals") + + ucrChkCorrelations.SetParameter(New RParameter("summary_cor", 20), bNewChangeParameterValue:=True, bNewAddRemoveParameter:=True, strNewValueIfChecked:=Chr(34) & "summary_cor" & Chr(34), strNewValueIfUnchecked:=Chr(34) & Chr(34)) + ucrChkCorrelations.SetText("Pearson Correlation") + + ttVerificationSummaries.SetToolTip(ucrInputJmia.txtInput, "numeric value, with the exponent to be used in the computation of the modified index of agreement. The default value is j=1") + + ucrInputJmia.SetParameter(New RParameter("j", 9)) + ucrInputJmia.SetValidationTypeAsNumeric() + ucrInputJmia.AddQuotesIfUnrecognised = False + ucrInputJmia.SetRDefault(1) + + ucrChkSelectAll.SetText("Select all") + + lstContinuousCheckboxes.AddRange({ucrChkCorrelations, ucrChkCoefDetermination, ucrChkCoefPersistence, ucrChkIndexOfAgreement, ucrChkKlingGuptaEfficiency, ucrChkMeanAbsoluteError, ucrChkModifiedIndexOfAgreement, ucrChkMeanError, ucrChkModNashSutcliffeEff, ucrChkMeanSquaredError, ucrChkNormRootMeanSquaredError, ucrChkNashSutcliffeEfficiency, ucrChkPercentBias, ucrChkRelativeIndexOfAgreement, ucrChkRootMeanSquaredError, ucrChkRelativeNashSutcliffeEff, ucrChkRatioOfStandardDeviation, ucrChkRatioOfRootMeanSquaredError, ucrChkSumOfSquaredResiduals, ucrChkVolumetricEfficiency}) + + For Each ctr In lstContinuousCheckboxes + ctr.SetParameterIncludeArgumentName(False) + ctr.SetRDefault(Chr(34) & Chr(34)) + Next + End Sub + + Public Sub SetRCodeForControls(clsNewSummaryFunction As RFunction, clsNewListFunction As RFunction, Optional bReset As Boolean = False) + If bControlsInitialised Then + InitialiseControls() + bControlsInitialised = False + End If + + For Each ctr In lstContinuousCheckboxes + ctr.SetRCode(clsNewListFunction, bReset) + If ctr.Enabled = False Then + ctr.Checked = False + ucrChkSelectAll.Checked = False + End If + Next + + ucrInputJmia.SetRCode(clsNewSummaryFunction, bReset) + + If bReset Then + ucrChkSelectAll.Checked = False + End If + End Sub + + Private Sub cmdHelp_Click(sender As Object, e As EventArgs) Handles cmdHelp.Click + Dim clsHelp As New RFunction + Dim strPackageName As String + + strPackageName = "hydroGOF" + clsHelp.SetPackageName("utils") + clsHelp.SetRCommand("help") + clsHelp.AddParameter("package", Chr(34) & strPackageName & Chr(34)) + clsHelp.AddParameter("help_type", Chr(34) & "html" & Chr(34)) + frmMain.clsRLink.RunScript(clsHelp.ToScript, strComment:="Opening help page for " & strPackageName & " Package. Generated from subdialog " & ParentForm.Text, iCallType:=2, bSeparateThread:=False, bUpdateGrids:=False) + End Sub + + Private Sub ucrChkSelectAll_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkSelectAll.ControlValueChanged + If ucrChkSelectAll.Checked Then + For Each ctrTemp In lstContinuousCheckboxes + ctrTemp.Checked = True + Next + ucrChkSelectAll.SetText("Unselect all") + Else + For Each ctrTemp In lstContinuousCheckboxes + ctrTemp.Checked = False + Next + ucrChkSelectAll.SetText("Select all") + End If End Sub End Class