public bool UpdatePSBoolData(string machineCode, string opcTag, bool dataValue)
        {
            int    dataType = 0; //1:bool;2:number;3:string
            bool   isRem    = false;
            string field    = "";
            bool   boolDataValue;
            int    intDataValue;
            string stringDataValue;

            objPSDaoService = new PSDaoImp();
            GetDataTypeAndFieldOfTag(opcTag, out dataType, out field, out isRem);

            if (dataType == 1)
            {
                boolDataValue = Convert.ToBoolean(dataValue);
                objPSDaoService.UpdateBoolValueUsingMachineCode(machineCode, field, boolDataValue);
            }
            else if (dataType == 2)
            {
                intDataValue = Convert.ToInt16(dataValue);
                objPSDaoService.UpdateIntValueUsingMachineCode(machineCode, field, intDataValue);
            }
            else if (dataType == 3)
            {
                stringDataValue = Convert.ToString(dataValue);
                objPSDaoService.UpdateStringValueUsingMachineCode(machineCode, field, stringDataValue);
            }

            return(true);
        }
 public Model.PSData GetPSDetailsIncludeAisle(int aisle)
 {
     if (objPSDaoService == null)
     {
         objPSDaoService = new PSDaoImp();
     }
     return(objPSDaoService.GetPSDetailsIncludeAisle(aisle));
 }
 public List <Model.PSData> GetPSList()
 {
     if (objPSDaoService == null)
     {
         objPSDaoService = new PSDaoImp();
     }
     return(objPSDaoService.GetPSList());
 }
        public bool CheckPSHealthy(Model.PSData objPSData)
        {
            bool isHealthy = false;

            objPSDaoService = new PSDaoImp();

            using (OpcOperationsService opcd = new OpcOperationsImp(OpcConnection.GetOPCServerConnection()))
            {
                if (opcd.IsMachineHealthy(objPSData.machineChannel + "." + objPSData.machineCode + "." + OpcTags.PS_Shuttle_Aisle_Position_for_L2))
                {
                    isHealthy = opcd.ReadTag <bool>(objPSData.machineChannel, objPSData.machineCode, OpcTags.PS_L2_Auto_Ready_Bit);
                    isHealthy = isHealthy && !objPSDaoService.IsPSDisabled(objPSData.machineCode);
                    isHealthy = isHealthy && !objPSDaoService.IsPSSwitchOff(objPSData.machineCode);
                }
            }
            return(isHealthy);
        }
        public bool UpdateMachineValues()
        {
            objPSDaoService = new PSDaoImp();
            List <Model.PSData> psList;
            bool result;
            int  dataValue;
            bool dataValueInBool;



            try
            {
                psList = objPSDaoService.GetPSList();
                using (OpcOperationsService opcd = new OpcOperationsImp(OpcConnection.GetOPCServerConnection()))
                {
                    foreach (Model.PSData objPSData in psList)
                    {
                        if (opcd.IsMachineHealthy(objPSData.machineChannel + "." + objPSData.machineCode + "." + OpcTags.PS_Auto_Mode) == true)
                        {
                            dataValue = opcd.ReadTag <Int16>(objPSData.machineChannel, objPSData.machineCode, OpcTags.PS_Shuttle_Aisle_Position_for_L2);
                            if (dataValue > 0)
                            {
                                UpdatePSIntData(objPSData.machineCode, OpcTags.PS_Shuttle_Aisle_Position_for_L2, dataValue);
                            }
                            dataValue = opcd.ReadTag <Int16>(objPSData.machineChannel, objPSData.machineCode, OpcTags.PS_L2_Max_Window_Limit);
                            if (dataValue > 0)
                            {
                                UpdatePSIntData(objPSData.machineCode, OpcTags.PS_L2_Max_Window_Limit, dataValue);
                            }
                            dataValue = opcd.ReadTag <Int16>(objPSData.machineChannel, objPSData.machineCode, OpcTags.PS_L2_Min_Window_Limit);
                            if (dataValue > 0)
                            {
                                UpdatePSIntData(objPSData.machineCode, OpcTags.PS_L2_Min_Window_Limit, dataValue);
                            }
                        }
                    }
                }
                result = true;
            }
            catch (Exception errMsg)
            {
                result = false;
                Console.WriteLine(errMsg.Message);
            }
            return(result);
        }
 public bool IsPSSwitchOff(string machineName)
 {
     objPSDaoService = new PSDaoImp();
     return(objPSDaoService.IsPSSwitchOff(machineName));
 }
 public bool IsPSDisabled(string machineName)
 {
     objPSDaoService = new PSDaoImp();
     return(objPSDaoService.IsPSDisabled(machineName));
 }
 public bool UpdateMachineBlockStatus(string machine_code, bool blockStatus)
 {
     objPSDaoService = new PSDaoImp();
     return(objPSDaoService.UpdateMachineBlockStatus(machine_code, blockStatus));
 }
 public bool IsPSBlockedInDB(string machineName)
 {
     objPSDaoService = new PSDaoImp();
     return(objPSDaoService.IsPSBlockedInDB(machineName));
 }