Exemplo n.º 1
0
        public ClothClamp[] LoadClothClamps()
        {
            ShouldPadDAO shouldPadDAO = new ShouldPadDAO();

            PointF[] pointfs = new PointF[6];

            //获得屏上 左 右 中 三个夹布间距
            Single leftClothClipSpace  = (Single)shouldPadDAO.GetDataBaseValue(ShouldPadDataEnum.LeftClothClipSpace);
            Single rightClothClipSpace = (Single)shouldPadDAO.GetDataBaseValue(ShouldPadDataEnum.RightClothChipSpace);
            Single middClothClipSpace  = (Single)shouldPadDAO.GetDataBaseValue(ShouldPadDataEnum.MiddClothChipSpace);

            //获得6个夹布位置 仅6个加布器内部中间点的坐标
            int invalidPointXDist = 0, invalidPointYDist = 0;

            pointfs[0]        = new PointF(-DefaultValue.DefaultValueEx.ClothClampSpace, leftClothClipSpace / 2);
            pointfs[1]        = new PointF(-DefaultValue.DefaultValueEx.ClothClampSpace, -leftClothClipSpace / 2);
            pointfs[2]        = new PointF(DefaultValue.DefaultValueEx.ClothClampSpace, rightClothClipSpace / 2);
            pointfs[3]        = new PointF(DefaultValue.DefaultValueEx.ClothClampSpace, -rightClothClipSpace / 2);
            pointfs[4]        = new PointF(0, middClothClipSpace / 2);
            pointfs[5]        = new PointF(0, -middClothClipSpace / 2);
            invalidPointXDist = Convert.ToInt32(Math.Round(DefaultValue.DefaultValueEx.InvalidPointXDist * MappingSize.MappingSizeEx.MappingRatio, 0));
            invalidPointYDist = Convert.ToInt32(Math.Round(DefaultValue.DefaultValueEx.InvalidPointYDist * MappingSize.MappingSizeEx.MappingRatio, 0));

            ClothClamp[] clothClamps   = new ClothClamp[6];
            Point        point         = Point.Empty;
            double       mappingRation = MappingSize.MappingSizeEx.MappingRatio;

            for (int i = 0; i < clothClamps.Length; i++)
            {
                point.X        = Convert.ToInt32(Math.Round(pointfs[i].X * mappingRation, 0));
                point.Y        = Convert.ToInt32(Math.Round(pointfs[i].Y * mappingRation, 0));
                clothClamps[i] = new ClothClamp(point, invalidPointXDist, invalidPointYDist);
            }
            return(clothClamps);
        }
Exemplo n.º 2
0
        public void LoadSizeRadio(Size screenSize)//加载图片比例
        {
            ShouldPadDAO shouldPadDAO = new ShouldPadDAO();
            Single       padWidth     = (Single)shouldPadDAO.GetDataBaseValue(ShouldPadDataEnum.ShouldPadWidth);
            Single       padLength    = (Single)shouldPadDAO.GetDataBaseValue(ShouldPadDataEnum.ShouldPadLength);
            Single       radianLevel  = (Single)shouldPadDAO.GetDataBaseValue(ShouldPadDataEnum.RadianLevel);

            MappingSize.MappingSizeEx.LowerMachineSize = new SizeF(padLength + radianLevel * 2, padWidth);
            MappingSize.MappingSizeEx.ScreenSize       = screenSize;
            LoadShouldPadInfo();
            shapeOperManager = new ShapeOperManager(DefaultValue.DefaultValueEx.DefaultBackSize);
        }
Exemplo n.º 3
0
        private void BaseDataForm_Load(object sender, EventArgs e)
        {
            ShouldPadDAO shouldPadDAO = new ShouldPadDAO();

            BaseDateModel.GetDataBaseModel().HaveDataChanged = true;
            dataButton5.Text            = shouldPadDAO.GetDataBaseValue(ShouldPadDataEnum.CutLineDistance).ToString();
            SerialDataManager.Feedback += new ShouldPadMachine.ShouldPadMachineAssist.DelegateEx.FeedbackEventHandle(SerialDataManager_Feedback);
        }
Exemplo n.º 4
0
        private void InitParamButtons()
        {
            //读Xml数据
            ShouldPadDAO PadDAO = new ShouldPadDAO();

            foreach (Tablet Tab in EditManager.ParamList)
            {
                if (Tab.Tag.ToString() == "6")
                {
                    Tab.Val_Max = Convert.ToInt32(tlPadLength.Content) / 2;
                }
                Tab.Content = PadDAO.GetDataBaseValue(int.Parse(Tab.Tag.ToString()));
            }
            tlPadHalf.SetValRange(20, Convert.ToInt32(tlPadLength.Content) / 2);
            PadDAO.SetDataBaseValue((ShouldPadDataEnum)Convert.ToInt16(tlPadHalf.Tag), tlPadHalf.Content);
        }