|
@@ -9,6 +9,7 @@ using System.Collections.Generic;
|
|
|
using System.ComponentModel;
|
|
|
using System.IO;
|
|
|
using Autodesk.Revit.DB;
|
|
|
+using Saga.PlugIn.CreateFacility;
|
|
|
using SAGA.DotNetUtils.Extend;
|
|
|
using SAGA.DotNetUtils.WPF;
|
|
|
using SAGA.RevitUtils;
|
|
@@ -18,15 +19,16 @@ namespace Saga.PlugIn.ModelCheck
|
|
|
/// <summary>
|
|
|
/// DataCheckContext
|
|
|
/// </summary>
|
|
|
- public class VMModelCheck:BaseViewModelStub
|
|
|
+ public class VMModelCheck : BaseViewModelStub
|
|
|
{
|
|
|
public VMModelCheck(Document doc)
|
|
|
{
|
|
|
m_Doc = doc;
|
|
|
ModelFilePath = doc.PathName;
|
|
|
- SavePath = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory));
|
|
|
+ SaveDir = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory));
|
|
|
CheckItems = CheckOperation.GetModeCheckItems();
|
|
|
ModelCheckState = ModelCheckState.Prepare;
|
|
|
+ CurrentIndex = 1;
|
|
|
}
|
|
|
|
|
|
private Document m_Doc;
|
|
@@ -71,6 +73,19 @@ namespace Saga.PlugIn.ModelCheck
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private string m_SaveDir;
|
|
|
+ /// <summary>
|
|
|
+ /// 保存路径
|
|
|
+ /// </summary>
|
|
|
+ public string SaveDir
|
|
|
+ {
|
|
|
+ get { return m_SaveDir; }
|
|
|
+ set
|
|
|
+ {
|
|
|
+ m_SaveDir = value;
|
|
|
+ NotifyPropertyChanged("SaveDir");
|
|
|
+ }
|
|
|
+ }
|
|
|
private string m_SavePath;
|
|
|
/// <summary>
|
|
|
/// 保存路径
|
|
@@ -84,6 +99,21 @@ namespace Saga.PlugIn.ModelCheck
|
|
|
NotifyPropertyChanged("SavePath");
|
|
|
}
|
|
|
}
|
|
|
+ private int m_CurrentIndex;
|
|
|
+ /// <summary>
|
|
|
+ /// 检查进度
|
|
|
+ /// </summary>
|
|
|
+ public int CurrentIndex
|
|
|
+ {
|
|
|
+ get { return m_CurrentIndex; }
|
|
|
+ set
|
|
|
+ {
|
|
|
+ m_CurrentIndex = value;
|
|
|
+ NotifyPropertyChanged("CurrentIndex");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ public WinModeCheck Win { get; set; }
|
|
|
+
|
|
|
[Command]
|
|
|
public void Execute(object param)
|
|
|
{
|
|
@@ -92,17 +122,22 @@ namespace Saga.PlugIn.ModelCheck
|
|
|
switch (ModelCheckState)
|
|
|
{
|
|
|
case ModelCheckState.Prepare:
|
|
|
+ Win = param as WinModeCheck;
|
|
|
CheckItems.ForEach(t => t.ModelCheckState = ModelCheckState.Progress);
|
|
|
ModelCheckState = ModelCheckState.Progress;
|
|
|
- string savePath = Path.Combine(SavePath,
|
|
|
+ string savePath = Path.Combine(SaveDir,
|
|
|
$"{ModelFilePath.GetFileName()}{"模型规范检查报告"}{DateTime.Now.ToString("yyyyMMddHHmmss")}.xlsx");
|
|
|
- CheckOperation.Execute(CheckItems, m_Doc, savePath);
|
|
|
+ CheckOperation.Execute(CheckItems, m_Doc, savePath, this);
|
|
|
ModelCheckState = ModelCheckState.Ending;
|
|
|
+ //为了Ending的界面显示,出问题注释掉
|
|
|
+ SavePath = savePath;
|
|
|
+ WinTipCheckComplete win = new WinTipCheckComplete();
|
|
|
+ win.ShowDialog();
|
|
|
break;
|
|
|
case ModelCheckState.Progress:
|
|
|
break;
|
|
|
case ModelCheckState.Ending:
|
|
|
- System.Diagnostics.Process.Start("explorer.exe", SavePath);
|
|
|
+ System.Diagnostics.Process.Start("explorer.exe", SaveDir);
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
@@ -110,11 +145,11 @@ namespace Saga.PlugIn.ModelCheck
|
|
|
{
|
|
|
MessageShow.Show(e);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
public bool CanExecute(object param)
|
|
|
{
|
|
|
- return ModelCheckState.Progress!=ModelCheckState;
|
|
|
+ return ModelCheckState.Progress != ModelCheckState;
|
|
|
}
|
|
|
|
|
|
}
|