You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
88 lines
2.2 KiB
88 lines
2.2 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.ServiceModel;
|
|
using System.Runtime.Serialization;
|
|
|
|
namespace OpcProcessWinService
|
|
{
|
|
[ServiceContract(SessionMode = SessionMode.Required, CallbackContract = typeof(IControlCallback))]
|
|
public interface IOpcService
|
|
{
|
|
/// <summary>
|
|
/// 注册双通道
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[OperationContract(IsInitiating = true, IsTerminating = false)]
|
|
int Register(string machineNo);
|
|
|
|
|
|
/// <summary>
|
|
/// 注销双通道
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[OperationContract(IsInitiating = false, IsTerminating = true)]
|
|
int Logout(string machineNo);
|
|
|
|
/// <summary>
|
|
///向设备发送可以进行操作的指令
|
|
/// </summary>
|
|
[OperationContract]
|
|
void SendOperateOrder(string configStr);
|
|
|
|
/// <summary>
|
|
/// 客户端向服务器更新连接信息
|
|
/// </summary>
|
|
/// <param name="machineNo"></param>
|
|
[OperationContract(IsInitiating = false, IsTerminating = true)]
|
|
int UpdateClientInfo(string machineNo);
|
|
}
|
|
|
|
public interface IControlCallback
|
|
{
|
|
|
|
[OperationContract(IsOneWay = true)]
|
|
//void ReturnResult(ReturnMessage message);
|
|
void ReturnResult(string messageType,string message);
|
|
}
|
|
|
|
|
|
public class ChatEventArgs : EventArgs
|
|
{
|
|
public string MessageType;
|
|
public string MessageContent;
|
|
public string MachineCode;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 双工通信传输数据对象
|
|
/// </summary>
|
|
[DataContract]
|
|
public class ReturnMessage
|
|
{
|
|
[DataMember]
|
|
public string MessageType { get; set; }
|
|
|
|
[DataMember]
|
|
public string MessageContent { get; set; }
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 加工设备指令对象
|
|
/// </summary>
|
|
[DataContract]
|
|
public class ProcessOrder
|
|
{
|
|
[DataMember]
|
|
public string MouldNumber { get; set; }
|
|
|
|
[DataMember]
|
|
public string MachineCode { get; set; }
|
|
|
|
[DataMember]
|
|
public string ProcessType { get; set; }
|
|
}
|
|
}
|
|
|