Quellcode durchsuchen

mxg:检查项排序;检查过程显示图标格式;其它交互微调

mengxiangge vor 5 Jahren
Ursprung
Commit
11f8e74edf
27 geänderte Dateien mit 305 neuen und 55 gelöschten Zeilen
  1. 2 0
      FWindSoft/Revit/XH.Tool/CreateBallFlagCommand.cs
  2. 7 6
      FWindSoft/Revit/XiaoHongApplication/XHApplication.cs
  3. 28 10
      FWindSoft/Saga.PlugIn/ModelCheck/CheckOperation.cs
  4. 1 0
      FWindSoft/Saga.PlugIn/ModelCheck/ColumnCheck.cs
  5. 1 0
      FWindSoft/Saga.PlugIn/ModelCheck/ConnectorCheck.cs
  6. 1 1
      FWindSoft/Saga.PlugIn/ModelCheck/DCRExport.cs
  7. 1 0
      FWindSoft/Saga.PlugIn/ModelCheck/ElementRangeCheck.cs
  8. 3 1
      FWindSoft/Saga.PlugIn/ModelCheck/EquipReferSystemCheck.cs
  9. 1 0
      FWindSoft/Saga.PlugIn/ModelCheck/EquipmentInSpaceCheck.cs
  10. 1 0
      FWindSoft/Saga.PlugIn/ModelCheck/EquipmentPartRefEqCheck.cs
  11. BIN
      FWindSoft/Saga.PlugIn/ModelCheck/ExcelTemplate/模型检查结果输出格式-模版.xlsx
  12. 6 1
      FWindSoft/Saga.PlugIn/ModelCheck/FamilyNameCheck.cs
  13. BIN
      FWindSoft/Saga.PlugIn/ModelCheck/Image/叉.png
  14. 23 10
      FWindSoft/Saga.PlugIn/ModelCheck/ModeCheckBase.cs
  15. 1 1
      FWindSoft/Saga.PlugIn/ModelCheck/ModeCheckResultBase.cs
  16. 44 9
      FWindSoft/Saga.PlugIn/ModelCheck/ModelCheckConverter.cs
  17. 1 0
      FWindSoft/Saga.PlugIn/ModelCheck/ParameterIntegrityCheck.cs
  18. 5 0
      FWindSoft/Saga.PlugIn/ModelCheck/ParseIgnoreAttribute.cs
  19. 1 0
      FWindSoft/Saga.PlugIn/ModelCheck/PipeCheck.cs
  20. 2 0
      FWindSoft/Saga.PlugIn/ModelCheck/SystemCheck.cs
  21. 1 0
      FWindSoft/Saga.PlugIn/ModelCheck/UnitCheck.cs
  22. 42 7
      FWindSoft/Saga.PlugIn/ModelCheck/VMModelCheck.cs
  23. 21 7
      FWindSoft/Saga.PlugIn/ModelCheck/WinModeCheck.xaml
  24. 25 2
      FWindSoft/Saga.PlugIn/ModelCheck/WinModeCheck.xaml.cs
  25. 37 0
      FWindSoft/Saga.PlugIn/ModelCheck/WinTipCheckComplete.xaml
  26. 40 0
      FWindSoft/Saga.PlugIn/ModelCheck/WinTipCheckComplete.xaml.cs
  27. 10 0
      FWindSoft/Saga.PlugIn/Saga.PlugIn.csproj

+ 2 - 0
FWindSoft/Revit/XH.Tool/CreateBallFlagCommand.cs

@@ -9,11 +9,13 @@ using Autodesk.Revit.Attributes;
 using Autodesk.Revit.DB;
 using Autodesk.Revit.UI;
 using FWindSoft.Revit;
