@@ -32,8 +32,6 @@ Public Class DlgDefineClimaticData
32
32
Private bIsUnique As Boolean = True
33
33
34
34
Private Sub DlgDefineClimaticData_Load(sender As Object , e As EventArgs) Handles MyBase .Load
35
- Dim stopwatch As New Stopwatch()
36
- stopwatch.Start()
37
35
autoTranslate( Me )
38
36
If bFirstLoad Then
39
37
InitialiseDialog()
@@ -45,9 +43,6 @@ Public Class DlgDefineClimaticData
45
43
SetRCodeForControls(bReset)
46
44
bReset = False
47
45
TestOKEnabled()
48
- stopwatch.Stop()
49
- Dim Logger As NLog.Logger = NLog.LogManager.GetCurrentClassLogger()
50
- Logger.Info( "DlgDefineClimaticData " & stopwatch.Elapsed.TotalSeconds & " seconds" )
51
46
End Sub
52
47
53
48
Private Sub InitialiseDialog()
@@ -132,8 +127,6 @@ Public Class DlgDefineClimaticData
132
127
clsDummyFunction = New RFunction
133
128
clsNewDefautFunction = New RFunction
134
129
135
- 'ucrSelectorDefineClimaticData.Reset()
136
- 'ucrSelectorLinkedDataFrame.Reset()
137
130
ucrInputCheckInput.Reset()
138
131
ucrReceiverDate.SetMeAsReceiver()
139
132
@@ -235,17 +228,17 @@ Public Class DlgDefineClimaticData
235
228
Dim bFound As Boolean = False
236
229
237
230
ucrCurrentReceiver = ucrSelectorDefineClimaticData.CurrentReceiver
238
-
231
+ Dim strData As String = ucrSelectorDefineClimaticData.ucrAvailableDataFrames.cboAvailableDataFrames.Text
239
232
For Each ucrTempReceiver As ucrReceiver In lstReceivers
240
233
ucrTempReceiver.SetMeAsReceiver()
241
234
lstRecognisedValues = GetRecognisedValues(ucrTempReceiver.Tag)
242
235
243
236
If lstRecognisedValues.Count > 0 Then
244
237
For Each lviTempVariable As ListViewItem In ucrSelectorDefineClimaticData.lstAvailableVariable.Items
245
- Dim strClimaticType As String = GetClimaticTypeFromRCommand(lviTempVariable.Text)
238
+ Dim strClimaticType As String = GetClimaticTypeFromRCommand(lviTempVariable.Text, strData )
246
239
For Each strValue As String In lstRecognisedValues
247
240
If Regex.Replace(lviTempVariable.Text.ToLower(), "[^\w]|_" , String .Empty).Contains(strValue) OrElse (strClimaticType IsNot Nothing AndAlso strClimaticType.Contains(strValue)) Then
248
- ucrTempReceiver.Add(lviTempVariable.Text, ucrSelectorDefineClimaticData.ucrAvailableDataFrames.cboAvailableDataFrames.Text )
241
+ ucrTempReceiver.Add(lviTempVariable.Text, strData )
249
242
bFound = True
250
243
Exit For
251
244
End If
@@ -268,43 +261,46 @@ Public Class DlgDefineClimaticData
268
261
Dim ucrCurrentReceiver As ucrReceiver
269
262
Dim bFound As Boolean = False
270
263
271
- ucrCurrentReceiver = ucrSelectorLinkedDataFrame.CurrentReceiver
272
-
273
- For Each ucrTempReceiver As ucrReceiver In lstNewReceivers
274
- ucrTempReceiver.SetMeAsReceiver()
275
- lstRecognisedValues = GetNewRecognisedValues(ucrTempReceiver.Tag)
276
-
277
- If lstRecognisedValues.Count > 0 Then
278
- For Each lviTempVariable As ListViewItem In ucrSelectorLinkedDataFrame.lstAvailableVariable.Items
279
- Dim strClimaticType As String = GetClimaticTypeFromRCommand(lviTempVariable.Text)
280
- For Each strValue As String In lstRecognisedValues
281
- If Regex.Replace(lviTempVariable.Text.ToLower(), "[^\w]|_" , String .Empty).Contains(strValue) OrElse (strClimaticType IsNot Nothing AndAlso strClimaticType.Contains(strValue)) Then
282
- ucrTempReceiver.Add(lviTempVariable.Text, ucrSelectorLinkedDataFrame.ucrAvailableDataFrames.cboAvailableDataFrames.Text)
283
- bFound = True
264
+ If ucrChkLinkedMetaData.Checked Then
265
+ ucrCurrentReceiver = ucrSelectorLinkedDataFrame.CurrentReceiver
266
+ Dim strData As String = ucrSelectorLinkedDataFrame.ucrAvailableDataFrames.cboAvailableDataFrames.Text
267
+
268
+ For Each ucrTempReceiver As ucrReceiver In lstNewReceivers
269
+ ucrTempReceiver.SetMeAsReceiver()
270
+ lstRecognisedValues = GetNewRecognisedValues(ucrTempReceiver.Tag)
271
+
272
+ If lstRecognisedValues.Count > 0 Then
273
+ For Each lviTempVariable As ListViewItem In ucrSelectorLinkedDataFrame.lstAvailableVariable.Items
274
+ Dim strClimaticType As String = GetClimaticTypeFromRCommand(lviTempVariable.Text, strData)
275
+ For Each strValue As String In lstRecognisedValues
276
+ If Regex.Replace(lviTempVariable.Text.ToLower(), "[^\w]|_" , String .Empty).Contains(strValue) OrElse (strClimaticType IsNot Nothing AndAlso strClimaticType.Contains(strValue)) Then
277
+ ucrTempReceiver.Add(lviTempVariable.Text, strData)
278
+ bFound = True
279
+ Exit For
280
+ End If
281
+ Next
282
+ If bFound Then
283
+ bFound = False
284
284
Exit For
285
285
End If
286
286
Next
287
- If bFound Then
288
- bFound = False
289
- Exit For
290
- End If
291
- Next
292
- End If
293
- Next
287
+ End If
288
+ Next
294
289
295
- If ucrCurrentReceiver IsNot Nothing Then
296
- ucrCurrentReceiver.SetMeAsReceiver()
290
+ If ucrCurrentReceiver IsNot Nothing Then
291
+ ucrCurrentReceiver.SetMeAsReceiver()
292
+ End If
297
293
End If
298
294
End Sub
299
295
300
- Private Function GetClimaticTypeFromRCommand(strName As String ) As String
296
+ Private Function GetClimaticTypeFromRCommand(strName As String , strDataName As String ) As String
301
297
Try
302
298
Dim clsGetClimaticTypeFunction As New RFunction
303
299
304
300
clsGetClimaticTypeFunction.SetRCommand(frmMain.clsRLink.strInstatDataObject & "$get_column_climatic_type" )
305
301
clsGetClimaticTypeFunction.AddParameter( "attr_name" , Chr( 34 ) & "Climatic_Type" & Chr( 34 ))
306
302
clsGetClimaticTypeFunction.AddParameter( "col_name" , Chr( 34 ) & strName & Chr( 34 ))
307
- clsGetClimaticTypeFunction.AddParameter( "data_name" , Chr( 34 ) & ucrSelectorLinkedDataFrame.strCurrentDataFrame & Chr( 34 ))
303
+ clsGetClimaticTypeFunction.AddParameter( "data_name" , Chr( 34 ) & strDataName & Chr( 34 ))
308
304
309
305
Dim result As SymbolicExpression
310
306
result = frmMain.clsRLink.RunInternalScriptGetValue(clsGetClimaticTypeFunction.ToScript())
@@ -409,7 +405,7 @@ Public Class DlgDefineClimaticData
409
405
AutoFillReceivers()
410
406
End Sub
411
407
412
- Private Sub ucrSelectorLinkedDataFrame_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSelectorLinkedDataFrame.ControlValueChanged
408
+ Private Sub ucrSelectorLinkedDataFrame_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrSelectorLinkedDataFrame.ControlValueChanged, ucrChkLinkedMetaData.ControlValueChanged
413
409
clsGetColFunction.AddParameter( "data_name" , Chr( 34 ) & ucrSelectorLinkedDataFrame.strCurrentDataFrame & Chr( 34 ), iPosition:= 1 )
414
410
NewAutoFillReceivers()
415
411
End Sub
0 commit comments