肖奇伟 4 днів тому
батько
коміт
352b4110ae

+ 263 - 0
SCADA_DAQ/Customer/Doc/Label_202406281804_01.cyc

@@ -0,0 +1,263 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<CycleFile>
+<Cycle Name="Cycle_Label">
+<Field Name="LabelName" Value="202406281804_01_0001.bmp" />
+<Field Name="X" Value="860.00" />
+<Field Name="Y" Value="131.00" />
+<Field Name="R" Value="0" />
+<Field Name="ID" Value="2900000000014 " />
+<Field Name="PositionX" Value="859.75" />
+<Field Name="PositionY" Value="131.25" />
+<Field Name="ActualLength" Value="220.00" />
+<Field Name="ActualWidth" Value="564.00" />
+<Field Name="Waste" Value="0" />
+<Field Name="Accurate" Value="0" />
+</Cycle>
+<Cycle Name="Cycle_Label">
+<Field Name="LabelName" Value="202406281804_01_0002.bmp" />
+<Field Name="X" Value="1122.50" />
+<Field Name="Y" Value="458.00" />
+<Field Name="R" Value="0" />
+<Field Name="ID" Value="2900000000003 " />
+<Field Name="PositionX" Value="1121.25" />
+<Field Name="PositionY" Value="458.75" />
+<Field Name="ActualLength" Value="310.00" />
+<Field Name="ActualWidth" Value="170.00" />
+<Field Name="Waste" Value="0" />
+<Field Name="Accurate" Value="0" />
+</Cycle>
+<Cycle Name="Cycle_Label">
+<Field Name="LabelName" Value="202406281804_01_0003.bmp" />
+<Field Name="X" Value="288.50" />
+<Field Name="Y" Value="127.00" />
+<Field Name="R" Value="0" />
+<Field Name="ID" Value="2900000000013 " />
+<Field Name="PositionX" Value="287.25" />
+<Field Name="PositionY" Value="127.25" />
+<Field Name="ActualLength" Value="240.00" />
+<Field Name="ActualWidth" Value="564.00" />
+<Field Name="Waste" Value="0" />
+<Field Name="Accurate" Value="0" />
+</Cycle>
+<Cycle Name="Cycle_Label">
+<Field Name="LabelName" Value="202406281804_01_0004.bmp" />
+<Field Name="X" Value="166.50" />
+<Field Name="Y" Value="380.00" />
+<Field Name="R" Value="0" />
+<Field Name="ID" Value="2900000000010 " />
+<Field Name="PositionX" Value="165.25" />
+<Field Name="PositionY" Value="380.75" />
+<Field Name="ActualLength" Value="250.00" />
+<Field Name="ActualWidth" Value="320.00" />
+<Field Name="Waste" Value="0" />
+<Field Name="Accurate" Value="0" />
+</Cycle>
+<Cycle Name="Cycle_Label">
+<Field Name="LabelName" Value="202406281804_01_0005.bmp" />
+<Field Name="X" Value="803.50" />
+<Field Name="Y" Value="409.00" />
+<Field Name="R" Value="0" />
+<Field Name="ID" Value="2900000000012 " />
+<Field Name="PositionX" Value="802.75" />
+<Field Name="PositionY" Value="409.75" />
+<Field Name="ActualLength" Value="320.00" />
+<Field Name="ActualWidth" Value="450.00" />
+<Field Name="Waste" Value="0" />
+<Field Name="Accurate" Value="0" />
+</Cycle>
+<Cycle Name="Cycle_Label">
+<Field Name="LabelName" Value="202406281804_01_0006.bmp" />
+<Field Name="X" Value="1062.50" />
+<Field Name="Y" Value="777.00" />
+<Field Name="R" Value="0" />
+<Field Name="ID" Value="2900000000001 " />
+<Field Name="PositionX" Value="1061.25" />
+<Field Name="PositionY" Value="777.25" />
+<Field Name="ActualLength" Value="310.00" />
+<Field Name="ActualWidth" Value="190.00" />
+<Field Name="Waste" Value="0" />
+<Field Name="Accurate" Value="0" />
+</Cycle>
+<Cycle Name="Cycle_Label">
+<Field Name="LabelName" Value="202406281804_01_0007.bmp" />
+<Field Name="X" Value="1087.50" />
+<Field Name="Y" Value="1095.00" />
+<Field Name="R" Value="0" />
+<Field Name="ID" Value="2900000000000 " />
+<Field Name="PositionX" Value="1086.25" />
+<Field Name="PositionY" Value="1095.75" />
+<Field Name="ActualLength" Value="310.00" />
+<Field Name="ActualWidth" Value="240.00" />
+<Field Name="Waste" Value="0" />
+<Field Name="Accurate" Value="0" />
+</Cycle>
+<Cycle Name="Cycle_Label">
+<Field Name="LabelName" Value="202406281804_01_0008.bmp" />
+<Field Name="X" Value="758.50" />
+<Field Name="Y" Value="728.00" />
+<Field Name="R" Value="0" />
+<Field Name="ID" Value="2900000000006 " />
+<Field Name="PositionX" Value="757.75" />
+<Field Name="PositionY" Value="728.25" />
+<Field Name="ActualLength" Value="300.00" />
+<Field Name="ActualWidth" Value="360.00" />
+<Field Name="Waste" Value="0" />
+<Field Name="Accurate" Value="0" />
+</Cycle>
+<Cycle Name="Cycle_Label">
+<Field Name="LabelName" Value="202406281804_01_0009.bmp" />
+<Field Name="X" Value="288.50" />
+<Field Name="Y" Value="696.00" />
+<Field Name="R" Value="0" />
+<Field Name="ID" Value="2900000000016 " />
+<Field Name="PositionX" Value="287.25" />
+<Field Name="PositionY" Value="696.25" />
+<Field Name="ActualLength" Value="364.00" />
+<Field Name="ActualWidth" Value="564.00" />
+<Field Name="Waste" Value="0" />
+<Field Name="Accurate" Value="0" />
+</Cycle>
+<Cycle Name="Cycle_Label">
+<Field Name="LabelName" Value="202406281804_01_0010.bmp" />
+<Field Name="X" Value="196.50" />
+<Field Name="Y" Value="1165.00" />
+<Field Name="R" Value="0" />
+<Field Name="ID" Value="2900000000004 " />
+<Field Name="PositionX" Value="195.25" />
+<Field Name="PositionY" Value="1165.75" />
+<Field Name="ActualLength" Value="310.00" />
+<Field Name="ActualWidth" Value="380.00" />
+<Field Name="Waste" Value="0" />
+<Field Name="Accurate" Value="0" />
+</Cycle>
+<Cycle Name="Cycle_Label">
+<Field Name="LabelName" Value="202406281804_01_0011.bmp" />
+<Field Name="X" Value="211.50" />
+<Field Name="Y" Value="1519.00" />
+<Field Name="R" Value="0" />
+<Field Name="ID" Value="2900000000021 " />
+<Field Name="PositionX" Value="210.25" />
+<Field Name="PositionY" Value="1519.25" />
+<Field Name="ActualLength" Value="380.00" />
+<Field Name="ActualWidth" Value="410.00" />
+<Field Name="Waste" Value="0" />
+<Field Name="Accurate" Value="0" />
+</Cycle>
+<Cycle Name="Cycle_Label">
+<Field Name="LabelName" Value="202406281804_01_0012.bmp" />
+<Field Name="X" Value="241.50" />
+<Field Name="Y" Value="1842.00" />
+<Field Name="R" Value="0" />
+<Field Name="ID" Value="2900000000009 " />
+<Field Name="PositionX" Value="240.25" />
+<Field Name="PositionY" Value="1842.75" />
+<Field Name="ActualLength" Value="250.00" />
+<Field Name="ActualWidth" Value="470.00" />
+<Field Name="Waste" Value="0" />
+<Field Name="Accurate" Value="0" />
+</Cycle>
+<Cycle Name="Cycle_Label">
+<Field Name="LabelName" Value="202406281804_01_0013.bmp" />
+<Field Name="X" Value="924.50" />
+<Field Name="Y" Value="2594.00" />
+<Field Name="R" Value="0" />
+<Field Name="ID" Value="2900000000005 " />
+<Field Name="PositionX" Value="923.75" />
+<Field Name="PositionY" Value="2594.75" />
+<Field Name="ActualLength" Value="300.00" />
+<Field Name="ActualWidth" Value="580.00" />
+<Field Name="Waste" Value="0" />
+<Field Name="Accurate" Value="0" />
+</Cycle>
+<Cycle Name="Cycle_Label">
+<Field Name="LabelName" Value="202406281804_01_0014.bmp" />
+<Field Name="X" Value="316.50" />
+<Field Name="Y" Value="2554.00" />
+<Field Name="R" Value="0" />
+<Field Name="ID" Value="2900000000018 " />
+<Field Name="PositionX" Value="315.25" />
+<Field Name="PositionY" Value="2554.75" />
+<Field Name="ActualLength" Value="380.00" />
+<Field Name="ActualWidth" Value="620.00" />
+<Field Name="Waste" Value="0" />
+<Field Name="Accurate" Value="0" />
+</Cycle>
+<Cycle Name="Cycle_Label">
+<Field Name="LabelName" Value="202406281804_01_0015.bmp" />
+<Field Name="X" Value="896.50" />
+<Field Name="Y" Value="2246.00" />
+<Field Name="R" Value="0" />
+<Field Name="ID" Value="2900000000020 " />
+<Field Name="PositionX" Value="895.75" />
+<Field Name="PositionY" Value="2246.25" />
+<Field Name="ActualLength" Value="380.00" />
+<Field Name="ActualWidth" Value="524.00" />
+<Field Name="Waste" Value="0" />
+<Field Name="Accurate" Value="0" />
+</Cycle>
+<Cycle Name="Cycle_Label">
+<Field Name="LabelName" Value="202406281804_01_0016.bmp" />
+<Field Name="X" Value="268.50" />
+<Field Name="Y" Value="2166.00" />
+<Field Name="R" Value="0" />
+<Field Name="ID" Value="2900000000019 " />
+<Field Name="PositionX" Value="267.25" />
+<Field Name="PositionY" Value="2166.25" />
+<Field Name="ActualLength" Value="380.00" />
+<Field Name="ActualWidth" Value="524.00" />
+<Field Name="Waste" Value="0" />
+<Field Name="Accurate" Value="0" />
+</Cycle>
+<Cycle Name="Cycle_Label">
+<Field Name="LabelName" Value="202406281804_01_0017.bmp" />
+<Field Name="X" Value="806.50" />
+<Field Name="Y" Value="1812.00" />
+<Field Name="R" Value="0" />
+<Field Name="ID" Value="2900000000015 " />
+<Field Name="PositionX" Value="805.75" />
+<Field Name="PositionY" Value="1812.75" />
+<Field Name="ActualLength" Value="470.00" />
+<Field Name="ActualWidth" Value="536.00" />
+<Field Name="Waste" Value="0" />
+<Field Name="Accurate" Value="0" />
+</Cycle>
+<Cycle Name="Cycle_Label">
+<Field Name="LabelName" Value="202406281804_01_0018.bmp" />
+<Field Name="X" Value="1023.50" />
+<Field Name="Y" Value="1414.00" />
+<Field Name="R" Value="0" />
+<Field Name="ID" Value="2900000000002 " />
+<Field Name="PositionX" Value="1022.25" />
+<Field Name="PositionY" Value="1414.25" />
+<Field Name="ActualLength" Value="310.00" />
+<Field Name="ActualWidth" Value="380.00" />
+<Field Name="Waste" Value="0" />
+<Field Name="Accurate" Value="0" />
+</Cycle>
+<Cycle Name="Cycle_Label">
+<Field Name="LabelName" Value="202406281804_01_0019.bmp" />
+<Field Name="X" Value="624.50" />
+<Field Name="Y" Value="1419.00" />
+<Field Name="R" Value="0" />
+<Field Name="ID" Value="2900000000007 " />
+<Field Name="PositionX" Value="623.75" />
+<Field Name="PositionY" Value="1419.25" />
+<Field Name="ActualLength" Value="300.00" />
+<Field Name="ActualWidth" Value="400.00" />
+<Field Name="Waste" Value="0" />
+<Field Name="Accurate" Value="0" />
+</Cycle>
+<Cycle Name="Cycle_Label">
+<Field Name="LabelName" Value="202406281804_01_0020.bmp" />
+<Field Name="X" Value="676.50" />
+<Field Name="Y" Value="1068.00" />
+<Field Name="R" Value="0" />
+<Field Name="ID" Value="2900000000017 " />
+<Field Name="PositionX" Value="675.75" />
+<Field Name="PositionY" Value="1068.75" />
+<Field Name="ActualLength" Value="364.00" />
+<Field Name="ActualWidth" Value="564.00" />
+<Field Name="Waste" Value="0" />
+<Field Name="Accurate" Value="0" />
+</Cycle>
+</CycleFile>

