1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
|
using System;
using System.Text;
using System.IO;
using System.Linq;
using System.Drawing;
using System.Diagnostics;
using System.Windows.Forms;
using System.Threading;
using System.Threading.Tasks;
using System.Collections.Generic;
using Tango.PMR.Stubs;
using Tango.Stubs;
bool i = true;
//--------------------------------------------------------------------------------
public void OnExecute(StubManager stubManager)
{
Form form1 = new Form();
// Set the caption bar text of the form.
form1.TopMost = true;
form1.Text = "RTFU Test";
form1.FormBorderStyle = FormBorderStyle.FixedDialog;
form1.MaximizeBox = false;
form1.MinimizeBox = false;
form1.StartPosition = FormStartPosition.CenterScreen;
form1.AutoSize = true;
form1.AutoSizeMode = AutoSizeMode.GrowAndShrink;
// Create buttons to Run.
Button button1 = new Button ()
{
Width = 100,
Height = 100,
};
button1.Text = "Run";
button1.Location = new Point (40, 100);
form1.Controls.Add(button1);
//-----RTFU Serial Number -----------
Label Label1 = new Label ()
{
Width = 150,
Height = 20,
Text =" RTFU S/N"
};
Label1.Location = new Point (30, 10);
form1.Controls.Add(Label1);
TextBox TextBox1 = new TextBox ()
{
Width = 100,
Height = 10,
Text =""
};
TextBox1.Location = new Point (40, 40);
form1.Controls.Add(TextBox1);
//----------LOCATION----------
Label Label3 = new Label ()
{
Width = 150,
Height = 20,
Text ="LOCATION"
};
Label3.Location = new Point (350, 10);
form1.Controls.Add(Label3);
TextBox TextBox3 = new TextBox ()
{
Width = 100,
Height = 10,
Text =""
};
TextBox3.Location = new Point (360, 40);
form1.Controls.Add(TextBox3);
Label Label5 = new Label ()
{
Width = 120,
Height =100,
Text = ""
};
Label5.Location = new Point (300, 100);
Label5.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
Label5.Text="";
Label5.Font = new Font("Arial", 24,FontStyle.Bold);
form1.Controls.Add(Label5);
//--------------------------------------------------------------------------------
button1.Click += (_,__) =>
{
Label5.Text="Pros"; ///???? not working
//------------------------------- start test -----------
Thread.Sleep(5000); //delay 10 second
if (i==true)
Label5.Text="Fail";
else
Label5.Text="Pass";
i= !i;
TextBox1.Text="";
};
form1.ShowDialog();
return ;
}
|