using CommonClassLib;
//using DBFactory;
using Microsoft.VisualBasic;
using RGDWCSServices.WMS;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.Xml;

namespace RGDWCSServices
{
    // 注意: 使用“重构”菜单上的“重命名”命令，可以同时更改代码和配置文件中的类名“Service2”。
    
    public class RGDWCSService : IRGDWCSService
    {
        HouseBase _HouseBase = new HouseBase();
        
        public string getWhEquipStatus(string sXmlIn)
        {
            string sXmlOut = string.Empty;

            this._HouseBase.InvokeHouse(System.Reflection.MethodBase.GetCurrentMethod().Name, sXmlIn, out sXmlOut);

            return sXmlOut;
        }
        public string packTask(string sXmlIn)
        {
            string sXmlOut = string.Empty;

            this._HouseBase.InvokeHouse(System.Reflection.MethodBase.GetCurrentMethod().Name, sXmlIn, out sXmlOut);

            return sXmlOut;
        }
        public string startArrangeTask(string sXmlIn)
        {
            string sXmlOut = string.Empty;

            this._HouseBase.InvokeHouse(System.Reflection.MethodBase.GetCurrentMethod().Name, sXmlIn, out sXmlOut);

            return sXmlOut;
        }
        public string startInTask(string sXmlIn)
        {
            string sXmlOut = string.Empty;

            this._HouseBase.InvokeHouse(System.Reflection.MethodBase.GetCurrentMethod().Name, sXmlIn, out sXmlOut);

            return sXmlOut;
        }
        public string startInventoryTask(string sXmlIn)
        {
            string sXmlOut = string.Empty;

            this._HouseBase.InvokeHouse(System.Reflection.MethodBase.GetCurrentMethod().Name, sXmlIn, out sXmlOut);

            return sXmlOut;
        }
        public string startBoxInvTask(string sXmlIn)
        {
            string sXmlOut = string.Empty;

            this._HouseBase.InvokeHouse(System.Reflection.MethodBase.GetCurrentMethod().Name, sXmlIn, out sXmlOut);

            return sXmlOut;


        }


        public string startOutTask(string sXmlIn)
        {
            string sXmlOut = string.Empty;

            this._HouseBase.InvokeHouse(System.Reflection.MethodBase.GetCurrentMethod().Name, sXmlIn, out sXmlOut);

            return sXmlOut;
        }
        public string stopTask(string sXmlIn)
        {
            string sXmlOut = string.Empty;

            this._HouseBase.InvokeHouse(System.Reflection.MethodBase.GetCurrentMethod().Name, sXmlIn, out sXmlOut);

            return sXmlOut;
        }

        /// <summary>
        /// RFID请求
        /// </summary>
        /// <param name="RFIDRequest">入参</param>
        /// <returns>出参</returns>
        public string RFIDRequestWithReturn(string RFIDRequest)
        {
            return CRFID.RFIDRequestWithReturn(RFIDRequest);
        }

        //DbHelperSQLperator DbHelperSQL = new DbHelperSQLperator();
        /// <summary>
        /// 监控射频读写启停信号
        /// </summary>
        /// <returns></returns>
        public string RFIDReadyToRead(string station_code)
        {
            return CRFID.RFIDReadyToRead(station_code);
        }
        /// <summary>
        /// VISION请求
        /// </summary>
        /// <param name="VisionRequest">入参</param>
        /// <returns>出参</returns>
        public string VISIONRequestWithReturn(string VisionRequest)
        {
            return CVision.VISIONRequestWithReturn(VisionRequest);
        }

        /// <summary>
        /// 视觉检测开始检测
        /// </summary>
        /// <param name="stationCode">视觉设备编号</param>
        /// <returns>0不启动；1单相表箱进入开始检测；2三相表箱进入开始检测</returns>
        public int ReadyToHandleVision(string stationCode)
        {
            return CVision.ReadyToHandleVision(stationCode);
        }

        public int Update_IO_Vision(string device_code, int read_flag)
        {
            return CVision.Update_IO_Vision(device_code, read_flag);
        }
    }
}