+using FWindSoft.Revit.Menu;
 
 namespace LRH.Tool
 {
     [Transaction(TransactionMode.Manual)]
     [Regeneration(RegenerationOption.Manual)]
+    [Button(ButtonName = "Panel菜单")]
     public class CreateBallFlagCommand: ExternalCommand
     {
         public override Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)

+ 7 - 6
FWindSoft/Revit/XiaoHongApplication/XHApplication.cs

@@ -24,6 +24,9 @@ namespace LRH.RevitApplication
     {
         protected override void AttachExecute(UIControlledApplication application)
         {
+            DockableWindow win = new DockableWindow();
+            win.RegisterDockableWindow(CurrentApp.UIControlApp, RevitCustomDockablePanels.Default);
+
             CatchUnhandledException();
             //MessageTip.Show("启动");
 
@@ -39,13 +42,13 @@ namespace LRH.RevitApplication
                 config.CreateUIRibbion(application);
             }
 
-           
+
             //Delegate[] delArray = this.UIControlApp.ControlledApplication.FamilyLoadedIntoDocument.GetInvocationList();
             //this.UIControlApp.ControlledApplication.FamilyLoadedIntoDocument = null;
-           
-           
+
+
             //DockablePane.
-           // pane.pro
+            // pane.pro
             //var useEvent = typeof(ControlledApplication).GetEvent("FamilyLoadedIntoDocument");
             //var fileds = useEvent.DeclaringType.GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.IgnoreCase | BindingFlags.Static);
             //var filed= useEvent.DeclaringType.GetField(typeof(ControlledApplication).FullName+ "FamilyLoadedIntoDocument",BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.IgnoreCase | BindingFlags.Static);
@@ -55,8 +58,6 @@ namespace LRH.RevitApplication
             //
             //this.UIControlApp.ControlledApplication.FamilyLoadedIntoDocument += ControlledApplication_FamilyLoadedIntoDocument;
             //this.UIControlApp.ControlledApplication.FamilyLoadingIntoDocument += ControlledApplication_FamilyLoadingIntoDocument;
-            //DockableWindow win = new DockableWindow();
-            //win.RegisterDockableWindow(CurrentApp.UIControlApp, RevitCustomDockablePanels.Default);
         }
 
         private object m_obj = new object();

+ 28 - 10
FWindSoft/Saga.PlugIn/ModelCheck/CheckOperation.cs

@@ -13,6 +13,7 @@ using Autodesk.Revit.UI;
 using NPOI.SS.UserModel;
 using SAGA.DotNetUtils.Extend;
 using SAGA.DotNetUtils.Others;
+using SAGA.RevitUtils.MEP;
 
 namespace Saga.PlugIn.ModelCheck
 {
@@ -35,15 +36,27 @@ namespace Saga.PlugIn.ModelCheck
                 if (type.IsSubclassOf(typeof(ModeCheckBase)))
                 {
                     var attribute = type.GetCustomAttribute<ParseIgnoreAttribute>();
-                    if(attribute!=null)
+                    if (attribute != null)
                         continue;
                     var constructor = type.GetConstructor(Type.EmptyTypes);
-                    if(constructor==null)
+                    if (constructor == null)
                         continue;
-                    if(constructor.Invoke(null) is ModeCheckBase checkBase)
+                    if (constructor.Invoke(null) is ModeCheckBase checkBase)
                         list.Add(checkBase);
                 }
             }
+            list.Sort(new CommonComparer<ModeCheckBase>((a, b) =>
+            {
+                var attribute = a.GetType().GetCustomAttribute<ParseIndexAttribute>();
+                int i1 = 0;
+                if (attribute != null)
+                    i1 = attribute.Index;
+                attribute = b.GetType().GetCustomAttribute<ParseIndexAttribute>();
+                int i2 = 0;
+                if (attribute != null)
+                    i2 = attribute.Index;
+                return i1.CompareTo(i2);
+            }));
             list.ForEach(t =>
             {
                 t.SetBaseCheck(sagaSignCheck);
@@ -57,11 +70,16 @@ namespace Saga.PlugIn.ModelCheck
         /// </summary>
         /// <param name="list"></param>
         /// <param name="context"></param>
-        public static void Execute(List<ICheckBase> list, Document doc,string savePath)
+        public static void Execute(List<ICheckBase> list, Document doc, string savePath, VMModelCheck vm)
         {
             //检查
-            list.ForEach(t => t.Check2(doc));
-            
+            list.ForEach(t =>
+            {
+                t.Check2(doc);
+                vm.CurrentIndex++;
+                vm.Win.DoEvents();
+            });
+
             //重置workbook准备保存结果
             DCRExport.ClearWorkbook();
             //保存
@@ -93,13 +111,13 @@ namespace Saga.PlugIn.ModelCheck
                     IRow rowN = sheet.CreateRow(index);
                     DataCheckNPOIStyle style = result.IsRight ? DataCheckNPOIStyle.Content : DataCheckNPOIStyle.Error;
                     int i = 0;
-                    rowN.AddCell(i++, result.Name, DataCheckNPOIStyle.HyperLink,true);
+                    rowN.AddCell(i++, result.Name, DataCheckNPOIStyle.HyperLink, true);
                     //链接到指定页签
-                    var cellN0 = rowN.GetCell(i-1);
+                    var cellN0 = rowN.GetCell(i - 1);
                     cellN0.Hyperlink = DCRExport.CreateLink(result.Name);
-                    rowN.AddCell(i++, result.RIsChecked?"是":"否", style);
+                    rowN.AddCell(i++, result.RIsChecked ? "是" : "否", style);
                     //检查,并且结果为不通过
-                    string rowN4 = !result.IsRight&&result.RIsChecked ? "包含问题数据" : "";
+                    string rowN4 = !result.IsRight && result.RIsChecked ? "包含问题数据" : "";
                     rowN.AddCell(i++, rowN4, style);
                 }
                 #endregion

+ 1 - 0
FWindSoft/Saga.PlugIn/ModelCheck/ColumnCheck.cs

@@ -16,6 +16,7 @@ namespace Saga.PlugIn.ModelCheck
     /// <summary>
     /// UnitCheck
     /// </summary>
+    [ParseIndex(Index = 6)]
     class ColumnCheck : ModeCheckBase
     {
         public ColumnCheck()

+ 1 - 0
FWindSoft/Saga.PlugIn/ModelCheck/ConnectorCheck.cs

@@ -20,6 +20,7 @@ namespace Saga.PlugIn.ModelCheck
     /// <summary>
     /// UnitCheck
     /// </summary>
+    [ParseIndex(Index = 7)]
     class ConnectorCheck : ModeCheckBase
     {
         public ConnectorCheck()

+ 1 - 1
FWindSoft/Saga.PlugIn/ModelCheck/DCRExport.cs

@@ -9,6 +9,7 @@ using System.IO;
 using Microsoft.Win32;
 using NPOI.SS.UserModel;
 using NPOI.XSSF.UserModel;
+using Saga.PlugIn.CreateFacility;
 using SAGA.DotNetUtils;
 using SAGA.DotNetUtils.Others;
 
@@ -128,7 +129,6 @@ namespace Saga.PlugIn.ModelCheck
                 }
                 ms.Close();
                 ms.Dispose();
-                MessageShowBase.Infomation("建模规范检查已完成");
             }
             catch (Exception e)
             {

+ 1 - 0
FWindSoft/Saga.PlugIn/ModelCheck/ElementRangeCheck.cs

@@ -20,6 +20,7 @@ namespace Saga.PlugIn.ModelCheck
     /// <summary>
     /// 
     /// </summary>
+    [ParseIndex(Index = 2)]
     class ElementRangeCheck : ModeCheckBase
     {
         public ElementRangeCheck()

+ 3 - 1
FWindSoft/Saga.PlugIn/ModelCheck/EquipReferSystemCheck.cs

@@ -9,6 +9,7 @@ using System.Collections.Generic;
 using System.Linq;
 using Autodesk.Revit.DB;
 using NPOI.SS.UserModel;
+using SAGA.DotNetUtils.Extend;
 using SAGA.DotNetUtils.Logger;
 using SAGA.DotNetUtils.Others;
 using SAGA.RevitUtils.Extends;
@@ -17,8 +18,9 @@ using SAGA.RevitUtils.MEP;
 namespace Saga.PlugIn.ModelCheck
 {
     /// <summary>
-    /// UnitCheck
+    /// 
     /// </summary>
+    [ParseIndex(Index = 11)]
     class EquipReferSystemCheck : ModeCheckBase 
     {
         public EquipReferSystemCheck()

+ 1 - 0
FWindSoft/Saga.PlugIn/ModelCheck/EquipmentInSpaceCheck.cs

@@ -18,6 +18,7 @@ namespace Saga.PlugIn.ModelCheck
     /// <summary>
     /// UnitCheck
     /// </summary>
+    [ParseIndex(Index = 9)]
     class EquipmentInSpaceCheck : ModeCheckBase
     {
         public EquipmentInSpaceCheck()

+ 1 - 0
FWindSoft/Saga.PlugIn/ModelCheck/EquipmentPartRefEqCheck.cs

@@ -16,6 +16,7 @@ namespace Saga.PlugIn.ModelCheck
     /// <summary>
     /// UnitCheck
     /// </summary>
+    [ParseIndex(Index = 5)]
     class EquipmentPartRefEqCheck : ModeCheckBase
     {
         public EquipmentPartRefEqCheck()

BIN
FWindSoft/Saga.PlugIn/ModelCheck/ExcelTemplate/模型检查结果输出格式-模版.xlsx


+ 6 - 1
FWindSoft/Saga.PlugIn/ModelCheck/FamilyNameCheck.cs

@@ -6,6 +6,7 @@
 
 using System;
 using System.Collections.Generic;
+using System.Collections.ObjectModel;
 using System.Linq;
 using Autodesk.Revit.DB;
 using NPOI.SS.UserModel;
@@ -19,6 +20,7 @@ namespace Saga.PlugIn.ModelCheck
     /// <summary>
     /// UnitCheck
     /// </summary>
+    [ParseIndex(Index = 4)]
     class FamilyNameCheck : ModeCheckBase
     {
         public FamilyNameCheck()
@@ -79,7 +81,10 @@ namespace Saga.PlugIn.ModelCheck
 
                 }
             }
-            Results.Sort(new CommonComparer<ModeCheckResultBase>((x, y) => { return x.IsRight.CompareTo(y.IsRight);}));
+
+            var list = Results.ToList();
+            list.Sort(new CommonComparer<ModeCheckResultBase>((x, y) => { return x.IsRight.CompareTo(y.IsRight); }));
+            Results =new ObservableCollection<ModeCheckResultBase>(list);
             return Results.All(t => t.IsRight);
         }
         /// <summary>

BIN
FWindSoft/Saga.PlugIn/ModelCheck/Image/叉.png


+ 23 - 10
FWindSoft/Saga.PlugIn/ModelCheck/ModeCheckBase.cs

@@ -6,6 +6,7 @@
 
 using System;
 using System.Collections.Generic;
+using System.Collections.ObjectModel;
 using System.ComponentModel;
 using Autodesk.Revit.DB;
 using NPOI.SS.UserModel;
@@ -16,14 +17,22 @@ namespace Saga.PlugIn.ModelCheck
     /// <summary>
     /// CheckBase
     /// </summary>
-    public class ModeCheckBase:ICheckBase,INotifyPropertyChanged
+    public class ModeCheckBase : ICheckBase, INotifyPropertyChanged
     {
         public string Name { get; set; }
 
         protected Document m_Document { get; set; }
 
-        private List<ModeCheckResultBase> results = new List<ModeCheckResultBase>();
-        internal List<ModeCheckResultBase> Results { get => results; set => results = value; }
+        private ObservableCollection<ModeCheckResultBase> results = new ObservableCollection<ModeCheckResultBase>();
+        public ObservableCollection<ModeCheckResultBase> Results
+        {
+            get { return results; }
+            set
+            {
+                results = value;
+                PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Results)));
+            }
+        }
 
         public void Check2(Document doc)
         {
@@ -31,6 +40,8 @@ namespace Saga.PlugIn.ModelCheck
             ModelCheckState = ModelCheckState.Ending;
             if (!RIsChecked) return;
             Check();
+            //刷新界面
+            Results = Results;
         }
 
         public virtual bool Check()
@@ -65,7 +76,7 @@ namespace Saga.PlugIn.ModelCheck
         public bool SetSheetVisible()
         {
             bool result = RIsChecked;
-            
+
             //if (result)
             //    result = !(results.All(t => t.IsRight));
             //如果有没有通过的项
@@ -78,7 +89,8 @@ namespace Saga.PlugIn.ModelCheck
                     //隐藏
                     book.SetSheetHidden(index, SheetState.VeryHidden);
                     //关联项隐藏
-                    foreach (var str in RSPecificationSheet)              {
+                    foreach (var str in RSPecificationSheet)
+                    {
 
                         int i = book.GetSheetIndex(str);
                         //隐藏
@@ -104,7 +116,7 @@ namespace Saga.PlugIn.ModelCheck
         #endregion
 
         #region 样式控制
-        private ModelCheckState m_ModelCheckState=ModelCheckState.Prepare;
+        private ModelCheckState m_ModelCheckState = ModelCheckState.Prepare;
 
         public ModelCheckState ModelCheckState
         {
@@ -122,14 +134,15 @@ namespace Saga.PlugIn.ModelCheck
         /// </summary>
         public bool RIsChecked
         {
-            get { return m_RIsChecked;}
+            get { return m_RIsChecked; }
             set
             {
                 m_RIsChecked = value;
-                PropertyChanged?.Invoke(this,new PropertyChangedEventArgs(nameof(RIsChecked)));
-            } }
+                PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(RIsChecked)));
+            }
+        }
 
-        private List<string> m_SpecificationSheet=new List<string>();
+        private List<string> m_SpecificationSheet = new List<string>();
 
         public event PropertyChangedEventHandler PropertyChanged;
 

+ 1 - 1
FWindSoft/Saga.PlugIn/ModelCheck/ModeCheckResultBase.cs

@@ -12,7 +12,7 @@ namespace Saga.PlugIn.ModelCheck
     /// ResultBase
     /// </summary>
     [Serializable]
-    class ModeCheckResultBase
+    public class ModeCheckResultBase
     {
         public ModeCheckResultBase RBase { get; set; }
         /// <summary>

+ 44 - 9
FWindSoft/Saga.PlugIn/ModelCheck/ModelCheckConverter.cs

@@ -4,7 +4,9 @@
  * 创建日期:2019/10/21 16:02:55
  * ==============================================================================*/
 using System;
+using System.Collections.ObjectModel;
 using System.Globalization;
+using System.Linq;
 using System.Text;
 using System.Windows;
 using System.Windows.Controls;
@@ -40,21 +42,21 @@ namespace Saga.PlugIn.ModelCheck
         }
     }
 
-    class ItemImageConverter : IValueConverter
+    class ItemImageConverter : IMultiValueConverter
     {
         public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
         {
-            var state = (ModelCheckState)value;
+            var items = value as ObservableCollection<ModeCheckResultBase>;
             BitmapSource image = null;
             string imageName = null;
-            switch (state)
+
+            if (items != null &&items.Count>0&& items.All(t => t.IsRight))
             {
-                case ModelCheckState.Progress:
-                    imageName = "省略号.png";
-                    break;
-                case ModelCheckState.Ending:
-                    imageName = "对勾.png";
-                    break;
+                imageName = "对勾.png";
+            }
+            else
+            {
+                imageName = "叉.png";
             }
             
             if (!string.IsNullOrEmpty(imageName))
@@ -69,5 +71,38 @@ namespace Saga.PlugIn.ModelCheck
         {
             throw new NotImplementedException();
         }
+
+        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
+        {
+            var state = (ModelCheckState)values[0];
+            BitmapSource image = null;
+            string imageName = null;
+            if(state== ModelCheckState.Progress)
+                imageName = "省略号.png";
+            else
+            {
+                var items = values[1] as ObservableCollection<ModeCheckResultBase>;
+                if (items != null  && items.All(t => t.IsRight))
+                {
+                    imageName = "对勾.png";
+                }
+                else
+                {
+                    imageName = "叉.png";
+                }
+            }
+
+            if (!string.IsNullOrEmpty(imageName))
+            {
+                Uri uri = new Uri("pack://application:,,,/Saga.PlugIn;component/ModelCheck/Image/" + imageName);
+                image = BitmapFrame.Create(uri, BitmapCreateOptions.None, BitmapCacheOption.OnDemand);
+            }
+            return image;
+        }
+
+        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
+        {
+            throw new NotImplementedException();
+        }
     }
 }

+ 1 - 0
FWindSoft/Saga.PlugIn/ModelCheck/ParameterIntegrityCheck.cs

@@ -17,6 +17,7 @@ namespace Saga.PlugIn.ModelCheck
     /// <summary>
     /// UnitCheck
     /// </summary>
+    [ParseIndex(Index = 12)]
     class ParameterIntegrityCheck : ModeCheckBase
     {
         public ParameterIntegrityCheck()

+ 5 - 0
FWindSoft/Saga.PlugIn/ModelCheck/ParseIgnoreAttribute.cs

@@ -17,4 +17,9 @@ namespace Saga.PlugIn.ModelCheck
     class ParseIgnoreAttribute : Attribute
     {
     }
+
+    class ParseIndexAttribute:Attribute
+    {
+        public int Index { get; set; }
+    }
 }

+ 1 - 0
FWindSoft/Saga.PlugIn/ModelCheck/PipeCheck.cs

@@ -20,6 +20,7 @@ namespace Saga.PlugIn.ModelCheck
     /// <summary>
     /// SagaCheck
     /// </summary>
+    [ParseIndex(Index = 10)]
     class PipeCheck : ModeCheckBase
     {
         public PipeCheck()

+ 2 - 0
FWindSoft/Saga.PlugIn/ModelCheck/SystemCheck.cs

@@ -10,6 +10,7 @@ using System.Linq;
 using Autodesk.Revit.DB;
 using Autodesk.Revit.DB.Mechanical;
 using NPOI.SS.UserModel;
+using SAGA.DotNetUtils.Extend;
 using SAGA.DotNetUtils.Others;
 using SAGA.RevitUtils.MEP;
 
@@ -18,6 +19,7 @@ namespace Saga.PlugIn.ModelCheck
     /// <summary>
     /// UnitCheck
     /// </summary>
+    [ParseIndex(Index = 8)]
     class SystemCheck : ModeCheckBase
     {
         public SystemCheck()

+ 1 - 0
FWindSoft/Saga.PlugIn/ModelCheck/UnitCheck.cs

@@ -15,6 +15,7 @@ namespace Saga.PlugIn.ModelCheck
     /// <summary>
     /// UnitCheck
     /// </summary>
+    [ParseIndex(Index = 3)]
     class UnitCheck : ModeCheckBase
     {
         public UnitCheck()

+ 42 - 7
FWindSoft/Saga.PlugIn/ModelCheck/VMModelCheck.cs

@@ -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;
         }
 
     }

+ 21 - 7
FWindSoft/Saga.PlugIn/ModelCheck/WinModeCheck.xaml

@@ -28,7 +28,7 @@
         </Grid>
         <Grid Grid.Row="1" Margin="10,0">
             <Grid.RowDefinitions>
-                <RowDefinition Height="30"></RowDefinition>
+                <RowDefinition Height="26"></RowDefinition>
                 <RowDefinition Height="*"></RowDefinition>
             </Grid.RowDefinitions>
             <Grid Grid.Row="0">
@@ -39,10 +39,16 @@
                     <ListBox.ItemTemplate>
                         <DataTemplate>
                             <WrapPanel  >
-                                <Image Width="30" Visibility="{Binding Path=ModelCheckState,
+                                <Image Width="26" Visibility="{Binding Path=ModelCheckState,
                                     Converter={StaticResource ItemImageEqualVisibleConverter},
-                                            ConverterParameter={x:Static local:ModelCheckState.Prepare}}"
-                                       Source="{Binding Path=ModelCheckState,Converter={StaticResource ItemImageConverter}}"></Image> 
+                                            ConverterParameter={x:Static local:ModelCheckState.Prepare}}">
+                                    <Image.Source>
+                                        <MultiBinding Converter="{StaticResource ItemImageConverter}">
+                                            <Binding Path="ModelCheckState"></Binding>
+                                            <Binding Path="Results"></Binding>
+                                        </MultiBinding>
+                                    </Image.Source>
+                                </Image> 
                                 <Label Content="{Binding Path=Name}" VerticalContentAlignment="Center"></Label>
                             </WrapPanel>
                         </DataTemplate>
@@ -74,7 +80,7 @@
                     </Grid.ColumnDefinitions>
                     <TextBox Margin="10,0,0,0" VerticalContentAlignment="Center" Height="25" 
                              Name="txtPath"
-                             Text="{Binding Path=SavePath,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}" 
+                             Text="{Binding Path=SaveDir,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}" 
                              VerticalAlignment="Center"></TextBox>
                     <Button Grid.Column="1" Content="浏览" Height="25" Margin="10,0,5,0"
                             Click="SelectFile_OnClick"></Button>
@@ -84,6 +90,7 @@
                             HorizontalAlignment="Right" 
                             Margin="0,0,5,0" VerticalAlignment="Center"
                             Command="{Binding Path=Commands.Execute}" 
+                            CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=Window,Mode=FindAncestor}}"
                             ></Button>
                 </Grid>
             </Grid>
@@ -96,10 +103,17 @@
                     <RowDefinition Height="60"></RowDefinition>
                 </Grid.RowDefinitions>
                 <Grid Grid.Row="0" Margin="5,0">
-                    <Label Content="建模规范检查进度...(12/12)" VerticalAlignment="Center"></Label>
+                    <WrapPanel>
+                        <Label Content="建模规范检查进度...(" VerticalAlignment="Center"></Label>
+                        <Label Margin="0" Content="{Binding ElementName=ProgressBar,Path=Value}" VerticalAlignment="Center"></Label>
+                        <Label Margin="0" Content="/" VerticalAlignment="Center"></Label>
+                        <Label Margin="0" Content="{Binding ElementName=ProgressBar,Path=Maximum}" VerticalAlignment="Center"></Label>
+                        <Label Margin="0" Content=")" VerticalAlignment="Center"></Label>
+                    </WrapPanel>
+                    
                 </Grid>
                 <Grid Grid.Row="1" Margin="15,0">
-                    <ProgressBar  Grid.Column="0" Height="30" Value="12" Maximum="12"></ProgressBar>
+                    <ProgressBar x:Name="ProgressBar"  Grid.Column="0" Height="30" Value="{Binding Path=CurrentIndex}" Maximum="{Binding Path=CheckItems.Count}"></ProgressBar>
                 </Grid>
                 <Grid Grid.Row="2" Background="LightGray">
                     <Button Width="100" Height="25" 

+ 25 - 2
FWindSoft/Saga.PlugIn/ModelCheck/WinModeCheck.xaml.cs

@@ -9,6 +9,7 @@ using Microsoft.Win32;
 using SAGA.DotNetUtils;
 using SAGA.DotNetUtils.Extend;
 using System.Windows.Forms;
+using System.Windows.Threading;
 
 namespace Saga.PlugIn.ModelCheck
 {
@@ -22,9 +23,10 @@ namespace Saga.PlugIn.ModelCheck
             InitializeComponent();
             this.DataContext = viewmodel;
         }
-        
+
 
         #region BindingProperty
+
         #endregion
 
 
@@ -34,7 +36,7 @@ namespace Saga.PlugIn.ModelCheck
         {
             this.DialogResult = true;
         }
-        
+
         #endregion
 
         private void SelectFile_OnClick(object sender, RoutedEventArgs e)
@@ -47,6 +49,27 @@ namespace Saga.PlugIn.ModelCheck
                 txtPath.Text = dialog.SelectedPath;
             }
         }
