Beispiel #1
0
        public override string ToString()
        {
            var ci = System.Globalization.CultureInfo.InvariantCulture;

            return(string.Format("{{ CenterX={0}, CenterY={1}, Width={2}, Height={3}, Angle={4} }}",
                                 CenterX.ToString("r", ci), CenterY.ToString("r", ci),
                                 Width.ToString("r", ci), Height.ToString("r", ci),
                                 Angle.ToString("r", ci)));
        }
Beispiel #2
0
        public override void DrawControls()
        {
            Name      = "Rectangle";
            rectColor = EditorGUILayout.ColorField("Color", rectColor);
            CenterX   = float.Parse(EditorGUILayout.TextField("X Position", CenterX.ToString()));
            CenterY   = float.Parse(EditorGUILayout.TextField("Y Position", CenterY.ToString()));
            Width     = float.Parse(EditorGUILayout.TextField("Width", Width.ToString()));
            Height    = float.Parse(EditorGUILayout.TextField("Height", Height.ToString()));


            base.DrawControls();
        }
Beispiel #3
0
        public override void DrawControls()
        {
            Name         = "RoundedRect";
            rectColor    = EditorGUILayout.ColorField("Color", rectColor);
            CenterX      = float.Parse(EditorGUILayout.TextField("X Position", CenterX.ToString()));
            CenterY      = float.Parse(EditorGUILayout.TextField("Y Position", CenterY.ToString()));
            Width        = float.Parse(EditorGUILayout.TextField("Width", Width.ToString()));
            Height       = float.Parse(EditorGUILayout.TextField("Height", Height.ToString()));
            CornerRadius = float.Parse(EditorGUILayout.TextField("Corner Radius", CornerRadius.ToString()));
            Smoothness   = float.Parse(EditorGUILayout.TextField("Smoothness", Smoothness.ToString()));


            base.DrawControls();
        }
Beispiel #4
0
        private void WindowRefresh_Tick(object sender, EventArgs e)
        {
            this.either_Light.LeftPress = GlobalVar.c_Modbus.Coils.CCDLightStatus.Value;  //相机光源
            this.either_Press.LeftPress = !GlobalVar.c_Modbus.Coils.Cylinder12.Value;     //相机汽缸

            double RealLocation = 0d;                                                     //Y轴实际位置

            RealLocation  = GlobalVar.c_Modbus.HoldingRegisters.AxisY_RealLocation.Value; //Y轴实际位置
            RealLocation /= GlobalVar.ConverRate;                                         //Y轴实际位置
            this.label_RealLocation.Text = string.Format("当前位置:{0}", RealLocation.ToString("#0.00"));
            RealLocation  = GlobalVar.c_Modbus.HoldingRegisters.CCD_RealLocation.Value;   //CCD轴实际位置[2018.4.16 lqz]
            RealLocation *= GlobalVar.ConverRate_CCD;                                     //CCD轴实际位置
            this.label_RealLocation_CCD.Text = string.Format("当前位置:{0}", RealLocation.ToString("#0.00"));

            try
            {
                if (!this.AutoFind || ShowBitmap.Count == 0)
                {
                    return;
                }
                Bitmap bitmap = ShowBitmap[0];
                GlobalVar.FindModel.ShapeFind(ref bitmap);
                EFoundPattern[] positioninfo = GlobalVar.FindModel.m_FindResult;
                //DrawMatchResult(positioninfo);
                this.pictureBox_CCD.Image = bitmap;
                this.pictureBox_CCD.Update();

                if (ShowBitmap.Count > 0)
                {
                    ShowBitmap.RemoveAt(0);
                }

                if (positioninfo.Length > 0)
                {
                    score   = positioninfo[0].Score;
                    CenterX = positioninfo[0].Center.X;
                    CenterY = positioninfo[0].Center.Y;
                    UpdateText(CenterX.ToString("#.000"), CenterY.ToString("#.000"), (score * 100).ToString("#.0"));
                }
                else
                {
                    ShowBitmap.Clear();
                    UpdateText("---", "---", "--");
                }
            }
            catch (Exception ex) { Console.WriteLine("Grab Image err:" + ex.Message); }
            finally
            { GC.Collect(); }
        }
        public override void WriteGroupCodes()
        {
            WriteGroupCodeValue(2, ViewportName.Trim());

            WriteGroupCodeValue(10, LowerLeftX.ToString().Trim());
            WriteGroupCodeValue(20, LowerLeftY.ToString().Trim());

            WriteGroupCodeValue(11, UpperRightX.ToString().Trim());
            WriteGroupCodeValue(21, UpperRightY.ToString().Trim());

            WriteGroupCodeValue(12, CenterX.ToString().Trim());
            WriteGroupCodeValue(22, CenterY.ToString().Trim());

            WriteGroupCodeValue(13, SnapBaseX.ToString().Trim());
            WriteGroupCodeValue(23, SnapBaseY.ToString().Trim());

            WriteGroupCodeValue(14, SnapSpacingX.ToString().Trim());
            WriteGroupCodeValue(24, SnapSpacingY.ToString().Trim());

            WriteGroupCodeValue(15, GridSpacingX.ToString().Trim());
            WriteGroupCodeValue(25, GridSpacingY.ToString().Trim());

            WriteGroupCodeValue(16, ViewDirectionX.ToString().Trim());
            WriteGroupCodeValue(26, ViewDirectionY.ToString().Trim());
            WriteGroupCodeValue(36, ViewDirectionZ.ToString().Trim());

            WriteGroupCodeValue(17, ViewTargetX.ToString().Trim());
            WriteGroupCodeValue(27, ViewTargetY.ToString().Trim());
            WriteGroupCodeValue(37, ViewTargetZ.ToString().Trim());

            WriteGroupCodeValue(40, ViewHeight.ToString().Trim());

            WriteGroupCodeValue(41, ViewportAspectRatio.ToString().Trim());

            WriteGroupCodeValue(42, LensLength.ToString().Trim());

            WriteGroupCodeValue(43, FrontClippingPlaneOffset.ToString().Trim());
            WriteGroupCodeValue(44, BackClippingPlaneOffset.ToString().Trim());

            WriteGroupCodeValue(50, SnapRotationAngle.ToString().Trim());

            WriteGroupCodeValue(51, TwistAngle.ToString().Trim());

            WriteGroupCodeValue(70, GetStandardFlags().ToString().Trim());
        }
Beispiel #6
0
 /// <summary>
 /// Returns a <see cref="System.String" /> that represents this instance.
 /// </summary>
 /// <returns>
 /// A <see cref="System.String" /> that represents this instance.
 /// </returns>
 public override string ToString()
 {
     return('(' + CenterX.ToString() + ',' + CenterY.ToString() + ';' + Radius.ToString() + ')');
 }
Beispiel #7
0
 public string ToString(string format, IFormatProvider provider)
 {
     return($"CenterX={CenterX.ToString(format, provider)} CenterY={CenterY.ToString(format, provider)} RadiusX={RadiusX.ToString(format, provider)} RadiusY={RadiusY.ToString(format, provider)}");
 }
Beispiel #8
0
 public override string ToString()
 {
     return(CenterX.ToString() + ", " + CenterY.ToString() + ", " + SizeX.ToString() + ", " + SizeY.ToString() + ", " +
            NodeIndex.ToString() + ", " + NodeCount.ToString() + ", " + Short7.ToString() + ", " + Short8.ToString() + ", " +
            FloatUtil.ToString(Float1) + ", " + Byte1.ToString() + ", " + Byte2.ToString() + ", " + Byte3.ToString() + ", " + Byte4.ToString());
 }