105 lines
2.5 KiB
C#
105 lines
2.5 KiB
C#
using System;
|
||
using System.Collections.Generic;
|
||
using System.Linq;
|
||
using System.Reflection;
|
||
using System.Security.Claims;
|
||
using System.Text;
|
||
using System.Threading.Tasks;
|
||
|
||
namespace WindowsFormsApp1.server
|
||
{
|
||
public class ApiClient
|
||
{
|
||
public BllResult SN_CheckIN()
|
||
{
|
||
return BllResult.Sucess();
|
||
}
|
||
public BllResult Carrier_Check()
|
||
{
|
||
return BllResult.Sucess();
|
||
}
|
||
public BllResult SN_FeedingCheck()
|
||
{
|
||
return BllResult.Sucess();
|
||
}
|
||
public BllResult Link_Comp()
|
||
{
|
||
return BllResult.Sucess();
|
||
}
|
||
public BllResult SN_Release()
|
||
{
|
||
return BllResult.Sucess();
|
||
}
|
||
public BllResult Glue_CheckOut()
|
||
{
|
||
return BllResult.Sucess();
|
||
}
|
||
public BllResult Get_Para()
|
||
{
|
||
return BllResult.Sucess();
|
||
}
|
||
public BllResult DispatchPara()
|
||
{
|
||
return BllResult.Sucess();
|
||
}
|
||
public BllResult Data_Collection()
|
||
{
|
||
return BllResult.Sucess();
|
||
}
|
||
public BllResult Status()
|
||
{
|
||
return BllResult.Sucess();
|
||
}
|
||
public BllResult Alarm()
|
||
{
|
||
return BllResult.Sucess();
|
||
}
|
||
public BllResult OEEDataCollection()
|
||
{
|
||
return BllResult.Sucess();
|
||
}
|
||
public BllResult SN_FileUpload()
|
||
{
|
||
return BllResult.Sucess();
|
||
}
|
||
public BllResult Test()
|
||
{
|
||
return BllResult.Sucess();
|
||
}
|
||
public BllResult SN_Checkout()
|
||
{
|
||
return BllResult.Sucess();
|
||
}
|
||
public BllResult Initialization()
|
||
{
|
||
//1.获取PLC参数,扫码器参数
|
||
|
||
//2、调用接口
|
||
|
||
//3.给PLC的 writeaddress赋值
|
||
|
||
return BllResult.Sucess("Initialization");
|
||
}
|
||
|
||
public BllResult CallFunctionByName(string functionName)
|
||
{
|
||
// 获取当前类的类型
|
||
Type type = this.GetType();
|
||
|
||
// 使用反射调用指定名称的方法
|
||
MethodInfo methodInfo = type.GetMethod(functionName);
|
||
|
||
if (methodInfo != null)
|
||
{
|
||
// 调用该方法
|
||
return (BllResult)methodInfo.Invoke(this, null);
|
||
}
|
||
else
|
||
{
|
||
Console.WriteLine($"Method '{functionName}' not found.");
|
||
return BllResult.Error();
|
||
}
|
||
}
|
||
}
|
||
}
|