+
+        public void DoEvents()
+        {
+            var frame = new DispatcherFrame();
+            Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Background,
+                new DispatcherOperationCallback(ExitFrames), frame);
+            try
+            {
+                Dispatcher.PushFrame(frame);
+            }
+            catch (InvalidOperationException)
+            {
+            }
+        }
+
+        private object ExitFrames(object frame)
+        {
+            ((DispatcherFrame) frame).Continue = false;
+            return null;
+
+        }
     }
 }
 

+ 37 - 0
FWindSoft/Saga.PlugIn/ModelCheck/WinTipCheckComplete.xaml

@@ -0,0 +1,37 @@
+<Window x:Class="Saga.PlugIn.CreateFacility.WinTipCheckComplete"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+             xmlns:local="clr-namespace:Saga.PlugIn.CreateFacility"
+             mc:Ignorable="d" ResizeMode="NoResize" WindowStartupLocation="CenterScreen"
+             Height="300" Width="450"
+        Title="提示">
+    <Grid>
+        <Grid.RowDefinitions>
+            <RowDefinition></RowDefinition>
+            <RowDefinition Height="60"></RowDefinition>
+        </Grid.RowDefinitions>
+        <Grid>
+            <Grid.RowDefinitions>
+                <RowDefinition></RowDefinition>
+                <RowDefinition></RowDefinition>
+            </Grid.RowDefinitions>
+            <Grid.ColumnDefinitions>
+                <ColumnDefinition Width="100"></ColumnDefinition>
+                <ColumnDefinition></ColumnDefinition>
+            </Grid.ColumnDefinitions>
+            <Image Height="40" Width="40" VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="10,0"
+                   Source="../CreateFacility/Image/成功.png"></Image>
+            <Label Grid.Row="0" Grid.Column="1" Content="建模规范检查已完成"
+                   FontSize="20" FontWeight="UltraBlack"
+                   VerticalAlignment="Bottom"></Label>
+            
+        </Grid>
+        <Grid Grid.Row="1" Background="LightGray">
+            <Button Width="100" Height="25" Background="Black"  Foreground="White" Content="确认"
+                    HorizontalAlignment="Right" Margin="0,0,5,0" VerticalAlignment="Center" 
+                    Click="ButtonNext_OnClick" ></Button>
+        </Grid>
+    </Grid>
+</Window>

