SystemConfiguration.cs 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537
  1. using Prism.Mvvm;
  2. using System;
  3. using System.Reflection;
  4. using TeamAAS_VP.Enums;
  5. namespace TeamAAS_VP.Models
  6. {
  7. /// <summary>
  8. /// 系统配置:保存软件版本、标题、语言、字体大小等全局设置。
  9. /// </summary>
  10. public class SystemConfiguration : BindableBase
  11. {
  12. public SystemConfiguration()
  13. {
  14. // 尝试从程序集信息读取版本号作为默认值
  15. try
  16. {
  17. var version = Assembly.GetEntryAssembly()?.GetName()?.Version?.ToString();
  18. if (string.IsNullOrEmpty(version))
  19. {
  20. version = Assembly.GetExecutingAssembly()?.GetName()?.Version?.ToString();
  21. }
  22. SoftwareVersion = version ?? "1.0.0.0";
  23. }
  24. catch
  25. {
  26. SoftwareVersion = "1.0.0.0";
  27. }
  28. Title = "Team Vision";
  29. CompanyTitle = "江苏新惕姆智能装备有限公司";
  30. CurrentLanguage = Language.ChineseSimplified;
  31. Font = new FontSizeSettings();
  32. }
  33. private bool _View3DUse;
  34. /// <summary>
  35. /// 3D是否使用
  36. /// </summary>
  37. public bool View3DUse
  38. {
  39. get => _View3DUse;
  40. set => SetProperty(ref _View3DUse, value);
  41. }
  42. private string _softwareVersion;
  43. /// <summary>
  44. /// 软件版本号
  45. /// </summary>
  46. public string SoftwareVersion
  47. {
  48. get => _softwareVersion;
  49. set => SetProperty(ref _softwareVersion, value);
  50. }
  51. private string _title;
  52. /// <summary>
  53. /// 软件标题
  54. /// </summary>
  55. public string Title
  56. {
  57. get => _title;
  58. set => SetProperty(ref _title, value);
  59. }
  60. private string _companyTitle;
  61. /// <summary>
  62. /// 公司名称/标题
  63. /// </summary>
  64. public string CompanyTitle
  65. {
  66. get => _companyTitle;
  67. set => SetProperty(ref _companyTitle, value);
  68. }
  69. private Language _currentLanguage;
  70. /// <summary>
  71. /// 当前语言
  72. /// </summary>
  73. public Language CurrentLanguage
  74. {
  75. get => _currentLanguage;
  76. set => SetProperty(ref _currentLanguage, value);
  77. }
  78. private FontSizeSettings _font;
  79. /// <summary>
  80. /// 字体大小配置
  81. /// </summary>
  82. public FontSizeSettings Font
  83. {
  84. get => _font;
  85. set => SetProperty(ref _font, value);
  86. }
  87. private Guid _lastOpenedProductId = Guid.Empty;
  88. /// <summary>
  89. /// 最近打开的产品 ID(可用于自动加载)
  90. /// </summary>
  91. public Guid LastOpenedProductId
  92. {
  93. get => _lastOpenedProductId;
  94. set => SetProperty(ref _lastOpenedProductId, value);
  95. }
  96. // 新增相机/拍照/检测计数属性
  97. private Int16 _WorkMode = 0;
  98. /// <summary>
  99. /// 工作模式 =1 拍1打1 =2 拍1打所有
  100. /// </summary>
  101. public Int16 WorkMode
  102. {
  103. get { return _WorkMode; }
  104. set { SetProperty(ref _WorkMode, value); }
  105. }
  106. private Int16 _PickPointNum = 0;
  107. /// <summary>
  108. /// 取料位置 =0 不需要取料 =1 需要取料
  109. /// </summary>
  110. public Int16 PickPointNum
  111. {
  112. get { return _PickPointNum; }
  113. set { SetProperty(ref _PickPointNum, value); }
  114. }
  115. private Int16 _DowmCameraNum = 0;
  116. /// <summary>
  117. /// 相机拍照次数
  118. /// </summary>
  119. public Int16 DowmCameraNum
  120. {
  121. get => _DowmCameraNum;
  122. set => SetProperty(ref _DowmCameraNum, value);
  123. }
  124. private Int16 _UpCameraPickNum = 0;
  125. /// <summary>
  126. /// 上相机取料拍照次数
  127. /// </summary>
  128. public Int16 UpCameraPickNum
  129. {
  130. get => _UpCameraPickNum;
  131. set => SetProperty(ref _UpCameraPickNum, value);
  132. }
  133. private Int16 _UpCameraPutNum = 0;
  134. /// <summary>
  135. /// 上相机放料拍照次数
  136. /// </summary>
  137. public Int16 UpCameraPutNum
  138. {
  139. get => _UpCameraPutNum;
  140. set => SetProperty(ref _UpCameraPutNum, value);
  141. }
  142. private Int16 _UPCameracheckNum = 0;
  143. /// <summary>
  144. /// 上相机锁附/组装次数
  145. /// </summary>
  146. public Int16 UPCameracheckNum
  147. {
  148. get => _UPCameracheckNum;
  149. set => SetProperty(ref _UPCameracheckNum, value);
  150. }
  151. private Int16 _FixedCameraPickNum = 0;
  152. /// <summary>
  153. /// 取料固定位置拍产品相机数量
  154. /// </summary>
  155. public Int16 FixedCameraPickNum
  156. {
  157. get => _FixedCameraPickNum;
  158. set => SetProperty(ref _FixedCameraPickNum, value);
  159. }
  160. private Int16 _FixedCameraPutNum = 0;
  161. /// <summary>
  162. /// 锁附/组装固定位置拍产品相机数量
  163. /// </summary>
  164. public Int16 FixedCameraPutNum
  165. {
  166. get => _FixedCameraPutNum;
  167. set => SetProperty(ref _FixedCameraPutNum, value);
  168. }
  169. private Int16 _FixedCameracheckNum = 0;
  170. /// <summary>
  171. /// 固定相机检测锁附/组装次数
  172. /// </summary>
  173. public Int16 FixedCameracheckNum
  174. {
  175. get => _FixedCameracheckNum;
  176. set => SetProperty(ref _FixedCameracheckNum, value);
  177. }
  178. private bool _IsSaveScrewCurve = false;
  179. /// <summary>
  180. /// 是否保存锁付曲线图
  181. /// </summary>
  182. public bool IsSaveScrewCurve
  183. {
  184. get => _IsSaveScrewCurve;
  185. set => SetProperty(ref _IsSaveScrewCurve, value);
  186. }
  187. private string _ScrewCurvePath = "";
  188. /// <summary>
  189. /// 锁付曲线图保存的文件夹路径
  190. /// </summary>
  191. public string ScrewCurvePath
  192. {
  193. get => _ScrewCurvePath;
  194. set => SetProperty(ref _ScrewCurvePath, value);
  195. }
  196. /// <summary>
  197. /// 字体大小子设置
  198. /// </summary>
  199. public class FontSizeSettings : BindableBase
  200. {
  201. private double _title1 = 20;
  202. public double Title1 { get => _title1; set => SetProperty(ref _title1, value); }
  203. private double _title2 = 18;
  204. public double Title2 { get => _title2; set => SetProperty(ref _title2, value); }
  205. private double _title3 = 16;
  206. public double Title3 { get => _title3; set => SetProperty(ref _title3, value); }
  207. private double _title4 = 14;
  208. public double Title4 { get => _title4; set => SetProperty(ref _title4, value); }
  209. private double _body1 = 15;
  210. public double Body1 { get => _body1; set => SetProperty(ref _body1, value); }
  211. private double _body2 = 14;
  212. public double Body2 { get => _body2; set => SetProperty(ref _body2, value); }
  213. private double _body3 = 13;
  214. public double Body3 { get => _body3; set => SetProperty(ref _body3, value); }
  215. private double _body4 = 12;
  216. public double Body4 { get => _body4; set => SetProperty(ref _body4, value); }
  217. private double _captions1 = 11;
  218. public double Captions1 { get => _captions1; set => SetProperty(ref _captions1, value); }
  219. private double _captions2 = 10;
  220. public double Captions2 { get => _captions2; set => SetProperty(ref _captions2, value); }
  221. private double _captions3 = 9;
  222. public double Captions3 { get => _captions3; set => SetProperty(ref _captions3, value); }
  223. private double _captions4 = 8;
  224. public double Captions4 { get => _captions4; set => SetProperty(ref _captions4, value); }
  225. }
  226. private bool _LabelUse;
  227. /// <summary>
  228. /// MES,结果标签是否显示
  229. /// </summary>
  230. public bool LabelUse
  231. {
  232. get => _LabelUse;
  233. set => SetProperty(ref _LabelUse, value);
  234. }
  235. private bool _TurnOnAllLightUse;
  236. /// <summary>
  237. /// 打开所有光源
  238. /// </summary>
  239. public bool TurnOnAllLightUse
  240. {
  241. get => _TurnOnAllLightUse;
  242. set => SetProperty(ref _TurnOnAllLightUse, value);
  243. }
  244. private bool _TurnOffAllLightUse;
  245. /// <summary>
  246. /// 关闭所有光源
  247. /// </summary>
  248. public bool TurnOffAllLightUse
  249. {
  250. get => _TurnOffAllLightUse;
  251. set => SetProperty(ref _TurnOffAllLightUse, value);
  252. }
  253. private bool _CodeUse ;
  254. /// <summary>
  255. /// 第一个点位是否使用为扫码点位,Mes询问两次
  256. /// </summary>
  257. public bool CodeUse
  258. {
  259. get => _CodeUse;
  260. set => SetProperty(ref _CodeUse, value);
  261. }
  262. private bool _CodeUse2;
  263. /// <summary>
  264. /// 第一个点位是否使用为扫码点位,Mes询问一次
  265. /// </summary>
  266. public bool CodeUse2
  267. {
  268. get => _CodeUse2;
  269. set => SetProperty(ref _CodeUse2, value);
  270. }
  271. private bool _ScannerUse;
  272. /// <summary>
  273. /// 扫码器是否使用
  274. /// </summary>
  275. public bool ScannerUse
  276. {
  277. get => _ScannerUse;
  278. set => SetProperty(ref _ScannerUse, value);
  279. }
  280. private bool _Camera1Use;
  281. /// <summary>
  282. /// 相机1是否使用
  283. /// </summary>
  284. public bool Camera1Use
  285. {
  286. get => _Camera1Use;
  287. set => SetProperty(ref _Camera1Use, value);
  288. }
  289. private bool _Camera2Use;
  290. /// <summary>
  291. /// 相机2是否使用
  292. /// </summary>
  293. public bool Camera2Use
  294. {
  295. get => _Camera2Use;
  296. set => SetProperty(ref _Camera2Use, value);
  297. }
  298. private bool _Camera3Use;
  299. /// <summary>
  300. /// 相机3是否使用
  301. /// </summary>
  302. public bool Camera3Use
  303. {
  304. get => _Camera3Use;
  305. set => SetProperty(ref _Camera3Use, value);
  306. }
  307. private bool _Camera4Use;
  308. /// <summary>
  309. /// 相机4是否使用
  310. /// </summary>
  311. public bool Camera4Use
  312. {
  313. get => _Camera4Use;
  314. set => SetProperty(ref _Camera4Use, value);
  315. }
  316. private bool _Camera5Use;
  317. /// <summary>
  318. /// 相机5是否使用
  319. /// </summary>
  320. public bool Camera5Use
  321. {
  322. get => _Camera5Use;
  323. set => SetProperty(ref _Camera5Use, value);
  324. }
  325. private bool _Camera6Use;
  326. /// <summary>
  327. /// 相机6是否使用
  328. /// </summary>
  329. public bool Camera6Use
  330. {
  331. get => _Camera6Use;
  332. set => SetProperty(ref _Camera6Use, value);
  333. }
  334. private bool _Camera7Use;
  335. /// <summary>
  336. /// 相机7是否使用
  337. /// </summary>
  338. public bool Camera7Use
  339. {
  340. get => _Camera7Use;
  341. set => SetProperty(ref _Camera7Use, value);
  342. }
  343. private bool _Camera8Use;
  344. /// <summary>
  345. /// 相机8是否使用
  346. /// </summary>
  347. public bool Camera8Use
  348. {
  349. get => _Camera8Use;
  350. set => SetProperty(ref _Camera8Use, value);
  351. }
  352. private bool _CameraData1Use;
  353. /// <summary>
  354. /// 相机长度1是否使用
  355. /// </summary>
  356. public bool CameraData1Use
  357. {
  358. get => _CameraData1Use;
  359. set => SetProperty(ref _CameraData1Use, value);
  360. }
  361. private bool _CameraData2Use;
  362. /// <summary>
  363. /// 相机长度2是否使用
  364. /// </summary>
  365. public bool CameraData2Use
  366. {
  367. get => _CameraData2Use;
  368. set => SetProperty(ref _CameraData2Use, value);
  369. }
  370. private bool _CameraData3Use;
  371. /// <summary>
  372. /// 相机长度3是否使用
  373. /// </summary>
  374. public bool CameraData3Use
  375. {
  376. get => _CameraData3Use;
  377. set => SetProperty(ref _CameraData3Use, value);
  378. }
  379. private bool _CameraData4Use;
  380. /// <summary>
  381. /// 相机长度4是否使用
  382. /// </summary>
  383. public bool CameraData4Use
  384. {
  385. get => _CameraData4Use;
  386. set => SetProperty(ref _CameraData4Use, value);
  387. }
  388. private bool _CameraProduct1Use;
  389. /// <summary>
  390. /// 相机切换产品1是否使用
  391. /// </summary>
  392. public bool CameraProduct1Use
  393. {
  394. get => _CameraProduct1Use;
  395. set => SetProperty(ref _CameraProduct1Use, value);
  396. }
  397. private bool _CameraProduct2Use;
  398. /// <summary>
  399. /// 相机切换产品2是否使用
  400. /// </summary>
  401. public bool CameraProduct2Use
  402. {
  403. get => _CameraProduct2Use;
  404. set => SetProperty(ref _CameraProduct2Use, value);
  405. }
  406. private bool _CameraProduct3Use;
  407. /// <summary>
  408. /// 相机切换产品3是否使用
  409. /// </summary>
  410. public bool CameraProduct3Use
  411. {
  412. get => _CameraProduct3Use;
  413. set => SetProperty(ref _CameraProduct3Use, value);
  414. }
  415. private bool _CameraProduct4Use;
  416. /// <summary>
  417. /// 相机切换产品4是否使用
  418. /// </summary>
  419. public bool CameraProduct4Use
  420. {
  421. get => _CameraProduct4Use;
  422. set => SetProperty(ref _CameraProduct4Use, value);
  423. }
  424. private bool _PhotoAI;
  425. /// <summary>
  426. /// 深度学习是否使用
  427. /// </summary>
  428. public bool PhotoAI
  429. {
  430. get => _PhotoAI;
  431. set => SetProperty(ref _PhotoAI, value);
  432. }
  433. private bool _AxisPassUse;
  434. /// <summary>
  435. /// 轴过度点是否使用
  436. /// </summary>
  437. public bool AxisPassUse
  438. {
  439. get => _AxisPassUse;
  440. set => SetProperty(ref _AxisPassUse, value);
  441. }
  442. private bool _LightUse;
  443. /// <summary>
  444. /// 光源是否使用
  445. /// </summary>
  446. public bool LightUse
  447. {
  448. get => _LightUse;
  449. set => SetProperty(ref _LightUse, value);
  450. }
  451. private bool _PhotosUse;
  452. /// <summary>
  453. /// 多次拍照是否使用
  454. /// </summary>
  455. public bool PhotosUse
  456. {
  457. get => _PhotosUse;
  458. set => SetProperty(ref _PhotosUse, value);
  459. }
  460. private float _confThreshold;
  461. public float confThreshold
  462. {
  463. get { return _confThreshold; }
  464. set => SetProperty(ref _confThreshold, value);
  465. }
  466. private float _iouThreshold;
  467. public float iouThreshold
  468. {
  469. get { return _iouThreshold; }
  470. set => SetProperty(ref _iouThreshold, value);
  471. }
  472. }
  473. }