|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- using BPASmartClient.AGV.Feedback;
- using BPASmartClient.Helper;
- using BPASmartClient.Http;
- using BPASmartClient.HubHelper;
- using Newtonsoft.Json;
- using BPASmartClient.S7Net;
-
- namespace TestDemo
- {
- public partial class Form1 : Form
- {
-
- int count = 0;
- public Form1()
- {
- InitializeComponent();
-
- SiemensHelper siemensHelper = new SiemensHelper();
- siemensHelper.Connect(S7.Net.CpuType.S71200, "192.168.101.11");
- var res = siemensHelper.ReadClass<ReadClass>(1);
-
- siemensHelper.WriteClass(new ReadClass() { temp1 = "", temp2 = "" }, 1);
-
- ActionManage.GetInstance.Register(new Action(() =>
- {
- label1.Text = (count++).ToString();
- }), "ֵ");
-
- ActionManage.GetInstance.Register(new Action(() =>
- {
- Console.WriteLine("ʼִ");
- Thread.Sleep(20000);
- Console.WriteLine("ִ");
- }), "");
- }
-
- private void button1_Click(object sender, EventArgs e)
- {
- AGVToUpSystem aGVToUpSystem = new AGVToUpSystem();
- //string value = JsonConvert.SerializeObject(aGVToUpSystem);
- //string url = $"http://192.168.1.40:8089/apicallback/quicktron/robotjob/report?sign={value}";
- string url = "http://192.168.1.40:8089/apicallback/quicktron/robotjob/report";
- var res = APIHelper.GetInstance.HttpRequest(url, "", aGVToUpSystem, RequestType.POST);
- }
-
- private void button2_Click(object sender, EventArgs e)
- {
- Upstreamrequest aGVToUpSystem = new Upstreamrequest() { agvCode = "123" };
- // string value = JsonConvert.SerializeObject(aGVToUpSystem);
- // string url = $"http://192.168.1.40:8089/apicallback/quicktron/robotjob/upstreamrequest?sign={value}";
- string url = $"http://192.168.1.40:8089/apicallback/quicktron/robotjob/upstreamrequest";
- var res = APIHelper.GetInstance.HttpRequest(url, "", aGVToUpSystem, RequestType.POST);
-
- }
-
- private void button3_Click(object sender, EventArgs e)
- {
- ActionManage.GetInstance.Send("ֵ");
- }
-
- private void button4_Click(object sender, EventArgs e)
- {
- Task.Run(new Action(() =>
- {
- ActionManage.GetInstance.Send("");
- }));
-
- }
- }
- }
|