Ver código fonte

mxg:重新输入tabcode清空

mengxiangge 5 anos atrás
pai
commit
a106f33e1a

+ 18 - 0
.gitignore

@@ -3,3 +3,21 @@
 ################################################################################
 
 /FWindSoft/.vs/FWindSoft/v15
+/FWindSoft/FWindSoft/bin/
+/FWindSoft/FWindSoft/obj/
+/FWindSoft/FWindSoft.Revit/obj/
+/FWindSoft/FWindSoft.WinForm/bin/
+/FWindSoft/FWindSoft.WinForm/obj/
+/FWindSoft/FWindSoft.Wpf/bin/
+/FWindSoft/FWindSoft.Wpf/obj/
+/FWindSoft/OutputDll
+/FWindSoft/packages
+/FWindSoft/Revit/XH.Tool/obj/
+/FWindSoft/Revit/XiaoHong/obj/
+/FWindSoft/Revit/XiaoHongApplication/obj/
+/FWindSoft/RevitBase/RevitVersion/bin/
+/FWindSoft/RevitBase/RevitVersion/obj/
+/FWindSoft/Test
+*.cs
+*.cache
+/FWindSoft/Saga.PlugIn/obj/

BIN
FWindSoft/Dlls/RevitDll/Current/RevitVersion.dll


BIN
FWindSoft/Saga.PlugIn/CreateFacility/Image/成功.png


BIN
FWindSoft/Saga.PlugIn/CreateFacility/Image/警告.png


BIN
FWindSoft/Saga.PlugIn/CreateFacility/Image/错误.png


+ 98 - 0
FWindSoft/Saga.PlugIn/CreateFacility/WinCreateFacility.xaml

@@ -0,0 +1,98 @@
+<Window x:Class="Saga.PlugIn.ModelCheck.WinCreateFacility"
+             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:converter="clr-namespace:SAGA.DotNetUtils.WPF.Converter;assembly=SAGA.DotNetUtils"
+             xmlns:local="clr-namespace:Saga.PlugIn.ModelCheck"
+             xmlns:createFacility="clr-namespace:Saga.PlugIn.CreateFacility"
+             mc:Ignorable="d"  Title="待建模设备" WindowStartupLocation="CenterScreen"
+        ResizeMode="NoResize"
+        Height="587" Width="600">
+    <Grid>
+        <Grid.RowDefinitions>
+            <RowDefinition Height="*"></RowDefinition>
+            <RowDefinition Height="80"></RowDefinition>
+            <RowDefinition Height="60"></RowDefinition>
+        </Grid.RowDefinitions>
+        <Grid  Margin="5,0">
+            <Grid.RowDefinitions>
+                <RowDefinition Height="30"></RowDefinition>
+                <RowDefinition Height="*"></RowDefinition>
+                <RowDefinition Height="30"></RowDefinition>
+            </Grid.RowDefinitions>
+            <Grid  Height="30" >
+                    <Label Content="需建模的设备标记码:"></Label>
+                    <Button Width="120" Height="25" Background="White"  Foreground="Black" Content="从剪切板粘贴" 
+                            HorizontalAlignment="Right" Margin="0,0,5,0" VerticalAlignment="Center" 
+                            Command="{Binding Path=Commands.PasteTabCode}" 
+                    ></Button>
+                </Grid>
+            <Grid Grid.Row="1">
+                <TextBox Text="{Binding Path=TabCode,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
+                    <TextBox.Resources>
+                        <VisualBrush x:Key="HelpBrush" TileMode="None" Opacity="0.3" Stretch="None" AlignmentX="Left" AlignmentY="Top">
+                            <VisualBrush.Visual>
+                                <TextBlock FontStyle="Normal" FontSize="14"  TextWrapping="Wrap" Width="430" Text='请输入需建模的设备标记码'/>
+                            </VisualBrush.Visual>
+                        </VisualBrush>
+                    </TextBox.Resources>
+                    <TextBox.Style>
+                        <Style TargetType="TextBox">
+                            <Setter Property="FontSize" Value="14"/>
+                            <Setter Property="Foreground" Value="#FF333333"/>
+                            <Setter Property="BorderBrush" Value="#8F666666"/>
+                            <Setter Property="TextWrapping" Value="Wrap"/>
+                            <Setter Property="AcceptsReturn" Value="True"/>
+                            <Setter Property="VerticalScrollBarVisibility" Value="Visible"/>
+                            <Style.Triggers>
+                                <Trigger Property="Text" Value="{x:Null}">
+                                    <Setter Property="Background" Value="{StaticResource HelpBrush}"/>
+                                </Trigger>
+                                <Trigger Property="Text" Value="">
+                                    <Setter Property="Background" Value="{StaticResource HelpBrush}"/>
+                                </Trigger>
+                            </Style.Triggers>
+                        </Style>
+                    </TextBox.Style>
+                </TextBox>
+            </Grid>
+            <WrapPanel  Grid.Row="2">
+                <Label Content="该设备所在:"></Label>
+                <TextBlock Text="{Binding Path=FacilityLocated}" VerticalAlignment="Center"></TextBlock>
+            </WrapPanel>
+        </Grid>
+        <Grid Grid.Row="1" Margin="5,0">
+            <Label Content="当前打开的模型文件:"  Foreground="DarkGray" ></Label>
+            <TextBlock Margin="5,15,0,0" Foreground="Black" 
+                       Text="{Binding Path=ModelFilePath}" 
+                       VerticalAlignment="Center" TextWrapping="WrapWithOverflow" ></TextBlock>
+        </Grid>
+        <Grid Grid.Row="2" Background="LightGray">
+            <Button Width="120" Height="25" Background="White"  Foreground="Black" Content="重新输入" 
+                    HorizontalAlignment="Right" Margin="0,0,115,0" VerticalAlignment="Center" 
+                    Command="{Binding Path=Commands.ClearTabCode}" 
+            ></Button>
+            <Button Width="100" Height="25" Background="Black"  Foreground="White" Content="下一步"
+                    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>
+</Window>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ 55 - 0
FWindSoft/Saga.PlugIn/CreateFacility/WinSelectDeviceClass.xaml

