using Prism.Mvvm; using System; using System.Collections.ObjectModel; using System.Reflection; using System.Windows; using TeamAAS_VP.Enums; namespace TeamAAS_VP.Models { /// /// 系统配置:保存软件版本、标题、语言、字体大小等全局设置。 /// public class SystemConfiguration : BindableBase { public SystemConfiguration() { // 尝试从程序集信息读取版本号作为默认值 try { var version = Assembly.GetEntryAssembly()?.GetName()?.Version?.ToString(); if (string.IsNullOrEmpty(version)) { version = Assembly.GetExecutingAssembly()?.GetName()?.Version?.ToString(); } SoftwareVersion = version ?? "1.0.0.0"; } catch { SoftwareVersion = "1.0.0.0"; } Title = "Team Vision"; CompanyTitle = "江苏新惕姆智能装备有限公司"; CurrentLanguage = Language.ChineseSimplified; Font = new FontSizeSettings(); } private string _softwareVersion; /// /// 软件版本号 /// public string SoftwareVersion { get => _softwareVersion; set => SetProperty(ref _softwareVersion, value); } private string _title; /// /// 软件标题 /// public string Title { get => _title; set => SetProperty(ref _title, value); } private string _companyTitle; /// /// 公司名称/标题 /// public string CompanyTitle { get => _companyTitle; set => SetProperty(ref _companyTitle, value); } private Language _currentLanguage; /// /// 当前语言 /// public Language CurrentLanguage { get => _currentLanguage; set => SetProperty(ref _currentLanguage, value); } private FontSizeSettings _font; /// /// 字体大小配置 /// public FontSizeSettings Font { get => _font; set => SetProperty(ref _font, value); } private Guid _lastOpenedProductId = Guid.Empty; /// /// 最近打开的产品 ID(可用于自动加载) /// public Guid LastOpenedProductId { get => _lastOpenedProductId; set => SetProperty(ref _lastOpenedProductId, value); } // 新增相机/拍照/检测计数属性 private Int16 _WorkMode = 0; /// /// 工作模式 =1 拍1打1 =2 拍1打所有 =3先拍1打1打3颗再拍2打所有 /// public Int16 WorkMode { get { return _WorkMode; } set { SetProperty(ref _WorkMode, value); } } private Int16 _PickPointNum = 0; /// /// 取料位置 =0 不需要取料 =1 需要取料 /// public Int16 PickPointNum { get { return _PickPointNum; } set { SetProperty(ref _PickPointNum, value); } } private double _JumpLimitZ = 0; /// /// 取料位置 =0 不需要取料 =1 需要取料 /// public double JumpLimitZ { get { return _JumpLimitZ; } set { SetProperty(ref _JumpLimitZ, value); } } private Int16 _DowmCameraNum = 0; /// /// 相机拍照次数 /// public Int16 DowmCameraNum { get => _DowmCameraNum; set => SetProperty(ref _DowmCameraNum, value); } private Int16 _UpCameraPickNum = 0; /// /// 上相机取料拍照次数 /// public Int16 UpCameraPickNum { get => _UpCameraPickNum; set => SetProperty(ref _UpCameraPickNum, value); } private Int16 _UpCameraPutNum = 0; /// /// 上相机放料拍照次数 /// public Int16 UpCameraPutNum { get => _UpCameraPutNum; set => SetProperty(ref _UpCameraPutNum, value); } private Int16 _UPCameracheckNum = 0; /// /// 上相机锁附/组装次数 /// public Int16 UPCameracheckNum { get => _UPCameracheckNum; set => SetProperty(ref _UPCameracheckNum, value); } private Int16 _FixedCameraPickNum = 0; /// /// 取料固定位置拍产品相机数量 /// public Int16 FixedCameraPickNum { get => _FixedCameraPickNum; set => SetProperty(ref _FixedCameraPickNum, value); } private Int16 _FixedCameraPutNum = 0; /// /// 锁附/组装固定位置拍产品相机数量 /// public Int16 FixedCameraPutNum { get => _FixedCameraPutNum; set => SetProperty(ref _FixedCameraPutNum, value); } private Int16 _FixedCameracheckNum = 0; /// /// 固定相机检测锁附/组装次数 /// public Int16 FixedCameracheckNum { get => _FixedCameracheckNum; set => SetProperty(ref _FixedCameracheckNum, value); } private Int16 _ScrewTeachNum = 0; /// /// 披头矫正的模式,1:初始化时矫正,2:每个产品矫正一次,3:每颗螺丝矫正一次 /// public Int16 ScrewTeachNum { get => _ScrewTeachNum; set => SetProperty(ref _ScrewTeachNum, value); } private ObservableCollection _PressureSensorConfig; /// /// 压力传感器配置列表 /// public ObservableCollection PressureSensorConfig { get { return _PressureSensorConfig; } set { SetProperty(ref _PressureSensorConfig, value); } } private bool _IsSaveScrewCurve = false; /// /// 是否保存锁付曲线图 /// public bool IsSaveScrewCurve { get => _IsSaveScrewCurve; set => SetProperty(ref _IsSaveScrewCurve, value); } private string _ScrewCurvePath = ""; /// /// 锁付曲线图保存的文件夹路径 /// public string ScrewCurvePath { get => _ScrewCurvePath; set => SetProperty(ref _ScrewCurvePath, value); } private bool _IsBasePartCodeGetSN = false; /// /// 是否基于零件码获取流程码 /// public bool IsBasePartCodeGetSN { get { return _IsBasePartCodeGetSN; } set { SetProperty(ref _IsBasePartCodeGetSN, value); } } private bool _IsBasePartCodeChooseScrew = false; /// /// 是否通过零件码判断螺丝型号 /// public bool IsBasePartCodeChooseScrew { get { return _IsBasePartCodeChooseScrew; } set { SetProperty(ref _IsBasePartCodeChooseScrew, value); } } private bool _IsBasePartOpenLight = false; /// /// 是否启用最后一次拍照关闭光源 /// public bool IsBasePartOpenLight { get { return _IsBasePartOpenLight; } set { SetProperty(ref _IsBasePartOpenLight, value); } } private bool _IsBasePartOpenLightKB = false; /// /// 是否启用KB复检 /// public bool IsBasePartOpenLightKB { get { return _IsBasePartOpenLightKB; } set { SetProperty(ref _IsBasePartOpenLightKB, value); } } private string _ChooseScrewModel = "***********abc123****"; /// /// 螺丝型号判断,如******123**,*为忽略字符 /// public string ChooseScrewModel { get { return _ChooseScrewModel; } set { SetProperty(ref _ChooseScrewModel, value); } } private bool _DoubleSoftMode = false; /// /// 双软件模式 /// public bool DoubleSoftMode { get => _DoubleSoftMode; set => SetProperty(ref _DoubleSoftMode, value); } /// /// 字体大小子设置 /// public class FontSizeSettings : BindableBase { private double _title1 = 20; public double Title1 { get => _title1; set => SetProperty(ref _title1, value); } private double _title2 = 18; public double Title2 { get => _title2; set => SetProperty(ref _title2, value); } private double _title3 = 16; public double Title3 { get => _title3; set => SetProperty(ref _title3, value); } private double _title4 = 14; public double Title4 { get => _title4; set => SetProperty(ref _title4, value); } private double _body1 = 15; public double Body1 { get => _body1; set => SetProperty(ref _body1, value); } private double _body2 = 14; public double Body2 { get => _body2; set => SetProperty(ref _body2, value); } private double _body3 = 13; public double Body3 { get => _body3; set => SetProperty(ref _body3, value); } private double _body4 = 12; public double Body4 { get => _body4; set => SetProperty(ref _body4, value); } private double _captions1 = 11; public double Captions1 { get => _captions1; set => SetProperty(ref _captions1, value); } private double _captions2 = 10; public double Captions2 { get => _captions2; set => SetProperty(ref _captions2, value); } private double _captions3 = 9; public double Captions3 { get => _captions3; set => SetProperty(ref _captions3, value); } private double _captions4 = 8; public double Captions4 { get => _captions4; set => SetProperty(ref _captions4, value); } } /// /// 压力传感器配置 /// public class PressureSensorSettings : BindableBase { private string _sensorName; /// /// 压力传感器的名称 /// public string SensorName { get => _sensorName; set => SetProperty(ref _sensorName, value); } private int _sensorId; /// /// 压力传感器的编号 /// public int SensorId { get => _sensorId; set => SetProperty(ref _sensorId, value); } private bool _IsSavePressureCurve; /// /// 是否保存压力曲线图 /// public bool IsSavePressureCurve { get => _IsSavePressureCurve; set => SetProperty(ref _IsSavePressureCurve, value); } private string _pressureCurvePath; /// /// 压力曲线图保存路径 /// public string PressureCurvePath { get => _pressureCurvePath; set => SetProperty(ref _pressureCurvePath, value); } } } }