Exemple #1
0
        public string ServerMode()
        {
            string result = "";
            string param  = "";

            Thread.Sleep(1000);
            if (this.retResult == 0 && SingleConnectionSession.GetInstance().Connected)
            {
                ProductionServer srv = (ProductionServer)SingleConnectionSession.GetInstance().GetServer(HostName.ToUpper() + "_PS01");

                if (srv == null)
                {
                    this.retResult  = -3;
                    this.errMessage = "서버에 연결하는 중 에러가 발생했습니다.";
                }
                else
                {
                    param = srv.GetProductionParam(ProductionModeParamType.OperatingModeParam).ToString().ToLower().Replace(" ", "");
                }

                result         = param;
                this.retResult = 0;
            }
            else
            {
                this.retResult  = -1;
                this.errMessage = "서버에 연결되어 있지 않습니다.";
            }


            return(result);
        }
Exemple #2
0
        public void getActiveOrders()
        {
            StringBuilder sb     = null;
            int           number = 0;

            Thread.Sleep(1000);

            try
            {
                if (SingleConnectionSession.GetInstance().Connected)
                {
                    ProductionServer srv = (ProductionServer)SingleConnectionSession.GetInstance().GetServer(HostName.ToUpper() + "_PS01");

                    if (srv != null)
                    {
                        sb = new StringBuilder();

                        foreach (ServerOrder order in srv.GetActiveOrders())
                        {
                            sb.Append("OrderId = " + order.OrderId + ", ");
                            sb.Append("Related JobId = " + order.JobId + ", ");
                            sb.Append("ClientId = " + order.ClientId + ", ");
                            sb.Append("State = " + order.State.ToString() + ", ");
                            sb.Append("Stage = " + order.Stage.ToString() + ", ");
                            sb.Append("Percent done = " + order.PercentCompleted.ToString() + "\r\n");

                            number++;
                        }

                        this.retResult  = 0;
                        this.OrderLists = sb.ToString();
                    }
                    else
                    {
                        this.retResult  = -3;
                        this.errMessage = "서버에 연결하는 중 에러가 발생했습니다.";
                    }
                }
                else
                {
                    this.retResult  = -1;
                    this.errMessage = "서버에 연결되어 있지 않습니다.";
                }
            }
            catch (Exception ex)
            {
                this.retResult  = -1;
                this.errMessage = ex.Message;
            }

            this.NumberOfOrders = number;
        }
Exemple #3
0
        public void ResetBin(ushort autoLoader)
        {
            if (this.retResult == 0 && SingleConnectionSession.GetInstance().Connected)
            {
                ProductionServer srv = (ProductionServer)SingleConnectionSession.GetInstance().GetServer(HostName.ToUpper() + "_PS01");

                if (srv == null)
                {
                    this.retResult  = -3;
                    this.errMessage = "서버에 연결하는 중 에러가 발생했습니다.";
                }
                else
                {
                    srv.ResetInputBins(autoLoader);
                    this.retResult = 0;
                }
            }
        }
Exemple #4
0
        public bool setNormalMode()
        {
            bool retBl = false;

            Thread.Sleep(1000);

            if (SingleConnectionSession.GetInstance().Connected)
            {
                ProductionServer srv = (ProductionServer)SingleConnectionSession.GetInstance().GetServer(HostName.ToUpper() + "_PS01");

                if (srv.GetProductionParam(ProductionModeParamType.OperatingModeParam).ToString().ToLower() != "normal")
                {
                    try
                    {
                        srv.Pause();
                    }
                    catch (RimageException ex)
                    {
                        this.retResult  = -1;
                        this.errMessage = ex.Message;
                    }
                    Thread.Sleep(3000);

                    string param = srv.GetProductionParam(ProductionModeParamType.OperatingModeParam);
                    srv.SetProductionParam(ProductionModeParamType.OperatingModeParam, ServerParamValues.ProductionOperatingModeNormal);
                    srv.CommitParamChanges();

                    try
                    {
                        srv.Resume();
                        retBl          = true;
                        this.retResult = 0;
                        Thread.Sleep(3000);
                    }
                    catch (RimageException ex)
                    {
                        this.retResult  = -1;
                        this.errMessage = ex.Message;
                    }
                }
            }
            return(retBl);
        }