I have read some plugin source code and also write several simple plugins, but still can not fully understand plugin. So raise my questions here:
1)RR may load many plugin when it starts, so there are many methods with same name. For example, if has 3 plugins, it will have 3 ProcessCommand method. How does RR handle this(multi-methods with same name)? It will execute each method one by one?
2)
Public Function ProcessCommand(ByVal CMD As String, ByVal frm As Object) As Integer
It seems that CMD should be defined as ByRef, since it may be modified in the method.
3)
Public Function ReturnLabel(ByVal LBL As String, ByVal FMT As String) As String
When will the method be called? for example, I write my code in ReturnLabel which will return the label text based on the label code. But It seems that the method was never called. I have to set the label taxt via COM interface:
RRExtension.SDK.Execute("SETLABEL;PDC_DISTANCE;" & bean.getMinDist())
4)
Public Function ReturnSlider(ByVal SLD As String) As Long
So I set the value in this method. But the sliders(pdc_sensor_a,b,c,d) were not changed. I can not find the set command via COM interface too.
Code:
Public Function ReturnSlider(ByVal SLD As String) As Long
'This tells RR that the Slider was not processed in this plugin
ReturnSlider = -1
Select Case LCase(SLD)
Case "pdc_sensor_a"
ReturnSlider = Int(327.68 * statusHolder.getPdcStatusBean.getDistRL1())
If ReturnSlider > 65536 Then ReturnSlider = 65536
Case "pdc_sensor_b"
ReturnSlider = Int(327.68 * statusHolder.getPdcStatusBean.getDistRL2())
If ReturnSlider > 65536 Then ReturnSlider = 65536
Case "pdc_sensor_c"
ReturnSlider = Int(327.68 * statusHolder.getPdcStatusBean.getDistRL3())
If ReturnSlider > 65536 Then ReturnSlider = 65536
Case "pdc_sensor_d"
ReturnSlider = Int(327.68 * statusHolder.getPdcStatusBean.getDistRL4())
If ReturnSlider > 65536 Then ReturnSlider = 65536
End Select
End Function
Bookmarks