| | |
| | | btyLength += compL; |
| | | btyWidth += compW; |
| | | |
| | | //限制精度5位 |
| | | btyLength = Math.Round(btyLength, 5); |
| | | btyWidth = Math.Round(btyWidth, 5); |
| | | |
| | | lengthMeasureState = (btyLength >= opcConfig.batteryLengthLimit.Min && btyLength <= opcConfig.batteryLengthLimit.Max) ? MeasureState.OK : MeasureState.NG; |
| | | widthMeasureState = (btyWidth >= opcConfig.batteryWidthLimit.Min && btyWidth <= opcConfig.batteryWidthLimit.Max) ? MeasureState.OK : MeasureState.NG; |
| | | |
| | |
| | | { |
| | | GregorianCalendar gc = new GregorianCalendar(); |
| | | int weekOfYear = gc.GetWeekOfYear(dt, CalendarWeekRule.FirstDay, DayOfWeek.Monday); |
| | | |
| | | var weekPlusStr = ConfigurationManager.AppSettings["WeekPlus"]; |
| | | int weekPlus = 0; |
| | | if (!int.TryParse(weekPlusStr, out weekPlus)) |
| | | { |
| | | weekPlus = 0; |
| | | } |
| | | weekOfYear += weekPlus; |
| | | string week = weekOfYear.ToString().Length == 1 ? "0" + weekOfYear.ToString() : weekOfYear.ToString(); |
| | | |
| | | var yearPlusStr = ConfigurationManager.AppSettings["YearPlus"]; |
| | | int yearPlus = 0; |
| | | if (!int.TryParse(yearPlusStr, out yearPlus)) |
| | | { |
| | | yearPlus = 0; |
| | | } |
| | | string year = dt.Year.ToString().Substring(dt.Year.ToString().Length - 1, 1); |
| | | year = (int.Parse(year) + yearPlus).ToString(); |
| | | |
| | | return year + week; |
| | | } |
| | | } |