@@ -0,0 +1,55 @@
+<Window x:Class="Saga.PlugIn.ModelCheck.WinSelectDeviceClass"
+             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:converter="clr-namespace:SAGA.DotNetUtils.WPF.Converter;assembly=SAGA.DotNetUtils"
+             xmlns:local="clr-namespace:Saga.PlugIn.ModelCheck"
+             mc:Ignorable="d"  Title="待建模设备" WindowStartupLocation="CenterScreen"
+        ResizeMode="NoResize"
+        Height="200" Width="300">
+    <Grid>
+        <Grid.RowDefinitions>
+            <RowDefinition Height="*"></RowDefinition>
+            <RowDefinition Height="60"></RowDefinition>
+        </Grid.RowDefinitions>
+        <Grid>
+            <Grid.RowDefinitions>
+                <RowDefinition Height="50"></RowDefinition>
+                <RowDefinition Height="35"></RowDefinition>
+            </Grid.RowDefinitions>
+            <Grid >
+                    <Label VerticalAlignment="Bottom" Margin="5"
+                           Content="请选择需建模的设备类型:"></Label>
+                </Grid>
+            <ComboBox Grid.Row="1" Margin="5"
+                      ItemsSource="{Binding Path=ClassCodes}"
+                      SelectedItem="{Binding Path=SelectedCode}"
+                      DisplayMemberPath="name"></ComboBox>
+        </Grid>
+        <Grid Grid.Row="1" Background="LightGray">
+            <Button Width="100" Height="25" Background="White"  Foreground="Black" Content="上一步" 
+                    HorizontalAlignment="Right" Margin="0,0,115,0" VerticalAlignment="Center" 
+                    IsCancel="True"
+            ></Button>
+            <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>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ 52 - 0
FWindSoft/Saga.PlugIn/CreateFacility/WinTipCreateSuccess.xaml