+ 40 - 0
FWindSoft/Saga.PlugIn/ModelCheck/WinTipCheckComplete.xaml.cs

@@ -0,0 +1,40 @@
+using System.Windows;
+
+namespace Saga.PlugIn.CreateFacility
+{
+    /// <summary>
+    /// WinTipMissFamily.xaml 的交互逻辑
+    /// </summary>
+    public partial class WinTipCheckComplete
+    {
+
+        public WinTipCheckComplete()
+        {
+            InitializeComponent();
+            this.DataContext = this;
+        }
+
+        private string m_id;
+        private string m_Tip;
+
+        public string Tip
+        {
+            get { return m_Tip; }
+            set { m_Tip = value; }
+        }
+
+        #region Action
+
+        private void ButtonNext_OnClick(object sender, RoutedEventArgs e)
+        {
+            this.DialogResult = true;
+        }
+
+        private void ButtonCopy_OnClick(object sender, RoutedEventArgs e)
+        {
+            Clipboard.SetDataObject(m_id);
+        }
+        #endregion
+
+    }
+}

+ 10 - 0
FWindSoft/Saga.PlugIn/Saga.PlugIn.csproj

@@ -127,9 +127,15 @@
     <Compile Include="ModelCheck\WinModeCheck.xaml.cs">
       <DependentUpon>WinModeCheck.xaml</DependentUpon>
     </Compile>
+    <Compile Include="ModelCheck\WinTipCheckComplete.xaml.cs">
+      <DependentUpon>WinTipCheckComplete.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Properties\AssemblyInfo.cs" />
   </ItemGroup>
   <ItemGroup>
+    <Resource Include="ModelCheck\Image\叉.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Resource>
     <Resource Include="CreateFacility\Image\成功.png">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Resource>
@@ -188,6 +194,10 @@
       <SubType>Designer</SubType>
       <Generator>XamlIntelliSenseFileGenerator</Generator>
     </Page>
+    <Page Include="ModelCheck\WinTipCheckComplete.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
   </ItemGroup>
   <ItemGroup>
     <Resource Include="ModelCheck\Image\对勾.png" />