103 lines
3.9 KiB
C#
103 lines
3.9 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;
|
|
using System.Xml.Linq;
|
|
using WindowsFormsApp1.mod;
|
|
using WindowsFormsApp1.mod.server;
|
|
|
|
namespace WindowsFormsApp1.server
|
|
{
|
|
public class ApiClient
|
|
{
|
|
public ApiFormResult SN_CheckIN(plcdata PlcData, otherdata OtherData)
|
|
{
|
|
return ApiFormResult.Sucess(mesresult.pass,false,"", PlcData);
|
|
}
|
|
public ApiFormResult Carrier_Check(plcdata PlcData, otherdata OtherData)
|
|
{
|
|
return ApiFormResult.Sucess(mesresult.pass,false,"", PlcData);
|
|
}
|
|
public ApiFormResult SN_FeedingCheck(plcdata PlcData, otherdata OtherData)
|
|
{
|
|
return ApiFormResult.Sucess(mesresult.pass,false,"", PlcData);
|
|
}
|
|
public ApiFormResult Link_Comp(plcdata PlcData, otherdata OtherData)
|
|
{
|
|
return ApiFormResult.Sucess(mesresult.pass,false,"", PlcData);
|
|
}
|
|
public ApiFormResult SN_Release(plcdata PlcData, otherdata OtherData)
|
|
{
|
|
return ApiFormResult.Sucess(mesresult.pass,false,"", PlcData);
|
|
}
|
|
public ApiFormResult Glue_CheckOut(plcdata PlcData, otherdata OtherData)
|
|
{
|
|
return ApiFormResult.Sucess(mesresult.pass,false,"", PlcData);
|
|
}
|
|
public ApiFormResult Get_Para(plcdata PlcData, otherdata OtherData)
|
|
{
|
|
return ApiFormResult.Sucess(mesresult.pass,false,"", PlcData);
|
|
}
|
|
public ApiFormResult DispatchPara(plcdata PlcData, otherdata OtherData)
|
|
{
|
|
return ApiFormResult.Sucess(mesresult.pass,false,"", PlcData);
|
|
}
|
|
public ApiFormResult Data_Collection(plcdata PlcData, otherdata OtherData)
|
|
{
|
|
return ApiFormResult.Sucess(mesresult.pass,false,"", PlcData);
|
|
}
|
|
public ApiFormResult Status(plcdata PlcData, otherdata OtherData)
|
|
{
|
|
return ApiFormResult.Sucess(mesresult.pass,false,"", PlcData);
|
|
}
|
|
public ApiFormResult Alarm(plcdata PlcData, otherdata OtherData)
|
|
{
|
|
return ApiFormResult.Sucess(mesresult.pass,false,"", PlcData);
|
|
}
|
|
public ApiFormResult OEEDataCollection(plcdata PlcData, otherdata OtherData)
|
|
{
|
|
return ApiFormResult.Sucess(mesresult.pass, false, "", PlcData);
|
|
}
|
|
public ApiFormResult SN_FileUpload(plcdata PlcData, otherdata OtherData)
|
|
{
|
|
return ApiFormResult.Sucess(mesresult.pass, false, "", PlcData);
|
|
}
|
|
public ApiFormResult Test(plcdata PlcData, otherdata OtherData)
|
|
{
|
|
return ApiFormResult.Sucess(mesresult.pass, false, "", PlcData);
|
|
}
|
|
public ApiFormResult SN_Checkout(plcdata PlcData, otherdata OtherData)
|
|
{
|
|
return ApiFormResult.Sucess(mesresult.pass, false, "", PlcData);
|
|
}
|
|
public ApiFormResult Initialization(plcdata PlcData, otherdata OtherData)
|
|
{
|
|
PlcData.Write_Status = 3;
|
|
return ApiFormResult.Sucess(mesresult.pass,false,"", PlcData);
|
|
}
|
|
|
|
public ApiFormResult CallFunctionByName(string functionName, plcdata plcdata,otherdata otherdata)
|
|
{
|
|
// 获取当前类的类型
|
|
Type type = this.GetType();
|
|
|
|
// 使用反射调用指定名称的方法
|
|
MethodInfo methodInfo = type.GetMethod(functionName);
|
|
|
|
if (methodInfo != null)
|
|
{
|
|
// 调用该方法
|
|
return (ApiFormResult)methodInfo.Invoke(this, new object[] { plcdata, otherdata });
|
|
}
|
|
else
|
|
{
|
|
LogExecute.logNet.WriteError($"未找到对应的函数{functionName}");
|
|
return ApiFormResult.Error(mesresult.none, false, $"未找到对应的函数{functionName}", null);
|
|
}
|
|
}
|
|
}
|
|
}
|