예제 #1
0
        public static decimal CalcScore(Steps steps, string iniPath, decimal percent)
        {
            var ini = new IniFile(iniPath);

            try
            {
                Offset.Score    = Decimal.Parse(ini.IniReadValue("OffsetScore", "value"));
                Speed.Score     = Decimal.Parse(ini.IniReadValue("SpeedScore", "value"));
                WorkAngle.Score = Decimal.Parse(ini.IniReadValue("WorkAngleScore", "value"));
                MoveAngle.Score = Decimal.Parse(ini.IniReadValue("MoveAngleScore", "value"));
                Nozzle.Score    = Decimal.Parse(ini.IniReadValue("NozzleScore", "value"));
            }
            catch (Exception ex)
            {
                Logger.Error("{ex.GetType().ToString()} {ex.Message} iniPath:{iniPath} ReadValue:{ini.IniReadValue(OffsetScore+, value)}");
            }

            //TigWire.Score = Decimal.Parse(ini.IniReadValue("TigWireScore", "value"));

            Offset.Score    = ScoreHelper.MapScore(Offset.Score, percent);
            Speed.Score     = ScoreHelper.MapScore(Speed.Score, percent);
            WorkAngle.Score = ScoreHelper.MapScore(WorkAngle.Score, percent);
            MoveAngle.Score = ScoreHelper.MapScore(MoveAngle.Score, percent);
            Nozzle.Score    = ScoreHelper.MapScore(Nozzle.Score, percent);
            //TigWire.Score = ScoreHelper.MapScore(TigWire.Score, percent);

            steps.StepList.Add(new Step
            {
                StepName  = Offset.Description,
                StepScore = Offset.Score,
            });
            steps.StepList.Add(new Step
            {
                StepName  = Speed.Description,
                StepScore = Speed.Score,
            });
            steps.StepList.Add(new Step
            {
                StepName  = WorkAngle.Description,
                StepScore = WorkAngle.Score,
            });
            steps.StepList.Add(new Step
            {
                StepName  = Offset.Description,
                StepScore = Offset.Score,
            });
            steps.StepList.Add(new Step
            {
                StepName  = MoveAngle.Description,
                StepScore = MoveAngle.Score,
            });
            steps.StepList.Add(new Step
            {
                StepName  = Nozzle.Description,
                StepScore = Nozzle.Score,
            });

            return(Offset.Score + Speed.Score + WorkAngle.Score +
                   MoveAngle.Score + Nozzle.Score);// + TigWire.Score;
        }
예제 #2
0
        public static decimal CalcScore(Steps steps, string iniPath, decimal percent)
        {
            var ini = new IniFile(iniPath);

            Offset.Score    = Decimal.Parse(ini.IniReadValue("OffsetScore", "value"));
            Speed.Score     = Decimal.Parse(ini.IniReadValue("SpeedScore", "value"));
            WorkAngle.Score = Decimal.Parse(ini.IniReadValue("WorkAngleScore", "value"));
            MoveAngle.Score = Decimal.Parse(ini.IniReadValue("MoveAngleScore", "value"));
            Nozzle.Score    = Decimal.Parse(ini.IniReadValue("NozzleScore", "value"));
            TigWire.Score   = Decimal.Parse(ini.IniReadValue("TigWireScore", "value"));

            Offset.Score    = ScoreHelper.MapScore(Offset.Score, percent);
            Speed.Score     = ScoreHelper.MapScore(Speed.Score, percent);
            WorkAngle.Score = ScoreHelper.MapScore(WorkAngle.Score, percent);
            MoveAngle.Score = ScoreHelper.MapScore(MoveAngle.Score, percent);
            Nozzle.Score    = ScoreHelper.MapScore(Nozzle.Score, percent);
            TigWire.Score   = ScoreHelper.MapScore(TigWire.Score, percent);

            steps.StepList.Add(new Step
            {
                StepName  = Offset.Description,
                StepScore = Offset.Score,
            });
            steps.StepList.Add(new Step
            {
                StepName  = Speed.Description,
                StepScore = Speed.Score,
            });
            steps.StepList.Add(new Step
            {
                StepName  = WorkAngle.Description,
                StepScore = WorkAngle.Score,
            });
            steps.StepList.Add(new Step
            {
                StepName  = Offset.Description,
                StepScore = Offset.Score,
            });
            steps.StepList.Add(new Step
            {
                StepName  = MoveAngle.Description,
                StepScore = MoveAngle.Score,
            });
            steps.StepList.Add(new Step
            {
                StepName  = Nozzle.Description,
                StepScore = Nozzle.Score,
            });
            steps.StepList.Add(new Step
            {
                StepName  = TigWire.Description,
                StepScore = TigWire.Score,
            });

            return(Offset.Score + Speed.Score + WorkAngle.Score +
                   MoveAngle.Score + Nozzle.Score + TigWire.Score);
        }