BIN
SCADA_DAQ/Customer/Doc/分板坐标系.png


+ 194 - 29
SCADA_DAQ/Customer/Machines/SortMachine.cs

@@ -343,32 +343,147 @@ namespace SCADA_DAQ.Customer.Machines
                             BoardInfo.CupCenter = new Point(BoardInfo.CupCenter.X - cup2NewCenter.X, BoardInfo.CupCenter.Y - cup2NewCenter.Y);
                             //releaseY = CurrentLabel.ActualLength / 2 - 140;
                             CupNewCenter = cup2NewCenter;
-                           }
+                        }
                         else
                         {
                             BoardInfo.ReleaseY = CurrentLabel.ActualWidth / 2 - 150;
-                            var cup2NewCenter = new Point(Cup1Center.X, Cup1Center.Y);  //旋转后的坐标
+                            var cup2NewCenter = new Point(Cup2Center.X, Cup2Center.Y);  //旋转后的坐标
                             BoardInfo.CupCenter = new Point(BoardInfo.CupCenter.X - cup2NewCenter.X, BoardInfo.CupCenter.Y - cup2NewCenter.Y);
                             CupNewCenter = cup2NewCenter;
                         }
                     }
                     else
                     {
-                        if ((CenterX > 600 && CurrentLabel.ActualLength > CurrentLabel.ActualWidth) ||   //靠近X轴且横着
-                            (CenterX <= 600 && CurrentLabel.ActualLength < CurrentLabel.ActualWidth))
+                        //if ((CenterX > 600 && CurrentLabel.ActualLength > CurrentLabel.ActualWidth) ||   //靠近X轴且横着
+                        //    (CenterX <= 600 && CurrentLabel.ActualLength < CurrentLabel.ActualWidth))
+                        //{
+                        //    BoardInfo.CupIndex = 3;
+                        //}
+                        //else
+                        //{
+                        //    BoardInfo.CupIndex = 1;
+                        //}
+
+
+                        //if (BoardInfo.CupIndex == 1)
+                        //{
+                        //    if (CenterX <= 600)
+                        //    {
+                        //        if (CurrentLabel.ActualLength >= CurrentLabel.ActualWidth)
+                        //        {
+                        //            var cup1NewCenter = new Point(Cup1Center.X, Cup1Center.Y);  //旋转后的坐标
+                        //            BoardInfo.CupCenter = new Point(BoardInfo.CupCenter.X - cup1NewCenter.X, BoardInfo.CupCenter.Y - cup1NewCenter.Y);
+                        //            BoardInfo.ReleaseY = CurrentLabel.ActualWidth / 2 - 30;
+                        //            CupNewCenter = cup1NewCenter;
+                        //        }
+                        //    }
+                        //    else
+                        //    {
+                        //        BoardInfo.Rotation = 90;
+                        //        var cup1NewCenter = new Point(Cup1Center.Y, -1 * (double)Cup1Center.X);  //旋转后的坐标
+                        //        CupNewCenter = cup1NewCenter;
+                        //        BoardInfo.CupCenter = new Point(BoardInfo.CupCenter.X - cup1NewCenter.X, BoardInfo.CupCenter.Y - cup1NewCenter.Y);
+                        //        BoardInfo.ReleaseY = CurrentLabel.ActualLength / 2 - 180;
+                        //    }
+                        //}
+                        //else if (BoardInfo.CupIndex == 3)
+                        //{
+                        //    if (CenterX <= 600)
+                        //    {
+                        //        if (CurrentLabel.ActualLength < CurrentLabel.ActualWidth)
+                        //        {
+                        //            BoardInfo.Rotation = -90;
+                        //            var cup3NewCenter = new Point(Cup3Center.Y * -1, (double)Cup3Center.X);  //旋转后的坐标
+                        //            BoardInfo.CupCenter = new Point(BoardInfo.CupCenter.X - cup3NewCenter.X, BoardInfo.CupCenter.Y - cup3NewCenter.Y);
+                        //            CupNewCenter = cup3NewCenter;
+                        //        }
+                        //        //BoardInfo.ReleaseY = CurrentLabel.ActualWidth / 2;
+                        //        BoardInfo.ReleaseY = CurrentLabel.ActualLength / 2 - 180;
+                        //        //BoardInfo.ReleaseY = CurrentLabel.ActualWidth / 2 - 20;
+                        //    }
+                        //    else
+                        //    {
+                        //        var cup3NewCenter = new Point(Cup3Center.X, (double)Cup3Center.Y);  //旋转后的坐标
+                        //        BoardInfo.CupCenter = new Point(BoardInfo.CupCenter.X - cup3NewCenter.X, BoardInfo.CupCenter.Y - cup3NewCenter.Y);
+                        //        //BoardInfo.ReleaseY = CurrentLabel.ActualWidth / 2 + 500;
+                        //        BoardInfo.ReleaseY = CurrentLabel.ActualWidth / 2 - 180;
+                        //        CupNewCenter = cup3NewCenter;
+                        //        //BoardInfo.ReleaseY = CurrentLabel.ActualWidth / 2 - 20;
+                        //    }
+                        //}
+                        //else
+                        //{
+                        //    //BoardInfo.ReleaseY = CurrentLabel.ActualWidth / 2;
+                        //}
+
+
+
+                        //if ((CenterX > 600 && CurrentLabel.ActualLength > CurrentLabel.ActualWidth) ||   //靠近X轴且横着
+                        //    (CenterX <= 600 && CurrentLabel.ActualLength < CurrentLabel.ActualWidth))
+                        //{
+                        //    BoardInfo.CupIndex = 3;
+                        //}
+                        //else
+                        //{
+                        //    BoardInfo.CupIndex = 1;
+                        //}
+
+                        var isVer = CurrentLabel.ActualLength < CurrentLabel.ActualWidth;   //是否竖版
+                        var area = 0;
+                        if (CenterX < 600 && CenterY < 500)
+                        {
+                            area = 1;
+                        }
+                        else if (CenterX >= 600 && CenterY < 500)
                         {
-                            BoardInfo.CupIndex = 3;
+                            area = 4;
+                        }
+                        else if (CenterX >= 600 && CenterY >= 500)
+                        {
+                            area = 3;
+                        }
+                        else if (CenterX < 600 && CenterY >= 500)
+                        {
+                            area = 2;
+                        }
+
+                        if (area == 1 || area == 3)
+                        {
+                            if (isVer)
+                            {
+                                BoardInfo.CupIndex = 1;
+                            }
+                            else
+                            {
+                                BoardInfo.CupIndex = 3;
+                            }
                         }
                         else
                         {
-                            BoardInfo.CupIndex = 1;
+                            if (isVer)
+                            {
+                                BoardInfo.CupIndex = 3;
+                            }
+                            else
+                            {
+                                BoardInfo.CupIndex = 1;
+                            }
                         }
 
+
                         if (BoardInfo.CupIndex == 1)
                         {
-                            if (CenterX <= 600)
+                            if (isVer)
                             {
-                                if (CurrentLabel.ActualLength >= CurrentLabel.ActualWidth)
+                                if (area == 1)
+                                {
+                                    BoardInfo.Rotation = 90;
+                                    var cup1NewCenter = new Point(Cup1Center.Y, -1 * (double)Cup1Center.X);  //旋转后的坐标
+                                    BoardInfo.CupCenter = new Point(BoardInfo.CupCenter.X - cup1NewCenter.X, BoardInfo.CupCenter.Y - cup1NewCenter.Y);
+                                    BoardInfo.ReleaseY = CurrentLabel.ActualWidth / 2 - 30;
+                                    CupNewCenter = cup1NewCenter;
+                                }
+                                else if (area == 3)
                                 {
                                     var cup1NewCenter = new Point(Cup1Center.X, Cup1Center.Y);  //旋转后的坐标
                                     BoardInfo.CupCenter = new Point(BoardInfo.CupCenter.X - cup1NewCenter.X, BoardInfo.CupCenter.Y - cup1NewCenter.Y);
@@ -378,41 +493,91 @@ namespace SCADA_DAQ.Customer.Machines
                             }
                             else
                             {
-                                BoardInfo.Rotation = 90;
-                                var cup1NewCenter = new Point(Cup1Center.Y, -1 * (double)Cup1Center.X);  //旋转后的坐标
-                                CupNewCenter = cup1NewCenter;
-                                BoardInfo.CupCenter = new Point(BoardInfo.CupCenter.X - cup1NewCenter.X, BoardInfo.CupCenter.Y - cup1NewCenter.Y);
-                                BoardInfo.ReleaseY = CurrentLabel.ActualLength / 2 - 180;
+                                if (area == 2)
+                                {
+                                    BoardInfo.Rotation = -90;
+                                    var cup1NewCenter = new Point(-1 * Cup1Center.Y, (double)Cup1Center.X);  //旋转后的坐标
+                                    BoardInfo.CupCenter = new Point(BoardInfo.CupCenter.X - cup1NewCenter.X, BoardInfo.CupCenter.Y - cup1NewCenter.Y);
+                                    BoardInfo.ReleaseY = CurrentLabel.ActualWidth / 2 - 30;
+                                    CupNewCenter = cup1NewCenter;
+                                }
+                                else if (area == 4)
+                                {
+                                    BoardInfo.Rotation = 180;
+                                    var cup1NewCenter = new Point(-1 * Cup1Center.X, -1 * Cup1Center.Y);  //旋转后的坐标
+                                    BoardInfo.CupCenter = new Point(BoardInfo.CupCenter.X - cup1NewCenter.X, BoardInfo.CupCenter.Y - cup1NewCenter.Y);
+                                    BoardInfo.ReleaseY = CurrentLabel.ActualWidth / 2 - 30;
+                                    CupNewCenter = cup1NewCenter;
+                                }
                             }
+
+
+                            //if (CenterX <= 600)
+                            //{
+                            //    if (CurrentLabel.ActualLength >= CurrentLabel.ActualWidth)
+                            //    {
+                            //        var cup1NewCenter = new Point(Cup1Center.X, Cup1Center.Y);  //旋转后的坐标
+                            //        BoardInfo.CupCenter = new Point(BoardInfo.CupCenter.X - cup1NewCenter.X, BoardInfo.CupCenter.Y - cup1NewCenter.Y);
+                            //        BoardInfo.ReleaseY = CurrentLabel.ActualWidth / 2 - 30;
+                            //        CupNewCenter = cup1NewCenter;
+                            //    }
+                            //}
+                            //else
+                            //{
+                            //    BoardInfo.Rotation = 90;
+                            //    var cup1NewCenter = new Point(Cup1Center.Y, -1 * (double)Cup1Center.X);  //旋转后的坐标
+                            //    CupNewCenter = cup1NewCenter;
+                            //    BoardInfo.CupCenter = new Point(BoardInfo.CupCenter.X - cup1NewCenter.X, BoardInfo.CupCenter.Y - cup1NewCenter.Y);
+                            //    BoardInfo.ReleaseY = CurrentLabel.ActualLength / 2 - 180;
+                            //}
                         }
                         else if (BoardInfo.CupIndex == 3)
                         {
-                            if (CenterX <= 600)
+                            if (isVer)
                             {
-                                if (CurrentLabel.ActualLength < CurrentLabel.ActualWidth)
+                                if (area == 2)
+                                {
+                                    BoardInfo.Rotation = 90;
+                                    var cup3NewCenter = new Point(Cup3Center.Y, -1 * (double)Cup3Center.X);  //旋转后的坐标
+                                    BoardInfo.CupCenter = new Point(BoardInfo.CupCenter.X - cup3NewCenter.X, BoardInfo.CupCenter.Y - cup3NewCenter.Y);
+                                    BoardInfo.ReleaseY = CurrentLabel.ActualWidth / 2 - 30;
+                                    CupNewCenter = cup3NewCenter;
+
+  
+                                }
+                                else if (area == 4)
                                 {
                                     BoardInfo.Rotation = -90;
-                                    var cup3NewCenter = new Point(Cup3Center.Y * -1, (double)Cup3Center.X);  //旋转后的坐标
+                                    var cup3NewCenter = new Point(-1 * Cup3Center.Y, (double)Cup3Center.X);  //旋转后的坐标
                                     BoardInfo.CupCenter = new Point(BoardInfo.CupCenter.X - cup3NewCenter.X, BoardInfo.CupCenter.Y - cup3NewCenter.Y);
+                                    BoardInfo.ReleaseY = CurrentLabel.ActualWidth / 2 - 30;
                                     CupNewCenter = cup3NewCenter;
                                 }
-                                //BoardInfo.ReleaseY = CurrentLabel.ActualWidth / 2;
-                                BoardInfo.ReleaseY = CurrentLabel.ActualLength / 2 - 180;
-                                //BoardInfo.ReleaseY = CurrentLabel.ActualWidth / 2 - 20;
                             }
                             else
                             {
-                                var cup3NewCenter = new Point(Cup3Center.X, (double)Cup3Center.Y);  //旋转后的坐标
-                                BoardInfo.CupCenter = new Point(BoardInfo.CupCenter.X - cup3NewCenter.X, BoardInfo.CupCenter.Y - cup3NewCenter.Y);
-                                //BoardInfo.ReleaseY = CurrentLabel.ActualWidth / 2 + 500;
-                                BoardInfo.ReleaseY = CurrentLabel.ActualWidth / 2 - 180;
-                                CupNewCenter = cup3NewCenter;
-                                //BoardInfo.ReleaseY = CurrentLabel.ActualWidth / 2 - 20;
+                                if (area == 1)
+                                {
+                                    var cup3NewCenter = new Point(Cup3Center.X, Cup3Center.Y);  //旋转后的坐标
+                                    BoardInfo.CupCenter = new Point(BoardInfo.CupCenter.X - cup3NewCenter.X, BoardInfo.CupCenter.Y - cup3NewCenter.Y);
+                                    BoardInfo.ReleaseY = CurrentLabel.ActualWidth / 2 - 30;
+                                    CupNewCenter = cup3NewCenter;
+
+                                }
+                                else if (area == 3)
+                                {
+                              
+
+                                    BoardInfo.Rotation = 180;
+                                    var cup3NewCenter = new Point(-1 * Cup3Center.X, -1 * Cup3Center.Y);  //旋转后的坐标
+                                    BoardInfo.CupCenter = new Point(BoardInfo.CupCenter.X - cup3NewCenter.X, BoardInfo.CupCenter.Y - cup3NewCenter.Y);
+                                    BoardInfo.ReleaseY = CurrentLabel.ActualWidth / 2 - 30;
+                                    CupNewCenter = cup3NewCenter;
+
+                       
+                                }
                             }
-                        }
-                        else
-                        {
-                            //BoardInfo.ReleaseY = CurrentLabel.ActualWidth / 2;
+
                         }
 
                     }