diff --git a/MasstransferCommon/Model/Atrributes/Hide.cs b/MasstransferCommon/Model/Atrributes/Hide.cs new file mode 100644 index 0000000..bb67547 --- /dev/null +++ b/MasstransferCommon/Model/Atrributes/Hide.cs @@ -0,0 +1,6 @@ +namespace MasstransferCommon.Model.Atrributes; + +[AttributeUsage(AttributeTargets.Property)] +public class Hide : Attribute +{ +} \ No newline at end of file diff --git a/MasstransferCommon/Model/Atrributes/Property.cs b/MasstransferCommon/Model/Atrributes/Property.cs new file mode 100644 index 0000000..9d21fa4 --- /dev/null +++ b/MasstransferCommon/Model/Atrributes/Property.cs @@ -0,0 +1,30 @@ +namespace MasstransferCommon.Model.Atrributes; + +[AttributeUsage(AttributeTargets.Property)] +public class Property : Attribute +{ + public bool IsReadOnly { get; set; } = false; + + // 字符串格式 + public string? Format { get; set; } + + // 显示控件的宽 + public double Width { get; set; } + + // 显示控件的高 + public double Height { get; set; } + + public double Max { get; set; } + + public double Min { get; set; } + + public string Group { get; set; } + + public bool IsPassword { get; set; } + + public string Variable { get; set; } + + public int Axis { get; set; } = -1; + + public int Index { get; set; } = -1; +} \ No newline at end of file diff --git a/MasstransferCommon/Model/Enum/AltimetryStrategyEnum.cs b/MasstransferCommon/Model/Enum/AltimetryStrategyEnum.cs new file mode 100644 index 0000000..96ef80a --- /dev/null +++ b/MasstransferCommon/Model/Enum/AltimetryStrategyEnum.cs @@ -0,0 +1,9 @@ +using System.ComponentModel; + +namespace MasstransferCommon.Model.Enum; + +public enum AltimetryStrategyEnum +{ + [Description("按面积")] ByArea = 1, + [Description("按坐标")] ByCoordinate = 2 +} \ No newline at end of file diff --git a/MasstransferCommon/Model/Enum/ChipColorEnum.cs b/MasstransferCommon/Model/Enum/ChipColorEnum.cs new file mode 100644 index 0000000..d74b7bd --- /dev/null +++ b/MasstransferCommon/Model/Enum/ChipColorEnum.cs @@ -0,0 +1,8 @@ +namespace MasstransferCommon.Model.Enum; + +public enum ChipColorEnum +{ + R = 1, + G = 2, + B = 3 +} \ No newline at end of file diff --git a/MasstransferCommon/Model/Enum/DirectionEnum.cs b/MasstransferCommon/Model/Enum/DirectionEnum.cs new file mode 100644 index 0000000..c504aac --- /dev/null +++ b/MasstransferCommon/Model/Enum/DirectionEnum.cs @@ -0,0 +1,9 @@ +using System.ComponentModel; + +namespace MasstransferCommon.Model.Enum; + +public enum DirectionEnum +{ + [Description("行方向")] ROW = 1, + [Description("列方向")] COLUMN = 2, +} \ No newline at end of file diff --git a/MasstransferCommon/Model/Enum/GainAutoEnum.cs b/MasstransferCommon/Model/Enum/GainAutoEnum.cs new file mode 100644 index 0000000..2c3dfba --- /dev/null +++ b/MasstransferCommon/Model/Enum/GainAutoEnum.cs @@ -0,0 +1,8 @@ +namespace MasstransferCommon.Model.Enum; + +public enum GainAutoEnum +{ + Off, + Once, + Continuous +} \ No newline at end of file diff --git a/MasstransferCommon/Model/Enum/JobStateEnum.cs b/MasstransferCommon/Model/Enum/JobStateEnum.cs new file mode 100644 index 0000000..d1ddbe8 --- /dev/null +++ b/MasstransferCommon/Model/Enum/JobStateEnum.cs @@ -0,0 +1,19 @@ +using System.ComponentModel; + +namespace MasstransferCommon.Model.Enum; + +/// +/// 生产作业状态 +/// +public enum JobStateEnum +{ + [Description("待生产")] Waiting = 0, + + [Description("生产中")] Producing = 1, + + [Description("已完成")] Completed = 2, + + [Description("已取消")] Canceled = 3, + + [Description("生产异常")] Abnormal = 4, +} \ No newline at end of file diff --git a/MasstransferCommon/Model/Enum/LineModeEnum.cs b/MasstransferCommon/Model/Enum/LineModeEnum.cs new file mode 100644 index 0000000..d3a0fff --- /dev/null +++ b/MasstransferCommon/Model/Enum/LineModeEnum.cs @@ -0,0 +1,6 @@ +namespace MasstransferCommon.Model.Enum; + +public enum LineModeEnum +{ + Strobe +} \ No newline at end of file diff --git a/MasstransferCommon/Model/Enum/LineSelectorEnum.cs b/MasstransferCommon/Model/Enum/LineSelectorEnum.cs new file mode 100644 index 0000000..5f4718c --- /dev/null +++ b/MasstransferCommon/Model/Enum/LineSelectorEnum.cs @@ -0,0 +1,8 @@ +namespace MasstransferCommon.Model.Enum; + +public enum LineSelectorEnum +{ + Line0, + Line1, + Line2, +} \ No newline at end of file diff --git a/MasstransferCommon/Model/Enum/ScannerInterfaceEnum.cs b/MasstransferCommon/Model/Enum/ScannerInterfaceEnum.cs new file mode 100644 index 0000000..3846fa2 --- /dev/null +++ b/MasstransferCommon/Model/Enum/ScannerInterfaceEnum.cs @@ -0,0 +1,34 @@ +using System.ComponentModel; + +namespace MasstransferCommon.Model.Enum; + +/// +/// 扫码枪接口类型 +/// +public enum ScannerInterfaceEnum +{ + /// + /// 串口 + /// + [Description("串口")] Serial, + + /// + /// TCP + /// + [Description("网口")] Tcp, + + /// + /// USB + /// + [Description("USB")] Usb, + + /// + /// 蓝牙 + /// + [Description("蓝牙")] Bluetooth, + + /// + /// 无线 + /// + [Description("无线")] Wireless +} \ No newline at end of file diff --git a/MasstransferCommon/Model/Enum/TlsProtocolsEnum.cs b/MasstransferCommon/Model/Enum/TlsProtocolsEnum.cs new file mode 100644 index 0000000..36f3e81 --- /dev/null +++ b/MasstransferCommon/Model/Enum/TlsProtocolsEnum.cs @@ -0,0 +1,7 @@ +namespace MasstransferCommon.Model.Enum; + +public enum TlsProtocolsEnum +{ + TLS_1_2, + TLS_1_3 +} \ No newline at end of file diff --git a/MasstransferCommon/Model/Enum/TriggerActivationEnum.cs b/MasstransferCommon/Model/Enum/TriggerActivationEnum.cs new file mode 100644 index 0000000..530fd15 --- /dev/null +++ b/MasstransferCommon/Model/Enum/TriggerActivationEnum.cs @@ -0,0 +1,10 @@ +namespace MasstransferCommon.Model.Enum; + +public enum TriggerActivationEnum +{ + RisingEdge, + FallingEdge, + LevelHigh, + LevelLow, + AnyEdge +} \ No newline at end of file diff --git a/MasstransferCommon/Model/Enum/TriggerModeEnum.cs b/MasstransferCommon/Model/Enum/TriggerModeEnum.cs new file mode 100644 index 0000000..9071d2d --- /dev/null +++ b/MasstransferCommon/Model/Enum/TriggerModeEnum.cs @@ -0,0 +1,7 @@ +namespace MasstransferCommon.Model.Enum; + +public enum TriggerModeEnum +{ + Off, + On +} \ No newline at end of file diff --git a/MasstransferCommon/Model/Enum/TriggerSourceEnum.cs b/MasstransferCommon/Model/Enum/TriggerSourceEnum.cs new file mode 100644 index 0000000..ed243e7 --- /dev/null +++ b/MasstransferCommon/Model/Enum/TriggerSourceEnum.cs @@ -0,0 +1,10 @@ +namespace MasstransferCommon.Model.Enum; + +public enum TriggerSourceEnum +{ + Software, + Line0, + Line2, + Counter0, + Anyway +} \ No newline at end of file diff --git a/MasstransferExporter/DataExporter/FormulaService.cs b/MasstransferExporter/DataExporter/FormulaService.cs new file mode 100644 index 0000000..922c501 --- /dev/null +++ b/MasstransferExporter/DataExporter/FormulaService.cs @@ -0,0 +1,129 @@ +using MasstransferCommon.Model.Constant; +using MasstransferCommon.Utils; +using MasstransferCommunicate.Mqtt.Client; +using MasstransferCore.Model.Entity; +using MasstransferExporter.DataExporter.Model; +using MasstransferInfrastructure.Database.Sqlite; + +namespace MasstransferExporter.DataExporter; + +/// +/// 配方管理相关业务类 +/// +public class FormulaService +{ + private static readonly SqliteHelper Db = SqliteHelper.GetInstance(); + + /// + /// 获取所有的配方列表 + /// + /// + private static List GetAllFormulas() + { + var formulas = Db.ListAll(); + return BeanUtil.CopyProperties(formulas); + } + + /// + /// 根据配方id来获取配方信息 + /// + /// + /// + private static FormulaDTO GetFormulaById(string id) + { + var formula = Db.GetById(id); + var dto = BeanUtil.CopyProperties(formula); + dto.WorkBenchSetting = GetWorkBenchSettingByFormulaId(id) ?? new WorkBenchSetting(); + dto.WaferSetting = GetWaferSettingByFormulaId(id) ?? new WaferSetting(); + dto.PcbSetting = GetPcbSettingByFormulaId(id) ?? new PcbSetting(); + dto.NeedleSetting = GetNeedleSettingByFormulaId(id) ?? new NeedleSetting(); + dto.AltimetryParams = GetAltimetryParamsByFormulaId(id) ?? new AltimetryParams(); + dto.JobSetting = GetJobSettingByFormulaId(id) ?? new JobSetting(); + dto.AxisPositionParams = GetAxisPositionParamsByFormulaId(id) ?? new AxisPositionParams(); + dto.AlgorithmParams = GetAlgorithmParamsByFormulaId(id) ?? new AlgorithmParams(); + dto.AxisVariables = GetAxisVariablesByFormulaId(id) ?? new AxisVariables(); + return dto; + } + + private static NeedleSetting? GetNeedleSettingByFormulaId(string formulaId) + { + return Db.Query("select * from needle_settings where formulaId = ?", formulaId) + .FirstOrDefault(); + } + + private static WorkBenchSetting? GetWorkBenchSettingByFormulaId(string formulaId) + { + return Db.Query("select * from work_bench_settings where formulaId = ?", formulaId) + .FirstOrDefault(); + } + + private static PcbSetting? GetPcbSettingByFormulaId(string formulaId) + { + return Db.Query("select * from pcb_settings where formulaId = ?", formulaId).FirstOrDefault(); + } + + private static WaferSetting? GetWaferSettingByFormulaId(string formulaId) + { + return Db.Query("select * from wafer_settings where formulaId = ?", formulaId).FirstOrDefault(); + } + + + private static JobSetting? GetJobSettingByFormulaId(string formulaId) + { + return Db.Query("select * from job_settings where formulaId = ?", formulaId) + .FirstOrDefault(); + } + + private static AxisVariables? GetAxisVariablesByFormulaId(string formulaId) + { + return Db.Query("select * from axis_variables where formula_id = ?", formulaId) + .FirstOrDefault(); + } + + private static AxisPositionParams? GetAxisPositionParamsByFormulaId(string formulaId) + { + return Db.Query("select * from axis_position_params where formula_id = ?", formulaId) + .FirstOrDefault(); + } + + private static AlgorithmParams? GetAlgorithmParamsByFormulaId(string formulaId) + { + return Db.Query("select * from algorithm_params where formula_id = ?", formulaId) + .FirstOrDefault(); + } + + private static AltimetryParams? GetAltimetryParamsByFormulaId(string formulaId) + { + return Db.Query("select * from altimetry_params where formula_id = ?", formulaId) + .FirstOrDefault(); + } + + /// + /// 定时上报配方数据 + /// + public static async Task FormulaDataExporter() + { + try + { + var formulas = GetAllFormulas(); + + foreach (var formula in formulas) + { + var formulaDto = GetFormulaById(formula.Id); + if (formulaDto == null) continue; + var data = new ConfigData() + { + Name = formulaDto.Name, + Param = formulaDto, + Type = "formula" + }; + + await MessageQueueHelper.Publish(Topics.ReportConfigData, data); + } + } + catch (Exception e) + { + Console.WriteLine($"定时上报配方数据失败: {e}"); + } + } +} \ No newline at end of file diff --git a/MasstransferExporter/DataExporter/Model/AlgorithmParam.cs b/MasstransferExporter/DataExporter/Model/AlgorithmParam.cs new file mode 100644 index 0000000..5ba579c --- /dev/null +++ b/MasstransferExporter/DataExporter/Model/AlgorithmParam.cs @@ -0,0 +1,167 @@ +using System.ComponentModel; +using MasstransferCommon.Model.Atrributes; +using MasstransferCommon.Model.Entity; +using SQLite; + +namespace MasstransferExporter.DataExporter.Model; + +/// +/// 算法参数 +/// +[Table("algorithm_params")] +[Description("算法参数")] +public class AlgorithmParams : Entity +{ + [Column("formula_id"), Description("配方Id"), Hide] + public string FormulaId { get; set; } + + [Column("chip_detect_angle_start")] + [Description("芯片识别开始角度")] + public double ChipDetectAngleStart { get; set; } + + [Column("chip_detect_angle_extent")] + [Description("芯片识别角度范围")] + public double ChipDetectAngleExtent { get; set; } + + [Column("chip_max_angle")] + [Description("芯片识别最大角度")] + public double ChipMaxAngle { get; set; } + + [Column("chip_detect_min_score")] + [Description("芯片识别最小分数 eg:0.6")] + public double ChipDetectMinScore { get; set; } + + [Column("chip_detect_max_overlap")] + [Description("芯片识别最大重叠 eg:0.5")] + public double ChipDetectMaxOverlap { get; set; } + + [Column("chip_detect_greediness")] + [Description("芯片识别贪婪度 eg:0.9")] + public double ChipDetectGreediness { get; set; } + + [Column("solder_joint_chip_detect_angle_start")] + [Description("焊点识别 开始角度")] + public int SolderJointChipDetectAngleStart { get; set; } + + [Column("solder_joint_chip_detect_angle_extent")] + [Description("焊点识别 角度范围")] + public int SolderJointChipDetectAngleExtent { get; set; } + + [Column("solder_joint_chip_detect_min_score")] + [Description("焊点识别最小分数 eg:0.6")] + public double SolderJointChipDetectMinScore { get; set; } + + [Column("solder_joint_chip_detect_max_overlap")] + [Description("焊点识别贪婪度 eg:0.9")] + public double SolderJointChipDetectGreediness { get; set; } + + [Column("chip_amount_per_row")] + [Description("每行芯片数量")] + public int ChipAmountPerRow { get; set; } + + [Column("chip_padding_x")] + [Description("芯片坐标X轴补偿间距值"), Property(Format = "0.#######")] + public double ChipPaddingX { get; set; } + + [Column("chip_padding_y")] + [Description("芯片坐标Y轴补偿间距值"), Property(Format = "0.#######")] + public double ChipPaddingY { get; set; } + + [Column("chip_constant_x"), Property(Format = "0.#######")] + [Description("芯片坐标X轴补偿常量")] + public double ChipConstantX { get; set; } + + [Column("chip_constant_y")] + [Description("芯片坐标Y轴补偿常量"), Property(Format = "0.#######")] + public double ChipConstantY { get; set; } + + [Column("chip_constant_x_for_right2left")] + [Description("芯片从右到左方向动打补偿值")] + public double ChipConstantXForRight2Left { get; set; } + + [Column("chip_constant_x_for_left2_right")] + [Description("芯片从左到右方向动打补偿值")] + public double ChipConstantXForLeft2Right { get; set; } + + [Column("chip_multi_of_total_padding_x")] + [Description("芯片坐标X轴补偿间距值系数")] + public double ChipMultiOfTotalPaddingX { get; set; } + + [Column("chip_multi_of_total_padding_y")] + [Description("芯片坐标Y轴补偿间距值系数")] + public double ChipMultiOfTotalPaddingY { get; set; } + + [Column("pcb_diff_x_tolerance")] + [Description("PCB路径插补3点之间的距离差值容忍值")] + public double PcbDiffXTolerance { get; set; } + + [Column("chip_diff_x_tolerance")] + [Description("芯片路径插补3点之间的距离差值容忍值")] + public double ChipDiffXTolerance { get; set; } + + [Column("pcb_wrap_threshold")] + [Description("pcb路径换行逻辑的Y值阈值")] + public double PcbWrapThreshold { get; set; } + + [Column("chip_wrap_threshold")] + [Description("芯片路径换行逻辑的Y值阈值")] + public double ChipWrapThreshold { get; set; } + + [Column("interpolate_wrap_count")] + [Description("换行插点数")] + public int InterpolateWrapCount { get; set; } + + [Column("pcb_merge_similar_point_windows"), Description("PCB路径合并相似点窗口")] + public string PcbMergeSimilarPointWindows { get; set; } = "29,34"; + + [Column("chip_merge_similar_point_windows"), Description("芯片路径合并相似点窗口")] + public string ChipMergeSimilarPointWindows { get; set; } = "29,34"; + + [Column("pcb_row_similar_threshold"), Description("PCB路径行相似度阈值")] + public double PcbRowSimilarThreshold { get; set; } + + [Column("pcb_col_similar_threshold"), Description("PCB路径列相似度阈值")] + public double PcbColSimilarThreshold { get; set; } + + [Column("chip_row_similar_threshold"), Description("芯片路径行相似度阈值")] + public double ChipRowSimilarThreshold { get; set; } + + [Column("chip_col_similar_threshold"), Description("芯片路径列相似度阈值")] + public double ChipColSimilarThreshold { get; set; } + + [Column("skip_chips"), Description("跳过芯片数量")] + public int SkipChips { get; set; } + + [Column("bin_coordinate_transform_strategy"), Description("晶圆机构坐标转换策略,0:基于角度,1:基于矩阵")] + public int BinCoordinateTransformStrategy { get; set; } + + [Column("x_over_speed_distant_threshold"), Description("动打X方向导致加速度过大的3点之间距离差的阈值")] + public double XOverSpeedDistantThreshold { get; set; } + + [Column("y_over_speed_distant_threshold"), Description("动打Y方向导致加速度过大的3点之间距离差的阈值")] + public double YOverSpeedDistantThreshold { get; set; } + + [Column("from_right_Chip_offset_to_solder_joint_center"), Description("从右到左方向芯片对齐焊点中心需要增加的X偏移量")] + public double FromRightChipOffsetToSolderJointCenter { get; set; } + + [Column("from_left_Chip_offset_to_solder_joint_center"), Description("从左到右方向芯片对齐焊点中心需要增加的X偏移量")] + public double FromLeftChipOffsetToSolderJointCenter { get; set; } + + [Column("from_right_early_strike_offset"), Description("从右到左方向提前下针的X偏移量")] + public double FromRightEarlyStrikeOffset { get; set; } + + [Column("from_left_early_strike_offset"), Description("从左到右方向提前下针的X偏移量")] + public double FromLeftEarlyStrikeOffset { get; set; } + + [Column("chip_min_gray"), Description("芯片最小灰度值")] + public double ChipMinGray { get; set; } + + [Column("chip_max_gray"), Description("芯片最大灰度值")] + public double ChipMaxGray { get; set; } + + [Column("chip_min_area"), Description("芯片筛选最小面积")] + public double ChipMinArea { get; set; } + + [Column("chip_max_area"), Description("芯片筛选最大面积")] + public double ChipMaxArea { get; set; } +} \ No newline at end of file diff --git a/MasstransferExporter/DataExporter/Model/AltimetryParams.cs b/MasstransferExporter/DataExporter/Model/AltimetryParams.cs new file mode 100644 index 0000000..5d6ede7 --- /dev/null +++ b/MasstransferExporter/DataExporter/Model/AltimetryParams.cs @@ -0,0 +1,55 @@ +using System.ComponentModel; +using MasstransferCommon.Model.Entity; +using MasstransferCommon.Model.Enum; +using MasstransferCommon.Utils; +using SQLite; + +namespace MasstransferExporter.DataExporter.Model; + +/// +/// 测高参数 +/// +[Table("altimetry_params")] +[Description("测高参数")] +public class AltimetryParams : Entity +{ + [Column("formula_id"), Description("配方Id")] + public string FormulaId { get; set; } + + [Column("RowArea"), Description("针刺测高区域行数")] + public int RowArea { get; set; } + + [Column("ColumnArea"), Description("针刺测高区域列数")] + public int ColumnArea { get; set; } + + [Column(" altimetry_strategy"), Description("测高策略,1:按区域,2:按指定点位")] + public AltimetryStrategyEnum Strategy { get; set; } + + [Column("delta_height_of_plane"), Description("测高平面高度补偿值")] + public double DeltaHeightOfPlane { get; set; } + + [Column("first_point_per_row_delta_height"), Description("换行第一个点的补偿值")] + public double FirstPointPerRowDeltaHeight { get; set; } + + [Column("normal_delta_height"), Description("其他点补偿值")] + public double NormalDeltaHeight { get; set; } + + [Column("base_height"), Description("针刺测高基准高度")] + public double BaseHeight { get; set; } + + [Column("delta_base_height"), Description("第一个针刺测高值与基准高度的差值")] + public double DeltaBaseHeight { get; set; } + + [Column("p2p_delta"), Description("p2p的高度补偿")] + public double P2PDelta { get; set; } + + [Column("acupuncture_altimetry_coordinates_json"), Description("针刺测高坐标 eg: [[x1,y1],[x2,y2],[x3,y3]]")] + public string AcupunctureAltimetryCoordinatesJson { get; set; } + + [Ignore, Description("针刺测高坐标 eg: [[x1,y1],[x2,y2],[x3,y3]]")] + public double[][] AcupunctureAltimetryCoordinates + { + get => JsonUtil.FromJsonOrDefault(AcupunctureAltimetryCoordinatesJson); + set => AcupunctureAltimetryCoordinatesJson = JsonUtil.ToJson(value); + } +} \ No newline at end of file diff --git a/MasstransferExporter/DataExporter/Model/AxisPositionParams.cs b/MasstransferExporter/DataExporter/Model/AxisPositionParams.cs new file mode 100644 index 0000000..ce82f06 --- /dev/null +++ b/MasstransferExporter/DataExporter/Model/AxisPositionParams.cs @@ -0,0 +1,267 @@ +using System.ComponentModel; +using MasstransferCommon.Model.Atrributes; +using SQLite; + +namespace MasstransferCore.Model.Entity; + +/// +/// ACS 位置参数 +/// +[Table("axis_position_params"), Description("轴位置参数")] +public class AxisPositionParams : MasstransferCommon.Model.Entity.Entity +{ + [Column("formula_id"), Description("配方Id")] + public string FormulaId { get; set; } + + + [Column("wafer_y_manual_position"), Description("晶环龙门Y手动位置"), + Property(Group = "WaferY", Variable = "stAxisArPos", Axis = 0, Index = 0)] + public double WaferYManualPosition { get; set; } + + [Column("wafer_y_idle_position"), Description("晶环龙门Y待机位置"), + Property(Group = "WaferY", Variable = "stAxisArPos", Axis = 0, Index = 1)] + public double WaferYIdlePosition { get; set; } + + [Column("wafer_y_loading_position"), Description("晶环龙门Y换料位置"), + Property(Group = "WaferY", Variable = "stAxisArPos", Axis = 0, Index = 2)] + public double WaferYLoadingPosition { get; set; } + + [Column("wafer_y_camera_position"), Description("晶环龙门Y拍照位置"), + Property(Group = "WaferY", Variable = "stAxisArPos", Axis = 0, Index = 3)] + public double WaferYCameraPosition { get; set; } + + [Column("wafer_y_scanner_position"), Description("晶环龙门Y扫码位置"), + Property(Group = "WaferY", Variable = "stAxisArPos", Axis = 0, Index = 4)] + public double WaferYScannerPosition { get; set; } + + + [Column("needle_y_manual_position"), Description("针刺龙门Y手动位置"), + Property(Group = "NeedleY", Variable = "stAxisArPos", Axis = 2, Index = 0)] + public double NeedleYManualPosition { get; set; } + + [Column("needle_y_idle_position"), Description("针刺龙门Y待机位置"), + Property(Group = "NeedleY", Variable = "stAxisArPos", Axis = 2, Index = 1)] + public double NeedleYIdlePosition { get; set; } + + [Column("needle_y_camera_position"), Description("针刺龙门Y拍照位置"), + Property(Group = "NeedleY", Variable = "stAxisArPos", Axis = 2, Index = 2)] + public double NeedleYCameraPosition { get; set; } + + [Column("needle_y_scanner_position"), Description("针刺龙门Y扫码位置"), + Property(Group = "NeedleY", Variable = "stAxisArPos", Axis = 2, Index = 3)] + public double NeedleYScannerPosition { get; set; } + + + [Column("wafer_x_manual_position"), Description("晶环龙门X手动位置"), + Property(Group = "WaferX", Variable = "stAxisArPos", Axis = 4, Index = 0)] + public double WaferXManualPosition { get; set; } + + [Column("wafer_x_idle_position"), Description("晶环龙门X待机位置"), + Property(Group = "WaferX", Variable = "stAxisArPos", Axis = 4, Index = 1)] + public double WaferXIdlePosition { get; set; } + + [Column("wafer_x_loading_position"), Description("晶环龙门X换料位置"), + Property(Group = "WaferX", Variable = "stAxisArPos", Axis = 4, Index = 2)] + public double WaferXLoadingPosition { get; set; } + + [Column("wafer_x_camera_position"), Description("晶环龙门X拍照位置"), + Property(Group = "WaferX", Variable = "stAxisArPos", Axis = 4, Index = 3)] + public double WaferXCameraPosition { get; set; } + + [Column("wafer_x_scanner_position"), Description("晶环龙门X扫码位置"), + Property(Group = "WaferX", Variable = "stAxisArPos", Axis = 4, Index = 4)] + public double WaferXScannerPosition { get; set; } + + + [Column("needle_x_manual_position"), Description("针刺龙门X手动位置"), + Property(Group = "NeedleX", Variable = "stAxisArPos", Axis = 5, Index = 0)] + public double NeedleXManualPosition { get; set; } + + [Column("needle_x_idle_position"), Description("针刺龙门X待机位置"), + Property(Group = "NeedleX", Variable = "stAxisArPos", Axis = 5, Index = 1)] + public double NeedleXIdlePosition { get; set; } + + [Column("needle_x_camera_position"), Description("针刺龙门X拍照位置"), + Property(Group = "NeedleX", Variable = "stAxisArPos", Axis = 5, Index = 2)] + public double NeedleXCameraPosition { get; set; } + + + [Column("wafer_x_2_manual_position"), Description("晶环龙门X_2手动位置"), + Property(Group = "WaferX", Variable = "stAxisArPos", Axis = 6, Index = 0)] + public double WaferX2ManualPosition { get; set; } + + [Column("wafer_x2_idle_position"), Description("晶环龙门X_2待机位置"), + Property(Group = "WaferX", Variable = "stAxisArPos", Axis = 6, Index = 1)] + public double WaferX2IdlePosition { get; set; } + + + [Column("needle_x2_manual_position"), Description("针刺龙门X_2手动位置"), + Property(Group = "NeedleX", Variable = "stAxisArPos", Axis = 7, Index = 0)] + public double NeedleX2ManualPosition { get; set; } + + [Column("needle_x2_idle_position"), Description("针刺龙门X_2待机位置"), + Property(Group = "NeedleX", Variable = "stAxisArPos", Axis = 7, Index = 1)] + public double NeedleX2IdlePosition { get; set; } + + + [Column("needle_z_motor_manual_position"), Description("针刺音圈Z手动位置"), + Property(Group = "NeedleZ", Variable = "stAxisArPos", Axis = 8, Index = 0)] + public double NeedleZMotorManualPosition { get; set; } + + [Column("needle_z_motor_idle_position"), Description("针刺音圈Z待机位置"), + Property(Group = "NeedleZ", Variable = "stAxisArPos", Axis = 8, Index = 1)] + public double NeedleZMotorIdlePosition { get; set; } + + [Column("needle_z_motor_job_position"), Description("针刺音圈Z打晶抬升位置"), + Property(Group = "NeedleZ", Variable = "stAxisArPos", Axis = 8, Index = 2)] + public double NeedleZMotorJobPosition { get; set; } + + + [Column("needle_z_servo_manual_position"), Description("针刺伺服Z手动位置"), + Property(Group = "NeedleZ", Variable = "stAxisArPos", Axis = 9, Index = 0)] + public double NeedleZServoManualPosition { get; set; } + + [Column("needle_z_servo_idle_position"), Description("针刺伺服Z待机位置"), + Property(Group = "NeedleZ", Variable = "stAxisArPos", Axis = 9, Index = 1)] + public double NeedleZServoIdlePosition { get; set; } + + [Column("needle_z_servo_pcb_camera_position"), Description("针刺伺服Z基板拍照位"), + Property(Group = "NeedleZ", Variable = "stAxisArPos", Axis = 9, Index = 2)] + public double NeedleZServoPcbCameraPosition { get; set; } + + [Column("needle_z_servo_wafer_camera_position"), Description("针刺伺服Z芯片拍照位"), + Property(Group = "NeedleZ", Variable = "stAxisArPos", Axis = 9, Index = 3)] + public double NeedleZServoWaferCameraPosition { get; set; } + + [Column("needle_z_servo_job_position"), Description("针刺伺服Z打晶位置"), + Property(Group = "NeedleZ", Variable = "stAxisArPos", Axis = 9, Index = 4)] + public double NeedleZServoJobPosition { get; set; } + + + [Column("wafer_z_servo_manual_position"), Description("晶环升降伺服Z手动位置"), + Property(Group = "WaferLoading", Variable = "stAxisArPos", Axis = 10, Index = 0)] + public double WaferZServoManualPosition { get; set; } + + [Column("wafer_z_servo_idle_position"), Description("晶环升降伺服Z待机位置"), + Property(Group = "WaferLoading", Variable = "stAxisArPos", Axis = 10, Index = 1)] + public double WaferZServoIdlePosition { get; set; } + + [Column("wafer_rotate_servo_manual_position"), Description("晶环旋转伺服手动位置"), + Property(Group = "WaferLoading", Variable = "stAxisArPos", Axis = 11, Index = 0)] + public double WaferRotateServoManualPosition { get; set; } + + [Column("wafer_rotate_servo_idle_position"), Description("晶环旋转伺服待机位置"), + Property(Group = "WaferLoading", Variable = "stAxisArPos", Axis = 11, Index = 1)] + public double WaferRotateServoIdlePosition { get; set; } + + [Column("wafer_rotate_servo_origin_position"), Description("晶环旋转伺服相对原点位置"), + Property(Group = "WaferLoading", Variable = "stAxisArPos", Axis = 11, Index = 2)] + public double WaferRotateServoOriginPosition { get; set; } + + + [Column("wafer_z_servo_loading_manual_position"), Description("晶环换料升降伺服手动位置"), + Property(Group = "WaferLoading", Variable = "stAxisArPos", Axis = 12, Index = 0)] + public double WaferZServoLoadingManualPosition { get; set; } + + [Column("wafer_z_servo_loading_idle_position"), Description("晶环换料升降伺服待机位置"), + Property(Group = "WaferLoading", Variable = "stAxisArPos", Axis = 12, Index = 1)] + public double WaferZServoLoadingIdlePosition { get; set; } + + [Column("wafer_z_servo_relate_wafer_rotate_servo_loading_idle_position"), Description("晶环换料升降伺服晶环旋转端换料位置"), + Property(Group = "WaferLoading", Variable = "stAxisArPos", Axis = 12, Index = 2)] + public double WaferZServoRelateWaferRotateServoLoadingIdlePosition { get; set; } + + [Column("wafer_z_servo_to_wafer_box1_position"), Description("晶环换料升降伺服晶环料盒1层位置"), + Property(Group = "WaferLoading", Variable = "stAxisArPos", Axis = 12, Index = 3)] + public double WaferZServoToWaferBox1Position { get; set; } + + [Column("wafer_z_servo_to_wafer_box2_position"), Description("晶环换料升降伺服晶环料盒2层位置"), + Property(Group = "WaferLoading", Variable = "stAxisArPos", Axis = 12, Index = 4)] + public double WaferZServoToWaferBox2Position { get; set; } + + [Column("wafer_z_servo_to_wafer_box3_position"), Description("晶环换料升降伺服晶环料盒3层位置"), + Property(Group = "WaferLoading", Variable = "stAxisArPos", Axis = 12, Index = 5)] + public double WaferZServoToWaferBox3Position { get; set; } + + [Column("wafer_z_servo_to_wafer_box4_position"), Description("晶环换料升降伺服晶环料盒4层位置"), + Property(Group = "WaferLoading", Variable = "stAxisArPos", Axis = 12, Index = 6)] + public double WaferZServoToWaferBox4Position { get; set; } + + [Column("wafer_z_servo_to_wafer_box5_position"), Description("晶环换料升降伺服晶环料盒5层位置"), + Property(Group = "WaferLoading", Variable = "stAxisArPos", Axis = 12, Index = 7)] + public double WaferZServoToWaferBox5Position { get; set; } + + [Column("wafer_z_servo_to_wafer_box6_position"), Description("晶环换料升降伺服晶环料盒6层位置"), + Property(Group = "WaferLoading", Variable = "stAxisArPos", Axis = 12, Index = 8)] + public double WaferZServoToWaferBox6Position { get; set; } + + [Column("wafer_z_servo_to_wafer_box7_position"), Description("晶环换料升降伺服晶环料盒7层位置"), + Property(Group = "WaferLoading", Variable = "stAxisArPos", Axis = 12, Index = 9)] + public double WaferZServoToWaferBox7Position { get; set; } + + [Column("wafer_z_servo_to_wafer_box8_position"), Description("晶环换料升降伺服晶环料盒8层位置"), + Property(Group = "WaferLoading", Variable = "stAxisArPos", Axis = 12, Index = 10)] + public double WaferZServoToWaferBox8Position { get; set; } + + [Column("wafer_z_servo_to_wafer_box9_position"), Description("晶环换料升降伺服晶环料盒9层位置"), + Property(Group = "WaferLoading", Variable = "stAxisArPos", Axis = 12, Index = 11)] + public double WaferZServoToWaferBox9Position { get; set; } + + [Column("wafer_z_servo_to_wafer_box10_position"), Description("晶环换料升降伺服晶环料盒10层位置"), + Property(Group = "WaferLoading", Variable = "stAxisArPos", Axis = 12, Index = 12)] + public double WaferZServoToWaferBox10Position { get; set; } + + [Column("wafer_translation_servo_loading_manual_position"), Description("晶环换料平移伺服手动位置"), + Property(Group = "WaferLoading", Variable = "stAxisArPos", Axis = 13, Index = 0)] + public double WaferTranslationServoLoadingManualPosition { get; set; } + + [Column("wafer_translation_servo_loading_idle_position"), Description("晶环换料平移伺服待机位置"), + Property(Group = "WaferLoading", Variable = "stAxisArPos", Axis = 13, Index = 1)] + public double WaferTranslationServoLoadingIdlePosition { get; set; } + + + [Column("wafer_translation_servo_relate_wafer_rotate_servo_loading_idle_position"), + Description("晶环换料平移伺服晶环旋转端换料位置"), + Property(Group = "WaferLoading", Variable = "stAxisArPos", Axis = 13, Index = 2)] + public double WaferTranslationServoRelateWaferRotateServoLoadingIdlePosition { get; set; } + + [Column("wafer_translation_servo_to_wafer_box1_position"), Description("晶环换料平移伺服晶环料盒1层位置"), + Property(Group = "WaferLoading", Variable = "stAxisArPos", Axis = 13, Index = 3)] + public double WaferTranslationServoToWaferBox1Position { get; set; } + + [Column("wafer_translation_servo_to_wafer_box2_position"), Description("晶环换料平移伺服晶环料盒2层位置"), + Property(Group = "WaferLoading", Variable = "stAxisArPos", Axis = 13, Index = 4)] + public double WaferTranslationServoToWaferBox2Position { get; set; } + + [Column("wafer_translation_servo_to_wafer_box3_position"), Description("晶环换料平移伺服晶环料盒3层位置"), + Property(Group = "WaferLoading", Variable = "stAxisArPos", Axis = 13, Index = 5)] + public double WaferTranslationServoToWaferBox3Position { get; set; } + + [Column("wafer_translation_servo_to_wafer_box4_position"), Description("晶环换料平移伺服晶环料盒4层位置"), + Property(Group = "WaferLoading", Variable = "stAxisArPos", Axis = 13, Index = 6)] + public double WaferTranslationServoToWaferBox4Position { get; set; } + + [Column("wafer_translation_servo_to_wafer_box5_position"), Description("晶环换料平移伺服晶环料盒5层位置"), + Property(Group = "WaferLoading", Variable = "stAxisArPos", Axis = 13, Index = 7)] + public double WaferTranslationServoToWaferBox5Position { get; set; } + + [Column("wafer_translation_servo_to_wafer_box6_position"), Description("晶环换料平移伺服晶环料盒6层位置"), + Property(Group = "WaferLoading", Variable = "stAxisArPos", Axis = 13, Index = 8)] + public double WaferTranslationServoToWaferBox6Position { get; set; } + + [Column("wafer_translation_servo_to_wafer_box7_position"), Description("晶环换料平移伺服晶环料盒7层位置"), + Property(Group = "WaferLoading", Variable = "stAxisArPos", Axis = 13, Index = 9)] + public double WaferTranslationServoToWaferBox7Position { get; set; } + + [Column("wafer_translation_servo_to_wafer_box8_position"), Description("晶环换料平移伺服晶环料盒8层位置"), + Property(Group = "WaferLoading", Variable = "stAxisArPos", Axis = 13, Index = 10)] + public double WaferTranslationServoToWaferBox8Position { get; set; } + + [Column("wafer_translation_servo_to_wafer_box9_position"), Description("晶环换料平移伺服晶环料盒9层位置"), + Property(Group = "WaferLoading", Variable = "stAxisArPos", Axis = 13, Index = 11)] + public double WaferTranslationServoToWaferBox9Position { get; set; } + + [Column("wafer_translation_servo_to_wafer_box10_position"), Description("晶环换料平移伺服晶环料盒10层位置"), + Property(Group = "WaferLoading", Variable = "stAxisArPos", Axis = 13, Index = 12)] + public double WaferTranslationServoToWaferBox10Position { get; set; } +} \ No newline at end of file diff --git a/MasstransferExporter/DataExporter/Model/AxisVariables.cs b/MasstransferExporter/DataExporter/Model/AxisVariables.cs new file mode 100644 index 0000000..3fbd2d8 --- /dev/null +++ b/MasstransferExporter/DataExporter/Model/AxisVariables.cs @@ -0,0 +1,380 @@ +using System.ComponentModel; +using MasstransferCommon.Model.Atrributes; +using MasstransferCommon.Model.Entity; +using SQLite; + +namespace MasstransferExporter.DataExporter.Model; + +/// +/// 轴变量参数 +/// +[Table("axis_variables"), Description("轴变量")] +public class AxisVariables : Entity +{ + [Column("formula_id"), Description("配方Id")] + public string FormulaId { get; set; } + + [Column("needle_z_job_compensation"), Description("针刺Z轴工作补偿")] + public double NeedleZJobCompensation { get; set; } + + [Column("needle_x_1_flying_trigger_velocity"), Description("针刺X轴飞拍速度")] + public double NeedleX1FlyingTriggerVelocity { get; set; } + + [Column("job_frequency"), Description("动打频率")] + public int JobFrequency { get; set; } + + [Column("wafer_y_auto_velocity"), Description("晶圆Y轴自动速度")] + public int WaferYAutoVelocity { get; set; } + + [Column("wafer_y_auto_acceleration"), Description("晶圆Y轴自动加速度")] + public int WaferYAutoAcceleration { get; set; } + + [Column("wafer_y_auto_deceleration"), Description("晶圆Y轴自动减速度")] + public int WaferYAutoDeceleration { get; set; } + + [Column("wafer_y_auto_jerk"), Description("晶圆Y轴自动加加速度")] + public int WaferYAutoJerk { get; set; } + + [Column("wafer_y_reset_velocity"), Description("晶圆Y轴回原速度")] + public int WaferYResetVelocity { get; set; } + + [Column("wafer_y_reset_acceleration"), Description("晶圆Y轴回原加速度")] + public int WaferYResetAcceleration { get; set; } + + [Column("wafer_y_reset_deceleration"), Description("晶圆Y轴回原减速度")] + public int WaferYResetDeceleration { get; set; } + + [Column("wafer_y_reset_jerk"), Description("晶圆Y轴回原加加速度")] + public int WaferYResetJerk { get; set; } + + [Column("needle_y_auto_velocity"), Description("针刺Y轴自动速度")] + public int NeedleYAutoVelocity { get; set; } + + [Column("needle_y_auto_acceleration"), Description("针刺Y轴自动加速度")] + public int NeedleYAutoAcceleration { get; set; } + + [Column("needle_y_auto_deceleration"), Description("针刺Y轴自动减速度")] + public int NeedleYAutoDeceleration { get; set; } + + [Column("needle_y_auto_jerk"), Description("针刺Y轴自动加加速度")] + public int NeedleYAutoJerk { get; set; } + + [Column("needle_y_reset_velocity"), Description("针刺Y轴回原速度")] + public int NeedleYResetVelocity { get; set; } + + [Column("needle_y_reset_acceleration"), Description("针刺Y轴回原加速度")] + public int NeedleYResetAcceleration { get; set; } + + [Column("needle_y_reset_deceleration"), Description("针刺Y轴回原减速度")] + public int NeedleYResetDeceleration { get; set; } + + [Column("needle_y_reset_jerk"), Description("针刺Y轴回原加加速度")] + public int NeedleYResetJerk { get; set; } + + [Column("wafer_x_auto_velocity"), Description("晶圆X轴自动速度")] + public int WaferXAutoVelocity { get; set; } + + [Column("wafer_x_auto_acceleration"), Description("晶圆X轴自动加速度")] + public int WaferXAutoAcceleration { get; set; } + + [Column("wafer_x_auto_deceleration"), Description("晶圆X轴自动减速度")] + public int WaferXAutoDeceleration { get; set; } + + [Column("wafer_x_auto_jerk"), Description("晶圆X轴自动加加速度")] + public int WaferXAutoJerk { get; set; } + + [Column("wafer_x_reset_velocity"), Description("晶圆X回原速度")] + public int WaferXResetVelocity { get; set; } + + [Column("wafer_x_reset_acceleration"), Description("晶圆X轴回原加速度")] + public int WaferXResetAcceleration { get; set; } + + [Column("wafer_x_reset_deceleration"), Description("晶圆X轴回原减速度")] + public int WaferXResetDeceleration { get; set; } + + [Column("wafer_x_reset_jerk"), Description("晶圆X轴回原加加速度")] + public int WaferXResetJerk { get; set; } + + [Column("needle_x_auto_velocity"), Description("针刺X轴自动速度")] + public int NeedleXAutoVelocity { get; set; } + + [Column("needle_x_auto_acceleration"), Description("针刺X轴自动加速度")] + public int NeedleXAutoAcceleration { get; set; } + + [Column("needle_x_auto_deceleration"), Description("针刺X轴自动减速度")] + public int NeedleXAutoDeceleration { get; set; } + + [Column("needle_x_auto_jerk"), Description("针刺X轴自动加加速度")] + public int NeedleXAutoJerk { get; set; } + + + [Column("needle_x_reset_velocity"), Description("针刺X回原速度")] + public int NeedleXResetVelocity { get; set; } + + [Column("needle_x_reset_acceleration"), Description("针刺X轴回原加速度")] + public int NeedleXResetAcceleration { get; set; } + + [Column("needle_x_reset_deceleration"), Description("针刺X轴回原减速度")] + public int NeedleXResetDeceleration { get; set; } + + [Column("needle_x_reset_jerk"), Description("针刺X轴回原加加速度")] + public int NeedleXResetJerk { get; set; } + + [Column("wafer_x2_auto_velocity"), Description("晶圆X2轴自动速度"), + Property(Group = "WaferX", Variable = "axisVel", Axis = 6, Index = 0)] + public int WaferX2AutoVelocity { get; set; } + + [Column("wafer_x2_auto_acceleration"), Description("晶圆X2轴自动加速度"), + Property(Group = "WaferX", Variable = "axisAcc", Axis = 6, Index = 0)] + public int WaferX2AutoAcceleration { get; set; } + + [Column("wafer_x2_auto_deceleration"), Description("晶圆X2轴自动减速度"), + Property(Group = "WaferX", Variable = "axisDec", Axis = 6, Index = 0)] + public int WaferX2AutoDeceleration { get; set; } + + [Column("wafer_x2_auto_jerk"), Description("晶圆X2轴自动加加速度"), + Property(Group = "WaferX", Variable = "axisJerk", Axis = 6, Index = 0)] + public int WaferX2AutoJerk { get; set; } + + [Column("wafer_x2_reset_velocity"), Description("晶圆X2回原速度"), + Property(Group = "WaferX", Variable = "axisVel", Axis = 6, Index = 1)] + public int WaferX2ResetVelocity { get; set; } + + [Column("wafer_x2_reset_acceleration"), Description("晶圆X2轴回原加速度"), + Property(Group = "WaferX", Variable = "axisAcc", Axis = 6, Index = 1)] + public int WaferX2ResetAcceleration { get; set; } + + [Column("wafer_x2_reset_deceleration"), Description("晶圆X2轴回原减速度"), + Property(Group = "WaferX", Variable = "axisDec", Axis = 6, Index = 1)] + public int WaferX2ResetDeceleration { get; set; } + + [Column("wafer_x2_reset_jerk"), Description("晶圆X2轴回原加加速度"), + Property(Group = "WaferX", Variable = "axisJerk", Axis = 6, Index = 1)] + public int WaferX2ResetJerk { get; set; } + + [Column("needle_x2_auto_velocity"), Description("针刺X2轴自动速度"), + Property(Group = "NeedleX", Variable = "axisVel", Axis = 7, Index = 0)] + public int NeedleX2AutoVelocity { get; set; } + + [Column("needle_x2_auto_acceleration"), Description("针刺X2轴自动加速度"), Property(Group = "NeedleX", + Variable = "axisAcc", Axis = 7, Index = 0)] + public int NeedleX2AutoAcceleration { get; set; } + + [Column("needle_x2_auto_deceleration"), Description("针刺X2轴自动减速度"), + Property(Group = "NeedleX", Variable = "axisDec", Axis = 7, Index = 0)] + public int NeedleX2AutoDeceleration { get; set; } + + [Column("needle_x2_auto_jerk"), Description("针刺X2轴自动加加速度"), + Property(Group = "NeedleX", Variable = "axisJerk", Axis = 7, Index = 0)] + public int NeedleX2AutoJerk { get; set; } + + [Column("needle_x2_reset_velocity"), Description("针刺X2回原速度"), + Property(Group = "NeedleX", Variable = "axisVel", Axis = 7, Index = 1)] + public int NeedleX2ResetVelocity { get; set; } + + [Column("needle_x2_reset_acceleration"), Description("针刺X2轴回原加速度"), + Property(Group = "NeedleX", Variable = "axisAcc", Axis = 7, Index = 1)] + public int NeedleX2ResetAcceleration { get; set; } + + [Column("needle_x2_reset_deceleration"), Description("针刺X2轴回原减速度"), + Property(Group = "NeedleX", Variable = "axisDec", Axis = 7, Index = 1)] + public int NeedleX2ResetDeceleration { get; set; } + + [Column("needle_x2_reset_jerk"), Description("针刺X2轴回原加加速度"), + Property(Group = "NeedleX", Variable = "axisJerk", Axis = 7, Index = 1)] + public int NeedleX2ResetJerk { get; set; } + + [Column("needle_z_auto_velocity"), Description("针刺升降音圈电机自动速度"), + Property(Group = "NeedleZ", Variable = "axisVel", Axis = 8, Index = 0)] + public int NeedleZAutoVelocity { get; set; } + + [Column("needle_z_auto_acceleration"), Description("针刺升降音圈电机自动加速度"), + Property(Group = "NeedleZ", Variable = "axisAcc", Axis = 8, Index = 0)] + public int NeedleZAutoAcceleration { get; set; } + + [Column("needle_z_auto_deceleration"), Description("针刺升降音圈电机自动减速度"), + Property(Group = "NeedleZ", Variable = "axisDec", Axis = 8, Index = 0)] + public int NeedleZAutoDeceleration { get; set; } + + [Column("needle_z_auto_jerk"), Description("针刺升降音圈电机自动加加速度"), + Property(Group = "NeedleZ", Variable = "axisJerk", Axis = 8, Index = 0)] + public int NeedleZAutoJerk { get; set; } + + [Column("needle_z_reset_velocity"), Description("针刺升降音圈电机回原速度"), + Property(Group = "NeedleZ", Variable = "axisVel", Axis = 8, Index = 1)] + public int NeedleZResetVelocity { get; set; } + + [Column("needle_z_reset_acceleration"), Description("针刺升降音圈电机回原加速度"), + Property(Group = "NeedleZ", Variable = "axisAcc", Axis = 8, Index = 1)] + public int NeedleZResetAcceleration { get; set; } + + [Column("needle_z_reset_deceleration"), Description("针刺升降音圈电机回原减速度"), + Property(Group = "NeedleZ", Variable = "axisDec", Axis = 8, Index = 1)] + public int NeedleZResetDeceleration { get; set; } + + [Column("needle_z_reset_jerk"), Description("针刺升降音圈电机回原加加速度"), + Property(Group = "NeedleZ", Variable = "axisJerk", Axis = 8, Index = 1)] + public int NeedleZResetJerk { get; set; } + + [Column("needle_z_servo_auto_velocity"), Description("针刺升降伺服自动速度"), + Property(Group = "NeedleZ", Variable = "axisVel", Axis = 9, Index = 0)] + public int NeedleZServoAutoVelocity { get; set; } + + [Column("needle_z_servo_auto_acceleration"), Description("针刺升降伺服自动加速度"), + Property(Group = "NeedleZ", Variable = "axisAcc", Axis = 9, Index = 0)] + public int NeedleZServoAutoAcceleration { get; set; } + + [Column("needle_z_servo_auto_deceleration"), Description("针刺升降伺服自动减速度"), + Property(Group = "NeedleZ", Variable = "axisDec", Axis = 9, Index = 0)] + public int NeedleZServoAutoDeceleration { get; set; } + + [Column("needle_z_servo_auto_jerk"), Description("针刺升降伺服自动加加速度"), + Property(Group = "NeedleZ", Variable = "axisJerk", Axis = 9, Index = 0)] + public int NeedleZServoAutoJerk { get; set; } + + [Column("needle_z_servo_reset_velocity"), Description("针刺升降伺服回原速度"), + Property(Group = "NeedleZ", Variable = "axisVel", Axis = 9, Index = 1)] + public int NeedleZServoResetVelocity { get; set; } + + [Column("needle_z_servo_reset_acceleration"), Description("针刺升降伺服回原加速度"), + Property(Group = "NeedleZ", Variable = "axisAcc", Axis = 9, Index = 1)] + public int NeedleZServoResetAcceleration { get; set; } + + [Column("needle_z_servo_reset_deceleration"), Description("针刺升降伺服回原减速度"), + Property(Group = "NeedleZ", Variable = "axisDec", Axis = 9, Index = 1)] + public int NeedleZServoResetDeceleration { get; set; } + + [Column("needle_z_servo_reset_jerk"), Description("针刺升降伺服回原加加速度"), + Property(Group = "NeedleZ", Variable = "axisJerk", Axis = 9, Index = 1)] + public int NeedleZServoResetJerk { get; set; } + + [Column("wafer_z_servo_auto_velocity"), Description("晶环升降伺服自动速度"), + Property(Group = "WaferZ", Variable = "axisVel", Axis = 10, Index = 0)] + public int WaferZServoAutoVelocity { get; set; } + + [Column("wafer_z_servo_auto_acceleration"), Description("晶环升降伺服自动加速度"), + Property(Group = "WaferZ", Variable = "axisAcc", Axis = 10, Index = 0)] + public int WaferZServoAutoAcceleration { get; set; } + + [Column("wafer_z_servo_auto_deceleration"), Description("晶环升降伺服自动减速度"), + Property(Group = "WaferZ", Variable = "axisDec", Axis = 10, Index = 0)] + public int WaferZServoAutoDeceleration { get; set; } + + [Column("wafer_z_servo_auto_jerk"), Description("晶环升降伺服自动加加速度"), + Property(Group = "WaferZ", Variable = "axisJerk", Axis = 10, Index = 0)] + public int WaferZServoAutoJerk { get; set; } + + [Column("wafer_z_servo_reset_velocity"), Description("晶环升降伺服回原速度"), + Property(Group = "WaferZ", Variable = "axisVel", Axis = 10, Index = 1)] + public int WaferZServoResetVelocity { get; set; } + + [Column("wafer_z_servo_reset_acceleration"), Description("晶环升降伺服回原加速度"), + Property(Group = "WaferZ", Variable = "axisAcc", Axis = 10, Index = 1)] + public int WaferZServoResetAcceleration { get; set; } + + [Column("wafer_z_servo_reset_deceleration"), Description("晶环升降伺服回原减速度"), + Property(Group = "WaferZ", Variable = "axisDec", Axis = 10, Index = 1)] + public int WaferZServoResetDeceleration { get; set; } + + [Column("wafer_z_servo_reset_jerk"), Description("晶环升降伺服回原加加速度"), + Property(Group = "WaferZ", Variable = "axisJerk", Axis = 10, Index = 1)] + public int WaferZServoResetJerk { get; set; } + + + [Column("wafer_rotate_servo_auto_velocity"), Description("晶环旋转伺服自动速度"), + Property(Group = "WaferRotate", Variable = "axisVel", Axis = 11, Index = 0)] + public int WaferRotateServoAutoVelocity { get; set; } + + [Column("wafer_rotate_servo_auto_acceleration"), Description("晶环旋转伺服自动加速度"), + Property(Group = "WaferRotate", Variable = "axisAcc", Axis = 11, Index = 0)] + public int WaferRotateServoAutoAcceleration { get; set; } + + [Column("wafer_rotate_servo_auto_deceleration"), Description("晶环旋转伺服自动减速度"), + Property(Group = "WaferRotate", Variable = "axisDec", Axis = 11, Index = 0)] + public int WaferRotateServoAutoDeceleration { get; set; } + + [Column("wafer_rotate_servo_auto_jerk"), Description("晶环旋转伺服自动加加速度"), + Property(Group = "WaferRotate", Variable = "axisJerk", Axis = 11, Index = 0)] + public int WaferRotateServoAutoJerk { get; set; } + + [Column("wafer_rotate_servo_reset_velocity"), Description("晶环旋转伺服回原速度"), + Property(Group = "WaferRotate", Variable = "axisVel", Axis = 11, Index = 1)] + public int WaferRotateServoResetVelocity { get; set; } + + [Column("wafer_rotate_servo_reset_acceleration"), Description("晶环旋转伺服回原加速度"), + Property(Group = "WaferRotate", Variable = "axisAcc", Axis = 11, Index = 1)] + public int WaferRotateServoResetAcceleration { get; set; } + + [Column("wafer_rotate_servo_reset_deceleration"), Description("晶环旋转伺服回原减速度"), + Property(Group = "WaferRotate", Variable = "axisDec", Axis = 11, Index = 1)] + public int WaferRotateServoResetDeceleration { get; set; } + + [Column("wafer_rotate_servo_reset_jerk"), Description("晶环旋转伺服回原加加速度"), + Property(Group = "WaferRotate", Variable = "axisJerk", Axis = 11, Index = 1)] + public int WaferRotateServoResetJerk { get; set; } + + [Column("wafer_up_down_servo_auto_velocity"), Description("晶环上料升降步进自动速度"), + Property(Group = "WaferLoading", Variable = "axisVel", Axis = 12, Index = 0)] + public int WaferUpDownServoAutoVelocity { get; set; } + + [Column("wafer_up_down_servo_auto_acceleration"), Description("晶环上料升降步进自动加速度"), + Property(Group = "WaferLoading", Variable = "axisAcc", Axis = 12, Index = 0)] + public int WaferUpDownServoAutoAcceleration { get; set; } + + [Column("wafer_up_down_servo_auto_deceleration"), Description("晶环上料升降步进自动减速度"), + Property(Group = "WaferLoading", Variable = "axisDec", Axis = 12, Index = 0)] + public int WaferUpDownServoAutoDeceleration { get; set; } + + [Column("wafer_up_down_servo_auto_jerk"), Description("晶环上料升降步进自动加加速度"), + Property(Group = "WaferLoading", Variable = "axisJerk", Axis = 12, Index = 0)] + public int WaferUpDownServoAutoJerk { get; set; } + + [Column("wafer_up_down_servo_reset_velocity"), Description("晶环上料升降步进回原速度"), + Property(Group = "WaferLoading", Variable = "axisVel", Axis = 12, Index = 1)] + public int WaferUpDownServoResetVelocity { get; set; } + + [Column("wafer_up_down_servo_reset_acceleration"), Description("晶环上料升降步进回原加速度"), + Property(Group = "WaferLoading", Variable = "axisAcc", Axis = 12, Index = 1)] + public int WaferUpDownServoResetAcceleration { get; set; } + + [Column("wafer_up_down_servo_reset_deceleration"), Description("晶环上料升降步进回原减速度"), + Property(Group = "WaferLoading", Variable = "axisDec", Axis = 12, Index = 1)] + public int WaferUpDownServoResetDeceleration { get; set; } + + [Column("wafer_up_down_servo_reset_jerk"), Description("晶环上料升降步进回原加加速度"), + Property(Group = "WaferLoading", Variable = "axisJerk", Axis = 12, Index = 1)] + public int WaferUpDownServoResetJerk { get; set; } + + [Column("wafer_translation_servo_auto_velocity"), Description("晶环上料平移步进自动速度"), + Property(Group = "WaferLoading", Variable = "axisVel", Axis = 13, Index = 0)] + public int WaferTranslationServoAutoVelocity { get; set; } + + [Column("wafer_translation_servo_auto_acceleration"), Description("晶环上料平移步进自动加速度"), + Property(Group = "WaferLoading", Variable = "axisAcc", Axis = 13, Index = 0)] + public int WaferTranslationServoAutoAcceleration { get; set; } + + [Column("wafer_translation_servo_auto_deceleration"), Description("晶环上料平移步进自动减速度"), + Property(Group = "WaferLoading", Variable = "axisDec", Axis = 13, Index = 0)] + public int WaferTranslationServoAutoDeceleration { get; set; } + + [Column("wafer_translation_servo_auto_jerk"), Description("晶环上料平移步进自动加加速度"), + Property(Group = "WaferLoading", Variable = "axisJerk", Axis = 13, Index = 0)] + public int WaferTranslationServoAutoJerk { get; set; } + + + [Column("wafer_translation_servo_reset_velocity"), Description("晶环上料平移步进回原速度"), + Property(Group = "WaferLoading", Variable = "axisVel", Axis = 13, Index = 1)] + public int WaferTranslationServoResetVelocity { get; set; } + + [Column("wafer_translation_servo_acceleration"), Description("晶环上料平移步进回原加速度"), + Property(Group = "WaferLoading", Variable = "axisAcc", Axis = 13, Index = 1)] + public int WaferTranslationServoAcceleration { get; set; } + + [Column("wafer_translation_servo_deceleration"), Description("晶环上料平移步进回原减速度"), + Property(Group = "WaferLoading", Variable = "axisDec", Axis = 13, Index = 1)] + public int WaferTranslationServoDeceleration { get; set; } + + [Column("wafer_translation_servo_reset_jerk"), Description("晶环上料平移步进回原加加速度"), + Property(Group = "WaferLoading", Variable = "axisJerk", Axis = 13, Index = 1)] + public int WaferTranslationServoResetJerk { get; set; } +} \ No newline at end of file diff --git a/MasstransferExporter/DataExporter/Model/CameraInternalParams.cs b/MasstransferExporter/DataExporter/Model/CameraInternalParams.cs new file mode 100644 index 0000000..fde1249 --- /dev/null +++ b/MasstransferExporter/DataExporter/Model/CameraInternalParams.cs @@ -0,0 +1,60 @@ +using System.ComponentModel; +using MasstransferCommon.Model.Atrributes; +using MasstransferCommon.Model.Entity; +using MasstransferCommon.Model.Enum; +using SQLite; + +namespace MasstransferExporter.DataExporter.Model; + +[Table("camera_internal_params"), Description("相机内部参数")] +public class CameraInternalParams : Entity +{ + [Column("type"), Description("参数类型")] public string Type { get; set; } + + [Column("balance_ratio"), Description("白平衡值")] + public int BalanceRatio { get; set; } + + [Column("exposure_time"), Description("曝光时间"), Property(Min = 15, Max = 2000)] + public int ExposureTime { get; set; } + + [Column("exposure_auto"), Description("自动曝光")] + public bool ExposureAuto { get; set; } + + [Column("gain"), Description("增益")] public float Gain { get; set; } + + [Column("gain_auto"), Description("自动增益")] + public GainAutoEnum GainAuto { get; set; } + + [Column("black_level"), Description("灰度值")] + public float BlackLevel { get; set; } + + [Column("black_level_enable"), Description("黑电平调节使能")] + public bool BlackLevelEnable { get; set; } + + [Column("balance_white_auto"), Description("自动白平衡")] + public bool BalanceWhiteAuto { get; set; } + + [Column("resulting_frame_rate"), Description("实际采集帧率fps")] + public float ResultingFrameRate { get; set; } + + [Column("gamma"), Description("gamma值"), Property(Min = 0, Max = 4)] + public float Gamma { get; set; } + + [Column("gamma_enable"), Description("是否gamma使能")] + public bool GammaEnable { get; set; } + + [Column("line_mode"), Description("IO 模式")] + public LineModeEnum LineMode { get; set; } + + [Column("line_selector"), Description("IO 选择")] + public LineSelectorEnum LineSelector { get; set; } + + [Column("trigger_activation"), Description("触发激活")] + public TriggerActivationEnum TriggerActivation { get; set; } + + [Column("trigger_mode"), Description("触发模式")] + public TriggerModeEnum TriggerMode { get; set; } + + [Column("trigger_source"), Description("触发源")] + public TriggerSourceEnum TriggerSource { get; set; } +} \ No newline at end of file diff --git a/MasstransferExporter/DataExporter/Model/CameraParams.cs b/MasstransferExporter/DataExporter/Model/CameraParams.cs new file mode 100644 index 0000000..929edea --- /dev/null +++ b/MasstransferExporter/DataExporter/Model/CameraParams.cs @@ -0,0 +1,33 @@ +using System.ComponentModel; +using MasstransferCommon.Model.Atrributes; +using MasstransferCommon.Model.Entity; +using SQLite; + +namespace MasstransferExporter.DataExporter.Model; + +/// +/// 相机参数 +/// +[Table("camera_params")] +[Description("相机参数")] +public class CameraParams : Entity +{ + [Column("camera_sn"), Description("相机序列号")] + public string CameraSn { get; set; } + + [Column("sdk"), Description("SDK")] public string Sdk { get; set; } + + [Column("dll"), Description("DLL")] public string Dll { get; set; } + + [Column("scale_ratio"), Description("视频缩放比例")] + public double ScaleRatio { get; set; } + + [Column("pixel_length"), Description("像素长度"), Property(Format = "0.########")] + public double PixelLength { get; set; } + + [Column("deflect_angle"), Description("相机偏转角度"), Property(Format = "0.#####")] + public double DeflectAngle { get; set; } + + [Column("camera_inner_param_template"), Description("相机内参模板")] + public string CameraInnerParamTemplate { get; set; } +} \ No newline at end of file diff --git a/MasstransferExporter/DataExporter/Model/ConfigData.cs b/MasstransferExporter/DataExporter/Model/ConfigData.cs new file mode 100644 index 0000000..f895096 --- /dev/null +++ b/MasstransferExporter/DataExporter/Model/ConfigData.cs @@ -0,0 +1,13 @@ +namespace MasstransferExporter.DataExporter.Model; + +/// +/// 配置数据 +/// +public class ConfigData +{ + public string Name { get; set; } + + public string Type { get; set; } + + public object Param { get; set; } +} \ No newline at end of file diff --git a/MasstransferExporter/DataExporter/Model/Formula.cs b/MasstransferExporter/DataExporter/Model/Formula.cs new file mode 100644 index 0000000..2d76219 --- /dev/null +++ b/MasstransferExporter/DataExporter/Model/Formula.cs @@ -0,0 +1,22 @@ +using System.ComponentModel; +using MasstransferCommon.Model.Entity; +using SQLite; + +namespace MasstransferExporter.DataExporter.Model; + +/// +/// 配方信息 +/// +[Table("formulas")] +public class Formula : Entity +{ + [Column("name"), Description("配方名称")] public string Name { get; set; } + + [Column("code"), Description("配方编码")] public string Code { get; set; } + + [Column("description"), Description("配方描述")] + public string Description { get; set; } + + [Column("selected"), Description("是否启用")] + public bool Selected { get; set; } +} \ No newline at end of file diff --git a/MasstransferExporter/DataExporter/Model/FormulaConfig.cs b/MasstransferExporter/DataExporter/Model/FormulaConfig.cs new file mode 100644 index 0000000..30f6121 --- /dev/null +++ b/MasstransferExporter/DataExporter/Model/FormulaConfig.cs @@ -0,0 +1,10 @@ +namespace MasstransferExporter.DataExporter.Model; + +/// +/// 配方参数信息 +/// +public class FormulaConfig +{ + + +} \ No newline at end of file diff --git a/MasstransferExporter/DataExporter/Model/FormulaDTO.cs b/MasstransferExporter/DataExporter/Model/FormulaDTO.cs new file mode 100644 index 0000000..59c31c5 --- /dev/null +++ b/MasstransferExporter/DataExporter/Model/FormulaDTO.cs @@ -0,0 +1,36 @@ +using MasstransferCore.Model.Entity; + +namespace MasstransferExporter.DataExporter.Model; + +/// +/// 配方信息 +/// +public class FormulaDTO +{ + public string Id { get; set; } + + public string Name { get; set; } + + public string Code { get; set; } + + public string Description { get; set; } + + public bool Selected { get; set; } + + public WorkBenchSetting? WorkBenchSetting { get; set; } + + public PcbSetting? PcbSetting { get; set; } + + public WaferSetting? WaferSetting { get; set; } + + public NeedleSetting? NeedleSetting { get; set; } + + public AltimetryParams? AltimetryParams { get; set; } + public JobSetting? JobSetting { get; set; } + + public AxisVariables? AxisVariables { get; set; } + + public AxisPositionParams? AxisPositionParams { get; set; } + + public AlgorithmParams? AlgorithmParams { get; set; } +} \ No newline at end of file diff --git a/MasstransferExporter/DataExporter/Model/JobSetting.cs b/MasstransferExporter/DataExporter/Model/JobSetting.cs new file mode 100644 index 0000000..5e57db1 --- /dev/null +++ b/MasstransferExporter/DataExporter/Model/JobSetting.cs @@ -0,0 +1,33 @@ +using System.ComponentModel; +using MasstransferCommon.Model.Entity; +using SQLite; + +namespace MasstransferExporter.DataExporter.Model; + +/// +/// 作业配置 +/// +[Table("job_settings")] +public class JobSetting : Entity +{ + [Column("formulaId"), Description("配方Id")] + public string? FormulaId { get; set; } + + [Column("batch_no"), Description("批次号")] + public string? BatchNo { get; set; } + + [Column("chip_amount_per_batch"), Description("每批次的芯片数量")] + public int ChipAmountPerBatch { get; set; } + + [Column("strike_detect_threshold"), Description("每次动打数量检测阈值")] + public int StrikeDetectThreshold { get; set; } + + [Column("max_re_strike_times"), Description("最大补打次数")] + public int MaxReStrikeTimes { get; set; } + + [Column("missing_threshold"), Description("最大漏打数量阈值")] + public int MissingThreshold { get; set; } + + [Column("batch_preset_capacity"), Description("批次预设容量")] + public int BatchPresetCapacity { get; set; } +} \ No newline at end of file diff --git a/MasstransferExporter/DataExporter/Model/LogParams.cs b/MasstransferExporter/DataExporter/Model/LogParams.cs new file mode 100644 index 0000000..b398592 --- /dev/null +++ b/MasstransferExporter/DataExporter/Model/LogParams.cs @@ -0,0 +1,24 @@ +using System.ComponentModel; +using MasstransferCommon.Model.Entity; +using SQLite; + +namespace MasstransferExporter.DataExporter.Model; + +/// +/// 日志参数 +/// +[Table("log_params")] +[Description("日志参数")] +public class LogParams : Entity +{ + [Column("level"), Description("日志级别")] public string? Level { get; set; } + + [Column("path"), Description("日志存放路径")] + public string? Path { get; set; } + + [Column("upload_corn"), Description("日志上传时间")] + public string? UploadCorn { get; set; } + + [Column("upload_levels"), Description("日志上传级别")] + public string? UploadLevels { get; set; } +} \ No newline at end of file diff --git a/MasstransferExporter/DataExporter/Model/MinioParams.cs b/MasstransferExporter/DataExporter/Model/MinioParams.cs new file mode 100644 index 0000000..4952a95 --- /dev/null +++ b/MasstransferExporter/DataExporter/Model/MinioParams.cs @@ -0,0 +1,21 @@ +using System.ComponentModel; +using MasstransferCommon.Model.Entity; +using SQLite; + +namespace MasstransferExporter.DataExporter.Model; + +[Table("minio_params"), Description("MinIO参数")] +public class MinioParams : Entity +{ + [Column("minio_access_key"), Description("Minio AccessKey")] + public string MinioAccessKey { get; set; } + + [Column("minio_secret_key"), Description("Minio SecretKey")] + public string MinioSecretKey { get; set; } + + [Column("minio_bucket"), Description("Minio Bucket")] + public string MinioBucket { get; set; } + + [Column("minio_endpoint"), Description("Minio Endpoint")] + public string MinioEndpoint { get; set; } +} \ No newline at end of file diff --git a/MasstransferExporter/DataExporter/Model/MqttParams.cs b/MasstransferExporter/DataExporter/Model/MqttParams.cs new file mode 100644 index 0000000..8627ca7 --- /dev/null +++ b/MasstransferExporter/DataExporter/Model/MqttParams.cs @@ -0,0 +1,21 @@ +using System.ComponentModel; +using MasstransferCommon.Model.Atrributes; +using MasstransferCommon.Model.Entity; +using SQLite; + +namespace MasstransferExporter.DataExporter.Model; + +[Table("mqtt_params"), Description("Mqtt连接参数")] +public class MqttParams : Entity +{ + [Column("server_address"), Description("服务器地址")] + public string ServerAddress { get; set; } + + [Column("port"), Description("端口")] public int Port { get; set; } + + [Column("user_name"), Description("用户名")] + public string UserName { get; set; } + + [Column("password"), Description("密码"), Property(IsPassword = true)] + public string Password { get; set; } +} \ No newline at end of file diff --git a/MasstransferExporter/DataExporter/Model/NeedleSetting.cs b/MasstransferExporter/DataExporter/Model/NeedleSetting.cs new file mode 100644 index 0000000..30787e9 --- /dev/null +++ b/MasstransferExporter/DataExporter/Model/NeedleSetting.cs @@ -0,0 +1,33 @@ +using System.ComponentModel; +using MasstransferCommon.Model.Entity; +using SQLite; + +namespace MasstransferExporter.DataExporter.Model; + +/// +/// 生产配方-针刺机构配置参数 +/// +[Table("needle_settings")] +public class NeedleSetting : Entity +{ + [Column("formulaId"), Description("配方Id")] + public string FormulaId { get; set; } + + /// + /// 基础下针高度 + /// + [Column("base_acupuncture_high"), Description("基础下针高度")] + public double BaseAcupunctureHigh { get; set; } + + /// + /// 针刺x坐标相对于激光x坐标的偏移值 + /// + [Column("delta_x_between_pcb_and_laser"), Description("针刺x坐标相对于激光x坐标的偏移值")] + public double DeltaXBetweenPcbAndLaser { get; set; } + + /// + /// 针刺y坐标相对于激光y坐标的偏移值 + /// + [Column("delta_y_between_pcb_and_laser"), Description("针刺y坐标相对于激光y坐标的偏移值")] + public double DeltaYBetweenPcbAndLaser { get; set; } +} \ No newline at end of file diff --git a/MasstransferExporter/DataExporter/Model/PcbSetting.cs b/MasstransferExporter/DataExporter/Model/PcbSetting.cs new file mode 100644 index 0000000..2f36af3 --- /dev/null +++ b/MasstransferExporter/DataExporter/Model/PcbSetting.cs @@ -0,0 +1,82 @@ +using System.ComponentModel; +using MasstransferCommon.Model.Entity; +using MasstransferCommon.Model.Enum; +using SQLite; +using ChipColorEnum = MasstransferCommon.Model.Entity.ChipColorEnum; + +namespace MasstransferExporter.DataExporter.Model; + +/// +/// 生产配方-pcb设置参数 +/// +[Table("pcb_settings"), Description("PCB设置")] +public class PcbSetting : Entity +{ + [Column("formulaId"), Description("配方Id")] + public string? FormulaId { get; set; } + + [Column("type"), Description("基材类型")] public SubstrateTypeEnum TypeEnum { get; set; } + + + [Column("solder_joint_width"), Description("焊点宽度")] + public double SolderJointWidth { get; set; } + + [Column("solder_joint_height"), Description("焊点高度")] + public double SolderJointHeight { get; set; } + + /// + /// 焊点内间距 + /// + [Column("padding"), Description("焊点内间距")] + public double Padding { get; set; } + + [Column("row_margin"), Description("焊点的行间距")] + public double RowMargin { get; set; } + + [Column("column_margin"), Description("焊点的列间距")] + public double ColumnMargin { get; set; } + + [Column("row"), Description("行数")] public int Row { get; set; } + + [Column("column"), Description("列数")] public int Column { get; set; } + + [Column("strike_direction"), Description("动打方向")] + public DirectionEnum StrikeDirection { get; set; } + + /// + /// RGB 1;R,2:G,3:B + /// + [Column("rgb"), Description("RGB")] + public ChipColorEnum ChipColor { get; set; } + + [Column("pcb_chip_amount_per_row"), Description("每行PCB芯片数量")] + public int PcbChipAmountPerRow { get; set; } + + /// + /// PCB模板 + /// + [Column("pcb_template"), Description("PCB模板")] + public string? PcbTemplate { get; set; } + + /// + /// Mark1模板 + /// + [Column("mark1_template"), Description("Mark1模板")] + public string? Mark1Template { get; set; } + + /// + /// Mark2模板 + /// + [Column("mark2_template"), Description("Mark2模板")] + public string? Mark2Template { get; set; } + + /// + /// Mark3模板 + /// + [Column("mark3_template"), Description("Mark3模板")] + public string? Mark3Template { get; set; } + + [Column("mark_origin_coordinates_json"), Description("Mark点的像素坐标系下对应像素原点的针刺坐标")] + [Obsolete("已废弃,使用WorkBenchSetting.SolderJointX 配置")] + public string MarkOriginCoordinatesJson { get; set; } +} \ No newline at end of file diff --git a/MasstransferExporter/DataExporter/Model/ScannerParams.cs b/MasstransferExporter/DataExporter/Model/ScannerParams.cs new file mode 100644 index 0000000..0d95257 --- /dev/null +++ b/MasstransferExporter/DataExporter/Model/ScannerParams.cs @@ -0,0 +1,46 @@ +using System.ComponentModel; +using MasstransferCommon.Model.Entity; +using MasstransferCommon.Model.Enum; +using SQLite; + +namespace MasstransferExporter.DataExporter.Model; + +/// +/// 扫码器参数 +/// +[Table("scanner_params"), Description("扫描枪参数")] +public class ScannerParams : Entity +{ + [Column("interface_enum"), Description("扫码枪接口类型")] + public ScannerInterfaceEnum InterfaceEnum { get; set; } + + [Column("wafer_ip_address"), Description("晶环扫描枪IP地址")] + public string WaferIpAddress { get; set; } + + [Column("wafer_port"), Description("晶环扫描枪端口号")] + public int WaferPort { get; set; } + + [Column("wafer_port_name"), Description("晶环扫码枪串口名称")] + public string WaferPortName { get; set; } + + [Column("wafer_baud_rate"), Description("晶环扫码枪波特率")] + public int WaferBaudRate { get; set; } + + [Column("wafer_scan_delay"), Description("晶环扫码枪扫描间隔")] + public int WaferScanDelay { get; set; } + + [Column("pcb_ip_address"), Description("PCB扫描枪IP地址")] + public string PcbIpAddress { get; set; } + + [Column("pcb_port"), Description("PCB扫描枪端口号")] + public int PcbPort { get; set; } + + [Column("pcb_port_name"), Description("PCB扫码枪串口名称")] + public string PcbPortName { get; set; } + + [Column("pcb_baud_rate"), Description("PCB扫码枪枪波特率")] + public int PcbBaudRate { get; set; } + + [Column("pcb_scan_delay"), Description("PCB扫码枪枪扫描间隔")] + public int PcbScanDelay { get; set; } +} \ No newline at end of file diff --git a/MasstransferExporter/DataExporter/Model/SystemParams.cs b/MasstransferExporter/DataExporter/Model/SystemParams.cs new file mode 100644 index 0000000..8241c3f --- /dev/null +++ b/MasstransferExporter/DataExporter/Model/SystemParams.cs @@ -0,0 +1,36 @@ +using System.ComponentModel; +using MasstransferCommon.Model.Entity; +using SQLite; + +namespace MasstransferExporter.DataExporter.Model; + +/// +/// 系统参数 +/// +[Table("system_params")] +[Description("系统参数")] +public class SystemParams : Entity +{ + [Column("device_type"), Description("设备类型")] + public string? DeviceType { get; set; } + + [Column("version"), Description("版本号")] + public string? Version { get; set; } + + [Column("name"), Description("名称")] public string? Name { get; set; } + + [Column("acs_ip"), Description("ACS 控制器IP")] + public string AcsIp { get; set; } + + [Column("image_storage_path"), Description("照片存储路径")] + public string? ImageStoragePath { get; set; } + + [Column("camera_viewer_storage_path"), Description("相机预览控件图片存储路径")] + public string? CameraViewerStoragePath { get; set; } + + [Column("enable_auto_clear_image"), Description("是否自动清除历史照片")] + public bool EnableAutoClearImage { get; set; } + + [Column("retained_day"), Description("照片保留天数")] + public int RetainedDay { get; set; } +} \ No newline at end of file diff --git a/MasstransferExporter/DataExporter/Model/SystemParamsDTO.cs b/MasstransferExporter/DataExporter/Model/SystemParamsDTO.cs new file mode 100644 index 0000000..900330d --- /dev/null +++ b/MasstransferExporter/DataExporter/Model/SystemParamsDTO.cs @@ -0,0 +1,23 @@ +namespace MasstransferExporter.DataExporter.Model; + +/// +/// 系统参数DTO +/// +public class SystemParamsDTO +{ + public CameraParams CameraParams { get; set; } + + public SystemParams SystemParams { get; set; } + + public LogParams LogParams { get; set; } + + public ScannerParams ScannerParams { get; set; } + + public CameraInternalParams WaferCameraInternalParams { get; set; } + + public CameraInternalParams SubstrateCameraInternalParams { get; set; } + + public MinioParams MinioParams { get; set; } + + public MqttParams MqttParams { get; set; } +} \ No newline at end of file diff --git a/MasstransferExporter/DataExporter/Model/WaferSetting.cs b/MasstransferExporter/DataExporter/Model/WaferSetting.cs new file mode 100644 index 0000000..7b65b07 --- /dev/null +++ b/MasstransferExporter/DataExporter/Model/WaferSetting.cs @@ -0,0 +1,70 @@ +using System.ComponentModel; +using MasstransferCommon.Model.Entity; +using SQLite; + +namespace MasstransferExporter.DataExporter.Model; + +/// +/// 生产配方-wafer配置参数 +/// +[Table("wafer_settings")] +public class WaferSetting : Entity +{ + [Column("formulaId"), Description("配方Id")] + public string FormulaId { get; set; } + + /// + /// 芯片间距 + /// + [Column("pitch"), Description("芯片间距")] + public double Pitch { get; set; } + + /// + /// 芯片高 + /// + [Column("height"), Description("芯片高")] + public double Height { get; set; } + + /// + /// 芯片宽 + /// + [Column("width"), Description("芯片宽")] + public double Width { get; set; } + + /// + /// 合并行容忍度 + /// + [Column("row_similar_threshold"), Description("合行容忍度")] + public double RowSimilarThreshold { get; set; } + + /// + /// 合并列容忍度 + /// + [Column("column_similar_threshold"), Description("合列容忍度")] + public double ColumnSimilarThreshold { get; set; } + + /// + /// 芯片最大旋转角度 + /// + [Column("max_angle"), Description("芯片最大旋转角度")] + public double MaxAngle { get; set; } + + /// + /// 芯片模板 + /// + [Column("bin_template"), Description("芯片模板")] + public string BinTemplate { get; set; } + + /// + /// 芯片ncc模板 + /// + [Column("bin_ncc_template"), Description("芯片ncc模板")] + public string BinNccTemplate { get; set; } + + + /// + /// 标定模板 + /// + [Column("calibration_template"), Description("标定模板")] + public string CalibrationTemplate { get; set; } +} \ No newline at end of file diff --git a/MasstransferExporter/DataExporter/Model/WorkBenchSetting.cs b/MasstransferExporter/DataExporter/Model/WorkBenchSetting.cs new file mode 100644 index 0000000..cd9cbf6 --- /dev/null +++ b/MasstransferExporter/DataExporter/Model/WorkBenchSetting.cs @@ -0,0 +1,93 @@ +using System.ComponentModel; +using MasstransferCommon.Model.Entity; +using SQLite; + +namespace MasstransferExporter.DataExporter.Model; + +/// +/// 生产配方-工作台配置参数 +/// +[Table("work_bench_settings")] +public class WorkBenchSetting : Entity +{ + // 所属的配方id + [Column("formulaId"), Description("配方Id")] + public string FormulaId { get; set; } + + [Column("bin_scan_start_x"), Description("晶圆飞拍时PCB机构开始X坐标")] + public double BinScanStartX { get; set; } + + [Column("bin_scan_start_y"), Description("晶圆飞拍时PCB机构开始Y坐标")] + public double BinScanStartY { get; set; } + + [Column("bin_scan_end_x"), Description("晶圆飞拍时PCB机构结束X坐标")] + public double BinScanEndX { get; set; } + + [Column("bin"), Description("晶圆飞拍时PCB机构结束Y坐标")] + public double BinScanEndY { get; set; } + + [Column("bin_scan_distance_x"), Description("晶圆飞拍X轴间距")] + public double BinScanDistanceX { get; set; } + + [Column("bin_scan_distance_y"), Description("晶圆飞拍Y轴间距")] + public double BinScanDistanceY { get; set; } + + [Column("bin_scan_move_x"), Description("晶圆飞拍初始X坐标")] + public double BinScanMoveX { get; set; } + + [Column("bin_scan_move_y"), Description("晶圆飞拍初始Y坐标")] + public double BinScanMoveY { get; set; } + + [Column("bin_scan_Height"), Description("晶圆飞拍相机高度")] + public double BinScanHeight { get; set; } + + [Column("pcb_scan_Height"), Description("PCB飞拍相机高度")] + public double PcbScanHeight { get; set; } + + [Column("solder_joint_x1"), Description("焊点1拍照坐标X")] + public double SolderJointX1 { get; set; } + + [Column("solder_joint_y1"), Description("焊点1拍照坐标Y")] + public double SolderJointY1 { get; set; } + + [Column("solder_joint_x2"), Description("焊点2拍照坐标X")] + public double SolderJointX2 { get; set; } + + [Column("solder_joint_y2"), Description("焊点2拍照坐标Y")] + public double SolderJointY2 { get; set; } + + [Column("solder_joint_x3"), Description("焊点3拍照坐标X")] + public double SolderJointX3 { get; set; } + + [Column("solder_joint_y3"), Description("焊点3拍照坐标Y")] + public double SolderJointY3 { get; set; } + + [Column("pcb_scan_origin_offset"), Description("基板扫描原点补偿值")] + public double PcbScanOriginOffset { get; set; } + + [Column("bin_scan_origin_offset"), Description("芯片飞拍原点补偿值")] + public double BinScanOriginOffset { get; set; } + + [Column("result_detect_origin_offset"), Description("结果检测原点补偿值")] + public double ResultDetectOriginOffset { get; set; } + + [Column("detect_pcb_x_distance"), Description("结果检测时pcbX飞拍间距")] + public double DetectPcbXDistance { get; set; } + + [Column("detect_pcb_y_distance"), Description("结果检测时pcbY轴飞拍间距")] + public double DetectPcbYDistance { get; set; } + + [Column("delta_x_between_acupuncture_and_bin_structure"), + Description("晶圆机构每移动1单位相对于针刺机构移动的x补偿值, binx*(1+DeltaXBetweenAcupunctureAndBinStructure) = pcbx")] + public double DeltaXBetweenAcupunctureAndBinStructure { get; set; } + + [Column("delta_Y_between_acupuncture_and_bin_structure"), + Description("晶圆机构每移动1单位相对于针刺机构移动的y补偿值, biny*(1+DeltaYBetweenAcupunctureAndBinStructure) = pcby")] + public double DeltaYBetweenAcupunctureAndBinStructure { get; set; } + + [Column("angle_between_acupuncture_and_bin_structure"), Description("晶圆机构与针刺机构的夹角")] + public double AngleBetweenAcupunctureAndBinStructure { get; set; } + + [Column("bin_calibration_scan_Height"), Description("晶圆机构标定拍照高度")] + public double BinCalibrationScanHeight { get; set; } +} \ No newline at end of file diff --git a/MasstransferExporter/DataExporter/SystemParamsService.cs b/MasstransferExporter/DataExporter/SystemParamsService.cs new file mode 100644 index 0000000..9b775dc --- /dev/null +++ b/MasstransferExporter/DataExporter/SystemParamsService.cs @@ -0,0 +1,149 @@ +using MasstransferCommon.Model.Constant; +using MasstransferCommunicate.Mqtt.Client; +using MasstransferExporter.DataExporter.Model; +using MasstransferInfrastructure.Database.Sqlite; + +namespace MasstransferExporter.DataExporter; + +/// +/// 系统配置参数服务 +/// +public class SystemParamsService +{ + private static readonly SqliteHelper Db = SqliteHelper.GetInstance(); + + /// + /// 系统参数上报 + /// + public static async Task SystemParamsExporter() + { + try + { + var cameraParams = new ConfigData() + { + Name = "相机配置", + Param = GetCameraParams(), + Type = "system" + }; + + var substrateCameraInternalParams = new ConfigData() + { + Name = "基板拍照相机内参", + Param = GetSubstrateParams(), + Type = "system" + }; + + var waferCameraInternalParams = new ConfigData() + { + Name = "芯片拍照相机内参", + Param = GetWaferParams(), + Type = "system" + }; + var logParams = new ConfigData() + { + Name = "日志配置", + Param = GetLogParams(), + Type = "system" + }; + + var systemParams = new ConfigData() + { + Name = "系统配置", + Param = GetSystemParams(), + Type = "system" + }; + + var scannerParams = new ConfigData() + { + Name = "扫描器配置", + Param = GetScannerParams(), + Type = "system" + }; + + var minioParams = new ConfigData() + { + Name = "MinIO配置", + Param = GetMinioParams(), + Type = "system" + }; + + var mqttParams = new ConfigData() + { + Name = "MQTT配置", + Param = GetMqttConnectParams(), + Type = "system" + }; + + await MessageQueueHelper.Publish(Topics.ReportConfigData, cameraParams); + await MessageQueueHelper.Publish(Topics.ReportConfigData, substrateCameraInternalParams); + await MessageQueueHelper.Publish(Topics.ReportConfigData, waferCameraInternalParams); + await MessageQueueHelper.Publish(Topics.ReportConfigData, logParams); + await MessageQueueHelper.Publish(Topics.ReportConfigData, systemParams); + await MessageQueueHelper.Publish(Topics.ReportConfigData, scannerParams); + await MessageQueueHelper.Publish(Topics.ReportConfigData, minioParams); + await MessageQueueHelper.Publish(Topics.ReportConfigData, mqttParams); + } + catch (Exception e) + { + Console.WriteLine($"系统配置参数上报失败: {e}"); + } + } + + + private static CameraParams? GetCameraParams() + { + return Db.Query("select * from camera_params limit 1") + .FirstOrDefault(); + } + + /// + /// 获取wafer相机参数 + /// + /// + private static CameraInternalParams? GetWaferParams() + { + return Db.Query("select * from camera_internal_params where type = 'wafer'") + .FirstOrDefault(); + } + + /// + /// 获取基材相机参数 + /// + /// + private static CameraInternalParams? GetSubstrateParams() + { + return Db.Query("select * from camera_internal_params where type = 'substrate'") + .FirstOrDefault(); + } + + private static LogParams? GetLogParams() + { + return Db.Query("select * from log_params limit 1") + .FirstOrDefault(); + } + + private static SystemParams? GetSystemParams() + { + return Db.Query("select * from system_params limit 1") + .FirstOrDefault(); + } + + + private static ScannerParams? GetScannerParams() + { + return Db.Query("select * from scanner_params limit 1") + .FirstOrDefault(); + } + + private static MinioParams? GetMinioParams() + { + return Db.Query("select * from minio_params limit 1") + .FirstOrDefault(); + } + + private static MqttParams? GetMqttConnectParams() + { + return Db.Query("select * from mqtt_params limit 1") + .FirstOrDefault(); + } +} \ No newline at end of file diff --git a/MasstransferExporter/Program.cs b/MasstransferExporter/Program.cs index 3d23cfc..18cf2d3 100644 --- a/MasstransferExporter/Program.cs +++ b/MasstransferExporter/Program.cs @@ -1,5 +1,5 @@ using MasstransferCommunicate.Mqtt.Client; -using MasstransferExporter.LogExporter; +using MasstransferExporter.DataExporter; using MasstransferInfrastructure.Mqtt.Model; class Program @@ -12,10 +12,10 @@ class Program Port = 8884, EnableTls = false }; - + await MessageQueueHelper.InitConnect(options); - await LogFileExporter.ExportLogFile(); + await SystemParamsService.SystemParamsExporter(); Console.WriteLine("按任意键退出");