|
|
|
@ -1,7 +1,9 @@ |
|
|
|
|
using System.Collections.Generic; |
|
|
|
|
using System.ComponentModel; |
|
|
|
|
using System.Data; |
|
|
|
|
using System.IO; |
|
|
|
|
using System.Reflection; |
|
|
|
|
using System.Windows.Forms; |
|
|
|
|
using System.Windows.Input; |
|
|
|
|
using System.Windows.Shapes; |
|
|
|
|
using HandyControl.Controls; |
|
|
|
@ -31,6 +33,8 @@ public class GradingResultVM : BaseViewModel |
|
|
|
|
private string _cutLevelTotal; |
|
|
|
|
private string _symLevelTotal; |
|
|
|
|
public ICommand ChangeSymCommand { get; } |
|
|
|
|
|
|
|
|
|
public ICommand SaveAsCommand { get; } |
|
|
|
|
public List<DataInfo> DtResults { get { return _dtResults; } set { _dtResults = value; OnPropertyChanged(nameof(DtResults)); } } |
|
|
|
|
public ViewportData ViewportData { get { return _viewportData; } set { _viewportData = value; OnPropertyChanged(nameof(ViewportData)); } } |
|
|
|
|
public string Standard { get { return _standard; } set { _standard = value; OnPropertyChanged(nameof(Standard)); } } |
|
|
|
@ -53,7 +57,6 @@ public class GradingResultVM : BaseViewModel |
|
|
|
|
/// <param name="result">检测结果</param> |
|
|
|
|
public GradingResultVM(object result) |
|
|
|
|
{ |
|
|
|
|
ChangeSymCommand = new RelayCommand(ChangeSym); |
|
|
|
|
if (result != null) |
|
|
|
|
{ |
|
|
|
|
InitView(result as AlgorithmResultEntity); |
|
|
|
@ -441,6 +444,45 @@ public class GradingResultVM : BaseViewModel |
|
|
|
|
{ |
|
|
|
|
return m*m; |
|
|
|
|
} |
|
|
|
|
public void SaveAs() |
|
|
|
|
{ |
|
|
|
|
string filePath = ""; |
|
|
|
|
using (var folderBrowserDlg = new FolderBrowserDialog()) |
|
|
|
|
{ |
|
|
|
|
DialogResult result = folderBrowserDlg.ShowDialog(); |
|
|
|
|
|
|
|
|
|
if (result == DialogResult.OK) |
|
|
|
|
{ |
|
|
|
|
filePath = folderBrowserDlg.SelectedPath; |
|
|
|
|
ExportFile(filePath); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
private void ExportFile(string filePath) |
|
|
|
|
{ |
|
|
|
|
TxtFile(filePath); |
|
|
|
|
ExcelFile(filePath); |
|
|
|
|
DatFile(filePath); |
|
|
|
|
STLFile(filePath); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void TxtFile(string filePath) |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
private void ExcelFile(string filePath) |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
private void DatFile(string filePath) |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
private void STLFile(string filePath) |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private string GetName(string id) |
|
|
|
|
{ |
|
|
|
|
// TODO DB没关联 |
|
|
|
@ -531,7 +573,7 @@ public class CalGradeInfo{ |
|
|
|
|
public int isMaxExist { get; set; } |
|
|
|
|
public int isMinExist { get; set; } |
|
|
|
|
} |
|
|
|
|
public class DataInfo() : BaseViewModel |
|
|
|
|
public class DataInfo |
|
|
|
|
{ |
|
|
|
|
public string? TestItemId { get; set; } |
|
|
|
|
public string? TestItemName { get; set; } |
|
|
|
@ -541,18 +583,40 @@ public class DataInfo() : BaseViewModel |
|
|
|
|
public string? Max { get; set; } |
|
|
|
|
public string? CutLevel { get; set; } |
|
|
|
|
private int? _symLevel; |
|
|
|
|
public int? SymLevel { get { return _symLevel; } set { _symLevel = value; OnPropertyChanged(nameof(SymLevel)); }} |
|
|
|
|
public DataTable GradeList { get { |
|
|
|
|
//public int? SymLevel { get; set; } |
|
|
|
|
public int? SymLevel |
|
|
|
|
{ |
|
|
|
|
get { return _symLevel; } |
|
|
|
|
set |
|
|
|
|
{ |
|
|
|
|
if (_symLevel != value) |
|
|
|
|
{ |
|
|
|
|
_symLevel = value; |
|
|
|
|
OnPropertyChanged(nameof(SymLevel)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
private DataTable? _gradeList; |
|
|
|
|
public DataTable GradeList { |
|
|
|
|
get |
|
|
|
|
{ |
|
|
|
|
// TODO DB没关联 |
|
|
|
|
DataTable GradeList = new DataTable(); |
|
|
|
|
GradeList.Columns.Add("Key"); |
|
|
|
|
GradeList.Columns.Add("Value"); |
|
|
|
|
GradeList.Rows.Add("极好", 1); |
|
|
|
|
GradeList.Rows.Add("很好", 2); |
|
|
|
|
GradeList.Rows.Add("好", 3); |
|
|
|
|
GradeList.Rows.Add("一般", 4); |
|
|
|
|
GradeList.Rows.Add("差", 5); |
|
|
|
|
return GradeList; |
|
|
|
|
if (this._gradeList == null) { |
|
|
|
|
_gradeList = new DataTable(); |
|
|
|
|
_gradeList.Columns.Add("Key"); |
|
|
|
|
_gradeList.Columns.Add("Value"); |
|
|
|
|
_gradeList.Rows.Add("极好", 1); |
|
|
|
|
_gradeList.Rows.Add("很好", 2); |
|
|
|
|
_gradeList.Rows.Add("好", 3); |
|
|
|
|
_gradeList.Rows.Add("一般", 4); |
|
|
|
|
_gradeList.Rows.Add("差", 5); |
|
|
|
|
} |
|
|
|
|
return _gradeList; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
public event PropertyChangedEventHandler PropertyChanged; |
|
|
|
|
protected void OnPropertyChanged(string propertyName) |
|
|
|
|
{ |
|
|
|
|
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); |
|
|
|
|
} |
|
|
|
|
} |