| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231 |
- using Prism.Mvvm;
- using System;
- using System.Reflection;
- using TeamAAS_VP.Enums;
- namespace TeamAAS_VP.Models
- {
- /// <summary>
- /// 系统配置:保存软件版本、标题、语言、字体大小等全局设置。
- /// </summary>
- 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;
- /// <summary>
- /// 软件版本号
- /// </summary>
- public string SoftwareVersion
- {
- get => _softwareVersion;
- set => SetProperty(ref _softwareVersion, value);
- }
- private string _title;
- /// <summary>
- /// 软件标题
- /// </summary>
- public string Title
- {
- get => _title;
- set => SetProperty(ref _title, value);
- }
- private string _companyTitle;
- /// <summary>
- /// 公司名称/标题
- /// </summary>
- public string CompanyTitle
- {
- get => _companyTitle;
- set => SetProperty(ref _companyTitle, value);
- }
- private Language _currentLanguage;
- /// <summary>
- /// 当前语言
- /// </summary>
- public Language CurrentLanguage
- {
- get => _currentLanguage;
- set => SetProperty(ref _currentLanguage, value);
- }
- private FontSizeSettings _font;
- /// <summary>
- /// 字体大小配置
- /// </summary>
- public FontSizeSettings Font
- {
- get => _font;
- set => SetProperty(ref _font, value);
- }
- private Guid _lastOpenedProductId = Guid.Empty;
- /// <summary>
- /// 最近打开的产品 ID(可用于自动加载)
- /// </summary>
- public Guid LastOpenedProductId
- {
- get => _lastOpenedProductId;
- set => SetProperty(ref _lastOpenedProductId, value);
- }
- // 新增相机/拍照/检测计数属性
- private int _WorkMode = 0;
- /// <summary>
- /// 工作模式 =1 拍1打1 =2 拍1打所有
- /// </summary>
- public int WorkMode
- {
- get { return _WorkMode; }
- set { SetProperty(ref _WorkMode, value); }
- }
- private int _PickPointNum = 0;
- /// <summary>
- /// 取料位置 =0 不需要取料 =1 需要取料
- /// </summary>
- public int PickPointNum
- {
- get { return _PickPointNum; }
- set { SetProperty(ref _PickPointNum, value); }
- }
- private int _cameraShotCount = 0;
- /// <summary>
- /// 相机拍照次数
- /// </summary>
- public int CameraShotCount
- {
- get => _cameraShotCount;
- set => SetProperty(ref _cameraShotCount, value);
- }
- private int _upperCameraPickShotCount = 0;
- /// <summary>
- /// 上相机取料拍照次数
- /// </summary>
- public int UpperCameraPickShotCount
- {
- get => _upperCameraPickShotCount;
- set => SetProperty(ref _upperCameraPickShotCount, value);
- }
- private int _upperCameraPlaceShotCount = 0;
- /// <summary>
- /// 上相机放料拍照次数
- /// </summary>
- public int UpperCameraPlaceShotCount
- {
- get => _upperCameraPlaceShotCount;
- set => SetProperty(ref _upperCameraPlaceShotCount, value);
- }
- private int _upperCameraLockAssembleCount = 0;
- /// <summary>
- /// 上相机锁附/组装次数
- /// </summary>
- public int UpperCameraLockAssembleCount
- {
- get => _upperCameraLockAssembleCount;
- set => SetProperty(ref _upperCameraLockAssembleCount, value);
- }
- private int _pickFixedPositionProductCameraCount = 0;
- /// <summary>
- /// 取料固定位置拍产品相机数量
- /// </summary>
- public int PickFixedPositionProductCameraCount
- {
- get => _pickFixedPositionProductCameraCount;
- set => SetProperty(ref _pickFixedPositionProductCameraCount, value);
- }
- private int _lockFixedPositionProductCameraCount = 0;
- /// <summary>
- /// 锁附/组装固定位置拍产品相机数量
- /// </summary>
- public int LockFixedPositionProductCameraCount
- {
- get => _lockFixedPositionProductCameraCount;
- set => SetProperty(ref _lockFixedPositionProductCameraCount, value);
- }
- private int _fixedCameraDetectLockAssembleCount = 0;
- /// <summary>
- /// 固定相机检测锁附/组装次数
- /// </summary>
- public int FixedCameraDetectLockAssembleCount
- {
- get => _fixedCameraDetectLockAssembleCount;
- set => SetProperty(ref _fixedCameraDetectLockAssembleCount, value);
- }
- /// <summary>
- /// 字体大小子设置
- /// </summary>
- 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); }
- }
- }
- }
|