@@ -0,0 +1,52 @@
+<Window x:Class="Saga.PlugIn.CreateFacility.WinTipCreateSuccess"
+             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="Image/成功.png"></Image>
+            <Label Grid.Row="0" Grid.Column="1" Content="创建模型成功"
+                   FontSize="20" FontWeight="UltraBlack"
+                   VerticalAlignment="Bottom"></Label>
+            <WrapPanel  Grid.Row="1" Grid.Column="1" >
+                <TextBlock Text="{Binding Path=Tip}" 
+                           TextWrapping="WrapWithOverflow"
+                           FontSize="15" Margin="0,10,50,0"></TextBlock>
+                <Button Height="24" Content="复制"  Margin="0,10"
+                        Click="ButtonCopy_OnClick">
+                    <Button.Style >
+                        <Style TargetType="Button">
+                            <Setter Property="Foreground" Value="DeepSkyBlue"></Setter>
+                            <Setter Property="Background" Value="Transparent"></Setter>
+                            <Setter Property="BorderThickness" Value="0"></Setter>
+                        </Style>
+                    </Button.Style>
+                </Button>
+            </WrapPanel>
+            
+        </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>

+ 56 - 0
FWindSoft/Saga.PlugIn/CreateFacility/WinTipExisted.xaml

@@ -0,0 +1,56 @@
+<Window x:Class="Saga.PlugIn.CreateFacility.WinTipExisted"
+             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="Image/警告.png"></Image>
+            <Label Grid.Row="0" Grid.Column="1" Content="设备已存在,请检查"
+                   FontSize="20" FontWeight="UltraBlack"
+                   VerticalAlignment="Bottom"></Label>
+            <WrapPanel  Grid.Row="1" Grid.Column="1" >
+                <TextBlock Text="{Binding Path=Tip}" 
+                           TextWrapping="WrapWithOverflow"
+                           FontSize="15" Margin="0,10,50,0"></TextBlock>
+                <Button Height="24" Content="复制"  Margin="0,10"
+                        Click="ButtonCopy_OnClick">
+                    <Button.Style >
+                        <Style TargetType="Button">
+                            <Setter Property="Foreground" Value="DeepSkyBlue"></Setter>
+                            <Setter Property="Background" Value="Transparent"></Setter>
+                            <Setter Property="BorderThickness" Value="0"></Setter>
+                        </Style>
+                    </Button.Style>
+                </Button>
+            </WrapPanel>
+            
+        </Grid>
+        <Grid Grid.Row="1" Background="LightGray">
+            <Button Width="100" Height="25" Background="White"  Foreground="Black" Content="定位模型" 
+                    HorizontalAlignment="Right" Margin="0,0,115,0" VerticalAlignment="Center" 
+                    Click="ButtonFocus_OnClick"
+            ></Button>
+            <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>

+ 39 - 0
FWindSoft/Saga.PlugIn/CreateFacility/WinTipMissFamily.xaml

@@ -0,0 +1,39 @@
+<Window x:Class="Saga.PlugIn.CreateFacility.WinTipMissFamily"
+             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="Image/错误.png"></Image>
+            <Label Grid.Row="0" Grid.Column="1" Content="自动创建设备异常!"
+                   FontSize="20" FontWeight="UltraBlack"
+                   VerticalAlignment="Bottom"></Label>
+            <TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding Path=Tip}" 
+                       TextWrapping="WrapWithOverflow"
+                       FontSize="15" Margin="0,10,100,0"></TextBlock>
+        </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>

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


+ 0 - 4
FWindSoft/Saga.PlugIn/ModelCheck/VMModelCheck.cs

@@ -30,10 +30,6 @@ namespace Saga.PlugIn.ModelCheck
         }
 
         private Document m_Doc;
-        /// <summary>
-        /// 保存模板地址
-        /// </summary>
-        public string TemplatePath { get; set; }
 
         private string m_ModelFilePath;
         /// <summary>

+ 1 - 0
FWindSoft/Saga.PlugIn/ModelCheckCommand.cs

@@ -9,6 +9,7 @@ using Autodesk.Revit.DB;
 using Autodesk.Revit.UI;
 using FWindSoft.Revit.ExtensibleStorage;
 using FWindSoft.Revit.Menu;
