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”。 /// /// 调度wcf接口 /// [ServiceContract] public interface IBasicControlMonitor { /// /// 根据安装条码扫描器的输送机设备索引查询【在PLC读到的条码】和【已经给管理上报的条码】20140218 /// /// 安装条码扫描器的输送机 /// 在PLC读到的条码 /// 已经给管理上报的条码 /// [OperationContract] bool GetReadedAndReportedBarcode(int bindDeviceOfBarcode, out string readedBarcode, out string reportedBarcode, out string errorText); /// /// 获得指定设备类型的故障描述信息 /// /// 设备类型 /// /// [OperationContract] Model.MError GetDeviceAllErrors(int deviceKindIndex, out string errorText); /// /// 获得所有路径信息 /// /// /// [OperationContract] List GetAllRouteinfo(out string errorText); /// /// 获得指定设备参与的路径信息 /// /// 设备索引 /// /// [OperationContract] List GetDeviceJoinRouteinfo(int deviceIndex, out string errorText); /// /// 获得符合指定列作为查询项的调度任务信息 /// /// T_Manage_Task的表列名 /// 值 /// /// [OperationContract] ManageTask[] GetManageTasks(string FieldName, string content, out string errorText); /// /// 获得符合指定列作为查询项的设备指令队列信息 /// /// T_Monitor_Task的表列名 /// 值 /// /// [OperationContract] MonitorTask[] GetMonitorTasks(string FieldName, string content, out string errorText); /// /// 获得设备状态 /// /// 设备索引 /// /// [OperationContract] DeviceStateType GetDeviceStateInfo(int deviceIndex, out string errorText); /// /// 设置设备状态 /// /// 设备状态类 /// /// [OperationContract] bool SetDeviceStateInfo(DeviceStateType devstate, out string errorText); /// /// 设置某一条路径的状态 /// /// 路径编号 /// true可用;false不可用 /// /// [OperationContract] bool SetRouteStateInfo(int routeID, bool isEnabled, out string errorText); /// /// 设置设备参与的路径状态 /// /// 设备索引 /// true可用;false不可用 /// /// [OperationContract] bool SetDeviceJoinRouteStateInfo(int deviceIndex, bool isEnabled, out string errorText); /// /// 获得所有货位信息 /// /// /// [OperationContract] ST_Cell[] GetAllCellInfos(out string errorText); /// /// 获得多语言表中的所有语言对应的字段(列)名称 /// /// /// [OperationContract] string[] GetLanguageFields(out string errorText); /// /// 获得多语言表中的指定语言的所有描述信息 /// /// 多语言表中的语言字段(列)名称 /// /// [OperationContract] LanguageContent[] GetLanguageContent(string language, out string errorText); [OperationContract] [ServiceKnownType(typeof(Model.MDevice))] DevicesDic GetDevicesDic(out string errorText); /// /// 通过设置订阅的监控模式,刷新订阅 /// /// [OperationContract] bool RefreshMonitoringMode();//20150103增加断网恢复 /// /// 客户端登陆 /// /// 客户端标识:机器名+用户名 /// /// [OperationContract] bool RegisterClient(string userID, string userDescription, out string errText); /// /// 客户端注销登陆 /// /// 客户端标识:机器名+用户名 /// /// [OperationContract] bool LogoutClient(string userID, out string errText); /// /// 获取任务 /// /// 巷道限制 /// 更新"UPDATE",追加"APPEND",替换"REPLACE" /// [OperationContract] bool ObtainTask(string laneway, string Order); /// /// 停止获取任务 /// /// [OperationContract] bool StopObtainTask(); /// /// 打开命令开关 /// /// [OperationContract] bool OrderTurnOn(); /// /// 关闭命令开关 /// /// [OperationContract] bool OrderTurnOff(); /// /// 设备通讯初始化 /// /// 通讯类型:OPCClient,SocketsTCPIP,SimensSerialPort /// /// [OperationContract] bool DeviceCommunicationInit(string CommunicationType, out string ErrText); /// /// 获得用户信息 /// /// /// [OperationContract] DataTable GetUsers(out string Errtext); /// /// 生成手工任务 /// /// 手工任务结构 /// /// [OperationContract] bool BuildHandTask(Model.HandTask Handtask, out string Errtext); /// /// 生成关联设备任务 /// /// 输送机 /// 输送机命令 /// 穿梭车 /// 穿梭车命令 /// /// [OperationContract] bool BuildHandAssociateTask(int ConveyorIndex, int ConveyorOrder, int RgvIndex, int RgvOrder, string RgvOrderName, out string Errtext); /// /// 生成自动任务 /// /// 自动任务结构 /// /// [OperationContract] bool BuildAutoTask(Model.AutoTask Autotask, out string Errtext); /// /// 调度任务调整 /// /// 调度任务类型 /// 调度任务索引 /// 管理任务调整代码:900删除,999完成 /// /// [OperationContract] bool ModifyManageTask(int ManKind, int ManagetaskID, int ActionID, out string Errtext); /// /// 设备指令调整 /// /// 设备指令索引 /// 动作指令调整代码:800指令重发,900指令删除,999指令完成 /// /// [OperationContract] bool ModifyMonitorTask(int DeviceIndex, int MonitortaskID, int ActionID, out string Errtext); /// /// 设置设备状态 /// /// /// /// [OperationContract] bool SetDeviceState(Model.MDevice Devinfo, out string Errtext); /// /// 获得设备信息 /// /// /// /// [OperationContract] Model.MDevice GetDeviceInfo(int Deviceindex, out string Errtext); /// /// /// /// “F_ErrorCode>=30”显示所有故障设备,“F_ErrorCode>=0”显示所有设备,“F_LockedState=-1”显示所有被停用设备 /// /// [OperationContract] DataTable GetDeviceInfos(string erroecode, out string Errtext); /// /// 设置路径状态 /// /// /// /// [OperationContract] bool SetRouteState(Model.MRoute Routeinfo, out string Errtext); /// /// 获得路径信息 /// /// /// /// [OperationContract] Model.MRoute GetRouteInfo(decimal RouteID, out string Errtext); /// /// 获取多个路径信息 /// /// /// /// [OperationContract] Model.MRoute[] GetRouteInfos(int RouteState, out string Errtext); /// /// 设置货叉关联等待时间 /// /// /// /// [OperationContract] bool SetForkCombinWaitTime(int WaitTime, out string Errtext); /// /// 获取货叉关联等待时间 /// /// /// [OperationContract] int GetForkCombinWaitTime(out string Errtext); /// /// 设置输送机输送超时时间 /// /// /// /// [OperationContract] bool SetConveyorTimeOutTime(int Timeout, out string Errtext); /// /// 获得输送机输送超时时间 /// /// /// [OperationContract] int GetConveyorTimeOutTime(out string Errtext); /// /// /// /// Manage/Monitor /// 服务主机名称 /// 数据库服务名称 /// 用户名 /// 密码 /// 输出错误信息 /// [OperationContract] bool SetDBConnection(string MonitorOrManageDB, string ServerHostName, string DBServiceName, string Username, string Password, out string Errtext); /// /// /// /// Manage/Monitor /// 服务主机名称 /// 数据库服务名称 /// 用户名 /// 密码 /// 输出错误信息 /// [OperationContract] bool GetDBConnection(string MonitorOrManageDB, out string ServerHostName, out string DBServiceName, out string Username, out string Password, out string Errtext); /// /// 设置出入库站台属性 /// /// /// 1入库站台,2出库站台,0拣选站台 /// /// [OperationContract] bool SetIOStationProperty(int deviceIndex, int IOStationProperty, out string Errtext); //[OperationContract] //DataView GetIOStationProperty(int deviceIndex, out string Errtext); /// /// 设置黑匣子参数 /// /// 文件个数 /// 文件大小 /// /// [OperationContract] bool SetBlackBoxParameter(int FileCount, int FileSize, out string Errtext); /// /// 查询黑匣子 /// /// 设备索引 /// 开始时间 /// 截止时间 /// /// [OperationContract] string GetBlackBoxInfo(string deviceIndex, DateTime BeginTime, DateTime EndTime, out string Errtext); /// /// 获得自动任务历史 /// /// 开始时间 /// 截止时间 /// /// [OperationContract] DataTable GetAutoTaskHistory(DateTime BeginTime, DateTime EndTime, out string Errtext); /// /// 删除某一时间段的自动任务的备份 /// /// /// /// /// [OperationContract] bool DeleteAutoTaskHistory(DateTime BeginTime, DateTime EndTime, out string Errtext); /// /// 设置用户信息及权限 /// /// 用户编号 /// 用户名 /// 密码 /// 权限 /// /// [OperationContract] bool SetUserAndPurview(string UserID, string UserName, string Password, string Purview, out string Errtext); /// /// 获得用户信息及权限 /// /// 用户编号 /// 用户名 /// 密码 /// 权限 /// /// [OperationContract] bool GetUserAndPurview(string UserID, out string UserName, out string Password, out string Purview, out string Errtext); /// /// 设置用户密码 /// /// 用户编号 /// 密码 /// /// [OperationContract] bool SetUserPassword(string UserID, string Password, out string Errtext); /// /// 获得用户密码 /// /// 用户编号 /// /// [OperationContract] string GetUserPassword(string UserID, out string Errtext); /// /// 关闭调度系统 /// /// /// [OperationContract] bool ShutDownControlSystem(out string ErrText); /// /// 获得所有设备状态 /// /// /// [OperationContract] bool StartGetALLDeviceState(out string Errtext); /// /// 发送等待设备命令 /// /// /// [OperationContract] bool StartSendDeviceOrder(out string Errtext); /// /// 监听PLC请求 /// /// /// //[OperationContract] //bool ListenPLCAsk(out string Errtext); /// /// 调度数据清理 /// /// /// [OperationContract] bool DataClear(out string Errtext); /// /// 获得管理任务种类 /// /// /// 设备指令索引 /// [OperationContract] int GetManageTaskKindFromMonitor(out string errtext, int monitorIndex); /// /// 获得管理任务索引 /// /// /// 设备指令索引 /// [OperationContract] int GetManageTaskIndexFromMonitor(out string errtext, int monitorIndex); /// /// 获得设备种类索引 /// /// /// 设备索引 /// [OperationContract] int GetDeviceKindIndex(out string errtext, int deviceIndex); /// /// 发送设备置位清零 /// /// /// /// [OperationContract] bool SendDeviceReset(out string errtext, int deviceIndex, int ResetOrder); /// /// 心跳诊断 /// /// [OperationContract] bool Heartbeat(out Model.MonitorInfo monitorinfo);//20130817richard /// /// 获得指定SQL语句返回的DataView /// /// /// /// [OperationContract] DataTable GetDataView(out string errtext, string SQL); /// /// 只执行SQL,不反悔数据集的,例如insert,update,delete等 /// /// /// /// [OperationContract] int ExeSQLNoneQuery(out string errtext, string SQL); /// /// 获得指定SQL语句返回的DataView /// /// /// /// [OperationContract] DataTable GetManDataView(out string errtext, string SQL); /// /// 只执行SQL,不反悔数据集的,例如insert,update,delete等 /// /// /// /// [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); /// /// 获得所有设备信息 精简版(能够返回所有的数据) /// [OperationContract] byte[] GetAllDevicesString(out string errorText); /// /// 获得所有货位的信息 /// [OperationContract] byte[] GetAllCellString(out string errorText); /// /// 获得某一设备上或货位上的物料信息 /// [OperationContract] byte[] GetOneDeviceOrCellString(int DeviceIdx,int ForkIdx,string CellCode,out string errorText); } }