几何尺寸与公差论坛

 找回密码
 注册
查看: 468|回复: 3

Json长度不够怎么修改表里字段的长度?

  [复制链接]
发表于 2023-2-9 19:43:03 | 显示全部楼层 |阅读模式
using SqlSugar;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            // 创建数据库连接
            using (var db = new SqlSugarClient(new ConnectionConfig()
            {
                ConnectionString = "Data Source=(local);Initial Catalog=test;User ID=saassword=123456;",
                DbType = DbType.SqlServer,
                IsAutoCloseConnection = true
            }))
            {
                // 修改表中列的长度
                db.Ado.ExecuteCommand("ALTER TABLE JsonData ALTER COLUMN Json NVARCHAR(MAX)");
            }
        }
    }
}
 楼主| 发表于 2023-2-9 20:37:55 | 显示全部楼层
continue, please write c# code sample.
using Cognex.VisionPro;
using Cognex.VisionPro.CalibFix;

namespace WaferAlignment
{
    class Program
    {
        static void Main(string[] args)
        {
            // Load the VisionPro library and create an instance of the CogAcqFifo class
            CogAcqFifo cogAcqFifo = new CogAcqFifo();

            // Set the image acquisition parameters
            cogAcqFifo.OwnedVisionProTool = new CogAcqFifoTool();
            cogAcqFifo.OwnedVisionProTool.Operator.Open(CogAcqFifoConstants.AcqFifoImageAvailableEvent);

            // Acquire an image of the wafer and chuck
            cogAcqFifo.OwnedVisionProTool.Operator.OwnedImage.SetAcqSize(1024, 1024);
            cogAcqFifo.OwnedVisionProTool.Operator.OwnedImage.Start();
            cogAcqFifo.OwnedVisionProTool.Operator.OwnedImage.OwnedLiveDisplay.Show = true;

            // Process the image to determine the position of the wafer on the chuck
            CogImage8Grey image = cogAcqFifo.OwnedVisionProTool.Operator.OwnedImage;
            CogPointMarker pointMarker = new CogPointMarker();
            pointMarker.InputImage = image;
            pointMarker.Run();
            double waferX = pointMarker.Results.GetCogPoint().X;
            double waferY = pointMarker.Results.GetCogPoint().Y;

            // Calculate the deviation of the wafer from the desired position on the chuck
            double deviationX = desiredX - waferX;
            double deviationY = desiredY - waferY;

            // Use the motor control system integrated with VisionPro to move the chuck
            CogCalibFix calibFix = new CogCalibFix();
            calibFix.InputImage = image;
            calibFix.Operator.OwnedPositionerControl.Move(deviationX, deviationY);

            // Verify the alignment of the wafer
            cogAcqFifo.OwnedVisionProTool.Operator.OwnedImage.Start();
            pointMarker.InputImage = image;
            pointMarker.Run();
            double newWaferX = pointMarker.Results.GetCogPoint().X;
            double newWaferY = pointMarker.Results.GetCogPoint().Y;
            if (newWaferX == desiredX && newWaferY == desiredY)
            {
                Console.WriteLine("Wafer is aligned!");
            }
            else
            {
                Console.WriteLine("Wafer is not aligned.");
            }
        }
    }
}
Please note that this code is just a sample and may need to be modified based on the specific requirements of your application and the capabilities of your hardware. You may also need to consult the documentation and support resources provided by VisionPro to get a better understanding of how to implement these steps in your specific scenario.
 楼主| 发表于 2023-2-9 20:39:40 | 显示全部楼层
continue, what is pointMarker?
 楼主| 发表于 2023-2-9 20:40:07 | 显示全部楼层
In the code sample, pointMarker is an instance of the CogPointMarker class from the Cognex.VisionPro library. This class is used to identify a single point in an image and determine its position.

The pointMarker object is created and its InputImage property is set to the image of the wafer and chuck acquired using the CogAcqFifo class. The Run method is then called on the pointMarker object to process the image and identify the position of the wafer. The Results property of the pointMarker object is used to get the CogPoint object, which represents the position of the wafer in the image. The X and Y properties of the CogPoint object are used to calculate the deviation of the wafer from the desired position on the chuck.

The pointMarker object is also used again after the chuck is moved to verify the alignment of the wafer. The Run method is called on the pointMarker object to process the new image and determine the new position of the wafer. The X and Y properties of the CogPoint object are compared to the desired position to check if the wafer is aligned.
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|小黑屋|几何尺寸与公差论坛

GMT+8, 2024-12-22 13:08 , Processed in 0.038408 second(s), 21 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表