Skip to content

Commit

Permalink
Merge pull request #62 from africanmathsinitiative/master
Browse files Browse the repository at this point in the history
Update main branch
  • Loading branch information
stevekogo committed Apr 21, 2016
2 parents fe67027 + 2f6fb84 commit bdbb7ab
Show file tree
Hide file tree
Showing 32 changed files with 1,145 additions and 398 deletions.
4 changes: 1 addition & 3 deletions instat/dlgBoxPlot.designer.vb

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

122 changes: 109 additions & 13 deletions instat/dlgCanonicalCorrelationAnalysis.Designer.vb

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

88 changes: 88 additions & 0 deletions instat/dlgCanonicalCorrelationAnalysis.vb
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,96 @@
' along with this program. If not, see <http://www.gnu.org/licenses/>.
Imports instat.Translations
Public Class dlgCanonicalCorrelationAnalysis
Public bFirstLoad As Boolean = True
Private Sub dlgCanonicalCorrelationAnalysis_Load(sender As Object, e As EventArgs) Handles MyBase.Load
If bFirstLoad Then
InitialiseDialog()
SetDefaults()
bFirstLoad = False
Else
ReopenDialog()
End If

autoTranslate(Me)
End Sub

Private Sub InitialiseDialog()
ucrBaseCCA.clsRsyntax.SetFunction("cancor")
ucrBaseCCA.clsRsyntax.iCallType = 0
ucrReceiverYvariables.Selector = ucrSelectorCCA
ucrReceiverXvariables.Selector = ucrSelectorCCA
ucrBaseCCA.iHelpTopicID = 188
ucrReceiverYvariables.SetDataType("numeric")
ucrReceiverXvariables.SetDataType("numeric")
ucrResultName.SetDefaultTypeAsModel()
ucrResultName.SetPrefix("CCA")
End Sub

Private Sub ReopenDialog()

End Sub

Private Sub SetDefaults()
ucrSelectorCCA.Reset()
ucrReceiverYvariables.SetMeAsReceiver()
ucrSelectorCCA.Focus()
chkSaveResult.Checked = True
ucrResultName.Visible = True
sdgCanonicalCorrelation.SetDefaults()
TestOKEnabled()
End Sub

Private Sub TestOKEnabled()
If (Not ucrReceiverYvariables.IsEmpty()) And (Not ucrReceiverXvariables.IsEmpty()) Then
ucrBaseCCA.OKEnabled(True)
AssignName()
Else
ucrBaseCCA.OKEnabled(False)
End If
End Sub

Private Sub ucrBaseCCA_ClickReset(sender As Object, e As EventArgs) Handles ucrBaseCCA.ClickReset
SetDefaults()
End Sub

Public Sub ucrreceiverxvariables_selectionchanged() Handles ucrReceiverXvariables.SelectionChanged
TestOKEnabled()
ucrBaseCCA.clsRsyntax.AddParameter("x", clsRFunctionParameter:=ucrReceiverXvariables.GetVariables())
End Sub

Public Sub ucrReceiverYvariables_SelectionChanged() Handles ucrReceiverYvariables.SelectionChanged
TestOKEnabled()
ucrBaseCCA.clsRsyntax.AddParameter("y", clsRFunctionParameter:=ucrReceiverYvariables.GetVariables())
End Sub

Private Sub cmdCCAOptions_Click(sender As Object, e As EventArgs) Handles cmdCCAOptions.Click
sdgCanonicalCorrelation.ShowDialog()
End Sub

Private Sub ucrResultName_NameChanged() Handles ucrResultName.NameChanged
AssignName()
End Sub

Private Sub chkSaveResult_CheckedChanged(sender As Object, e As EventArgs) Handles chkSaveResult.CheckedChanged
If chkSaveResult.Checked Then
ucrResultName.Visible = True
Else
ucrResultName.Visible = False
End If
AssignName()
End Sub

Private Sub AssignName()
If chkSaveResult.Checked AndAlso ucrResultName.GetText() <> "" Then
ucrBaseCCA.clsRsyntax.SetAssignTo(ucrResultName.GetText(), strTempModel:=ucrResultName.GetText())
ucrBaseCCA.clsRsyntax.bExcludeAssignedFunctionOutput = False
Else
ucrBaseCCA.clsRsyntax.SetAssignTo("last_CCA", strTempModel:="last_CCA")
ucrBaseCCA.clsRsyntax.bExcludeAssignedFunctionOutput = False
End If
End Sub

Private Sub ucrBaseCCA_clickok(sender As Object, e As EventArgs) Handles ucrBaseCCA.ClickOk
sdgCanonicalCorrelation.CCAOptions()
End Sub
End Class
Loading

0 comments on commit bdbb7ab

Please sign in to comment.