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
{
///
/// 注册双通道
///
///
[OperationContract(IsInitiating = true, IsTerminating = false)]
int Register(string machineNo);
///
/// 注销双通道
///
///
[OperationContract(IsInitiating = false, IsTerminating = true)]
int Logout(string machineNo);
///
///向设备发送可以进行操作的指令
///
[OperationContract]
void SendOperateOrder(string configStr);
///
/// 客户端向服务器更新连接信息
///
///
[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;
}
///
/// 双工通信传输数据对象
///
[DataContract]
public class ReturnMessage
{
[DataMember]
public string MessageType { get; set; }
[DataMember]
public string MessageContent { get; set; }
}
///
/// 加工设备指令对象
///
[DataContract]
public class ProcessOrder
{
[DataMember]
public string MouldNumber { get; set; }
[DataMember]
public string MachineCode { get; set; }
[DataMember]
public string ProcessType { get; set; }
}
}