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.
1009 lines
36 KiB
1009 lines
36 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Runtime.Serialization;
|
|
using System.ServiceModel;
|
|
using System.Text;
|
|
using CommonLib;
|
|
using System.Data;
|
|
namespace WcfControlMonitorLib
|
|
{
|
|
// 注意: 使用“重构”菜单上的“重命名”命令,可以同时更改代码和配置文件中的接口名“IService1”。
|
|
/// <summary>
|
|
/// 调度wcf接口
|
|
/// </summary>
|
|
[ServiceContract(CallbackContract = typeof(IClient))]
|
|
|
|
public interface IControlMonitor
|
|
{
|
|
/// <summary>
|
|
/// 根据安装条码扫描器的输送机设备索引查询【在PLC读到的条码】和【已经给管理上报的条码】20140218
|
|
/// </summary>
|
|
/// <param name="bindDeviceOfBarcode">安装条码扫描器的输送机</param>
|
|
/// <param name="readedBarcode">在PLC读到的条码</param>
|
|
/// <param name="reportedBarcode">已经给管理上报的条码</param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
bool GetReadedAndReportedBarcode(int bindDeviceOfBarcode, out string readedBarcode, out string reportedBarcode, out string errorText);
|
|
|
|
/// <summary>
|
|
/// 获得指定设备类型的故障描述信息
|
|
/// </summary>
|
|
/// <param name="deviceKindIndex">设备类型</param>
|
|
/// <param name="errorText"></param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
Model.MError GetDeviceAllErrors(int deviceKindIndex, out string errorText);
|
|
/// <summary>
|
|
/// 获得所有路径信息
|
|
/// </summary>
|
|
/// <param name="errorText"></param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
List<Model.MRoute> GetAllRouteinfo(out string errorText);
|
|
/// <summary>
|
|
/// 获得指定设备参与的路径信息
|
|
/// </summary>
|
|
/// <param name="deviceIndex">设备索引</param>
|
|
/// <param name="errorText"></param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
List<Model.MRoute> GetDeviceJoinRouteinfo(int deviceIndex, out string errorText);
|
|
/// <summary>
|
|
/// 获得符合指定列作为查询项的调度任务信息
|
|
/// </summary>
|
|
/// <param name="FieldName">T_Manage_Task的表列名</param>
|
|
/// <param name="content">值</param>
|
|
/// <param name="errorText"></param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
ManageTask[] GetManageTasks(string FieldName, string content, out string errorText);
|
|
/// <summary>
|
|
/// 获得符合指定列作为查询项的设备指令队列信息
|
|
/// </summary>
|
|
/// <param name="FieldName">T_Monitor_Task的表列名</param>
|
|
/// <param name="content">值</param>
|
|
/// <param name="errorText"></param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
MonitorTask[] GetMonitorTasks(string FieldName, string content, out string errorText);
|
|
/// <summary>
|
|
/// 获得设备状态
|
|
/// </summary>
|
|
/// <param name="deviceIndex">设备索引</param>
|
|
/// <param name="errorText"></param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
DeviceStateType GetDeviceStateInfo(int deviceIndex, out string errorText);
|
|
/// <summary>
|
|
/// 设置设备状态
|
|
/// </summary>
|
|
/// <param name="devstate">设备状态类</param>
|
|
/// <param name="errorText"></param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
bool SetDeviceStateInfo(DeviceStateType devstate, out string errorText);
|
|
/// <summary>
|
|
/// 设置某一条路径的状态
|
|
/// </summary>
|
|
/// <param name="routeID">路径编号</param>
|
|
/// <param name="isEnabled">true可用;false不可用</param>
|
|
/// <param name="errorText"></param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
bool SetRouteStateInfo(int routeID, bool isEnabled, out string errorText);
|
|
/// <summary>
|
|
/// 设置设备参与的路径状态
|
|
/// </summary>
|
|
/// <param name="deviceIndex">设备索引</param>
|
|
/// <param name="isEnabled">true可用;false不可用</param>
|
|
/// <param name="errorText"></param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
bool SetDeviceJoinRouteStateInfo(int deviceIndex, bool isEnabled, out string errorText);
|
|
/// <summary>
|
|
/// 获得所有货位信息
|
|
/// </summary>
|
|
/// <param name="errorText"></param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
ST_Cell[] GetAllCellInfos(out string errorText);
|
|
/// <summary>
|
|
/// 获得多语言表中的所有语言对应的字段(列)名称
|
|
/// </summary>
|
|
/// <param name="errorText"></param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
string[] GetLanguageFields(out string errorText);
|
|
/// <summary>
|
|
/// 获得多语言表中的指定语言的所有描述信息
|
|
/// </summary>
|
|
/// <param name="language">多语言表中的语言字段(列)名称</param>
|
|
/// <param name="errorText"></param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
LanguageContent[] GetLanguageContent(string language, out string errorText);
|
|
[OperationContract]
|
|
[ServiceKnownType(typeof(Model.MDevice))]
|
|
DevicesDic GetDevicesDic(out string errorText);
|
|
|
|
/// <summary>
|
|
/// 通过设置订阅的监控模式,刷新订阅
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
bool RefreshMonitoringMode();//20150103增加断网恢复
|
|
/// <summary>
|
|
/// 客户端登陆
|
|
/// </summary>
|
|
/// <param name="userID">客户端标识:机器名+用户名</param>
|
|
/// <param name="errText"></param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
bool RegisterClient(string userID,string userDescription, out string errText);
|
|
|
|
/// <summary>
|
|
/// 客户端注销登陆
|
|
/// </summary>
|
|
/// <param name="userID">客户端标识:机器名+用户名</param>
|
|
/// <param name="errText"></param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
bool LogoutClient(string userID, out string errText);
|
|
/// <summary>
|
|
/// 获取任务
|
|
/// </summary>
|
|
/// <param name="laneway">巷道限制</param>
|
|
/// <param name="Order">更新"UPDATE",追加"APPEND",替换"REPLACE"</param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
bool ObtainTask(string laneway, string Order);
|
|
/// <summary>
|
|
/// 停止获取任务
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
bool StopObtainTask();
|
|
/// <summary>
|
|
/// 打开命令开关
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
bool OrderTurnOn();
|
|
/// <summary>
|
|
/// 关闭命令开关
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
bool OrderTurnOff();
|
|
/// <summary>
|
|
/// 设备通讯初始化
|
|
/// </summary>
|
|
/// <param name="CommunicationType">通讯类型:OPCClient,SocketsTCPIP,SimensSerialPort</param>
|
|
/// <param name="ErrText"></param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
bool DeviceCommunicationInit(string CommunicationType,out string ErrText);
|
|
/// <summary>
|
|
/// 获得用户信息
|
|
/// </summary>
|
|
/// <param name="Errtext"></param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
DataTable GetUsers(out string Errtext);
|
|
/// <summary>
|
|
/// 生成手工任务
|
|
/// </summary>
|
|
/// <param name="Handtask">手工任务结构</param>
|
|
/// <param name="Errtext"></param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
bool BuildHandTask(Model.HandTask Handtask, out string Errtext);
|
|
/// <summary>
|
|
/// 生成关联设备任务
|
|
/// </summary>
|
|
/// <param name="ConveyorIndex">输送机</param>
|
|
/// <param name="ConveyorOrder">输送机命令</param>
|
|
/// <param name="RgvIndex">穿梭车</param>
|
|
/// <param name="RgvOrder">穿梭车命令</param>
|
|
/// <param name="Errtext"></param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
bool BuildHandAssociateTask(int ConveyorIndex, int ConveyorOrder, int RgvIndex,int RgvOrder, string RgvOrderName, out string Errtext);
|
|
/// <summary>
|
|
/// 生成自动任务
|
|
/// </summary>
|
|
/// <param name="Autotask">自动任务结构</param>
|
|
/// <param name="Errtext"></param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
bool BuildAutoTask(Model.AutoTask Autotask, out string Errtext);
|
|
/// <summary>
|
|
/// 调度任务调整
|
|
/// </summary>
|
|
/// <param name="ManKind">调度任务类型</param>
|
|
/// <param name="ManagetaskID">调度任务索引</param>
|
|
/// <param name="ActionID">管理任务调整代码:900删除,999完成</param>
|
|
/// <param name="Errtext"></param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
bool ModifyManageTask(int ManKind, int ManagetaskID,int ActionID, out string Errtext);
|
|
/// <summary>
|
|
/// 设备指令调整
|
|
/// </summary>
|
|
/// <param name="MonitortaskID">设备指令索引</param>
|
|
/// <param name="ActionID">动作指令调整代码:800指令重发,900指令删除,999指令完成</param>
|
|
/// <param name="Errtext"></param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
bool ModifyMonitorTask(int DeviceIndex,int MonitortaskID, int ActionID, out string Errtext);
|
|
|
|
//[OperationContract]
|
|
//bool ModifyMonitorTask_LR(int DeviceIndex, int MonitortaskID, int ActionID, string text, out string Errtext);
|
|
|
|
/// <summary>
|
|
/// 更改任务的货叉信息
|
|
/// </summary>
|
|
/// <param name="Flag">0:设置双叉guanlianren,1设置近叉任务,2设置远叉任务</param>
|
|
/// <param name="FarForkTaskID">远叉调度任务索引</param>
|
|
/// <param name="NearForkTaskID">近叉调度任务索引</param>
|
|
/// <param name="Errtext"></param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
bool ModifyManageTaskFork(int Flag, int FarForkTaskID, int NearForkTaskID, out string Errtext);
|
|
/// <summary>
|
|
/// 设置设备状态
|
|
/// </summary>
|
|
/// <param name="Devinfo"></param>
|
|
/// <param name="Errtext"></param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
bool SetDeviceState(Model.MDevice Devinfo, out string Errtext);
|
|
|
|
/// <summary>
|
|
/// 获得设备信息
|
|
/// </summary>
|
|
/// <param name="Deviceindex"></param>
|
|
/// <param name="Errtext"></param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
Model.MDevice GetDeviceInfo(int Deviceindex, out string Errtext);
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="erroecode">“F_ErrorCode>=30”显示所有故障设备,“F_ErrorCode>=0”显示所有设备,“F_LockedState=-1”显示所有被停用设备 </param>
|
|
/// <param name="Errtext"></param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
DataTable GetDeviceInfos(string erroecode, out string Errtext);
|
|
|
|
/// <summary>
|
|
/// 设置路径状态
|
|
/// </summary>
|
|
/// <param name="Routeinfo"></param>
|
|
/// <param name="Errtext"></param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
bool SetRouteState(Model.MRoute Routeinfo, out string Errtext);
|
|
/// <summary>
|
|
/// 获得路径信息
|
|
/// </summary>
|
|
/// <param name="RouteID"></param>
|
|
/// <param name="Errtext"></param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
Model.MRoute GetRouteInfo(decimal RouteID, out string Errtext);
|
|
/// <summary>
|
|
/// 获取多个路径信息
|
|
/// </summary>
|
|
/// <param name="RouteState"></param>
|
|
/// <param name="Errtext"></param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
Model.MRoute[] GetRouteInfos(int RouteState, out string Errtext);
|
|
/// <summary>
|
|
/// 设置货叉关联等待时间
|
|
/// </summary>
|
|
/// <param name="WaitTime"></param>
|
|
/// <param name="Errtext"></param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
bool SetForkCombinWaitTime(int WaitTime, out string Errtext);
|
|
/// <summary>
|
|
/// 获取货叉关联等待时间
|
|
/// </summary>
|
|
/// <param name="Errtext"></param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
int GetForkCombinWaitTime( out string Errtext);
|
|
/// <summary>
|
|
/// 设置输送机输送超时时间
|
|
/// </summary>
|
|
/// <param name="Timeout"></param>
|
|
/// <param name="Errtext"></param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
bool SetConveyorTimeOutTime(int Timeout, out string Errtext);
|
|
|
|
/// <summary>
|
|
/// 获得输送机输送超时时间
|
|
/// </summary>
|
|
/// <param name="Errtext"></param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
int GetConveyorTimeOutTime(out string Errtext);
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="MonitorOrManageDB">Manage/Monitor</param>
|
|
/// <param name="ServerHostName">服务主机名称</param>
|
|
/// <param name="DBServiceName">数据库服务名称</param>
|
|
/// <param name="Username">用户名</param>
|
|
/// <param name="Password">密码</param>
|
|
/// <param name="Errtext">输出错误信息</param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
bool SetDBConnection(string MonitorOrManageDB, string ServerHostName, string DBServiceName, string Username, string Password, out string Errtext);
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="MonitorOrManageDB">Manage/Monitor</param>
|
|
/// <param name="ServerHostName">服务主机名称</param>
|
|
/// <param name="DBServiceName">数据库服务名称</param>
|
|
/// <param name="Username">用户名</param>
|
|
/// <param name="Password">密码</param>
|
|
/// <param name="Errtext">输出错误信息</param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
bool GetDBConnection(string MonitorOrManageDB, out string ServerHostName, out string DBServiceName, out string Username, out string Password, out string Errtext);
|
|
/// <summary>
|
|
/// 设置出入库站台属性
|
|
/// </summary>
|
|
/// <param name="deviceIndex"></param>
|
|
/// <param name="IOStationProperty">1入库站台,2出库站台,0拣选站台</param>
|
|
/// <param name="Errtext"></param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
bool SetIOStationProperty(int deviceIndex, int IOStationProperty, out string Errtext);
|
|
//[OperationContract]
|
|
//DataView GetIOStationProperty(int deviceIndex, out string Errtext);
|
|
/// <summary>
|
|
/// 设置黑匣子参数
|
|
/// </summary>
|
|
/// <param name="FileCount">文件个数</param>
|
|
/// <param name="FileSize">文件大小</param>
|
|
/// <param name="Errtext"></param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
bool SetBlackBoxParameter(int FileCount, int FileSize, out string Errtext);
|
|
/// <summary>
|
|
/// 查询黑匣子
|
|
/// </summary>
|
|
/// <param name="deviceIndex">设备索引</param>
|
|
/// <param name="BeginTime">开始时间</param>
|
|
/// <param name="EndTime">截止时间</param>
|
|
/// <param name="Errtext"></param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
string GetBlackBoxInfo(string deviceIndex, DateTime BeginTime, DateTime EndTime, out string Errtext);
|
|
/// <summary>
|
|
/// 获得自动任务历史
|
|
/// </summary>
|
|
/// <param name="BeginTime">开始时间</param>
|
|
/// <param name="EndTime">截止时间</param>
|
|
/// <param name="Errtext"></param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
DataTable GetAutoTaskHistory(DateTime BeginTime, DateTime EndTime, out string Errtext);
|
|
/// <summary>
|
|
/// 删除某一时间段的自动任务的备份
|
|
/// </summary>
|
|
/// <param name="BeginTime"></param>
|
|
/// <param name="EndTime"></param>
|
|
/// <param name="Errtext"></param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
bool DeleteAutoTaskHistory(DateTime BeginTime, DateTime EndTime, out string Errtext);
|
|
/// <summary>
|
|
/// 设置用户信息及权限
|
|
/// </summary>
|
|
/// <param name="UserID">用户编号</param>
|
|
/// <param name="UserName">用户名</param>
|
|
/// <param name="Password">密码</param>
|
|
/// <param name="Purview">权限</param>
|
|
/// <param name="Errtext"></param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
bool SetUserAndPurview(string UserID, string UserName, string Password,string Purview, out string Errtext);
|
|
/// <summary>
|
|
/// 获得用户信息及权限
|
|
/// </summary>
|
|
/// <param name="UserID">用户编号</param>
|
|
/// <param name="UserName">用户名</param>
|
|
/// <param name="Password">密码</param>
|
|
/// <param name="Purview">权限</param>
|
|
/// <param name="Errtext"></param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
bool GetUserAndPurview(string UserID,out string UserName,out string Password,out string Purview, out string Errtext);
|
|
/// <summary>
|
|
/// 设置用户密码
|
|
/// </summary>
|
|
/// <param name="UserID">用户编号</param>
|
|
/// <param name="Password">密码</param>
|
|
/// <param name="Errtext"></param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
bool SetUserPassword(string UserID, string Password, out string Errtext);
|
|
/// <summary>
|
|
/// 获得用户密码
|
|
/// </summary>
|
|
/// <param name="UserID">用户编号</param>
|
|
/// <param name="Errtext"></param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
string GetUserPassword(string UserID, out string Errtext);
|
|
/// <summary>
|
|
/// 关闭调度系统
|
|
/// </summary>
|
|
/// <param name="ErrText"></param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
bool ShutDownControlSystem(out string ErrText);
|
|
/// <summary>
|
|
/// 获得所有设备状态
|
|
/// </summary>
|
|
/// <param name="Errtext"></param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
bool StartGetALLDeviceState(out string Errtext);
|
|
/// <summary>
|
|
/// 发送等待设备命令
|
|
/// </summary>
|
|
/// <param name="Errtext"></param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
bool StartSendDeviceOrder(out string Errtext);
|
|
/// <summary>
|
|
/// 监听PLC请求
|
|
/// </summary>
|
|
/// <param name="Errtext"></param>
|
|
/// <returns></returns>
|
|
//[OperationContract]
|
|
//bool ListenPLCAsk(out string Errtext);
|
|
/// <summary>
|
|
/// 调度数据清理
|
|
/// </summary>
|
|
/// <param name="Errtext"></param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
bool DataClear(out string Errtext);
|
|
/// <summary>
|
|
/// 获得管理任务种类
|
|
/// </summary>
|
|
/// <param name="errtext"></param>
|
|
/// <param name="monitorIndex">设备指令索引</param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
int GetManageTaskKindFromMonitor(out string errtext, int monitorIndex);
|
|
/// <summary>
|
|
/// 获得管理任务索引
|
|
/// </summary>
|
|
/// <param name="errtext"></param>
|
|
/// <param name="monitorIndex">设备指令索引</param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
int GetManageTaskIndexFromMonitor(out string errtext, int monitorIndex);
|
|
/// <summary>
|
|
/// 获得设备种类索引
|
|
/// </summary>
|
|
/// <param name="errtext"></param>
|
|
/// <param name="deviceIndex">设备索引</param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
int GetDeviceKindIndex(out string errtext, int deviceIndex);
|
|
/// <summary>
|
|
/// 发送设备置位清零
|
|
/// </summary>
|
|
/// <param name="errtext"></param>
|
|
/// <param name="deviceIndex"></param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
bool SendDeviceReset(out string errtext, int deviceIndex, int ResetOrder);
|
|
/// <summary>
|
|
/// 心跳诊断
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
bool Heartbeat(out Model.MonitorInfo monitorinfo);//20130817richard
|
|
/// <summary>
|
|
/// 获得指定SQL语句返回的DataView
|
|
/// </summary>
|
|
/// <param name="errtext"></param>
|
|
/// <param name="SQL"></param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
DataTable GetDataView(out string errtext, string SQL);
|
|
/// <summary>
|
|
/// 只执行SQL,不反悔数据集的,例如insert,update,delete等
|
|
/// </summary>
|
|
/// <param name="errtext"></param>
|
|
/// <param name="SQL"></param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
int ExeSQLNoneQuery(out string errtext, string SQL);
|
|
/// <summary>
|
|
/// 获得指定SQL语句返回的DataView
|
|
/// </summary>
|
|
/// <param name="errtext"></param>
|
|
/// <param name="SQL"></param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
DataTable GetManDataView(out string errtext, string SQL);
|
|
/// <summary>
|
|
/// 只执行SQL,不反悔数据集的,例如insert,update,delete等
|
|
/// </summary>
|
|
/// <param name="errtext"></param>
|
|
/// <param name="SQL"></param>
|
|
/// <returns></returns>
|
|
[OperationContract]
|
|
int ExeManSQLNoneQuery(out string errtext, string SQL);
|
|
[OperationContract]
|
|
bool GetAllManageTask(out string errtext);
|
|
[OperationContract]
|
|
bool DisassembleTask(out string errtext);
|
|
[OperationContract]
|
|
bool SetLogicHaveGoods(out string errtext, bool ifHaveGoods, int deviceindex);
|
|
[OperationContract]
|
|
bool DealWithDeviceState(out string errtext, int deviceindex, byte[] splitbyteValue, byte[] devicestates);
|
|
[OperationContract]
|
|
Model.MDevice SendAllDeviceStates(int device);
|
|
[OperationContract]
|
|
bool WriteDBData(int deviceIndex, string DBBlock, string Wdata, out string errtext);
|
|
[OperationContract]
|
|
bool ReConnectOPCServer();//20130817richard
|
|
void ActionError(int DeviceIdx, int TaskIdx, int ErrId);
|
|
}
|
|
/// <summary>
|
|
/// 客户端回调接口
|
|
/// </summary>
|
|
public interface IClient
|
|
{
|
|
/// <summary>
|
|
/// 回调的发送消息的处理
|
|
/// </summary>
|
|
/// <param name="message"></param>
|
|
[OperationContract(IsOneWay = true)]
|
|
void SendMessage(string message);
|
|
|
|
[OperationContract(AsyncPattern = true, IsOneWay = true)]
|
|
IAsyncResult BeginSendMessage(string message, AsyncCallback callBack, object state);
|
|
void EndSendMessage(IAsyncResult ar);
|
|
|
|
[OperationContract(IsOneWay = true)]
|
|
void SendDeviceInfo(Model.MDevice devinfo);
|
|
[OperationContract(AsyncPattern = true,IsOneWay = true)]
|
|
IAsyncResult BeginSendDeviceInfo(Model.MDevice devinfo, AsyncCallback callBack, object state);
|
|
void EndSendDeviceInfo(IAsyncResult ar);
|
|
|
|
|
|
[OperationContract(IsOneWay = true)]
|
|
void SendOrderMessage(Model.MonitorInfo mi);
|
|
|
|
[OperationContract(AsyncPattern = true, IsOneWay = true)]
|
|
IAsyncResult BeginSendOrderMessage(Model.MonitorInfo mi, AsyncCallback callBack, object state);
|
|
void EndSendOrderMessage(IAsyncResult ar);
|
|
}
|
|
|
|
[DataContract]
|
|
public class StaticProperty
|
|
{
|
|
|
|
[DataMember]
|
|
public bool TurnOrder
|
|
{
|
|
get { return CStaticClass.Order; }
|
|
set { CStaticClass.Order = value; }
|
|
}
|
|
|
|
|
|
}
|
|
#region 数据契约
|
|
/// <summary>
|
|
/// 设备状态类
|
|
/// </summary>
|
|
[DataContract]
|
|
public class DeviceStateType
|
|
{
|
|
int _deviceindex;
|
|
/// <summary>
|
|
/// 设备唯一索引
|
|
/// </summary>
|
|
[DataMember(IsRequired = true)]
|
|
public int DeviceIndex
|
|
{
|
|
get { return _deviceindex; }
|
|
set { _deviceindex = value; }
|
|
}
|
|
|
|
int _deviceKind;
|
|
|
|
/// <summary>
|
|
/// 设备类型索引
|
|
/// </summary>
|
|
[DataMember(IsRequired = true)]
|
|
public int DeviceKind
|
|
{
|
|
get { return _deviceKind; }
|
|
set { _deviceKind = value; }
|
|
}
|
|
|
|
string _devname;
|
|
/// <summary>
|
|
/// 设备名称
|
|
/// </summary>
|
|
[DataMember]
|
|
public string DeviceName
|
|
{
|
|
get { return _devname; }
|
|
set { _devname = value; }
|
|
}
|
|
|
|
int _errorCode;
|
|
/// <summary>
|
|
/// 设备状态:0正常;>=30故障;998被停用
|
|
/// </summary>
|
|
[DataMember(IsRequired = true)]
|
|
public int ErrorCode
|
|
{
|
|
get { return _errorCode; }
|
|
set { _errorCode = value; }
|
|
}
|
|
|
|
int _manTaskReserve;
|
|
/// <summary>
|
|
/// 调度任务逻辑预约锁
|
|
/// </summary>
|
|
[DataMember(IsRequired = true)]
|
|
public int ManTaskReserve
|
|
{
|
|
get { return _manTaskReserve; }
|
|
set { _manTaskReserve = value; }
|
|
}
|
|
int _lockedState;
|
|
/// <summary>
|
|
/// 运行状态:-1被停用;0空闲;>0有任务号在运行
|
|
/// </summary>
|
|
[DataMember(IsRequired = true)]
|
|
public int LockedState
|
|
{
|
|
get { return _lockedState; }
|
|
set { _lockedState = value; }
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 调度任务类
|
|
/// </summary>
|
|
[DataContract]
|
|
public class ManageTask
|
|
{
|
|
[DataMember(IsRequired = true)]
|
|
public int ManageTaskKindIndex { set; get; }
|
|
[DataMember(IsRequired = true)]
|
|
public int FID { set; get; }
|
|
[DataMember]
|
|
public string PalletBarcode { set; get; }
|
|
[DataMember(IsRequired = true)]
|
|
public int ControlTaskType { set; get; }
|
|
[DataMember]
|
|
public string StartDevice { set; get; }
|
|
[DataMember]
|
|
public string StartCell { set; get; }
|
|
[DataMember]
|
|
public string EndDevice { set; get; }
|
|
[DataMember]
|
|
public string EndCell { set; get; }
|
|
[DataMember(IsRequired = true)]
|
|
public int Status { set; get; }
|
|
[DataMember]
|
|
public string Begtime { set; get; }
|
|
}
|
|
/// <summary>
|
|
/// 设备指令队列类
|
|
/// </summary>
|
|
[DataContract]
|
|
public class MonitorTask
|
|
{
|
|
[DataMember]
|
|
public string BarCode { set; get; }
|
|
[DataMember(IsRequired = true)]
|
|
public int ManageTaskIndex { set; get; }
|
|
[DataMember(IsRequired = true)]
|
|
public int MonitorIndex { set; get; }
|
|
[DataMember(IsRequired = true)]
|
|
public int DeviceIndex { set; get; }
|
|
[DataMember]
|
|
public string DeviceName { set; get; }
|
|
[DataMember(IsRequired = true)]
|
|
public int DeviceCommandIndex { set; get; }
|
|
[DataMember]
|
|
public string DeviceCommandName { set; get; }
|
|
[DataMember]
|
|
public string ErrorName { set; get; }
|
|
[DataMember(IsRequired = true)]
|
|
public int ErrorCode { set; get; }
|
|
[DataMember(IsRequired = true)]
|
|
public int NumParam1Z { set; get; }
|
|
[DataMember(IsRequired = true)]
|
|
public int NumParam2X { set; get; }
|
|
[DataMember(IsRequired = true)]
|
|
public int NumParam3Y { set; get; }
|
|
[DataMember(IsRequired = true)]
|
|
public int NumParam4Z { set; get; }
|
|
[DataMember(IsRequired = true)]
|
|
public int NumParam5X { set; get; }
|
|
[DataMember(IsRequired = true)]
|
|
public int NumParam6Y { set; get; }
|
|
[DataMember(IsRequired = true)]
|
|
public int ForkNo { set; get; }
|
|
[DataMember]
|
|
public string StartTime { set; get; }
|
|
[DataMember(IsRequired = true)]
|
|
public int Status { set; get; }
|
|
}
|
|
/// <summary>
|
|
/// 手工任务类
|
|
/// </summary>
|
|
[DataContract]
|
|
public class HandTask
|
|
{
|
|
/// <summary>
|
|
/// 设备索引
|
|
/// </summary>
|
|
private int _deviceIndex;
|
|
[DataMember(IsRequired = true)]
|
|
public int DeviceIndex
|
|
{
|
|
get { return _deviceIndex; }
|
|
set { _deviceIndex = value; }
|
|
}
|
|
/// <summary>
|
|
/// 起始设备索引
|
|
/// </summary>
|
|
private int _begindeviceIndex;
|
|
[DataMember(IsRequired = true)]
|
|
public int BegindeviceIndex
|
|
{
|
|
get { return _begindeviceIndex; }
|
|
set { _begindeviceIndex = value; }
|
|
}
|
|
/// <summary>
|
|
/// 设备指令
|
|
/// </summary>
|
|
private int _deviceOrder;
|
|
[DataMember(IsRequired = true)]
|
|
public int DeviceOrder
|
|
{
|
|
get { return _deviceOrder; }
|
|
set { _deviceOrder = value; }
|
|
}
|
|
/// <summary>
|
|
/// 位置:“立库货位”,或者输送机的目标位置
|
|
/// </summary>
|
|
private string _arrowLocation;
|
|
[DataMember]
|
|
public string ArrowLocation
|
|
{
|
|
get { return _arrowLocation; }
|
|
set { _arrowLocation = value; }
|
|
}
|
|
/// <summary>
|
|
/// 起始货位编码
|
|
/// </summary>
|
|
private string _cellcodeBegin;
|
|
[DataMember]
|
|
public string CellcodeBegin
|
|
{
|
|
get { return _cellcodeBegin; }
|
|
set { _cellcodeBegin = value; }
|
|
}
|
|
/// <summary>
|
|
/// 终止货位编码
|
|
/// </summary>
|
|
private string _cellcodeEnd;
|
|
[DataMember]
|
|
public string CellcodeEnd
|
|
{
|
|
get { return _cellcodeEnd; }
|
|
set { _cellcodeEnd = value; }
|
|
}
|
|
/// <summary>
|
|
/// 多货叉序号:0,1,2,3,4,5.。。。。距离控制柜由近及远;单叉为0
|
|
/// </summary>
|
|
private int _forkNo;
|
|
[DataMember(IsRequired = true)]
|
|
public int ForkNo
|
|
{
|
|
get { return _forkNo; }
|
|
set { _forkNo = value; }
|
|
}
|
|
/// <summary>
|
|
/// 携带的关联任务货叉组,单叉或者不携带任务为""举例:1叉携带“2,3”,【规则:只能携带_forkNo值大于自己的货叉】
|
|
/// </summary>
|
|
private string _correlTaskForks;
|
|
[DataMember]
|
|
public string CorrelTaskForks
|
|
{
|
|
get { return _correlTaskForks; }
|
|
set { _correlTaskForks = value; }
|
|
}
|
|
public HandTask(int deviceIndex, int deviceOrder, int beginDeviceIndex, string arrowLocation, string cellcodeBegin, string cellcodeEnd, int forkNo, string correlTaskForks)
|
|
{
|
|
_begindeviceIndex = beginDeviceIndex;
|
|
_deviceIndex = deviceIndex;
|
|
_deviceOrder = deviceOrder;
|
|
_arrowLocation = arrowLocation;
|
|
_cellcodeBegin = cellcodeBegin;
|
|
_cellcodeEnd = cellcodeEnd;
|
|
_forkNo = forkNo;
|
|
_correlTaskForks = correlTaskForks;
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 自动任务类
|
|
/// </summary>
|
|
[DataContract]
|
|
public class AutoTask
|
|
{
|
|
/// <summary>
|
|
/// 控制任务类型:1入库,2出库,3倒库
|
|
/// </summary>
|
|
private int _controlType;
|
|
[DataMember(IsRequired = true)]
|
|
public int ControlType
|
|
{
|
|
get { return _controlType; }
|
|
set { _controlType = value; }
|
|
}
|
|
/// <summary>
|
|
/// 托盘或者周转箱条码
|
|
/// </summary>
|
|
private string _palletBarcode;
|
|
[DataMember]
|
|
public string PalletBarcode
|
|
{
|
|
get { return _palletBarcode; }
|
|
set { _palletBarcode = value; }
|
|
}
|
|
/// <summary>
|
|
/// 起始位置
|
|
/// </summary>
|
|
private string _startDevice;
|
|
[DataMember]
|
|
public string StartDevice
|
|
{
|
|
get { return _startDevice; }
|
|
set { _startDevice = value; }
|
|
}
|
|
/// <summary>
|
|
/// 起始货位
|
|
/// </summary>
|
|
private string _startCell;
|
|
[DataMember]
|
|
public string StartCell
|
|
{
|
|
get { return _startCell; }
|
|
set { _startCell = value; }
|
|
}
|
|
/// <summary>
|
|
/// 终止位置
|
|
/// </summary>
|
|
private string _endDevice;
|
|
[DataMember]
|
|
public string EndDevice
|
|
{
|
|
get { return _endDevice; }
|
|
set { _endDevice = value; }
|
|
}
|
|
/// <summary>
|
|
/// 终止货位
|
|
/// </summary>
|
|
private string _endCell;
|
|
[DataMember]
|
|
public string EndCell
|
|
{
|
|
get { return _endCell; }
|
|
set { _endCell = value; }
|
|
}
|
|
private bool _enableEndCell;
|
|
[DataMember(IsRequired = true)]
|
|
public bool EnableEndCell
|
|
{
|
|
get { return _enableEndCell; }
|
|
set { _enableEndCell = value; }
|
|
}
|
|
private bool _enableStartCell;
|
|
[DataMember(IsRequired = true)]
|
|
public bool EnableStartCell
|
|
{
|
|
get { return _enableStartCell; }
|
|
set { _enableStartCell = value; }
|
|
}
|
|
private int _inWorkbench;
|
|
[DataMember(IsRequired = true)]
|
|
public int InWorkbench
|
|
{
|
|
get { return _inWorkbench; }
|
|
set { _inWorkbench = value; }
|
|
}
|
|
public AutoTask(int controlType, string palletBarcode, string startDevice, string startCell, string endDevice, string endCell, bool enableStartCell, bool enableEndCell, int inWorkbench)
|
|
{
|
|
_controlType = controlType;
|
|
_palletBarcode = palletBarcode;
|
|
_startDevice = startDevice;
|
|
_startCell = startCell;
|
|
_endDevice = endDevice;
|
|
_endCell = endCell;
|
|
_enableStartCell = enableStartCell;
|
|
_enableEndCell = enableEndCell;
|
|
_inWorkbench = inWorkbench;
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 货位类
|
|
/// </summary>
|
|
[DataContract]
|
|
public class ST_Cell
|
|
{
|
|
[DataMember(IsRequired = true)]
|
|
public int FID { get; set; }
|
|
[DataMember(IsRequired = true)]
|
|
public string WAREHOUSE { get; set; }
|
|
[DataMember(IsRequired = true)]
|
|
public int LaneWay { get; set; }
|
|
[DataMember(IsRequired = true)]
|
|
public string CELLCODE { get; set; }
|
|
[DataMember(IsRequired = true)]
|
|
public string CELLNAME { get; set; }
|
|
[DataMember(IsRequired = true)]
|
|
public string CELLSTATUS { get; set; }
|
|
[DataMember(IsRequired = true)]
|
|
public string RUNSTATUS { get; set; }
|
|
[DataMember(IsRequired = true)]
|
|
public int Z { get; set; }
|
|
[DataMember(IsRequired = true)]
|
|
public int X { get; set; }
|
|
[DataMember(IsRequired = true)]
|
|
public int Y { get; set; }
|
|
[DataMember(IsRequired = true)]
|
|
public string PALLETBARCODE { get; set; }
|
|
[DataMember(IsRequired = true)]
|
|
public int Stack { get; set; }
|
|
|
|
}
|
|
/// <summary>
|
|
/// 多语言表中的指定语言的内容类
|
|
/// </summary>
|
|
[DataContract]
|
|
public class LanguageContent
|
|
{
|
|
[DataMember(IsRequired = true)]
|
|
public string key { get; set; }
|
|
[DataMember(IsRequired = true)]
|
|
public string value { get; set; }
|
|
}
|
|
[DataContract]
|
|
[KnownType(typeof(Model.MDevice))]
|
|
public class DevicesDic
|
|
{
|
|
[DataMember(IsRequired = true)]
|
|
|
|
public Dictionary<int, Model.MDevice> MDevices
|
|
{
|
|
set;
|
|
get;
|
|
}
|
|
|
|
}
|
|
#endregion
|
|
}
|