| | |
| | | using HMI.Core.Util; |
| | | using HMI.UI.Util; |
| | | using Microsoft.Win32; |
| | | using NPOI.SS.Formula.Functions; |
| | | using NPOI.XSSF.UserModel; |
| | | using Sharp7; |
| | | using SimensDriver; |
| | |
| | | case "settingBtn": |
| | | OpenSettingWindow(); |
| | | break; |
| | | case "refreshBtn": |
| | | //Model. |
| | | break; |
| | | case "importBtn": |
| | | ImportText(); |
| | | break; |
| | |
| | | catch (Exception ex) |
| | | { |
| | | log.Error("AlarmText Import Failed.", ex); |
| | | ToastHelper.Error(Window.GetWindow(this), $"导入失败!{ex.Message}"); |
| | | ToastHelper.Error(Window.GetWindow(this), $"{this.lang("App.ImportFailed")}: {ex.Message}"); |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | if (excelFile.IndexOf(".xlsm") < 0) |
| | | { |
| | | this.Warning("仅支持xlsm格式文件"); |
| | | this.Warning(this.lang("Alm.OnlySupportXlsm")); |
| | | return; |
| | | } |
| | | |
| | |
| | | XmlHelper.SerializeToXml(textSettingPath, this.alarmTexts); |
| | | } |
| | | |
| | | this.Success("导入成功"); |
| | | this.Success(this.lang("App.ImportSuccess")); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | log.Error($"Row {index} AlarmText Import Failed.", ex); |
| | | this.Error($"第{index}行导入异常!{ex.Message}"); |
| | | this.Error($"{this.lang("Alm.RowImportFailed", index)}: {ex.Message}"); |
| | | } |
| | | } |
| | | |