| | |
| | | using Bro.Common.Model; |
| | | using Bro.M135.Common; |
| | | using Bro.Process; |
| | | using Newtonsoft.Json; |
| | | using System.ComponentModel; |
| | | using System.Drawing.Design; |
| | | using System.Drawing.Imaging; |
| | | using System.Drawing.Printing; |
| | | using System.Reflection; |
| | | using System.Windows.Forms.Design; |
| | | |
| | |
| | | { |
| | | public class M141Config : ProcessConfigBase |
| | | { |
| | | [Category("打印机配置")] |
| | | [Description("打印机配置集合")] |
| | | [DisplayName("打印机配置集合")] |
| | | [TypeConverter(typeof(CollectionCountConvert))] |
| | | [Editor(typeof(ComplexCollectionEditor<Printer>), typeof(UITypeEditor))] |
| | | public List<Printer> Printers { get; set; } = new List<Printer>(); |
| | | |
| | | |
| | | |
| | | [Category("产品显示界面配置")] |
| | | [Description("字体大小")] |
| | | [DisplayName("字体大小")] |
| | |
| | | public bool Isreadbasketcode { get; set; } = false; |
| | | |
| | | |
| | | //[Category("数据库配置")] |
| | | //[Description("是否为终点设备")] |
| | | //[DisplayName("是否为终点设备")] |
| | | //public bool IsfinDevice { get; set; } = false; |
| | | [Category("PLC配置")] |
| | | [Description("报警配置")] |
| | | [DisplayName("报警配置")] |
| | | [TypeConverter(typeof(CollectionCountConvert))] |
| | | [Editor(typeof(ComplexCollectionEditor<PLCAlarms>), typeof(UITypeEditor))] |
| | | public List<PLCAlarms> PLCAlarm { get; set; } = new List<PLCAlarms>(); |
| | | |
| | | |
| | | [Category("PLC配置")] |
| | | [Description("心跳地址")] |
| | | [DisplayName("心跳地址")] |
| | | public int heartadd { get; set; } = 1505; |
| | | |
| | | |
| | | } |
| | |
| | | return $"{(IsEnabled ? "" : "禁用")} 工位 {PositionName} 交互触发值:{TriggerValue}"; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | public class PLCAlarms : IComplexDisplay |
| | | { |
| | | |
| | | [Category("PLC配置")] |
| | | [DisplayName("plc名称")] |
| | | [Description("plc名称")] |
| | | [TypeConverter(typeof(DeviceIdSelectorConverter<PLCBase>))] |
| | | public string plcname { get; set; } = ""; |
| | | |
| | | |
| | | [Category("PLC配置")] |
| | | [DisplayName("是否启用")] |
| | | [Description("是否启用")] |
| | | public bool isused { get; set; } = true; |
| | | |
| | | |
| | | [Category("报警配置")] |
| | | [Description("报警详情")] |
| | | [DisplayName("报警详情")] |
| | | [TypeConverter(typeof(CollectionCountConvert))] |
| | | [Editor(typeof(ComplexCollectionEditor<PLCAlarmDetails>), typeof(UITypeEditor))] |
| | | public List<PLCAlarmDetails> AlarmDetails { get; set; } = new List<PLCAlarmDetails>(); |
| | | |
| | | |
| | | |
| | | |
| | | public string GetDisplayText() |
| | | { |
| | | return plcname + (isused ? "启用" : "禁用"); |
| | | } |
| | | } |
| | | |
| | | public class PLCAlarmDetails : IComplexDisplay |
| | | { |
| | | [Category("配置")] |
| | | [DisplayName("首地址")] |
| | | [Description("首地址")] |
| | | public int address { get; set; } |
| | | |
| | | [Category("配置")] |
| | | [DisplayName("子地址")] |
| | | [Description("子地址")] |
| | | public int address2 { get; set; } |
| | | |
| | | [Category("配置")] |
| | | [DisplayName("报警名称")] |
| | | [Description("报警名称")] |
| | | public string alarmname { get; set; } = ""; |
| | | |
| | | [Browsable(false)] |
| | | [JsonIgnore] |
| | | public int value { get; set; } = -1; |
| | | |
| | | public string GetDisplayText() |
| | | { |
| | | return alarmname; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | public class Printer : IComplexDisplay |
| | | { |
| | | [Category("打印机配置")] |
| | | [DisplayName("名称")] |
| | | [Description("名称")] |
| | | [TypeConverter(typeof(DevicePrinter))] |
| | | public string name { get; set; } = ""; |
| | | |
| | | |
| | | [Category("打印机配置")] |
| | | [DisplayName("位置")] |
| | | [Description("位置")] |
| | | public string station { get; set; } |
| | | |
| | | |
| | | [Category("PLC配置")] |
| | | [DisplayName("plc名称")] |
| | | [Description("plc名称")] |
| | | [TypeConverter(typeof(DeviceIdSelectorConverter<PLCBase>))] |
| | | public string plcname { get; set; } |
| | | |
| | | [Category("PLC配置")] |
| | | [DisplayName("状态地址")] |
| | | [Description("状态地址")] |
| | | public int addstate { get; set; } |
| | | |
| | | [Category("PLC配置")] |
| | | [DisplayName("结果地址")] |
| | | [Description("结果地址")] |
| | | public int addresult { get; set; } |
| | | |
| | | |
| | | public string GetDisplayText() |
| | | { |
| | | return name; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | string filePath = ""; |
| | | if (saveFileDialog.ShowDialog() == DialogResult.OK) |
| | | { |
| | | filePath = saveFileDialog.FileName; // 获取用户选择的文件路径 |
| | | filePath = saveFileDialog.FileName; // 获取用户选择的文件路径 |
| | | } |
| | | else |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | public class DevicePrinter : ComboBoxItemTypeConvert |
| | | { |
| | | public override Dictionary<string, string> GetConvertDict(ITypeDescriptorContext context) |
| | | { |
| | | Dictionary<string, string> table = new Dictionary<string, string>(); |
| | | table[""] = "未指定"; |
| | | |
| | | PrintDocument print = new PrintDocument(); |
| | | string sDefault = print.PrinterSettings.PrinterName;//默认打印机名 |
| | | foreach (string sPrint in PrinterSettings.InstalledPrinters)//获取所有打印机名称 |
| | | { |
| | | table[sPrint] = sPrint; |
| | | } |
| | | return table; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | [Device("ImageCheck", "图片检测操作配置", EnumHelper.DeviceAttributeType.OperationConfig)] |
| | | public class ImageCheckOperationConfigBase : OperationConfigBase, IHalconToolPath, IImageCheckOperationConfig |
| | | { |