Change scene by clicking buttons whose background is the workpiece image

Overview

Change scene by clicking buttons whose background is the workpiece image to measure the selected workpiece.

Specification of this example


Behavior
Set buttons whose background are the workpiece image on the PanDA form.
When click the button, Change scene to measure the selected workpiece.

Screenshot


How to try this example
1.Click the link below, then the folder containing zip file automatically opens.
refFile

2.Right-click and hold on the zip file, and drop it on working window of FJ system, then the demo-tool automatically starts.

3.Click "Start PanDA Form" button in the program, then the PanDA form will start.

4.When click a button whose background is the workpiece image, Change scene to measure the selected workpiece.

How to implement

Scene data
 When click the left button.
Unit No.
Processing Item
0.
Camera Image Input
1.
Search
2.
End
3.
Macro
 When click the center button.
Unit No.
Processing Item
0.
Camera Image Input
1.
ECM Search
2.
End
3.
Macro
 When click the right button.
Unit No.
Processing Item
0.
Camera Image Input
1.
Scan Edge Position
2.
End
3.
Macro
Process of UI unit
Public Class Form1

    Private Sub btnScene1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnScene1.Click
        Call change_Scene(1)
    End Sub

    Private Sub btnScene2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnScene2.Click
        Call change_Scene(2)
    End Sub

    Private Sub btnScene3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnScene3.Click
        Call change_Scene(3)
    End Sub

    Private Sub change_Scene(ByVal index As Integer)
        '(1)
        Dim currentScene As Integer = FZ_PanDAForm.FZ_PanDAForm.GetSceneNo
        Dim filePath As String = FZ_PanDAForm.FZ_PanDAForm.GetFzPath(FzPathKind.Root) + "Ramdisk\macro\Macro_VB_ChangeScenebyTappingButton_Child" + Format$(index, "0") + ".scn"

        '(2)
        FZ_PanDAForm.FZ_PanDAForm.MeasureStop()
        FZ_PanDAForm.FZ_PanDAForm.LoadScene(currentScene, filePath)
        FZ_PanDAForm.FZ_PanDAForm.MeasureStart()

    End Sub

End Class

Explanation
(1)Get current scene No. and file path of scene file for which scene change.
(2)Change scene.

Source codes

Total source codes can be get from refhere.