+using Saga.PlugIn.CreateFacility;
 using Saga.PlugIn.ModelCheck;
 
 namespace Saga.PlugIn

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

@@ -33,6 +33,9 @@
     <Reference Include="ICSharpCode.SharpZipLib, Version=0.86.0.518, Culture=neutral, PublicKeyToken=1b03e6acf1164f73, processorArchitecture=MSIL">
       <HintPath>..\packages\SharpZipLib.0.86.0\lib\20\ICSharpCode.SharpZipLib.dll</HintPath>
     </Reference>
+    <Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
+      <HintPath>..\packages\Newtonsoft.Json.10.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
+    </Reference>
     <Reference Include="NPOI, Version=2.2.1.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
       <HintPath>..\packages\NPOI.2.2.1\lib\net40\NPOI.dll</HintPath>
     </Reference>
@@ -72,6 +75,27 @@
     <Reference Include="WindowsBase" />
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="CreateFacility\CreateFacilityConst.cs" />
+    <Compile Include="CreateFacility\CreateFacilityRevitUtils.cs" />
+    <Compile Include="CreateFacility\MFacilityTabCode.cs" />
+    <Compile Include="CreateFacility\ParseFacilityTabCode.cs" />
+    <Compile Include="CreateFacility\VMCreateFacility.cs" />
+    <Compile Include="CreateFacility\WinSelectDeviceClass.xaml.cs">
+      <DependentUpon>WinSelectDeviceClass.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="CreateFacility\WinCreateFacility.xaml.cs">
+      <DependentUpon>WinCreateFacility.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="CreateFacility\WinTipExisted.xaml.cs">
+      <DependentUpon>WinTipExisted.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="CreateFacility\WinTipCreateSuccess.xaml.cs">
+      <DependentUpon>WinTipCreateSuccess.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="CreateFacility\WinTipMissFamily.xaml.cs">
+      <DependentUpon>WinTipMissFamily.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="CreateFacilityCommand.cs" />
     <Compile Include="ModelCheckCommand.cs" />
     <Compile Include="ModelCheck\ModelCheckConverter.cs" />
     <Compile Include="ModelCheck\VMModelCheck.cs" />
@@ -106,6 +130,15 @@
     <Compile Include="Properties\AssemblyInfo.cs" />
   </ItemGroup>
   <ItemGroup>
+    <Resource Include="CreateFacility\Image\成功.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Resource>
+    <Resource Include="CreateFacility\Image\警告.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Resource>
+    <Resource Include="CreateFacility\Image\错误.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Resource>
     <Content Include="ModelCheck\ExcelTemplate\模型检查结果输出格式-模版.xlsx">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Content>
@@ -131,6 +164,26 @@
     </ProjectReference>
   </ItemGroup>
   <ItemGroup>
+    <Page Include="CreateFacility\WinSelectDeviceClass.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Include="CreateFacility\WinCreateFacility.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Include="CreateFacility\WinTipExisted.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Include="CreateFacility\WinTipCreateSuccess.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Include="CreateFacility\WinTipMissFamily.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="ModelCheck\WinModeCheck.xaml">
       <SubType>Designer</SubType>
       <Generator>XamlIntelliSenseFileGenerator</Generator>

+ 4 - 0
FWindSoft/Saga.PlugIn/app.config

@@ -6,6 +6,10 @@
         <assemblyIdentity name="ICSharpCode.SharpZipLib" publicKeyToken="1b03e6acf1164f73" culture="neutral" />
         <bindingRedirect oldVersion="0.0.0.0-1.0.0.999" newVersion="1.0.0.999" />
       </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0" />
+      </dependentAssembly>
     </assemblyBinding>
   </runtime>
 </configuration>

+ 1 - 0
FWindSoft/Saga.PlugIn/packages.config

@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <packages>
+  <package id="Newtonsoft.Json" version="10.0.1" targetFramework="net461" />
   <package id="NPOI" version="2.2.1" targetFramework="net461" />
   <package id="SharpZipLib" version="0.86.0" targetFramework="net461" />
 </packages>