예제 #1
0
        private static void OnlinCalculatePosition(List <LableCode> lcs, LableCode lc, int state)
        {
            if (lc == null)
            {
                throw new Exception($"{nameof(OnlinCalculatePosition)}, lc is null.");
            }

            var z = lc.Floor == 1 ? clsSetting.InitHeigh : LableCode.GetFloorMaxDiameter(lc.PanelNo, lc.Floor) - (lc.Floor * 5);
            var r = clsSetting.OddTurn ?
                    (lc.Floor % 2 == 1 ? 0 : 90) : //奇数层横放
                    (lc.Floor % 2 == 1 ? 90 : 0);  //偶数层横放

            var xory = CalculateXory(lcs, lc);

            xory = OffsetSideLastRollXory(state, lc, xory);

            //z,r,x/y
            lc.Coordinates = string.Format("{0},{1},{2}", z, r, xory);
            lc.Cx          = r == 0 ? 0 : xory;
            lc.Cy          = r == 0 ? xory : 0;
            lc.Cz          = z;
            lc.Crz         = r;
        }