Compare commits

...

23 Commits

Author SHA1 Message Date
Emmanuele Sassi 238bdbb1ce - Correzione su import/export machining 2022-12-14 11:53:24 +01:00
Emmanuele Sassi 144b8dc66e - aggiunta gestione dis/attivazione wait
- aggiunta modifica con selezione dei tempi wait
2022-12-13 19:05:57 +01:00
Emmanuele Sassi 5f9a01ae2e - aggiunta del parametro G0FeedZ
- aggiunta gestione colori e trasparenze categorie
- corretta creazione nuovo pezzo da superficie in import
- Reintrodotta gestione parametro RibsLink su singole Ribs
2022-12-13 11:01:58 +01:00
Emmanuele Sassi a6386e64d9 Merge remote-tracking branch 'ICARUS/main' into ImportExportMachiningDb&Material 2022-12-09 17:16:55 +01:00
Emmanuele Sassi 551eec6496 - aggiunta gestione spostamento pezzo print quando aggiunto o rimosso e stampa a 45 gradi 2022-12-09 16:45:37 +01:00
Emmanuele Sassi a24c4ada62 - correzione indice di slice 2022-12-09 12:43:00 +01:00
DarioS 2a86d67ca9 Icarus 2.4l3 :
- riportate su StartMach e ShellNumber le modifiche di selezione fatte sui Ribs.
2022-12-07 17:37:36 +01:00
DarioS 5c4a8adf9b Icarus 2.4l2 :
- corretti movimenti e rotazioni di LayerStart, Ribs e Reduce
- bottone impostazioni Grid visibile solo se Grid abilitata
- migliorato controllo esistenza direttorio generazione CN.
2022-12-06 16:56:58 +01:00
DarioS 0cc2534628 Icarus :
- corretta gestione rotazione pezzo (ora default asse Z)
- quando si fa SaveAs si rimuove il nome del CN da generare (per forzare generazione con nuovo nome)
- ora gestita anche estrusione 45deg in Y e riordinate le parti relative compresa abilitazione da Ini macchina.
2022-12-05 11:45:05 +01:00
DarioS 2a861dca1b Icarus 2.4k6 :
- aggiunte versioni a 32bit solo per usi interni (test/debug).
2022-11-28 15:35:15 +01:00
Emmanuele Sassi 16715a8c08 Icarus 2.4k5 :
- cambio di versione
2022-11-23 11:09:03 +01:00
Emmanuele Sassi 4c5500c490 Merge branch 'main' of https://gitlab.steamware.net/egalware/icarus 2022-11-23 11:08:18 +01:00
Emmanuele Sassi 75b4b4e4d0 - correzione se lavorazione nulla 2022-11-23 11:08:15 +01:00
Emmanuele Sassi b643cb5030 - correzione 2022-11-23 10:56:15 +01:00
DarioS f710918411 Icarus :
- aggiunti controlli per evitare crash se progetto senza materiale.
2022-11-22 19:59:51 +01:00
DarioS 1585fc2659 Icarus :
- controllo esistenza direttorio in cui generare CN, altrimenti direttorio del progetto.
2022-11-22 19:25:39 +01:00
Emmanuele Sassi c06d75e292 Merge branch 'main' into ImportExportMachiningDb&Material 2022-11-22 16:11:50 +01:00
Emmanuele Sassi a6acc66099 - migliorato import export 2022-11-22 16:10:08 +01:00
Emmanuele Sassi 12de367ba1 - Importazione ed esportazione lavorazioni 2022-11-14 20:12:49 +01:00
Emmanuele Sassi a68dba11a2 Merge branch 'develop' into ImportExportMachiningDb&Material 2022-11-14 13:28:14 +01:00
Emmanuele Sassi 5d26914967 Merge branch 'develop' into ImportExportMachiningDb&Material 2022-11-14 09:35:34 +01:00
Emmanuele Sassi 98628b887e - Inizio implementazione finestra di import export 2022-10-28 08:33:03 +02:00
Emmanuele Sassi 5152600fd9 Merge remote-tracking branch 'ICARUS/main' into ImportExportMachiningDb&Material 2022-10-27 22:28:40 +02:00
42 changed files with 1660 additions and 381 deletions
+7 -1
View File
@@ -3,18 +3,24 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.32002.261
MinimumVisualStudioVersion = 10.0.40219.1
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Icarus", "Icarus/Icarus.vbproj", "{BCDE0368-2C69-4948-8723-D0FE71417986}"
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Icarus", "Icarus\Icarus.vbproj", "{BCDE0368-2C69-4948-8723-D0FE71417986}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{BCDE0368-2C69-4948-8723-D0FE71417986}.Debug|x64.ActiveCfg = Debug|x64
{BCDE0368-2C69-4948-8723-D0FE71417986}.Debug|x64.Build.0 = Debug|x64
{BCDE0368-2C69-4948-8723-D0FE71417986}.Debug|x86.ActiveCfg = Debug|x86
{BCDE0368-2C69-4948-8723-D0FE71417986}.Debug|x86.Build.0 = Debug|x86
{BCDE0368-2C69-4948-8723-D0FE71417986}.Release|x64.ActiveCfg = Release|x64
{BCDE0368-2C69-4948-8723-D0FE71417986}.Release|x64.Build.0 = Release|x64
{BCDE0368-2C69-4948-8723-D0FE71417986}.Release|x86.ActiveCfg = Release|x86
{BCDE0368-2C69-4948-8723-D0FE71417986}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
+2
View File
@@ -36,6 +36,7 @@
Public Const KEY_SPEED = "Speed"
Public Const KEY_SLICEID = "SliceId"
Public Const KEY_MASS = "PrintMass"
Public Const KEY_EMITWAITINGTIME = "EmitWaitingTime"
' parametri Materiali
@@ -95,6 +96,7 @@
Public Const MAC_WIPEDIR = "WipeDir"
Public Const MAC_FLOORCOUNT = "FloorCount"
Public Const MAC_G0FEED = "G0Feed"
Public Const MAC_G0FEEDZ = "G0FeedZ"
Public Const MAC_TOOLDIAM = "ToolDiam"
Public Const MAC_RIBSTYPE = "RibsType"
Public Const MAC_RIBSOVERLAP = "RibsOverlap"
+8
View File
@@ -113,6 +113,14 @@ Public Module ConstIni
Public Const K_VIEWSLIDER As String = "ViewSlider"
Public Const K_IMPORTCURREXTENSION As String = "ImportCurrExtension"
Public Const S_COLORS As String = "Colors"
Public Const K_CLR_PRINTPART As String = "PrintPart"
Public Const K_CLR_RIBS As String = "Ribs"
Public Const K_CLR_SHELLNUMBERS As String = "ShellNumbers"
Public Const K_CLR_AUXSOLIDS As String = "AuxSolids"
Public Const K_CLR_MACHSTART As String = "MachStart"
Public Const K_CLR_OTHERS As String = "Others"
Public Const S_MRUFILES As String = "MruFiles"
Public Const S_MRUIMPORTFILES As String = "MruImportFiles"
+1 -1
View File
@@ -32,7 +32,7 @@
Public Const K_MACH_EXITSCRIPT As String = "ExitScript"
Public Const S_MACH_PRINTING3D As String = "3dPrinting"
Public Const K_HORIZONTAL_PRINT As String = "HorizontalPrint"
Public Const K_SLICINGTYPE As String = "SlicingType"
Public Const K_SPEED_MIN As String = "SpeedMin"
Public Const K_SPEED_MAX As String = "SpeedMax"
+19 -8
View File
@@ -194,6 +194,7 @@ Public Class CurrMachiningCathegory
New CurrComboMachiningParam(MachiningParam.Params.DIRECTION, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.FLOORCOUNT, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.G0FEED, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.G0FEEDZ, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.TOOLDIAM, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.FLOWRATE_PC, nPartId, nIndex, bForceFromDb)})
Case Cathegories.LINK
@@ -273,13 +274,13 @@ Public Class CurrNumericMachiningParam
Public Overrides Property sValue As String
Get
Return If(m_bIsLen, LenToString(m_dValue, 1), DoubleToString( m_dValue, 2))
Return If(m_bIsLen, LenToString(m_dValue, 1), DoubleToString(m_dValue, 2))
End Get
Set(value As String)
If m_bIsLen Then
StringToLen(value, m_dValue)
Else
StringToDouble( value, m_dValue)
StringToDouble(value, m_dValue)
End If
NotifyPropertyChanged(NameOf(sValue))
NotifyPropertyChanged(NameOf(bIsModifiedFromDb))
@@ -366,6 +367,9 @@ Public Class CurrNumericMachiningParam
Case Params.G0FEED
bReadFromPart = EgtGetInfo(nPartId, MAC_G0FEED, m_dValue)
m_bIsLen = True
Case Params.G0FEEDZ
bReadFromPart = EgtGetInfo(nPartId, MAC_G0FEEDZ, m_dValue)
m_bIsLen = True
Case Params.TOOLDIAM
bReadFromPart = EgtGetInfo(nPartId, MAC_TOOLDIAM, m_dValue)
m_bIsLen = True
@@ -429,7 +433,7 @@ Public Class CurrNumericMachiningParam
Dim DbMachining As Machining = Map.refMachiningDbVM.MachiningList.FirstOrDefault(Function(x) x.nIndex = nIndex)
Select Case Type
Case Params.STRANDH, Params.STRANDW, Params.STRANDCOUNT, Params.OFFSET, Params.STRANDOVERLAP, Params.STARTPOINTOFFSETONSLICE,
Params.FLOORCOUNT, Params.G0FEED, Params.TOOLDIAM, Params.FLOWRATE_PC
Params.FLOORCOUNT, Params.G0FEED, Params.G0FEEDZ, Params.TOOLDIAM, Params.FLOWRATE_PC
m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.GENERAL).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type)
Case Params.LINKPARAM, Params.LINKZUP, Params.OFFSETLEADPOINT, Params.LEADINTANGDIST, Params.LEADINORTHODIST,
Params.LEADOUTTANGDIST, Params.LEADOUTORTHODIST, Params.COASTINGLEN, Params.COASTINGFEED_PC,
@@ -503,6 +507,8 @@ Public Class CurrNumericMachiningParam
EgtSetInfo(nPartId, MAC_FLOORCOUNT, sWriteValue)
Case Params.G0FEED
EgtSetInfo(nPartId, MAC_G0FEED, sWriteValue)
Case Params.G0FEEDZ
EgtSetInfo(nPartId, MAC_G0FEEDZ, sWriteValue)
Case Params.TOOLDIAM
EgtSetInfo(nPartId, MAC_TOOLDIAM, sWriteValue)
Case Params.RIBSOVERLAP
@@ -677,11 +683,16 @@ Public Class CurrComboMachiningParam
Dim bReadFromPart As Boolean = False
Select Case Type
Case Params.SLICINGTYPE
Dim nHorizontalPrint As Integer = GetPrivateProfileInt(S_MACH_PRINTING3D, K_HORIZONTAL_PRINT, 0, CurrentMachine.sMachIniFile)
m_ValueList = New List(Of IdNameStruct)({New IdNameStruct(Machining.MPAR_SLICINGTYPE.VERTICAL, "Vertical"),
New IdNameStruct(Machining.MPAR_SLICINGTYPE.DEG45, "45°")})
If nHorizontalPrint > 0 Then
m_ValueList.Add(New IdNameStruct(Machining.MPAR_SLICINGTYPE.HORIZONTAL, "Horizontal"))
Dim nSlicingType As Integer = GetPrivateProfileInt(S_MACH_PRINTING3D, K_SLICINGTYPE, 0, CurrentMachine.sMachIniFile)
m_ValueList = New List(Of IdNameStruct)({New IdNameStruct(Machining.MPAR_SLICINGTYPE.VERTICAL, "Vertical")})
If nSlicingType >= 1 Then
m_ValueList.Add(New IdNameStruct(Machining.MPAR_SLICINGTYPE.DEG45, "45deg X"))
If nSlicingType >= 2 Then
m_ValueList.Add(New IdNameStruct(Machining.MPAR_SLICINGTYPE.DEG45_Y, "45deg Y"))
If nSlicingType >= 3 Then
m_ValueList.Add(New IdNameStruct(Machining.MPAR_SLICINGTYPE.HORIZONTAL, "Horizontal"))
End If
End If
End If
Dim nSelValue As Integer = 0
bReadFromPart = EgtGetInfo(nPartId, MAC_SLICINGTYPE, nSelValue)
@@ -186,15 +186,15 @@
<UniformGrid Columns="3">
<RadioButton Content="X"
GroupName="Axes"
IsChecked="{Binding RotAxes[0]}"
IsChecked="{Binding RotX}"
Style="{StaticResource ToolBar_ToggleButton}"/>
<RadioButton Content="Y"
GroupName="Axes"
IsChecked="{Binding RotAxes[1]}"
IsChecked="{Binding RotY}"
Style="{StaticResource ToolBar_ToggleButton}"/>
<RadioButton Content="Z"
GroupName="Axes"
IsChecked="{Binding RotAxes[2]}"
IsChecked="{Binding RotZ}"
Style="{StaticResource ToolBar_ToggleButton}"/>
</UniformGrid>
<EgtWPFLib5:EgtTextBox Grid.Row="1"
+46 -18
View File
@@ -21,12 +21,12 @@ Public Class DispositionPanelVM
Dim dNewXPos As Double = ptReference.x
StringToLen(value, dNewXPos)
If dNewXPos >= 0 AndAlso dNewXPos <= CurrentMachine.b3Tab.DimX Then
EgtMove(Map.refTopPanelVM.SelPart.nPartId, New Point3d(dNewXPos, ptReference.y, ptReference.z) - ptReference)
EgtMove(Map.refTopPanelVM.SelPart.nPartId, New Point3d(dNewXPos, ptReference.y, ptReference.z) - ptReference, GDB_RT.GLOB)
Map.refReferencePanelVM.UpdateFramePosition()
EgtDraw()
Else
NotifyPropertyChanged(NameOf(sXPos))
End If
Map.refReferencePanelVM.UpdateFramePosition()
End Set
End Property
@@ -46,12 +46,12 @@ Public Class DispositionPanelVM
Dim dNewYPos As Double = ptReference.y
StringToLen(value, dNewYPos)
If dNewYPos >= 0 AndAlso dNewYPos <= CurrentMachine.b3Tab.DimY Then
EgtMove(Map.refTopPanelVM.SelPart.nPartId, New Point3d(ptReference.x, dNewYPos, ptReference.z) - ptReference)
EgtMove(Map.refTopPanelVM.SelPart.nPartId, New Point3d(ptReference.x, dNewYPos, ptReference.z) - ptReference, GDB_RT.GLOB)
Map.refReferencePanelVM.UpdateFramePosition()
EgtDraw()
Else
NotifyPropertyChanged(NameOf(sYPos))
End If
Map.refReferencePanelVM.UpdateFramePosition()
End Set
End Property
@@ -71,22 +71,38 @@ Public Class DispositionPanelVM
Dim dNewZPos As Double = ptReference.z
StringToLen(value, dNewZPos)
If dNewZPos >= 0 Then
EgtMove(Map.refTopPanelVM.SelPart.nPartId, New Point3d(ptReference.x, ptReference.y, dNewZPos) - ptReference)
EgtMove(Map.refTopPanelVM.SelPart.nPartId, New Point3d(ptReference.x, ptReference.y, dNewZPos) - ptReference, GDB_RT.GLOB)
Map.refReferencePanelVM.UpdateFramePosition()
EgtDraw()
Else
NotifyPropertyChanged(NameOf(sZPos))
End If
Map.refReferencePanelVM.UpdateFramePosition()
End Set
End Property
Private m_RotAxes() As Boolean = {False, False, True}
Public Property RotAxes As Boolean()
Private m_RotAxes As Boolean() = { False, False, False}
Public Property RotX As Boolean
Get
Return m_RotAxes
Return m_RotAxes(0)
End Get
Set(value As Boolean())
m_RotAxes = value
Set(value As Boolean)
m_RotAxes(0) = value
End Set
End Property
Public Property RotY As Boolean
Get
Return m_RotAxes(1)
End Get
Set(value As Boolean)
m_RotAxes(1) = value
End Set
End Property
Public Property RotZ As Boolean
Get
Return m_RotAxes(2)
End Get
Set(value As Boolean)
m_RotAxes(2) = value
End Set
End Property
@@ -96,7 +112,7 @@ Public Class DispositionPanelVM
Return Vector3d.X_AX
ElseIf m_RotAxes(1) Then
Return Vector3d.Y_AX
ElseIf m_RotAxes(2) Then
Else
Return Vector3d.Z_AX
End If
End Get
@@ -109,22 +125,33 @@ Public Class DispositionPanelVM
End Get
Set(value As String)
Dim dNewAngle As Double = 0
If Not StringToLen(value, dNewAngle) Then
If IsNothing( value) OrElse Not StringToLen(value, dNewAngle) Then
m_sRotAngle = 0
NotifyPropertyChanged(NameOf(sRotAngle))
Return
End If
Dim vtMovedPart As Vector3d
if EgtGetInfo(Map.refTopPanelVM.SelPart.nPartId, "MovedPart", vtMovedPart) Then
Dim nEntId = EgtGetFirstInGroup( Map.refTopPanelVM.SelPart.nPrintSolidLayerId)
While nEntId <> GDB_ID.NULL
EgtMove(nEntId, -vtMovedPart, GDB_RT.GLOB)
nEntId = EgtGetNext( nEntId)
End While
EgtRemoveInfo(Map.refTopPanelVM.SelPart.nPartId, "MovedPart")
End If
Dim b3PrintSolid As New BBox3d
EgtGetBBoxGlob(Map.refTopPanelVM.SelPart.nPartId, GDB_BB.STANDARD, b3PrintSolid)
If EgtRotate(Map.refTopPanelVM.SelPart.nPartId, b3PrintSolid.Center, vtSelRotAxes, dNewAngle) Then
EgtDraw()
RefreshPos()
If EgtRotate(Map.refTopPanelVM.SelPart.nPartId, b3PrintSolid.Center, vtSelRotAxes, dNewAngle, GDB_RT.GLOB) Then
m_sRotAngle = 0
Map.refReferencePanelVM.UpdateFramePosition()
RefreshPos()
EgtDraw()
NotifyPropertyChanged(NameOf(sRotAngle))
' Imposto flag di ricalcolo slice
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
Else
m_sRotAngle = value
End If
Map.refReferencePanelVM.UpdateFramePosition()
End Set
End Property
@@ -178,7 +205,8 @@ Public Class DispositionPanelVM
End Sub
Friend Sub Init()
RotZ = True
NotifyPropertyChanged(NameOf(RotZ))
End Sub
Friend Sub RefreshPos()
+37 -1
View File
@@ -53,6 +53,28 @@
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<OutputPath>bin\x86\Debug\</OutputPath>
<DocumentationFile>Icarus.xml</DocumentationFile>
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<DebugSymbols>true</DebugSymbols>
<DefineTrace>true</DefineTrace>
<OutputPath>bin\x86\Release\</OutputPath>
<DocumentationFile>Icarus.xml</DocumentationFile>
<Optimize>true</Optimize>
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="EgtUILib, Version=2.4.7.1, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
@@ -123,6 +145,10 @@
<DependentUpon>DispositionPanelV.xaml</DependentUpon>
</Compile>
<Compile Include="DispositionPanel\DispositionPanelVM.vb" />
<Compile Include="ImportExportMachiningPanel\ImportExportMachiningPanelV.xaml.vb">
<DependentUpon>ImportExportMachiningPanelV.xaml</DependentUpon>
</Compile>
<Compile Include="ImportExportMachiningPanel\ImportExportMachiningPanelVM.vb" />
<Compile Include="InstrumentPanel\InstrumentPanelV.xaml.vb">
<DependentUpon>InstrumentPanelV.xaml</DependentUpon>
</Compile>
@@ -299,6 +325,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="ImportExportMachiningPanel\ImportExportMachiningPanelV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="InstrumentPanel\InstrumentPanelV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -631,6 +661,10 @@
<ItemGroup>
<Resource Include="Resources\TopPanel\Edit.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\MachiningDb\Export.png" />
<Resource Include="Resources\MachiningDb\Import.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\SplashScreen\GoldSplashscreen.png" />
</ItemGroup>
@@ -639,7 +673,9 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<PropertyGroup>
<PostBuildEvent>IF "$(PlatformName)"=="x64" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\Icarus\IcarusR64.exe
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\Icarus\IcarusR32.exe
IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Debug" copy $(TargetPath) c:\EgtProg\Icarus\IcarusD32.exe
IF "$(PlatformName)"=="x64" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\Icarus\IcarusR64.exe
IF "$(PlatformName)"=="x64" IF "$(ConfigurationName)" == "Debug" copy $(TargetPath) c:\EgtProg\Icarus\IcarusD64.exe</PostBuildEvent>
</PropertyGroup>
</Project>
@@ -0,0 +1,62 @@
<EgtWPFLib5:EgtCustomWindow x:Class="ImportExportMachiningPanelV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
Title="{Binding OkMsg}"
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30" IsResizable="False"
IsMinimizable="False" WindowStartupLocation="CenterOwner" ShowInTaskbar="False"
Width="400" Height="500">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="7*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<ListBox ItemsSource="{Binding MachiningList}">
<ListBox.ItemTemplate>
<DataTemplate DataType="{x:Type EgtWPFLib5:ImpExpMachiningItem}">
<Grid Height="20">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<CheckBox Name="ActiveTxBx"
Grid.Column="0"
IsChecked="{Binding Active}"
Height="15"
Width="15"
Margin="0,0,5,0"
VerticalContentAlignment="Center"
Visibility="{Binding Path=DataContext.Active_Visibility,
RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtCustomWindow}}}"/>
<TextBlock Grid.Column="1"
Text="{Binding sName}"
FontSize="15"
Margin="0,0,5,0"
VerticalAlignment="Center" />
<Ellipse Grid.Column="2"
Width="15"
Height="15"
Fill="DarkOrange"
Visibility="{Binding Overwrite_Visibility}"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<Button Command="{Binding OkCommand}"
Content="{Binding OkMsg}"
IsEnabled="{Binding IsEnabledOkBtn, Mode=OneWay}"
Grid.Row="1"
Height="30" Width="100"
Margin="10" />
</Grid>
</EgtWPFLib5:EgtCustomWindow>
@@ -0,0 +1,18 @@
Public Class ImportExportMachiningPanelV
Private WithEvents m_ImportExportMachiningPanelVM As ImportExportMachiningPanelVM
Sub New(Owner As Window, ImportExportMachiningPanelVM As ImportExportMachiningPanelVM)
MyBase.New(Owner)
' This call is required by the designer.
InitializeComponent()
Me.DataContext = ImportExportMachiningPanelVM
' Assegno al riferimento locale al VM il VM preso dal DataContext
m_ImportExportMachiningPanelVM = ImportExportMachiningPanelVM
End Sub
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_ImportExportMachiningPanelVM.m_CloseWindow
Me.DialogResult = bDialogResult
End Sub
End Class
@@ -0,0 +1,441 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports EgtUILib
Imports EgtWPFLib5
Public Class ImportExportMachiningPanelVM
Inherits VMBase
' Modalita' di apertura della finestra
Public Enum WindowModeEnum As Integer
IMPORT
EXPORT
End Enum
Private m_WindowMode As WindowModeEnum
Public ReadOnly Property WindowMode As WindowModeEnum
Get
Return m_WindowMode
End Get
End Property
' Lista delle lavorazioni
Private m_MachiningList As New ObservableCollection(Of ImpExpMachiningItem)
Public Property MachiningList As ObservableCollection(Of ImpExpMachiningItem)
Get
Return m_MachiningList
End Get
Set(value As ObservableCollection(Of ImpExpMachiningItem))
m_MachiningList = value
End Set
End Property
' Percorso del file da cui importare le lavorazioni
Private m_ImportFilePath As String
Public ReadOnly Property ImportFilePath As String
Get
Return m_ImportFilePath
End Get
End Property
' Lista delle lavorazioni presenti nel file da cui importare
Private m_ImportFileMachiningNameList As String()
Public ReadOnly Property ImportFileMachiningNameList As String()
Get
Return m_ImportFileMachiningNameList
End Get
End Property
' Lista delle lavorazioni importate con successo
Private m_vsImported As String()
Public ReadOnly Property vsImported As String()
Get
Return m_vsImported
End Get
End Property
Public ReadOnly Property IsEnabledOkBtn As Boolean
Get
For Each Machining In MachiningList
If Machining.Active Then Return True
Next
Return False
End Get
End Property
Friend Event m_CloseWindow(bDialogResult As Boolean)
' Definizione comandi
Private m_cmdOk As ICommand
#Region "MESSAGES"
Public ReadOnly Property OkMsg As String
Get
If WindowMode = WindowModeEnum.IMPORT Then
Return EgtMsg(31450)
Else
Return EgtMsg(31451)
End If
End Get
End Property
#End Region ' Messages
#Region "CONSTRUCTOR"
' export
Sub New()
m_WindowMode = WindowModeEnum.EXPORT
' carico lista lavorazioni
MachiningList.Clear()
' leggo ed aggiungo le altre
Dim nIndex As Integer = 1
Dim sGUID As String = ""
Dim sName As String = ""
Dim sMaterials As String = ""
While ReadMachiningParamString(nIndex, MAC_GUID, "", sGUID) > 0
Dim Guid As Guid = Guid.Empty
Guid.TryParse(sGUID, Guid)
ReadMachiningParamString(nIndex, MAC_NAME, "", sName)
MachiningList.Add(New ImpExpMachiningItem(nIndex, Guid, sName, False))
nIndex += 1
End While
ImpExpMachiningItem.m_delEnableOkBtn = AddressOf EnableOkBtn
End Sub
' import
Sub New(sImportFilePath As String)
m_WindowMode = WindowModeEnum.IMPORT
m_ImportFilePath = sImportFilePath
' carico lista lavorazioni
MachiningList.Clear()
' leggo ed aggiungo le altre
Dim nIndex As Integer = 1
Dim sGUID As String = ""
Dim sName As String = ""
Dim sMaterials As String = ""
While ReadMachiningParamString(nIndex, MAC_GUID, "", sGUID, sImportFilePath) > 0
Dim Guid As Guid = Guid.Empty
Guid.TryParse(sGUID, Guid)
ReadMachiningParamString(nIndex, MAC_NAME, "", sName, sImportFilePath)
MachiningList.Add(New ImpExpMachiningItem(nIndex, Guid, sName, AlreadyExist(sName)))
nIndex += 1
End While
ImpExpMachiningItem.m_delEnableOkBtn = AddressOf EnableOkBtn
End Sub
#End Region ' Constructor
#Region "METHODS"
Private Sub EnableOkBtn()
NotifyPropertyChanged(NameOf(IsEnabledOkBtn))
End Sub
Private Function AlreadyExist(MachiningName As String) As Boolean
Return Map.refMachiningDbVM.MachiningList.Any(Function(x) x.sName = MachiningName)
End Function
#End Region ' METHODS
#Region "COMMANDS"
#Region "OkCommand"
''' <summary>
''' Returns a command that remove the current selected machining.
''' </summary>
Public ReadOnly Property OkCommand() As ICommand
Get
If m_cmdOk Is Nothing Then
m_cmdOk = New Command(AddressOf ConfirmImpExpMachinings)
End If
Return m_cmdOk
End Get
End Property
''' <summary>
''' Manage the MachiningDb closing. This method is invoked by the CloseMachiningDbCommand.
''' </summary>
Public Sub ConfirmImpExpMachinings(param As Object)
Select Case WindowMode
Case WindowModeEnum.IMPORT
Dim OrigFilePath As String = CurrentMachine.sMachiningFilePath
Dim NewMachining As Machining = Nothing
For Each Machining In m_MachiningList
Dim nIndex As Integer = Map.refMachiningDbVM.MachiningList.Max(Function(x) x.nIndex) + 1
If Machining.Active Then
CurrentMachine.SetMachiningFilePath(ImportFilePath)
' leggo lavorazione da file di import
NewMachining = New Machining(Machining.nIndex)
' cambio guid, indice e verifico nome
NewMachining.sGUID = Guid.NewGuid.ToString()
NewMachining.SetIndex(nIndex)
If Machining.AlreadyExist Then
If Machining.ChangeName Then
NewMachining.sName = Machining.sName
End If
End If
Map.refMachiningDbVM.MachiningList.Add(NewMachining)
' ripristino path corretta del Db
CurrentMachine.SetMachiningFilePath(OrigFilePath)
' salvo la lavorazione
NewMachining.Save()
End If
Next
' ripristino path corretta del Db
CurrentMachine.SetMachiningFilePath(OrigFilePath)
' seleziono ultima importata
If Not IsNothing(NewMachining) Then
Map.refMachiningDbVM.SelMachining = NewMachining
Map.refMachiningDbVM.NotifyPropertyChanged(NameOf(Map.refMachiningDbVM.SelMachining))
End If
Case WindowModeEnum.EXPORT
' recupero le lavorazioni checkate
Dim FinalNameList As New List(Of String)
For Each Machining In MachiningList
If Machining.Active Then
FinalNameList.Add(Machining.sName)
End If
Next
If FinalNameList.Count() = 0 Then Return
Dim FinalNameArray = FinalNameList.ToArray()
' chiedo il nome con cui salvare il file .data
Dim SaveFileDlg As New System.Windows.Forms.SaveFileDialog() With {
.Title = EgtMsg(31451) & " " & EgtMsg(31452),
.Filter = "File data (*.data)|*.data|Tutti i file (*.*)|*.*",
.FileName = String.Empty
}
If SaveFileDlg.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then Return
Dim sFilePath As String = String.Empty
sFilePath = SaveFileDlg.FileName
' se esiste già lo elimino
If File.Exists(sFilePath) Then
Try
File.Delete(sFilePath)
Catch ex As Exception
End Try
End If
' creo nuovo file
If Not File.Exists(sFilePath) Then
Try
File.WriteAllLines(sFilePath, {"; Commento per evitare BOM con UTF-8"})
Catch ex As Exception
End Try
End If
Dim ActiveMachiningList As List(Of Machining) = (From Machining In Map.refMachiningDbVM.MachiningList
Select Machining
Where m_MachiningList.Any(Function(x) x.sGUID.ToString() = Machining.sGUID AndAlso x.Active)).ToList()
' salvo tutte le lavorazioni sul Db
For Index = 0 To ActiveMachiningList.Count - 1
ActiveMachiningList(Index).WriteParamsOnDb(Index + 1, sFilePath)
Next
End Select
' Chiusura finestra
RaiseEvent m_CloseWindow(True)
End Sub
#End Region ' OkCommand
#End Region ' Commands
End Class
Public Class ImpExpMachiningItem
Inherits VMBase
Public Const IMPEXTNAME As String = "_imp"
' Actions
Friend Shared m_delEnableOkBtn As Action
Private Shared m_Empty As New MachiningIndex(-1, Guid.Empty, "None")
Private m_nIndex As Integer
Public ReadOnly Property nIndex As Integer
Get
Return m_nIndex
End Get
End Property
Private m_sGUID As Guid
Public ReadOnly Property sGUID As Guid
Get
Return m_sGUID
End Get
End Property
Private m_sOrigName As String
Private m_sName As String
Public ReadOnly Property sName As String
Get
Return m_sName
End Get
End Property
Private m_Active As Boolean
Public Property Active As Boolean
Get
Return m_Active
End Get
Set(value As Boolean)
' se esiste gia' chiedo se sovrascriverla
If value Then
If m_AlreadyExist Then
Select Case System.Windows.MessageBox.Show(EgtMsg(31453), "", MessageBoxButton.YesNoCancel)
Case MessageBoxResult.Yes
m_ChangeName = False
m_Active = True
Case MessageBoxResult.No
Dim bImpNameAlreadyInList = False
Dim nImpNameIndex As Integer = 0
If Map.refMachiningDbVM.MachiningList.Any(Function(x) x.sName = m_sOrigName & IMPEXTNAME) Then
nImpNameIndex += 1
While Map.refMachiningDbVM.MachiningList.Any(Function(x) x.sName = m_sOrigName & IMPEXTNAME & "_" & nImpNameIndex)
nImpNameIndex += 1
End While
End If
m_sName = m_sOrigName & IMPEXTNAME & If(nImpNameIndex > 0, "_" & nImpNameIndex, "")
System.Windows.MessageBox.Show("Machining will be imported with the name: " & m_sName, "", MessageBoxButton.OK)
NotifyPropertyChanged(NameOf(sName))
m_ChangeName = True
m_Active = True
Case Else
m_Active = False
End Select
NotifyPropertyChanged(NameOf(Active))
Else
m_Active = True
End If
Else
m_ChangeName = False
m_Active = False
m_sName = m_sOrigName
NotifyPropertyChanged(NameOf(sName))
End If
NotifyPropertyChanged(NameOf(Overwrite_Visibility))
If Not IsNothing(m_delEnableOkBtn) Then m_delEnableOkBtn()
End Set
End Property
' Parametro che indica se questo item da importare esiste gia'
Private m_AlreadyExist As Boolean
Friend ReadOnly Property AlreadyExist As Boolean
Get
Return m_AlreadyExist
End Get
End Property
Private m_Overwrite_Visibility As Visibility = Visibility.Collapsed
Public ReadOnly Property Overwrite_Visibility As Visibility
Get
Return If(m_Active AndAlso m_AlreadyExist AndAlso Not m_ChangeName, Visibility.Visible, Visibility.Collapsed)
End Get
End Property
' Parametro che indica se cambiare il nome di un item che esiste gia' o sovrascriverlo
Private m_ChangeName As Boolean
Friend Property ChangeName As Boolean
Get
Return m_ChangeName
End Get
Set(value As Boolean)
m_ChangeName = value
End Set
End Property
Sub New(nIndex As Integer, GUID As Guid, sName As String, AlreadyExist As Boolean)
m_nIndex = nIndex
m_sGUID = GUID
m_sOrigName = sName
m_sName = sName
m_AlreadyExist = AlreadyExist
m_Active = False
End Sub
Friend Shared Function Empty() As MachiningIndex
Return m_Empty
End Function
End Class
Public Class MachiningItem
Inherits VMBase
' Actions
Friend Shared m_delEnableOkBtn As Action
Private m_Name As String
Public Property Name As String
Get
If m_ChangeName Then
Return m_Name & "_imp"
Else
Return m_Name
End If
End Get
Set(value As String)
m_Name = value
End Set
End Property
Private m_Active As Boolean
Public Property Active As Boolean
Get
Return m_Active
End Get
Set(value As Boolean)
' se esiste gia' chiedo se sovrascriverla
If value Then
If m_AlreadyExist Then
Select Case System.Windows.MessageBox.Show(EgtMsg(31453), "", MessageBoxButton.YesNoCancel)
Case MessageBoxResult.Yes
m_ChangeName = False
m_Active = True
Case MessageBoxResult.No
System.Windows.MessageBox.Show(EgtMsg(31454), "", MessageBoxButton.OK)
m_ChangeName = True
m_Active = True
Case Else
m_Active = False
End Select
NotifyPropertyChanged("Active")
Else
m_Active = True
End If
Else
m_ChangeName = False
m_Active = False
End If
If Not IsNothing(m_delEnableOkBtn) Then m_delEnableOkBtn()
End Set
End Property
' Parametro che indica se questo item da importare esiste gia'
Private m_AlreadyExist As Boolean
Friend ReadOnly Property AlreadyExist As Boolean
Get
Return m_AlreadyExist
End Get
End Property
' Parametro che indica se cambiare il nome di un item che esiste gia' o sovrascriverlo
Private m_ChangeName As Boolean
Friend Property ChangeName As Boolean
Get
Return m_ChangeName
End Get
Set(value As Boolean)
m_ChangeName = value
NotifyPropertyChanged("Name")
End Set
End Property
Sub New(Name As String, AlreadyExist As Boolean)
m_Name = Name
m_AlreadyExist = AlreadyExist
End Sub
End Class
+133 -110
View File
@@ -9,7 +9,8 @@ Public Class Machining
Public Enum MPAR_SLICINGTYPE As Integer
VERTICAL = 1
DEG45 = 2
HORIZONTAL = 3
DEG45_Y = 3
HORIZONTAL = 4
End Enum
Public Enum MPAR_STRANDORDERS As Integer
@@ -70,6 +71,9 @@ Public Class Machining
Return m_nIndex
End Get
End Property
Friend Sub SetIndex(nValue As Integer)
m_nIndex = nValue
End Sub
Protected m_sGUID As String = ""
Public Property sGUID As String
@@ -184,11 +188,11 @@ Public Class Machining
Next
End Sub
Friend Sub WriteParamsOnDb(nIndex As Integer)
WriteMachiningParam(nIndex, MAC_GUID, m_sGUID)
WriteMachiningParam(nIndex, MAC_NAME, m_sName)
Friend Sub WriteParamsOnDb(nIndex As Integer, Optional sFilePath As String = "")
WriteMachiningParam(nIndex, MAC_GUID, m_sGUID, sFilePath)
WriteMachiningParam(nIndex, MAC_NAME, m_sName, sFilePath)
For Each Cathegory In m_CathegoryList
Cathegory.WriteParamOnDb(nIndex)
Cathegory.WriteParamOnDb(nIndex, sFilePath)
Next
End Sub
@@ -303,6 +307,7 @@ Public Class MachiningCathegory
New ComboMachiningParam(MachiningParam.Params.DIRECTION, nIndex),
New NumericMachiningParam(MachiningParam.Params.FLOORCOUNT, nIndex),
New NumericMachiningParam(MachiningParam.Params.G0FEED, nIndex),
New NumericMachiningParam(MachiningParam.Params.G0FEEDZ, nIndex),
New NumericMachiningParam(MachiningParam.Params.TOOLDIAM, nIndex),
New NumericMachiningParam(MachiningParam.Params.FLOWRATE_PC, nIndex)})
Case Cathegories.LINK
@@ -378,12 +383,12 @@ Public Class MachiningCathegory
Next
End Sub
Friend Sub WriteParamOnDb(nIndex As Integer)
Friend Sub WriteParamOnDb(nIndex As Integer, Optional sFilePath As String = "")
If Type = Cathegories.MATERIALS Then
WriteMachiningParamSplit(nIndex, MAC_MATERIALS, "")
WriteMachiningParamSplit(nIndex, MAC_MATERIALS, "", sFilePath)
End If
For Each Param In m_MachiningParamList
Param.WriteParamOnDb(nIndex)
Param.WriteParamOnDb(nIndex, sFilePath)
Next
End Sub
@@ -418,37 +423,38 @@ Public MustInherit Class MachiningParam
WIPEFEED_PC = 24
FLOORCOUNT = 25
G0FEED = 26
TOOLDIAM = 27
RIBSTYPE = 28
RIBSOVERLAP = 29
RIBSSTRANDCOUNT = 30
RIBSLINK = 31
RIBSINVERTORDER = 32
RIBSINVERTDIRECTION = 33
RIBSLEADININVERT = 34
RIBSLEADINLEN = 35
RIBSLEADOUTINVERT = 36
RIBSLEADOUTLEN = 37
RIBSLEADOUTCOASTING = 38
RIBSLEADOUTWIPE = 39
RIBSLEADOUTWIPEDIR = 40
SHELLNBRDIFFERENCE = 41
SHELLNBRCOASTING = 42
SHELLNBRWIPE = 43
SHELLNBRWIPEDIR = 44
AUXSOLIDSOVERLAP = 45
AUXSOLIDSINFILL = 46
AUXSOLIDSSTRANDORDER = 47
AUXSOLIDSLINKTYPE = 48
AUXSOLIDSLINKPARAM = 49
AUXSOLIDSSTARTPOINTOFFSETONSLICE = 50
AUXSOLIDSCOASTINGLEN = 51
AUXSOLIDSWIPELEN = 52
AUXSOLIDSWIPEDIR = 53
SPIRALVASE = 54
WIPEDIR = 55
STRANDOVERLAP = 56
FLOWRATE_PC = 57
G0FEEDZ = 27
TOOLDIAM = 28
RIBSTYPE = 29
RIBSOVERLAP = 30
RIBSSTRANDCOUNT = 31
RIBSLINK = 32
RIBSINVERTORDER = 33
RIBSINVERTDIRECTION = 34
RIBSLEADININVERT = 35
RIBSLEADINLEN = 36
RIBSLEADOUTINVERT = 37
RIBSLEADOUTLEN = 38
RIBSLEADOUTCOASTING = 39
RIBSLEADOUTWIPE = 40
RIBSLEADOUTWIPEDIR = 41
SHELLNBRDIFFERENCE = 42
SHELLNBRCOASTING = 43
SHELLNBRWIPE = 44
SHELLNBRWIPEDIR = 45
AUXSOLIDSOVERLAP = 46
AUXSOLIDSINFILL = 47
AUXSOLIDSSTRANDORDER = 48
AUXSOLIDSLINKTYPE = 49
AUXSOLIDSLINKPARAM = 50
AUXSOLIDSSTARTPOINTOFFSETONSLICE = 51
AUXSOLIDSCOASTINGLEN = 52
AUXSOLIDSWIPELEN = 53
AUXSOLIDSWIPEDIR = 54
SPIRALVASE = 55
WIPEDIR = 56
STRANDOVERLAP = 57
FLOWRATE_PC = 58
MATERIALS = 100
End Enum
@@ -519,6 +525,8 @@ Public MustInherit Class MachiningParam
m_sName = "Floor Count"
Case Params.G0FEED
m_sName = "G0 Feed"
Case Params.G0FEEDZ
m_sName = "G0 Feed Z"
Case Params.TOOLDIAM
m_sName = "Nozzle Diameter"
Case Params.RIBSTYPE
@@ -589,7 +597,7 @@ Public MustInherit Class MachiningParam
m_sName = sName
End Sub
Friend MustOverride Sub WriteParamOnDb(nIndex As Integer)
Friend MustOverride Sub WriteParamOnDb(nIndex As Integer, Optional sFilePath As String = "")
Friend Overridable Sub WriteParamInPart(nIndex As Integer)
End Sub
Friend MustOverride Sub SaveParam()
@@ -610,15 +618,16 @@ Public Class NumericMachiningParam
End Property
Public Overridable Property sValue As String
Get
Return If(m_bIsLen, LenToString(m_dValue, 1), DoubleToString( m_dValue, 2))
Return If(m_bIsLen, LenToString(m_dValue, 1), DoubleToString(m_dValue, 2))
End Get
Set(value As String)
If m_bIsLen Then
StringToLen(value, m_dValue)
Else
StringToDouble( value, m_dValue)
StringToDouble(value, m_dValue)
End If
NotifyPropertyChanged(NameOf(sValue))
Map.refMachiningDbVM.NotifyPropertyChanged(NameOf(Map.refMachiningDbVM.ImpExp_IsEnabled))
End Set
End Property
@@ -706,6 +715,9 @@ Public Class NumericMachiningParam
Case Params.G0FEED
m_dValue = ReadMachiningParamDouble(nIndex, MAC_G0FEED, 0)
m_bIsLen = True
Case Params.G0FEEDZ
m_dValue = ReadMachiningParamDouble(nIndex, MAC_G0FEEDZ, 0)
m_bIsLen = True
Case Params.TOOLDIAM
m_dValue = ReadMachiningParamDouble(nIndex, MAC_TOOLDIAM, 0)
m_bIsLen = True
@@ -768,7 +780,7 @@ Public Class NumericMachiningParam
m_dOrigValue = m_dValue
End Sub
Friend Overrides Sub WriteParamOnDb(nIndex As Integer)
Friend Overrides Sub WriteParamOnDb(nIndex As Integer, Optional sFilePath As String = "")
Dim sWriteValue As String = ""
If m_bIsLen Then
sWriteValue = LenToString(m_dValue, 2)
@@ -777,83 +789,85 @@ Public Class NumericMachiningParam
End If
Select Case Type
Case Params.STRANDH
WriteMachiningParam(nIndex, MAC_STRANDH, sWriteValue)
WriteMachiningParam(nIndex, MAC_STRANDH, sWriteValue, sFilePath)
Case Params.STRANDW
WriteMachiningParam(nIndex, MAC_STRANDW, sWriteValue)
WriteMachiningParam(nIndex, MAC_STRANDW, sWriteValue, sFilePath)
Case Params.STRANDCOUNT
WriteMachiningParam(nIndex, MAC_STRANDCOUNT, sWriteValue)
WriteMachiningParam(nIndex, MAC_STRANDCOUNT, sWriteValue, sFilePath)
Case Params.OFFSET
WriteMachiningParam(nIndex, MAC_OFFSET, sWriteValue)
WriteMachiningParam(nIndex, MAC_OFFSET, sWriteValue, sFilePath)
Case Params.STRANDOVERLAP
WriteMachiningParam(nIndex, MAC_STRANDOVERLAP, sWriteValue)
WriteMachiningParam(nIndex, MAC_STRANDOVERLAP, sWriteValue, sFilePath)
Case Params.STARTPOINTOFFSETONSLICE
WriteMachiningParam(nIndex, MAC_STARTPOINTOFFSETONSLICE, sWriteValue)
WriteMachiningParam(nIndex, MAC_STARTPOINTOFFSETONSLICE, sWriteValue, sFilePath)
Case Params.LINKPARAM
WriteMachiningParam(nIndex, MAC_LINKPARAM, sWriteValue)
WriteMachiningParam(nIndex, MAC_LINKPARAM, sWriteValue, sFilePath)
Case Params.LINKZUP
WriteMachiningParam(nIndex, MAC_LINKZUP, sWriteValue)
WriteMachiningParam(nIndex, MAC_LINKZUP, sWriteValue, sFilePath)
Case Params.OFFSETLEADPOINT
WriteMachiningParam(nIndex, MAC_OFFSETLEADPOINT, sWriteValue)
WriteMachiningParam(nIndex, MAC_OFFSETLEADPOINT, sWriteValue, sFilePath)
Case Params.LEADINTANGDIST
WriteMachiningParam(nIndex, MAC_LEADINTANGDIST, sWriteValue)
WriteMachiningParam(nIndex, MAC_LEADINTANGDIST, sWriteValue, sFilePath)
Case Params.LEADINORTHODIST
WriteMachiningParam(nIndex, MAC_LEADINORTHODIST, sWriteValue)
WriteMachiningParam(nIndex, MAC_LEADINORTHODIST, sWriteValue, sFilePath)
Case Params.LEADOUTTANGDIST
WriteMachiningParam(nIndex, MAC_LEADOUTTANGDIST, sWriteValue)
WriteMachiningParam(nIndex, MAC_LEADOUTTANGDIST, sWriteValue, sFilePath)
Case Params.LEADOUTORTHODIST
WriteMachiningParam(nIndex, MAC_LEADOUTORTHODIST, sWriteValue)
WriteMachiningParam(nIndex, MAC_LEADOUTORTHODIST, sWriteValue, sFilePath)
Case Params.COASTINGLEN
WriteMachiningParam(nIndex, MAC_COASTINGLEN, sWriteValue)
WriteMachiningParam(nIndex, MAC_COASTINGLEN, sWriteValue, sFilePath)
Case Params.COASTINGFEED_PC
WriteMachiningParam(nIndex, MAC_COASTINGFEEDPU, sWriteValue)
WriteMachiningParam(nIndex, MAC_COASTINGFEEDPU, sWriteValue, sFilePath)
Case Params.WIPELEN
WriteMachiningParam(nIndex, MAC_WIPELEN, sWriteValue)
WriteMachiningParam(nIndex, MAC_WIPELEN, sWriteValue, sFilePath)
Case Params.WIPEFEED_PC
WriteMachiningParam(nIndex, MAC_WIPEFEEDPU, sWriteValue)
WriteMachiningParam(nIndex, MAC_WIPEFEEDPU, sWriteValue, sFilePath)
Case Params.WIPEDIR
WriteMachiningParam(nIndex, MAC_WIPEDIR, sWriteValue)
WriteMachiningParam(nIndex, MAC_WIPEDIR, sWriteValue, sFilePath)
Case Params.FLOORCOUNT
WriteMachiningParam(nIndex, MAC_FLOORCOUNT, sWriteValue)
WriteMachiningParam(nIndex, MAC_FLOORCOUNT, sWriteValue, sFilePath)
Case Params.G0FEED
WriteMachiningParam(nIndex, MAC_G0FEED, sWriteValue)
WriteMachiningParam(nIndex, MAC_G0FEED, sWriteValue, sFilePath)
Case Params.G0FEEDZ
WriteMachiningParam(nIndex, MAC_G0FEEDZ, sWriteValue, sFilePath)
Case Params.TOOLDIAM
WriteMachiningParam(nIndex, MAC_TOOLDIAM, sWriteValue)
WriteMachiningParam(nIndex, MAC_TOOLDIAM, sWriteValue, sFilePath)
Case Params.RIBSOVERLAP
WriteMachiningParam(nIndex, MAC_RIBSOVERLAP, sWriteValue)
WriteMachiningParam(nIndex, MAC_RIBSOVERLAP, sWriteValue, sFilePath)
Case Params.RIBSSTRANDCOUNT
WriteMachiningParam(nIndex, MAC_RIBSSTRANDCOUNT, sWriteValue)
WriteMachiningParam(nIndex, MAC_RIBSSTRANDCOUNT, sWriteValue, sFilePath)
Case Params.RIBSLEADINLEN
WriteMachiningParam(nIndex, MAC_RIBSLEADINLEN, sWriteValue)
WriteMachiningParam(nIndex, MAC_RIBSLEADINLEN, sWriteValue, sFilePath)
Case Params.RIBSLEADOUTLEN
WriteMachiningParam(nIndex, MAC_RIBSLEADOUTLEN, sWriteValue)
WriteMachiningParam(nIndex, MAC_RIBSLEADOUTLEN, sWriteValue, sFilePath)
Case Params.RIBSLEADOUTCOASTING
WriteMachiningParam(nIndex, MAC_RIBSLEADOUTCOASTING, sWriteValue)
WriteMachiningParam(nIndex, MAC_RIBSLEADOUTCOASTING, sWriteValue, sFilePath)
Case Params.RIBSLEADOUTWIPE
WriteMachiningParam(nIndex, MAC_RIBSLEADOUTWIPE, sWriteValue)
WriteMachiningParam(nIndex, MAC_RIBSLEADOUTWIPE, sWriteValue, sFilePath)
Case Params.RIBSLEADOUTWIPEDIR
WriteMachiningParam(nIndex, MAC_RIBSLEADOUTWIPEDIR, sWriteValue)
WriteMachiningParam(nIndex, MAC_RIBSLEADOUTWIPEDIR, sWriteValue, sFilePath)
Case Params.SHELLNBRDIFFERENCE
WriteMachiningParam(nIndex, MAC_SHELLNBRDIFFERENCE, sWriteValue)
WriteMachiningParam(nIndex, MAC_SHELLNBRDIFFERENCE, sWriteValue, sFilePath)
Case Params.SHELLNBRCOASTING
WriteMachiningParam(nIndex, MAC_SHELLNBRCOASTING, sWriteValue)
WriteMachiningParam(nIndex, MAC_SHELLNBRCOASTING, sWriteValue, sFilePath)
Case Params.SHELLNBRWIPE
WriteMachiningParam(nIndex, MAC_SHELLNBRWIPE, sWriteValue)
WriteMachiningParam(nIndex, MAC_SHELLNBRWIPE, sWriteValue, sFilePath)
Case Params.SHELLNBRWIPEDIR
WriteMachiningParam(nIndex, MAC_SHELLNBRWIPEDIR, sWriteValue)
WriteMachiningParam(nIndex, MAC_SHELLNBRWIPEDIR, sWriteValue, sFilePath)
Case Params.AUXSOLIDSOVERLAP
WriteMachiningParam(nIndex, MAC_AUXSOLIDSOVERLAP, sWriteValue)
WriteMachiningParam(nIndex, MAC_AUXSOLIDSOVERLAP, sWriteValue, sFilePath)
Case Params.AUXSOLIDSLINKPARAM
WriteMachiningParam(nIndex, MAC_AUXSOLIDSLINKPARAM, sWriteValue)
WriteMachiningParam(nIndex, MAC_AUXSOLIDSLINKPARAM, sWriteValue, sFilePath)
Case Params.AUXSOLIDSSTARTPOINTOFFSETONSLICE
WriteMachiningParam(nIndex, MAC_AUXSOLIDSSTARTPOINTOFFSETONSLICE, sWriteValue)
WriteMachiningParam(nIndex, MAC_AUXSOLIDSSTARTPOINTOFFSETONSLICE, sWriteValue, sFilePath)
Case Params.AUXSOLIDSCOASTINGLEN
WriteMachiningParam(nIndex, MAC_AUXSOLIDSCOASTINGLEN, sWriteValue)
WriteMachiningParam(nIndex, MAC_AUXSOLIDSCOASTINGLEN, sWriteValue, sFilePath)
Case Params.AUXSOLIDSWIPELEN
WriteMachiningParam(nIndex, MAC_AUXSOLIDSWIPELEN, sWriteValue)
WriteMachiningParam(nIndex, MAC_AUXSOLIDSWIPELEN, sWriteValue, sFilePath)
Case Params.AUXSOLIDSWIPEDIR
WriteMachiningParam(nIndex, MAC_AUXSOLIDSWIPEDIR, sWriteValue)
WriteMachiningParam(nIndex, MAC_AUXSOLIDSWIPEDIR, sWriteValue, sFilePath)
Case Params.FLOWRATE_PC
WriteMachiningParam(nIndex, MAC_CONSTANT, sWriteValue)
WriteMachiningParam(nIndex, MAC_CONSTANT, sWriteValue, sFilePath)
End Select
End Sub
@@ -879,6 +893,7 @@ Public Class StringMachiningParam
Set(value As String)
m_sValue = value
NotifyPropertyChanged(NameOf(sValue))
Map.refMachiningDbVM.NotifyPropertyChanged(NameOf(Map.refMachiningDbVM.ImpExp_IsEnabled))
End Set
End Property
@@ -901,10 +916,10 @@ Public Class StringMachiningParam
m_sOrigValue = m_sValue
End Sub
Friend Overrides Sub WriteParamOnDb(nIndex As Integer)
Friend Overrides Sub WriteParamOnDb(nIndex As Integer, Optional sFilePath As String = "")
Select Case Type
Case Params.STRANDH
'WritePrivateProfileString(nIndex, MAC_STRANDH, sWriteValue)
'WritePrivateProfileString(nIndex, MAC_STRANDH, sWriteValue, sFilePath)
End Select
End Sub
@@ -937,6 +952,7 @@ Public Class ComboMachiningParam
Set(value As IdNameStruct)
m_SelValue = value
NotifyPropertyChanged(NameOf(SelValue))
Map.refMachiningDbVM.NotifyPropertyChanged(NameOf(Map.refMachiningDbVM.ImpExp_IsEnabled))
End Set
End Property
@@ -965,11 +981,16 @@ Public Class ComboMachiningParam
Else
Select Case Type
Case Params.SLICINGTYPE
Dim nHorizontalPrint As Integer = GetPrivateProfileInt(S_MACH_PRINTING3D, K_HORIZONTAL_PRINT, 0, CurrentMachine.sMachIniFile)
m_ValueList = New List(Of IdNameStruct)({New IdNameStruct(Machining.MPAR_SLICINGTYPE.VERTICAL, "Vertical"),
New IdNameStruct(Machining.MPAR_SLICINGTYPE.DEG45, "45°")})
If nHorizontalPrint > 0 Then
m_ValueList.Add(New IdNameStruct(Machining.MPAR_SLICINGTYPE.HORIZONTAL, "Horizontal"))
Dim nSlicingType As Integer = GetPrivateProfileInt(S_MACH_PRINTING3D, K_SLICINGTYPE, 0, CurrentMachine.sMachIniFile)
m_ValueList = New List(Of IdNameStruct)({New IdNameStruct(Machining.MPAR_SLICINGTYPE.VERTICAL, "Vertical")})
If nSlicingType >= 1 Then
m_ValueList.Add(New IdNameStruct(Machining.MPAR_SLICINGTYPE.DEG45, "45deg X"))
If nSlicingType >= 2 Then
m_ValueList.Add(New IdNameStruct(Machining.MPAR_SLICINGTYPE.DEG45_Y, "45deg Y"))
If nSlicingType >= 3 Then
m_ValueList.Add(New IdNameStruct(Machining.MPAR_SLICINGTYPE.HORIZONTAL, "Horizontal"))
End If
End If
End If
Dim nSelValue As Double = ReadMachiningParamDouble(nIndex, MAC_SLICINGTYPE, -1)
If nSelValue = -1 Then
@@ -1025,28 +1046,28 @@ Public Class ComboMachiningParam
m_OrigSelValue = m_SelValue
End Sub
Friend Overrides Sub WriteParamOnDb(nIndex As Integer)
Friend Overrides Sub WriteParamOnDb(nIndex As Integer, Optional sFilePath As String = "")
Select Case Type
Case Params.SLICINGTYPE
WriteMachiningParam(nIndex, MAC_SLICINGTYPE, m_SelValue.Id)
WriteMachiningParam(nIndex, MAC_SLICINGTYPE, m_SelValue.Id, sFilePath)
Case Params.STRANDORDER
WriteMachiningParam(nIndex, MAC_STRANDORDER, m_SelValue.Id)
WriteMachiningParam(nIndex, MAC_STRANDORDER, m_SelValue.Id, sFilePath)
Case Params.DIRECTION
WriteMachiningParam(nIndex, MAC_DIRECTION, m_SelValue.Id)
WriteMachiningParam(nIndex, MAC_DIRECTION, m_SelValue.Id, sFilePath)
Case Params.LINKTYPE
WriteMachiningParam(nIndex, MAC_LINKTYPE, m_SelValue.Id)
WriteMachiningParam(nIndex, MAC_LINKTYPE, m_SelValue.Id, sFilePath)
Case Params.LEADIN
WriteMachiningParam(nIndex, MAC_LEADIN, m_SelValue.Id)
WriteMachiningParam(nIndex, MAC_LEADIN, m_SelValue.Id, sFilePath)
Case Params.LEADOUT
WriteMachiningParam(nIndex, MAC_LEADOUT, m_SelValue.Id)
WriteMachiningParam(nIndex, MAC_LEADOUT, m_SelValue.Id, sFilePath)
Case Params.RIBSTYPE
WriteMachiningParam(nIndex, MAC_RIBSTYPE, m_SelValue.Id)
WriteMachiningParam(nIndex, MAC_RIBSTYPE, m_SelValue.Id, sFilePath)
Case Params.AUXSOLIDSINFILL
WriteMachiningParam(nIndex, MAC_AUXSOLIDSINFILL, m_SelValue.Id)
WriteMachiningParam(nIndex, MAC_AUXSOLIDSINFILL, m_SelValue.Id, sFilePath)
Case Params.AUXSOLIDSSTRANDORDER
WriteMachiningParam(nIndex, MAC_AUXSOLIDSSTRANDORDER, m_SelValue.Id)
WriteMachiningParam(nIndex, MAC_AUXSOLIDSSTRANDORDER, m_SelValue.Id, sFilePath)
Case Params.AUXSOLIDSLINKTYPE
WriteMachiningParam(nIndex, MAC_AUXSOLIDSLINKTYPE, m_SelValue.Id)
WriteMachiningParam(nIndex, MAC_AUXSOLIDSLINKTYPE, m_SelValue.Id, sFilePath)
End Select
End Sub
@@ -1072,6 +1093,7 @@ Public Class CheckMachiningParam
Set(value As Boolean)
m_bValue = value
NotifyPropertyChanged(NameOf(bValue))
Map.refMachiningDbVM.NotifyPropertyChanged(NameOf(Map.refMachiningDbVM.ImpExp_IsEnabled))
End Set
End Property
@@ -1115,20 +1137,20 @@ Public Class CheckMachiningParam
m_bOrigValue = m_bValue
End Sub
Friend Overrides Sub WriteParamOnDb(nIndex As Integer)
Friend Overrides Sub WriteParamOnDb(nIndex As Integer, Optional sFilePath As String = "")
Select Case Type
Case Params.SPIRALVASE
WriteMachiningParam(nIndex, MAC_SPIRALVASE, If(m_bValue, 1, 0))
WriteMachiningParam(nIndex, MAC_SPIRALVASE, If(m_bValue, 1, 0), sFilePath)
Case Params.RIBSLINK
WriteMachiningParam(nIndex, MAC_RIBSLINK, If(m_bValue, 1, 0))
WriteMachiningParam(nIndex, MAC_RIBSLINK, If(m_bValue, 1, 0), sFilePath)
Case Params.RIBSINVERTORDER
WriteMachiningParam(nIndex, MAC_RIBSINVERTORDER, If(m_bValue, 1, 0))
WriteMachiningParam(nIndex, MAC_RIBSINVERTORDER, If(m_bValue, 1, 0), sFilePath)
Case Params.RIBSINVERTDIRECTION
WriteMachiningParam(nIndex, MAC_RIBSINVERTDIRECTION, If(m_bValue, 1, 0))
WriteMachiningParam(nIndex, MAC_RIBSINVERTDIRECTION, If(m_bValue, 1, 0), sFilePath)
Case Params.RIBSLEADININVERT
WriteMachiningParam(nIndex, MAC_RIBSLEADININVERT, If(m_bValue, 1, 0))
WriteMachiningParam(nIndex, MAC_RIBSLEADININVERT, If(m_bValue, 1, 0), sFilePath)
Case Params.RIBSLEADOUTINVERT
WriteMachiningParam(nIndex, MAC_RIBSLEADOUTINVERT, If(m_bValue, 1, 0))
WriteMachiningParam(nIndex, MAC_RIBSLEADOUTINVERT, If(m_bValue, 1, 0), sFilePath)
End Select
End Sub
@@ -1164,6 +1186,7 @@ Public Class MaterialMachiningParam
Set(value As Boolean)
m_bValue = value
NotifyPropertyChanged(NameOf(bValue))
Map.refMachiningDbVM.NotifyPropertyChanged(NameOf(Map.refMachiningDbVM.ImpExp_IsEnabled))
End Set
End Property
@@ -1187,9 +1210,9 @@ Public Class MaterialMachiningParam
m_bOrigValue = m_bValue
End Sub
Friend Overrides Sub WriteParamOnDb(nIndex As Integer)
Friend Overrides Sub WriteParamOnDb(nIndex As Integer, Optional sFilePath As String = "")
Dim sMaterials As String = ""
ReadMachiningParamSplit(nIndex, MAC_MATERIALS, "", sMaterials)
ReadMachiningParamSplit(nIndex, MAC_MATERIALS, "", sMaterials, sFilePath)
Dim MaterialGuidList As New List(Of String)
If Not String.IsNullOrWhiteSpace(sMaterials) Then
MaterialGuidList = sMaterials.Split(";"c).ToList()
@@ -1203,7 +1226,7 @@ Public Class MaterialMachiningParam
For Index = 0 To MaterialGuidList.Count - 1
sMaterials &= MaterialGuidList(Index) & If(Index < MaterialGuidList.Count - 1, ";"c, "")
Next
WriteMachiningParamSplit(nIndex, MAC_MATERIALS, sMaterials)
WriteMachiningParamSplit(nIndex, MAC_MATERIALS, sMaterials, sFilePath)
End Sub
Friend Overrides Sub SaveParam()
+25 -2
View File
@@ -14,20 +14,43 @@
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<UniformGrid Rows="1">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Button Content="New"
Command="{Binding New_Command}"
IsEnabled="{Binding IsEnabled}"
Style="{StaticResource ToolBar_TextButton}"/>
<Button Content="Save"
Grid.Column="1"
Command="{Binding Save_Command}"
IsEnabled="{Binding IsEnabled}"
Style="{StaticResource ToolBar_TextButton}"/>
<Button Content="Delete"
Grid.Column="2"
Command="{Binding Delete_Command}"
IsEnabled="{Binding IsEnabled}"
Style="{StaticResource ToolBar_TextButton}"/>
</UniformGrid>
<Button Grid.Column="3"
Command="{Binding Import_Command}"
ToolTip="{Binding ImportToolTip}"
IsEnabled="{Binding ImpExp_IsEnabled}"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/MachiningDB/Import.png" Stretch="Uniform"/>
</Button>
<Button Grid.Column="4"
Command="{Binding Export_Command}"
ToolTip="{Binding ImportToolTip}"
IsEnabled="{Binding ImpExp_IsEnabled}"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/MachiningDB/Export.png" Stretch="Uniform"/>
</Button>
</Grid>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
+59 -4
View File
@@ -26,7 +26,7 @@ Public Class MachiningDbVM
' verifico se modificato
If m_SelMachining.bIsModified Then
' chiedo se salvare
Select Case MessageBox.Show("Salvare le modifiche apportate alla lavorazione selezionata?", "Info", MessageBoxButton.YesNoCancel, MessageBoxImage.Question)
Select Case MessageBox.Show("Do you want to save the modification done on the selected machining?", "Info", MessageBoxButton.YesNoCancel, MessageBoxImage.Question)
Case MessageBoxResult.Yes
m_SelMachining.Save()
Case MessageBoxResult.No
@@ -50,6 +50,7 @@ Public Class MachiningDbVM
End If
Next
End If
NotifyPropertyChanged(NameOf(ImpExp_IsEnabled))
End Set
End Property
@@ -105,12 +106,20 @@ Public Class MachiningDbVM
NotifyPropertyChanged(NameOf(UserShouldEditValueNow))
End Sub
Public ReadOnly Property ImpExp_IsEnabled As Boolean
Get
Return m_IsEnabled AndAlso (IsNothing(m_SelMachining) OrElse Not m_SelMachining.bIsModified)
End Get
End Property
' Definizione comandi
Private m_cmdOk As ICommand
Private m_cmdNew As ICommand
Private m_cmdSave As ICommand
Private m_cmdDelete As ICommand
Private m_cmdEditName As ICommand
Private m_cmdImport As ICommand
Private m_cmdExport As ICommand
#End Region ' FIELDS & PROPERTIES
@@ -138,6 +147,7 @@ Public Class MachiningDbVM
GetMainPrivateProfileString(S_PRINTING3D, K_CURRMACHINING, "", sCurrMachining)
m_SelMachining = MachiningList.FirstOrDefault(Function(x) x.sGUID = sCurrMachining)
NotifyPropertyChanged(NameOf(SelMachining))
NotifyPropertyChanged(NameOf(ImpExp_IsEnabled))
End Sub
Friend Sub SetNameVisibility(bValue As Boolean)
@@ -213,7 +223,7 @@ Public Class MachiningDbVM
' aggiorno combo top
Dim CurrSelTopMachining As MachiningIndex = Map.refTopPanelVM.SelMachining
Map.refTopPanelVM.InitMachiningsList()
Map.refTopPanelVM.SetSelMachining( CurrSelTopMachining)
Map.refTopPanelVM.SetSelMachining(CurrSelTopMachining)
End If
' ripristino modalita' standard
Map.refTopPanelVM.SelPage = Pages.MODIFY
@@ -239,6 +249,7 @@ Public Class MachiningDbVM
m_SelMachining = NewMachining
NotifyPropertyChanged(NameOf(SelMachining))
SetNameVisibility(True)
SetIsModified(True)
End Sub
#End Region ' New
@@ -255,8 +266,9 @@ Public Class MachiningDbVM
End Property
Public Sub Save()
If IsNothing( m_SelMachining) Then Return
If IsNothing(m_SelMachining) Then Return
m_SelMachining.Save()
NotifyPropertyChanged(NameOf(ImpExp_IsEnabled))
End Sub
#End Region ' Save
@@ -275,7 +287,7 @@ Public Class MachiningDbVM
Public Sub Delete()
If IsNothing(m_SelMachining) Then Return
' chiedo conferma
Select Case MessageBox.Show("Sei sicuro di voler cancellare la lavorazione selezionata?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning)
Select Case MessageBox.Show("Are you sure you want to delete the selected machining?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning)
Case MessageBoxResult.Yes
m_MachiningList.Remove(m_SelMachining)
SetIsModified(True)
@@ -305,6 +317,49 @@ Public Class MachiningDbVM
#End Region ' EditName
#Region "Import"
Public ReadOnly Property Import_Command As ICommand
Get
If m_cmdImport Is Nothing Then
m_cmdImport = New Command(AddressOf Import)
End If
Return m_cmdImport
End Get
End Property
Public Sub Import()
' chiedo il nome del file .data da aprire
Dim OpenFileDlg As New System.Windows.Forms.OpenFileDialog() With {
.Title = EgtMsg(31451) & " " & EgtMsg(31452),
.Filter = "File data (*.data)|*.data|Tutti i file (*.*)|*.*",
.FileName = String.Empty
}
If OpenFileDlg.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then Return
Dim ImportWindow As New ImportExportMachiningPanelV(Application.Current.MainWindow, New ImportExportMachiningPanelVM(OpenFileDlg.FileName))
ImportWindow.ShowDialog()
End Sub
#End Region ' Import
#Region "Export"
Public ReadOnly Property Export_Command As ICommand
Get
If m_cmdExport Is Nothing Then
m_cmdExport = New Command(AddressOf Export)
End If
Return m_cmdExport
End Get
End Property
Public Sub Export()
Dim ExportWindow As New ImportExportMachiningPanelV(Application.Current.MainWindow, New ImportExportMachiningPanelVM)
ExportWindow.ShowDialog()
End Sub
#End Region ' Export
#End Region ' COMMANDS
End Class
+2 -2
View File
@@ -195,8 +195,8 @@ Public Class MainWindowM
' Verifico abilitazione nesting automatico
m_bAutoNestOption = Not String.IsNullOrWhiteSpace(sNestKey)
' Recupero livello e opzioni della chiave
Dim bKey As Boolean = EgtGetKeyLevel(3279, 2410, 1, m_nKeyLevel) And
EgtGetKeyOptions(3279, 2410, 1, m_nKeyOptions)
Dim bKey As Boolean = EgtGetKeyLevel(3279, 2412, 1, m_nKeyLevel) And
EgtGetKeyOptions(3279, 2412, 1, m_nKeyOptions)
' Inizializzazione generale di EgtInterface
m_nDebug = GetMainPrivateProfileInt(S_GENERAL, K_DEBUG, 0)
m_sLogFile = m_sTempDir & "\" & GENLOG_FILE_NAME.Replace("#", m_nInstance.ToString())
+27 -20
View File
@@ -310,13 +310,14 @@ Public Class ManagePartPanelVM
Case ManagePart_Layer.LayerType.PRINT_SOLID
nPrintPartLayerId = EgtCreateGroup(nPartId)
EgtSetName(nPrintPartLayerId, PRINT_SOLID)
EgtSetColor(nPrintPartLayerId, GeomEntityColors.c3Print)
If ManagePart_Layer.EntityList.Count > 0 Then
PrintSolidEntity = ManagePart_Layer.EntityList(0)
EgtRelocateGlob(PrintSolidEntity.nId, nPrintPartLayerId, GDB_POS.LAST_SON)
' calcolo box superficie per creazione riferimento
EgtGetBBoxGlob(PrintSolidEntity.nId, GDB_BB.STANDARD, b3PrintSolid)
' coloro l'entita'
EgtSetColor(PrintSolidEntity.nId, GeomEntityColors.c3Print)
' elimino colore entita'
EgtResetColor(PrintSolidEntity.nId)
If PrintSolidEntity.sName <> PrintSolidEntity.nId.ToString() Then
EgtSetInfo(PrintSolidEntity.nId, ENTITY_NAME, PrintSolidEntity.sName)
End If
@@ -324,6 +325,7 @@ Public Class ManagePartPanelVM
Case ManagePart_Layer.LayerType.MACH_START
nMachStartLayerId = EgtCreateGroup(nPartId)
EgtSetName(nMachStartLayerId, LAY_MACH_START)
EgtSetColor(nMachStartLayerId, GeomEntityColors.c3MachStart)
Dim nMachStartId As Integer = GDB_ID.NULL
If ManagePart_Layer.EntityList.Count > 0 Then
For Each PartManager_GeomEntity In ManagePart_Layer.EntityList
@@ -339,8 +341,8 @@ Public Class ManagePartPanelVM
nMachStartId = EgtCreateCurveCompo(nMachStartLayerId, PartManager_GeomEntity.nId, True)
End Select
EgtSetName(nMachStartId, START_GEOM)
' coloro l'entita'
EgtSetColor(nMachStartId, GeomEntityColors.c3MachStart)
' elimino colore entita'
EgtResetColor(nMachStartId)
If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then
EgtSetInfo(PartManager_GeomEntity.nId, ENTITY_NAME, PartManager_GeomEntity.sName)
End If
@@ -350,17 +352,18 @@ Public Class ManagePartPanelVM
Dim ptStart As Point3d = b3PrintSolid.Center() - 0.6 * b3PrintSolid.DimY() * Vector3d.Y_AX() - 0.5 * b3PrintSolid.DimZ() * Vector3d.Z_AX()
nMachStartId = EgtCreateGeoPoint(nMachStartLayerId, ptStart, GDB_RT.GLOB)
EgtSetName(nMachStartId, START_GEOM)
' coloro l'entita' di rosso
EgtSetColor(nMachStartId, GeomEntityColors.c3MachStart)
' elimino colore entita'
EgtResetColor(nMachStartId)
End If
Case ManagePart_Layer.LayerType.RIBS
nRibsLayerId = EgtCreateGroup(nPartId)
EgtSetName(nRibsLayerId, LAY_RIBS)
EgtSetColor(nRibsLayerId, GeomEntityColors.c3Rib)
For Each PartManager_GeomEntity In ManagePart_Layer.EntityList
EgtSetInfo(PartManager_GeomEntity.nId, KEY_RIB_TYPE, RibEntity.RibTypes.FROMIMPORT)
EgtRelocateGlob(PartManager_GeomEntity.nId, nRibsLayerId, GDB_POS.LAST_SON)
' coloro l'entita'
EgtSetColor(PartManager_GeomEntity.nId, GeomEntityColors.c3Rib)
' elimino colore entita'
EgtResetColor(PartManager_GeomEntity.nId)
If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then
EgtSetInfo(PartManager_GeomEntity.nId, ENTITY_NAME, PartManager_GeomEntity.sName)
End If
@@ -368,11 +371,12 @@ Public Class ManagePartPanelVM
Case ManagePart_Layer.LayerType.SHELL_NUMBER
nShellNumberLayerId = EgtCreateGroup(nPartId)
EgtSetName(nShellNumberLayerId, LAY_SHELL_NBR)
EgtSetColor(nShellNumberLayerId, GeomEntityColors.c3ShellNumber)
For Each PartManager_GeomEntity In ManagePart_Layer.EntityList
EgtSetInfo(PartManager_GeomEntity.nId, KEY_SHELLNBR_TYPE, ShellNumberEntity.ShellNumberTypes.FROMIMPORT)
EgtRelocateGlob(PartManager_GeomEntity.nId, nShellNumberLayerId, GDB_POS.LAST_SON)
' coloro l'entita'
EgtSetColor(PartManager_GeomEntity.nId, GeomEntityColors.c3ShellNumber)
' elimino colore entita'
EgtResetColor(PartManager_GeomEntity.nId)
If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then
EgtSetInfo(PartManager_GeomEntity.nId, ENTITY_NAME, PartManager_GeomEntity.sName)
End If
@@ -380,11 +384,12 @@ Public Class ManagePartPanelVM
Case ManagePart_Layer.LayerType.AUX_SOLIDS
nAuxSolidsLayerId = EgtCreateGroup(nPartId)
EgtSetName(nAuxSolidsLayerId, LAY_AUX_SOLIDS)
EgtSetColor(nAuxSolidsLayerId, GeomEntityColors.c3AuxSolids)
For Each PartManager_GeomEntity In ManagePart_Layer.EntityList
EgtSetInfo(PartManager_GeomEntity.nId, KEY_AUXSOLID_TYPE, RibEntity.RibTypes.FROMIMPORT)
EgtRelocateGlob(PartManager_GeomEntity.nId, nAuxSolidsLayerId, GDB_POS.LAST_SON)
' coloro l'entita'
EgtSetColor(PartManager_GeomEntity.nId, GeomEntityColors.c3AuxSolids)
' elimino colore entita'
EgtResetColor(PartManager_GeomEntity.nId)
If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then
EgtSetInfo(PartManager_GeomEntity.nId, ENTITY_NAME, PartManager_GeomEntity.sName)
End If
@@ -392,10 +397,11 @@ Public Class ManagePartPanelVM
Case ManagePart_Layer.LayerType.OTHERS
nOthersLayerId = EgtCreateGroup(nPartId)
EgtSetName(nOthersLayerId, LAY_OTHERS)
EgtSetColor(nOthersLayerId, GeomEntityColors.c3Others)
For Each PartManager_GeomEntity In ManagePart_Layer.EntityList
EgtRelocateGlob(PartManager_GeomEntity.nId, nOthersLayerId, GDB_POS.LAST_SON)
' coloro l'entita'
EgtSetColor(PartManager_GeomEntity.nId, GeomEntityColors.c3Others)
' elimino colore entita'
EgtResetColor(PartManager_GeomEntity.nId)
If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then
EgtSetInfo(PartManager_GeomEntity.nId, ENTITY_NAME, PartManager_GeomEntity.sName)
End If
@@ -408,16 +414,16 @@ Public Class ManagePartPanelVM
Case GDB_TY.CRV_ARC, GDB_TY.CRV_BEZ, GDB_TY.CRV_LINE
' la trasformo in curva compo
Dim nOtherId As Integer = EgtCreateCurveCompo(nOthersLayerId, PartManager_GeomEntity.nId, True)
' coloro l'entita'
EgtSetColor(nOtherId, GeomEntityColors.c3Others)
' elimino colore entita'
EgtResetColor(PartManager_GeomEntity.nId)
If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then
EgtSetInfo(nOtherId, ENTITY_NAME, PartManager_GeomEntity.sName)
End If
Case Else
' altrimenti la sposto solamente
EgtRelocateGlob(PartManager_GeomEntity.nId, nOthersLayerId, GDB_POS.LAST_SON)
' coloro l'entita'
EgtSetColor(PartManager_GeomEntity.nId, GeomEntityColors.c3Others)
' elimino colore entita'
EgtResetColor(PartManager_GeomEntity.nId)
If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then
EgtSetInfo(PartManager_GeomEntity.nId, ENTITY_NAME, PartManager_GeomEntity.sName)
End If
@@ -464,11 +470,11 @@ Public Class ManagePartPanelVM
' elimino vecchio pezzo d'importazione
EgtErase(m_nImportedPartId)
EgtDraw()
Case ManagePartType.MODIFY
' nulla da fare
End Select
EgtDeselectAll()
EgtDraw()
' ripristino modalita' standard
Map.refTopPanelVM.SelPage = Pages.MODIFY
End Sub
@@ -489,6 +495,7 @@ Public Class ManagePartPanelVM
Public Sub Cancel()
' elimino pezzo importato
EgtErase(m_nImportedPartId)
EgtDeselectAll()
EgtDraw()
' se ci sono pezzi
If Map.refTopPanelVM.PartList.Count > 0 Then
+21 -9
View File
@@ -625,8 +625,14 @@ Public Class GeomEntity_MenuItem
Case ManagePartPanelVM.ManagePartType.IMPORT
Dim NewPart As ManagePart_Part = New ManagePart_Part(Nothing)
Map.refManagePartPanelVM.ManagerPartList.Add(NewPart)
' elimino entity dalla lista entita' importate
Map.refManagePartPanelVM.ImportedEntityList.Remove(m_OrigEntity)
' se l'entita' e' gia' in lista pezzi
If Not IsNothing(m_OrigEntity.OrigLayer) Then
' elimino dalla lista pezzi
m_OrigEntity.OrigLayer.EntityList.Remove(m_OrigEntity)
Else
' altrimenti lo elimino dalla lista entita' importate
Map.refManagePartPanelVM.ImportedEntityList.Remove(m_OrigEntity)
End If
If Not IsNothing(NewPart) Then
Dim NewLayer As ManagePart_Layer = NewPart.LayerList.FirstOrDefault(Function(x) x.Type = ManagePart_Layer.LayerType.PRINT_SOLID)
If Not IsNothing(NewLayer) Then
@@ -700,13 +706,6 @@ Public Class GeomEntity_MenuItem
Dim ManagePart_Part As ManagePart_Part = New ManagePart_Part(NewPart)
' elimino da posizione originale
m_OrigEntity.OrigLayer.EntityList.Remove(m_OrigEntity)
'Dim bUpdateAllContextMenu As Boolean = False
'Dim NewLayer As ManagePart_Layer = ManagePart_Part.LayerList.FirstOrDefault(Function(x) x.Type = ManagePart_Layer.LayerType.PRINT_SOLID)
'If Not IsNothing(NewLayer) Then
' NewLayer.EntityList.Add(m_OrigEntity)
' ' aggiorno riferimenti nell'entita'
' m_OrigEntity.UpdateOrigLayer(NewLayer)
'End If
EgtSetInfo(nPartId, PART_NAME, ManagePart_Part.sName)
' lo aggiungo a lista
Map.refManagePartPanelVM.ManagerPartList.Add(ManagePart_Part)
@@ -715,6 +714,9 @@ Public Class GeomEntity_MenuItem
' Imposto flag di ricalcolo slice
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
End Select
'' aggiorno visibilita' da check di categoria
'Dim PrintLayer As ViewLayer = Map.refViewLayerManagerVM.LayerList.FirstOrDefault(Function(x) x.Type = ViewLayer.ViewLayerType.PRINT_SOLID)
'EgtSetStatus(m_OrigEntity.nId, If(IsNothing(PrintLayer.bIsVisible) OrElse PrintLayer.bIsVisible, GDB_ST.ON_, GDB_ST.OFF))
Return
End If
Select Case Map.refManagePartPanelVM.Type
@@ -761,6 +763,14 @@ Public Class GeomEntity_MenuItem
Select Case m_OrigEntity.OrigLayer.Type
Case ManagePart_Layer.LayerType.PRINT_SOLID
EgtResetMark(m_OrigEntity.nId)
' se e' presente flag di spostamento a 45 gradi
Dim nPartId As Integer = EgtGetParent(EgtGetParent(m_OrigEntity.nId))
Dim vtMoved As Vector3d
If EgtGetInfo(nPartId, "MovedPart", vtMoved) Then
' lo sposto e rimuovo info
EgtMove(m_OrigEntity.nId, -vtMoved, GDB_RT.GLOB)
EgtRemoveInfo(nPartId, "MovedPart")
End If
Case ManagePart_Layer.LayerType.MACH_START
Case ManagePart_Layer.LayerType.RIBS
EgtRemoveInfo(m_OrigEntity.nId, KEY_RIB_TYPE)
@@ -788,6 +798,8 @@ Public Class GeomEntity_MenuItem
Case ManagePart_Layer.LayerType.PRINT_SOLID
EgtSetName(m_OrigEntity.nId, PRINT_SOLID)
EgtSetColor(m_OrigEntity.nId, c3Print)
' rimuovo eventuale nota spostamento per 45 gradi
EgtRemoveInfo(m_OrigEntity.OrigLayer.OrigPart.nId, "MovedPart")
Case ManagePart_Layer.LayerType.MACH_START
EgtSetName(m_OrigEntity.nId, LAY_MACH_START)
EgtSetColor(m_OrigEntity.nId, c3MachStart)
+2 -2
View File
@@ -346,7 +346,7 @@ Public Class MenuItemVm
m_Part = Part
End Sub
#Region "Cancel"
#Region "Command"
Public ReadOnly Property MenuItem_Command As ICommand
Get
@@ -430,6 +430,6 @@ Public Class MenuItemVm
End If
End Sub
#End Region ' Cancel
#End Region ' Command
End Class
+12 -2
View File
@@ -11,6 +11,7 @@ Imports System.Windows
' Review the values of the assembly attributes
#If PLATFORM = "x64" Then
#If DEBUG Then
<Assembly: AssemblyTitle("IcarusD64.exe")>
<Assembly: AssemblyDescription("Icarus Debug 64 bit")>
@@ -18,6 +19,15 @@ Imports System.Windows
<Assembly: AssemblyTitle("IcarusR64.exe")>
<Assembly: AssemblyDescription("Icarus 64 bit")>
#End If
#Else
#If DEBUG Then
<Assembly: AssemblyTitle("IcarusD32.exe")>
<Assembly: AssemblyDescription("Icarus Debug 32 bit")>
#Else
<Assembly: AssemblyTitle("IcarusR32.exe")>
<Assembly: AssemblyDescription("Icarus 32 bit")>
#End If
#End If
<Assembly: AssemblyCompany("Egalware s.r.l.")>
<Assembly: AssemblyProduct("Icarus")>
<Assembly: AssemblyCopyright("Copyright © 2022 by Egalware s.r.l.")>
@@ -60,5 +70,5 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.4.11.4")>
<Assembly: AssemblyFileVersion("2.4.11.4")>
<Assembly: AssemblyVersion("2.4.12.3")>
<Assembly: AssemblyFileVersion("2.4.12.3")>
+32 -7
View File
@@ -80,13 +80,6 @@
</TabItem>
<TabItem Header="{Binding CADMsg}">
<StackPanel Margin="5,5,5,0">
<!--<UniformGrid Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding DefMaterialColorMsg}" VerticalAlignment="Center"/>
<Button Background="{Binding DefMaterialColor}"
Command="{Binding DefMaterialColor_Command}"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
</UniformGrid>-->
<UniformGrid Grid.ColumnSpan="2" Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding GeometryToleranceMsg}" VerticalAlignment="Center"/>
@@ -94,6 +87,38 @@
VerticalContentAlignment="Center"
Margin="10,0,0,0"/>
</UniformGrid>
<ItemsControl ItemsSource="{Binding LayerColorList}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<UniformGrid Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding Color_Msg}" VerticalAlignment="Center"/>
<Grid Margin="10,0,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="35"/>
</Grid.ColumnDefinitions>
<Button Background="{Binding Background}"
Command="{Binding Color_Command}"
Margin="0,0,5,0"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
<Slider Grid.Column="1"
Value="{Binding dAlpha}"
Minimum="10"
Maximum="100"
TickPlacement="BottomRight"
TickFrequency="10"
IsSnapToTickEnabled="True"
Margin="0,0,5,0"/>
<TextBlock Grid.Column="2"
Text="{Binding sAlpha}"
TextAlignment="Right"/>
</Grid>
</UniformGrid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<!--<GroupBox Grid.Column="1" Grid.RowSpan="2"
Header="{Binding DimensionMsg}"
Margin="0,0,0,5">
+155 -52
View File
@@ -179,12 +179,16 @@ Public Class OptionWindowVM
End Get
End Property
Public ReadOnly Property DefMaterialColor As Brush
' lista oggetti che gestiscono colori e trasparenze delle catogorie
Private m_LayerColorList As New ObservableCollection(Of LayerColor)({New LayerColor(LayerColor.LayerType.PRINTPART),
New LayerColor(LayerColor.LayerType.RIBS),
New LayerColor(LayerColor.LayerType.SHELLNUMBERS),
New LayerColor(LayerColor.LayerType.AUXSOLIDS),
New LayerColor(LayerColor.LayerType.MACHSTART),
New LayerColor(LayerColor.LayerType.OTHERS)})
Public ReadOnly Property LayerColorList As ObservableCollection(Of LayerColor)
Get
Return New SolidColorBrush(Color.FromArgb(CByte(255),
CByte(OptionModule.m_DefMaterialColor.R),
CByte(OptionModule.m_DefMaterialColor.G),
CByte(OptionModule.m_DefMaterialColor.B)))
Return m_LayerColorList
End Get
End Property
@@ -195,7 +199,7 @@ Public Class OptionWindowVM
Set(value As Boolean)
OptionModule.m_bThickLine = value
WriteMainPrivateProfileString(S_SCENE, K_LINEWIDTH, If(value, "2", "1"))
EgtSetLineAttribs( If( value, 2, 1))
EgtSetLineAttribs(If(value, 2, 1))
End Set
End Property
@@ -510,11 +514,11 @@ Public Class OptionWindowVM
'End Property
' Definizione comandi
Private m_cmdTopSceneBackground As ICommand
Private m_cmdBotSceneBackground As ICommand
Private m_cmdGridColor As ICommand
Private m_cmdUpdateLicenceCmd As ICommand
Private m_cmdDefMaterialColor As ICommand
Private m_cmdAddMachineCmd As ICommand
Private m_cmdExportMachineCmd As ICommand
@@ -583,11 +587,6 @@ Public Class OptionWindowVM
Return EgtMsg(6513)
End Get
End Property
Public ReadOnly Property DefMaterialColorMsg As String
Get
Return EgtMsg(6512)
End Get
End Property
Public ReadOnly Property ImportMsg As String
Get
@@ -747,9 +746,35 @@ Public Class OptionWindowVM
#End Region
Public Function WritePrivateProfileColor(IpAppName As String, IpKeyName As String, ByRef Color As Color3d) As Boolean
Dim sColor As String = Color.R & "," & Color.G & "," & Color.B
Return EgtUILib.WritePrivateProfileString(IpAppName, IpKeyName, sColor, m_sIniFile)
Private Function SelectColor(Col As Color3d, ByRef NewCol As Color3d) As Boolean
' Recupero colori custom
Dim sCustomColors As String = ""
GetMainPrivateProfileString(S_COLORS, K_CUSTOMCOLORS, "", sCustomColors)
Dim CustomColors() As String = sCustomColors.Split(","c)
Dim nCustomColors As New List(Of Integer)
For Each Color In CustomColors
Dim nColor As Integer
If Integer.TryParse(Color, nColor) Then
nCustomColors.Add(nColor)
End If
Next
' Creo dialogo colori
Dim ColorDlg As New System.Windows.Forms.ColorDialog
ColorDlg.FullOpen = True
ColorDlg.CustomColors = nCustomColors.ToArray()
ColorDlg.Color = Col.ToColor()
' Visualizzo dialogo
If ColorDlg.ShowDialog() <> Windows.Forms.DialogResult.OK Then Return False
' Recupero colore scelto
NewCol.FromColor(ColorDlg.Color)
' Salvo eventuali modifiche ai colori custom
sCustomColors = ""
For Each Color In ColorDlg.CustomColors
sCustomColors &= Color.ToString() & ","
Next
sCustomColors = sCustomColors.Trim({" "c, ","c})
WriteMainPrivateProfileString(S_COLORS, K_CUSTOMCOLORS, sCustomColors)
Return True
End Function
#Region "COMMANDS"
@@ -854,41 +879,6 @@ Public Class OptionWindowVM
#End Region ' GridColor
#Region "DefMaterialColor"
'''' <summary>
'''' Returns a command that remove the current selected machining.
'''' </summary>
'Public ReadOnly Property DefMaterialColor_Command() As ICommand
' Get
' If m_cmdDefMaterialColor Is Nothing Then
' m_cmdDefMaterialColor = New Command(AddressOf DefMaterialColorCmd)
' End If
' Return m_cmdDefMaterialColor
' End Get
'End Property
'''' <summary>
'''' Manage the MachiningDb closing. This method is invoked by the CloseMachiningDbCommand.
'''' </summary>
'Public Sub DefMaterialColorCmd()
' ' Recupero colore da Ini
' Dim DefColor As New Color3d(192, 192, 192)
' GetMainPrivateProfileColor(S_GEOMDB, K_DEFAULTCOLOR, DefColor)
' ' Eseguo modifica con dialogo
' If SelectColor(DefColor, DefColor) Then
' OptionModule.m_DefMaterialColor = DefColor
' Map.refSceneHostVM.MainScene.SetDefaultMaterial(OptionModule.m_DefMaterialColor)
' WritePrivateProfileColor(S_GEOMDB, K_DEFAULTCOLOR, OptionModule.m_DefMaterialColor)
' EgtDraw()
' Map.refManageLayerExpanderVM.UpdateHeaderColor(OptionModule.m_DefMaterialColor)
' Map.refManageLayerExpanderVM.LoadObjTree()
' NotifyPropertyChanged("DefMaterialColor")
' End If
'End Sub
#End Region ' DefMaterialColor
#Region "UpdateLicence"
''' <summary>
@@ -1165,10 +1155,94 @@ Public Class OptionWindowVM
#End Region ' COMMANDS
End Class
Public Class LayerColor
Inherits VMBase
Public Enum LayerType As Integer
PRINTPART = 1
RIBS = 2
SHELLNUMBERS = 3
AUXSOLIDS = 4
MACHSTART = 5
OTHERS = 6
End Enum
Private m_Type As LayerType
Public ReadOnly Property c3Color As Color3d
Get
Select Case m_Type
Case LayerType.PRINTPART
Return GeomEntityColors.c3Print
Case LayerType.RIBS
Return GeomEntityColors.c3Rib
Case LayerType.SHELLNUMBERS
Return GeomEntityColors.c3ShellNumber
Case LayerType.AUXSOLIDS
Return GeomEntityColors.c3AuxSolids
Case LayerType.MACHSTART
Return GeomEntityColors.c3MachStart
Case LayerType.OTHERS
Return GeomEntityColors.c3Others
End Select
End Get
End Property
Public ReadOnly Property Background As Brush
Get
Return New SolidColorBrush(Color.FromArgb(CByte(255),
CByte(c3Color.R),
CByte(c3Color.G),
CByte(c3Color.B)))
End Get
End Property
Public Property dAlpha As Double
Get
Return c3Color.A
End Get
Set(value As Double)
GeomEntityColors.SetAlpha(m_Type, value)
NotifyPropertyChanged(NameOf(sAlpha))
End Set
End Property
Public ReadOnly Property sAlpha As String
Get
Return c3Color.A & "%"
End Get
End Property
Public ReadOnly Property Color_Msg As String
Get
Select Case m_Type
Case LayerType.PRINTPART
Return "Print"
Case LayerType.RIBS
Return "Ribs"
Case LayerType.SHELLNUMBERS
Return "Reduce Shell Number"
Case LayerType.AUXSOLIDS
Return "Filled Solids"
Case LayerType.MACHSTART
Return "Layer Start"
Case LayerType.OTHERS
Return "Others"
End Select
End Get
End Property
Private m_cmdColor As ICommand
Sub New(Type As LayerType)
m_Type = Type
End Sub
Private Function SelectColor(Col As Color3d, ByRef NewCol As Color3d) As Boolean
' Recupero colori custom
Dim sCustomColors As String = ""
GetMainPrivateProfileString(S_SCENE, K_CUSTOMCOLORS, "", sCustomColors)
GetMainPrivateProfileString(S_COLORS, K_CUSTOMCOLORS, "", sCustomColors)
Dim CustomColors() As String = sCustomColors.Split(","c)
Dim nCustomColors As New List(Of Integer)
For Each Color In CustomColors
@@ -1192,10 +1266,39 @@ Public Class OptionWindowVM
sCustomColors &= Color.ToString() & ","
Next
sCustomColors = sCustomColors.Trim({" "c, ","c})
WriteMainPrivateProfileString(S_SCENE, K_CUSTOMCOLORS, sCustomColors)
WriteMainPrivateProfileString(S_COLORS, K_CUSTOMCOLORS, sCustomColors)
Return True
End Function
#Region "Color"
''' <summary>
''' Returns a command that remove the current selected machining.
''' </summary>
Public ReadOnly Property Color_Command() As ICommand
Get
If m_cmdColor Is Nothing Then
m_cmdColor = New Command(AddressOf ColorCmd)
End If
Return m_cmdColor
End Get
End Property
''' <summary>
''' Manage the MachiningDb closing. This method is invoked by the CloseMachiningDbCommand.
''' </summary>
Public Sub ColorCmd()
' Recupero colore da Ini
Dim c3Print As Color3d = c3Color
' Eseguo modifica con dialogo
If SelectColor(c3Color, c3Print) Then
GeomEntityColors.SetColor(m_Type, c3Print)
NotifyPropertyChanged(NameOf(Background))
End If
End Sub
#End Region ' PrintPartColor
End Class
'Public Class GeomTypeConverter
+1 -1
View File
@@ -104,7 +104,7 @@ Public Class ReferencePanelVM
ptOrig += b3PrintSolid.DimY() / 2 * Vector3d.Y_AX + b3PrintSolid.DimX() / 2 * Vector3d.X_AX
End Select
Dim vtMovedPart As Vector3d
EgtGetInfo(Map.refTopPanelVM.SelPart.nPrintSolidId, "MovedPart", vtMovedPart)
EgtGetInfo(Map.refTopPanelVM.SelPart.nPartId, "MovedPart", vtMovedPart)
ptOrig = ptOrig - vtMovedPart
frPrintSolid = New Frame3d(ptOrig)
End If
Binary file not shown.

After

Width:  |  Height:  |  Size: 603 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 671 B

+4 -3
View File
@@ -206,6 +206,7 @@
Grid.Row="6"
Content="Grid"
IsChecked="{Binding bGrid_IsChecked}"
IsEnabled="{Binding bGrid_IsEnabled}"
Style="{StaticResource ToolBar_TextToggleButton}"/>
<Border Grid.Column="1"
Grid.Row="5"
@@ -515,15 +516,15 @@
<UniformGrid Columns="3">
<RadioButton Content="X"
GroupName="Axes"
IsChecked="{Binding RotAxes[0]}"
IsChecked="{Binding RotX}"
Style="{StaticResource ToolBar_ToggleButton}"/>
<RadioButton Content="Y"
GroupName="Axes"
IsChecked="{Binding RotAxes[1]}"
IsChecked="{Binding RotY}"
Style="{StaticResource ToolBar_ToggleButton}"/>
<RadioButton Content="Z"
GroupName="Axes"
IsChecked="{Binding RotAxes[2]}"
IsChecked="{Binding RotZ}"
Style="{StaticResource ToolBar_ToggleButton}"/>
</UniformGrid>
<EgtWPFLib5:EgtTextBox Grid.Row="1"
+49 -18
View File
@@ -41,7 +41,7 @@ Public Class RibPanelVM
End Get
Set(value As RibEntity)
m_SelRib = value
EgtDeselectLayerObjs(m_nRibLayerId)
EgtDeselectAll()
If Not IsNothing(value) Then
EgtSelectObj(value.nCurveId)
EgtSelectObj(value.nExtrusionId)
@@ -74,8 +74,8 @@ Public Class RibPanelVM
Dim dNewXPos As Double = b3Reference.Min.x
StringToLen(value, dNewXPos)
If dNewXPos >= 0 AndAlso dNewXPos <= CurrentMachine.b3Tab.DimX Then
EgtMove(m_SelRib.nCurveId, New Point3d(dNewXPos, b3Reference.Min.y, b3Reference.Min.z) - b3Reference.Min)
EgtMove(m_SelRib.nExtrusionId, New Point3d(dNewXPos, b3Reference.Min.y, b3Reference.Min.z) - b3Reference.Min)
EgtMove(m_SelRib.nCurveId, New Point3d(dNewXPos, b3Reference.Min.y, b3Reference.Min.z) - b3Reference.Min, GDB_RT.GLOB)
EgtMove(m_SelRib.nExtrusionId, New Point3d(dNewXPos, b3Reference.Min.y, b3Reference.Min.z) - b3Reference.Min, GDB_RT.GLOB)
EgtDraw()
Else
NotifyPropertyChanged(NameOf(sXPos))
@@ -103,8 +103,8 @@ Public Class RibPanelVM
Dim dNewYPos As Double = b3Reference.Min.y
StringToLen(value, dNewYPos)
If dNewYPos >= 0 AndAlso dNewYPos <= CurrentMachine.b3Tab.DimY Then
EgtMove(m_SelRib.nCurveId, New Point3d(b3Reference.Min.x, dNewYPos, b3Reference.Min.z) - b3Reference.Min)
EgtMove(m_SelRib.nExtrusionId, New Point3d(b3Reference.Min.x, dNewYPos, b3Reference.Min.z) - b3Reference.Min)
EgtMove(m_SelRib.nCurveId, New Point3d(b3Reference.Min.x, dNewYPos, b3Reference.Min.z) - b3Reference.Min, GDB_RT.GLOB)
EgtMove(m_SelRib.nExtrusionId, New Point3d(b3Reference.Min.x, dNewYPos, b3Reference.Min.z) - b3Reference.Min, GDB_RT.GLOB)
EgtDraw()
Else
NotifyPropertyChanged(NameOf(sYPos))
@@ -132,8 +132,8 @@ Public Class RibPanelVM
Dim dNewZPos As Double = b3Reference.Min.y
StringToLen(value, dNewZPos)
If dNewZPos >= 0 Then
EgtMove(m_SelRib.nCurveId, New Point3d(b3Reference.Min.x, b3Reference.Min.y, dNewZPos) - b3Reference.Min)
EgtMove(m_SelRib.nExtrusionId, New Point3d(b3Reference.Min.x, b3Reference.Min.y, dNewZPos) - b3Reference.Min)
EgtMove(m_SelRib.nCurveId, New Point3d(b3Reference.Min.x, b3Reference.Min.y, dNewZPos) - b3Reference.Min, GDB_RT.GLOB)
EgtMove(m_SelRib.nExtrusionId, New Point3d(b3Reference.Min.x, b3Reference.Min.y, dNewZPos) - b3Reference.Min, GDB_RT.GLOB)
EgtDraw()
Else
NotifyPropertyChanged(NameOf(sZPos))
@@ -144,12 +144,28 @@ Public Class RibPanelVM
End Property
Private m_RotAxes() As Boolean = {False, False, True}
Public Property RotAxes As Boolean()
Public Property RotX As Boolean
Get
Return m_RotAxes
Return m_RotAxes(0)
End Get
Set(value As Boolean())
m_RotAxes = value
Set(value As Boolean)
m_RotAxes(0) = value
End Set
End Property
Public Property RotY As Boolean
Get
Return m_RotAxes(1)
End Get
Set(value As Boolean)
m_RotAxes(1) = value
End Set
End Property
Public Property RotZ As Boolean
Get
Return m_RotAxes(2)
End Get
Set(value As Boolean)
m_RotAxes(2) = value
End Set
End Property
@@ -159,7 +175,7 @@ Public Class RibPanelVM
Return Vector3d.X_AX
ElseIf m_RotAxes(1) Then
Return Vector3d.Y_AX
ElseIf m_RotAxes(2) Then
Else
Return Vector3d.Z_AX
End If
End Get
@@ -179,20 +195,20 @@ Public Class RibPanelVM
End If
Dim nId As Integer = If(m_SelRib.Type = RibEntity.RibTypes.FROMDRAW, m_SelRib.nCurveId, m_SelRib.nExtrusionId)
Dim b3Rib As New BBox3d
EgtGetBBox(nId, GDB_BB.STANDARD, b3Rib)
EgtGetBBoxGlob(nId, GDB_BB.STANDARD, b3Rib)
Dim bOk As Boolean = False
bOk = EgtRotate(nId, b3Rib.Center(), vtSelRotAxes, dNewAngle)
If bOk AndAlso m_SelRib.Type = RibEntity.RibTypes.FROMDRAW Then EgtRotate(m_SelRib.nExtrusionId, b3Rib.Center, vtSelRotAxes, dNewAngle)
bOk = EgtRotate(nId, b3Rib.Center(), vtSelRotAxes, dNewAngle, GDB_RT.GLOB)
If bOk AndAlso m_SelRib.Type = RibEntity.RibTypes.FROMDRAW Then EgtRotate(m_SelRib.nExtrusionId, b3Rib.Center, vtSelRotAxes, dNewAngle, GDB_RT.GLOB)
If bOk Then
EgtDraw()
RefreshPos()
m_sRotAngle = 0
NotifyPropertyChanged(NameOf(sRotAngle))
' Imposto flag di ricalcolo slice
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
Else
m_sRotAngle = value
End If
' Imposto flag di ricalcolo slice
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
End Set
End Property
@@ -264,6 +280,12 @@ Public Class RibPanelVM
End Set
End Property
Public ReadOnly Property bGrid_IsEnabled As Boolean
Get
Return Map.refMyStatusBarVM.bGridVisibility
End Get
End Property
Private m_bMove_IsChecked As Boolean
Public Property bMove_IsChecked As Boolean
Get
@@ -411,6 +433,9 @@ Public Class RibPanelVM
#Region "METHODS"
Friend Sub Init()
' asse rotazione di default
RotZ = True
NotifyPropertyChanged(NameOf(RotZ))
' azzero indice
StartEntity.ResetSharedIndex()
' fisso frame originale
@@ -418,6 +443,10 @@ Public Class RibPanelVM
' recupero dati pezzo selezionato layer ed entita'
m_nPartId = Map.refTopPanelVM.SelPart.nPartId
m_nRibLayerId = Map.refTopPanelVM.SelPart.nRibsLayerId
If m_nRibLayerId = GDB_ID.NULL Then
m_nRibLayerId = EgtCreateGroup(m_nPartId)
EgtSetName(m_nRibLayerId, LAY_RIBS)
End If
'recupero tutte le entita' rib
m_RibList.Clear()
Dim nRibId As Integer = EgtGetFirstInGroup(m_nRibLayerId)
@@ -525,7 +554,8 @@ Public Class RibPanelVM
EgtDraw()
' rimetto la selezione scena a null
Map.refSceneHostVM.MainScene.SetStatusNull()
Case Controller.CMD.GRID_ELEVATION, Controller.CMD.GRID_3P, Controller.CMD.GRID_ORIGIN, Controller.CMD.GRID_PERPCURVE, Controller.CMD.GRID_ROTATE, Controller.CMD.GRID_ROTATE3D
Case Controller.CMD.GRID_ELEVATION, Controller.CMD.GRID_3P, Controller.CMD.GRID_ORIGIN, Controller.CMD.GRID_PERPCURVE,
Controller.CMD.GRID_ROTATE, Controller.CMD.GRID_ROTATE3D, Controller.CMD.GRID_OBJ
' rimetto la selezione scena a null
Map.refSceneHostVM.MainScene.SetStatusNull()
End Select
@@ -1162,6 +1192,7 @@ Public Class RibPanelVM
Public Sub CPlaneObj(ByVal param As Object)
If Map.refSceneHostVM.MainController.GetStep <> 0 Then Return
' salvo selezione precedente e deseleziono altri oggetti
m_PrevSelObjs.Clear()
Dim nSelObjId As Integer = EgtGetFirstSelectedObj()
While nSelObjId <> GDB_ID.NULL
m_PrevSelObjs.Add(nSelObjId)
+10 -9
View File
@@ -44,6 +44,7 @@ Public Class RibParamPanelVM
m_MachiningParamList = New List(Of MachiningParam)({New RibComboMachiningParam(MachiningParam.Params.RIBSTYPE, nRibId, nPartId),
New RibNumericMachiningParam(MachiningParam.Params.RIBSOVERLAP, nRibId, nPartId),
New RibNumericMachiningParam(MachiningParam.Params.RIBSSTRANDCOUNT, nRibId, nPartId),
New RibCheckMachiningParam(MachiningParam.Params.RIBSLINK, nRibId, nPartId),
New RibCheckMachiningParam(MachiningParam.Params.RIBSINVERTDIRECTION, nRibId, nPartId),
New RibCheckMachiningParam(MachiningParam.Params.RIBSLEADININVERT, nRibId, nPartId),
New RibNumericMachiningParam(MachiningParam.Params.RIBSLEADINLEN, nRibId, nPartId),
@@ -477,9 +478,9 @@ Public Class RibCheckMachiningParam
MyBase.New(Type)
Dim bReadFromPart As Boolean = False
Select Case Type
'Case Params.RIBSLINK
' bReadFromPart = EgtGetInfo(nRibId, MAC_RIBSLINK, m_bValue)
' EgtGetInfo(nPartId, MAC_RIBSOVERLAP, m_bPartValue)
Case Params.RIBSLINK
bReadFromPart = EgtGetInfo(nRibId, MAC_RIBSLINK, m_bValue)
EgtGetInfo(nPartId, MAC_RIBSLINK, m_bPartValue)
Case Params.RIBSINVERTDIRECTION
bReadFromPart = EgtGetInfo(nRibId, MAC_RIBSINVERTDIRECTION, m_bValue)
EgtGetInfo(nPartId, MAC_RIBSINVERTDIRECTION, m_bPartValue)
@@ -499,12 +500,12 @@ Public Class RibCheckMachiningParam
Friend Sub WriteParamInRib(nRibId As Integer)
Select Case Type
'Case Params.RIBSLINK
' If bIsModifiedFromPart Then
' EgtSetInfo(nRibId, MAC_RIBSLINK, If(m_bValue, 1, 0))
' Else
' EgtRemoveInfo(nRibId, MAC_RIBSLINK)
' End If
Case Params.RIBSLINK
If bIsModifiedFromPart Then
EgtSetInfo(nRibId, MAC_RIBSLINK, If(m_bValue, 1, 0))
Else
EgtRemoveInfo(nRibId, MAC_RIBSLINK)
End If
Case Params.RIBSINVERTDIRECTION
If bIsModifiedFromPart Then
EgtSetInfo(nRibId, MAC_RIBSINVERTDIRECTION, If(m_bValue, 1, 0))
+35 -36
View File
@@ -11,6 +11,8 @@ Public Class MySceneHostVM
m_bIsFocused = bValue
End Sub
' Flag per distinguere tra Save a SaveAs
Private m_bIsSaveAs As Boolean = False
' Identificativi per pezzo da selezionare/deselezionare
Private m_nIdToSel As Integer = GDB_ID.NULL
Private m_nIdToDesel As Integer = GDB_ID.NULL
@@ -293,7 +295,9 @@ Public Class MySceneHostVM
End Sub
Public Overrides Sub SaveAsProject()
m_bIsSaveAs = True
MyBase.SaveAsProject()
m_bIsSaveAs = False
' Imposto stato gestione mouse diretto della scena a nessuno
MainScene.SetStatusNull()
End Sub
@@ -897,7 +901,7 @@ Public Class MySceneHostVM
End If
If IsNothing(ProjectMaterial) Then
Dim sMaterialName As String = ""
EgtGetInfo(nTabPartId, KEY_MATERIAL_NAME, Map.refTopPanelVM.SelMaterial.sName)
EgtGetInfo(nTabPartId, KEY_MATERIAL_NAME, sMaterialName)
ProjectMaterial = Map.refTopPanelVM.MaterialList.FirstOrDefault(Function(x) x.sName = sMaterialName)
End If
If Not IsNothing(ProjectMaterial) Then
@@ -936,10 +940,12 @@ Public Class MySceneHostVM
' setto i solidi non calcolati
EgtSetInfo(nPartId, KEY_CALC_SOLIDS, 0)
EgtSetInfo(nPartId, KEY_HAS_SOLIDS, 0)
nPartId = EgtGetNextPart(nPartId)
' Ripristino stato segnalazione modifica
DisableMgr.ReEnable()
nPartId = EgtGetNextPart(nPartId)
End While
' aggiorno colori entita'
GeomEntityColors.UpdateColors(LayerType.ALL)
' se non e' da ricalcolare, recupero tempo e massa
If Not bProjectToRecalc Then
@@ -963,6 +969,13 @@ Public Class MySceneHostVM
End Sub
Private Sub OnSavingProject(ByVal sender As Object, sFile As String)
' Se in SaveAs, aggiorno nome CN da generare
If m_bIsSaveAs Then
Dim nTabPartId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, TABLE)
If nTabPartId <> GDB_ID.NULL Then
EgtRemoveInfo(nTabPartId, KEY_ISOFILE_PATH)
End If
End If
End Sub
Private Sub OnSavedProject(ByVal sender As Object, ByVal sFile As String, ByVal bOk As Boolean)
@@ -1191,20 +1204,6 @@ Public Class MySceneHostVM
End While
' Memorizzo Id da selezionare
m_nIdToSel = nCurrIdToSel
'While nId <> GDB_ID.NULL
' ' Recupero l'identificativo del pezzo cui appartiene
' Dim nPartId As Integer = EgtGetParent(EgtGetParent(nId))
' Dim bFound As Boolean = False
' If nPartId = Map.refImportPanelVM.nImportedPartId Then bFound = True
' If Not bFound Then
' nId = EgtGetNextObjInSelWin()
' Continue While
' End If
' ' Memorizzo Id da selezionare
' m_nIdToSel = nId
' Exit While
' nId = EgtGetNextObjInSelWin()
'End While
' Dati per drag
m_bDragToStart = True
End Sub
@@ -1254,17 +1253,15 @@ Public Class MySceneHostVM
End If
Else
' Recupero l'identificativo del pezzo cui appartiene
Dim nPartId As Integer = EgtGetParent(nId)
Dim bFound As Boolean = False
If nPartId = Map.refStartMachPanelVM.nStartMachLayerId Then bFound = True
If bFound Then
Dim nStartMachLayerId As Integer = EgtGetParent(nId)
If nStartMachLayerId = Map.refStartMachPanelVM.nStartMachLayerId Then
m_nIdToSel = nId
Exit While
End If
End If
nId = EgtGetNextObjInSelWin()
End While
If m_nIdToSel <> GDB_ID.NULL Then
If Map.refStartMachPanelVM.bCPlaneObj_IsActive And m_nIdToSel <> GDB_ID.NULL Then
' recupero dati punto di selezione
Dim PtTemp As Point3d
Dim nAux As Integer
@@ -1337,18 +1334,15 @@ Public Class MySceneHostVM
Exit While
End If
Else
' Recupero l'identificativo del pezzo cui appartiene
Dim nPartId As Integer = EgtGetParent(nId)
Dim bFound As Boolean = False
If nPartId = Map.refRibPanelVM.nRibLayerId Then bFound = True
If bFound Then
Dim nRibLayerId As Integer = EgtGetParent(nId)
If nRibLayerId = Map.refRibPanelVM.nRibLayerId Then
m_nIdToSel = nId
Exit While
End If
End If
nId = EgtGetNextObjInSelWin()
End While
If m_nIdToSel <> GDB_ID.NULL Then
If Map.refRibPanelVM.bCPlaneObj_IsActive And m_nIdToSel <> GDB_ID.NULL Then
' recupero dati punto di selezione
Dim PtTemp As Point3d
Dim nAux As Integer
@@ -1415,17 +1409,22 @@ Public Class MySceneHostVM
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSel)
Dim nId As Integer = EgtGetFirstObjInSelWin()
While nId <> GDB_ID.NULL
' Recupero l'identificativo del pezzo cui appartiene
Dim nPartId As Integer = EgtGetParent(nId)
Dim bFound As Boolean = False
If nPartId = Map.refShellNumberPanelVM.nShellNumberLayerId Then bFound = True
If bFound Then
m_nIdToSel = nId
Exit While
' Se per Griglia da faccia di oggetto
If Map.refShellNumberPanelVM.bCPlaneObj_IsActive Then
If EgtGetType( nId) = GDB_TY.SRF_MESH Then
m_nIdToSel = nId
Exit While
End If
Else
Dim nShellNumberLayerId As Integer = EgtGetParent(nId)
If nShellNumberLayerId = Map.refShellNumberPanelVM.nShellNumberLayerId Then
m_nIdToSel = nId
Exit While
End If
End If
nId = EgtGetNextObjInSelWin()
End While
If m_nIdToSel <> GDB_ID.NULL Then
If Map.refShellNumberPanelVM.bCPlaneObj_IsActive And m_nIdToSel <> GDB_ID.NULL Then
' recupero dati punto di selezione
Dim PtTemp As Point3d
Dim nAux As Integer
@@ -1480,7 +1479,7 @@ Public Class MySceneHostVM
EgtDraw()
End Sub
#End Region ' Rib
#End Region ' ShellNumber
#End Region ' VIEW EVENTS
@@ -206,6 +206,7 @@
Grid.Row="6"
Content="Grid"
IsChecked="{Binding bGrid_IsChecked}"
IsEnabled="{Binding bGrid_IsEnabled}"
Style="{StaticResource ToolBar_TextToggleButton}"/>
<Border Grid.Column="1"
Grid.Row="5"
@@ -515,15 +516,15 @@
<UniformGrid Columns="3">
<RadioButton Content="X"
GroupName="Axes"
IsChecked="{Binding RotAxes[0]}"
IsChecked="{Binding RotX}"
Style="{StaticResource ToolBar_ToggleButton}"/>
<RadioButton Content="Y"
GroupName="Axes"
IsChecked="{Binding RotAxes[1]}"
IsChecked="{Binding RotY}"
Style="{StaticResource ToolBar_ToggleButton}"/>
<RadioButton Content="Z"
GroupName="Axes"
IsChecked="{Binding RotAxes[2]}"
IsChecked="{Binding RotZ}"
Style="{StaticResource ToolBar_ToggleButton}"/>
</UniformGrid>
<EgtWPFLib5:EgtTextBox Grid.Row="1"
+51 -20
View File
@@ -41,7 +41,7 @@ Public Class ShellNumberPanelVM
End Get
Set(value As ShellNumberEntity)
m_SelShellNumber = value
EgtDeselectLayerObjs(m_nShellNumberLayerId)
EgtDeselectAll()
If Not IsNothing(value) Then
EgtSelectObj(value.nCurveId)
EgtSelectObj(value.nExtrusionId)
@@ -74,8 +74,8 @@ Public Class ShellNumberPanelVM
Dim dNewXPos As Double = b3Reference.Min.x
StringToLen(value, dNewXPos)
If dNewXPos >= 0 AndAlso dNewXPos <= CurrentMachine.b3Tab.DimX Then
EgtMove(m_SelShellNumber.nCurveId, New Point3d(dNewXPos, b3Reference.Min.y, b3Reference.Min.z) - b3Reference.Min)
EgtMove(m_SelShellNumber.nExtrusionId, New Point3d(dNewXPos, b3Reference.Min.y, b3Reference.Min.z) - b3Reference.Min)
EgtMove(m_SelShellNumber.nCurveId, New Point3d(dNewXPos, b3Reference.Min.y, b3Reference.Min.z) - b3Reference.Min, GDB_RT.GLOB)
EgtMove(m_SelShellNumber.nExtrusionId, New Point3d(dNewXPos, b3Reference.Min.y, b3Reference.Min.z) - b3Reference.Min, GDB_RT.GLOB)
EgtDraw()
Else
NotifyPropertyChanged(NameOf(sXPos))
@@ -103,8 +103,8 @@ Public Class ShellNumberPanelVM
Dim dNewYPos As Double = b3Reference.Min.y
StringToLen(value, dNewYPos)
If dNewYPos >= 0 AndAlso dNewYPos <= CurrentMachine.b3Tab.DimY Then
EgtMove(m_SelShellNumber.nCurveId, New Point3d(b3Reference.Min.x, dNewYPos, b3Reference.Min.z) - b3Reference.Min)
EgtMove(m_SelShellNumber.nExtrusionId, New Point3d(b3Reference.Min.x, dNewYPos, b3Reference.Min.z) - b3Reference.Min)
EgtMove(m_SelShellNumber.nCurveId, New Point3d(b3Reference.Min.x, dNewYPos, b3Reference.Min.z) - b3Reference.Min, GDB_RT.GLOB)
EgtMove(m_SelShellNumber.nExtrusionId, New Point3d(b3Reference.Min.x, dNewYPos, b3Reference.Min.z) - b3Reference.Min, GDB_RT.GLOB)
EgtDraw()
Else
NotifyPropertyChanged(NameOf(sYPos))
@@ -132,8 +132,8 @@ Public Class ShellNumberPanelVM
Dim dNewZPos As Double = b3Reference.Min.y
StringToLen(value, dNewZPos)
If dNewZPos >= 0 Then
EgtMove(m_SelShellNumber.nCurveId, New Point3d(b3Reference.Min.x, b3Reference.Min.y, dNewZPos) - b3Reference.Min)
EgtMove(m_SelShellNumber.nExtrusionId, New Point3d(b3Reference.Min.x, b3Reference.Min.y, dNewZPos) - b3Reference.Min)
EgtMove(m_SelShellNumber.nCurveId, New Point3d(b3Reference.Min.x, b3Reference.Min.y, dNewZPos) - b3Reference.Min, GDB_RT.GLOB)
EgtMove(m_SelShellNumber.nExtrusionId, New Point3d(b3Reference.Min.x, b3Reference.Min.y, dNewZPos) - b3Reference.Min, GDB_RT.GLOB)
EgtDraw()
Else
NotifyPropertyChanged(NameOf(sZPos))
@@ -144,12 +144,28 @@ Public Class ShellNumberPanelVM
End Property
Private m_RotAxes() As Boolean = {False, False, True}
Public Property RotAxes As Boolean()
Public Property RotX As Boolean
Get
Return m_RotAxes
Return m_RotAxes(0)
End Get
Set(value As Boolean())
m_RotAxes = value
Set(value As Boolean)
m_RotAxes(0) = value
End Set
End Property
Public Property RotY As Boolean
Get
Return m_RotAxes(1)
End Get
Set(value As Boolean)
m_RotAxes(1) = value
End Set
End Property
Public Property RotZ As Boolean
Get
Return m_RotAxes(2)
End Get
Set(value As Boolean)
m_RotAxes(2) = value
End Set
End Property
@@ -159,7 +175,7 @@ Public Class ShellNumberPanelVM
Return Vector3d.X_AX
ElseIf m_RotAxes(1) Then
Return Vector3d.Y_AX
ElseIf m_RotAxes(2) Then
Else
Return Vector3d.Z_AX
End If
End Get
@@ -179,20 +195,20 @@ Public Class ShellNumberPanelVM
End If
Dim nId As Integer = If(m_SelShellNumber.Type = ShellNumberEntity.ShellNumberTypes.FROMDRAW, m_SelShellNumber.nCurveId, m_SelShellNumber.nExtrusionId)
Dim b3Rib As New BBox3d
EgtGetBBox(nId, GDB_BB.STANDARD, b3Rib)
EgtGetBBoxGlob(nId, GDB_BB.STANDARD, b3Rib)
Dim bOk As Boolean = False
bOk = EgtRotate(nId, b3Rib.Center(), vtSelRotAxes, dNewAngle)
If bOk AndAlso m_SelShellNumber.Type = ShellNumberEntity.ShellNumberTypes.FROMDRAW Then EgtRotate(m_SelShellNumber.nExtrusionId, b3Rib.Center, vtSelRotAxes, dNewAngle)
bOk = EgtRotate(nId, b3Rib.Center(), vtSelRotAxes, dNewAngle, GDB_RT.GLOB)
If bOk AndAlso m_SelShellNumber.Type = ShellNumberEntity.ShellNumberTypes.FROMDRAW Then EgtRotate(m_SelShellNumber.nExtrusionId, b3Rib.Center, vtSelRotAxes, dNewAngle, GDB_RT.GLOB)
If bOk Then
EgtDraw()
RefreshPos()
m_sRotAngle = 0
NotifyPropertyChanged(NameOf(sRotAngle))
' Imposto flag di ricalcolo slice
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
Else
m_sRotAngle = value
End If
' Imposto flag di ricalcolo slice
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
End Set
End Property
@@ -264,6 +280,12 @@ Public Class ShellNumberPanelVM
End Set
End Property
Public ReadOnly Property bGrid_IsEnabled As Boolean
Get
Return Map.refMyStatusBarVM.bGridVisibility
End Get
End Property
Private m_bMove_IsChecked As Boolean
Public Property bMove_IsChecked As Boolean
Get
@@ -411,6 +433,9 @@ Public Class ShellNumberPanelVM
#Region "METHODS"
Friend Sub Init()
' asse rotazione di default
RotZ = True
NotifyPropertyChanged(NameOf(RotZ))
' azzero indice
StartEntity.ResetSharedIndex()
' fisso frame originale
@@ -418,7 +443,11 @@ Public Class ShellNumberPanelVM
' recupero dati pezzo selezionato layer ed entita'
m_nPartId = Map.refTopPanelVM.SelPart.nPartId
m_nShellNumberLayerId = Map.refTopPanelVM.SelPart.nShellNumberLayerId
'recupero tutte le entita' rib
If m_nShellNumberLayerId = GDB_ID.NULL Then
m_nShellNumberLayerId = EgtCreateGroup(m_nPartId)
EgtSetName(m_nShellNumberLayerId, LAY_SHELL_NBR)
End If
'recupero tutte le entita' shell number
m_ShellNumberList.Clear()
Dim nShellNumberId As Integer = EgtGetFirstInGroup(m_nShellNumberLayerId)
While nShellNumberId <> GDB_ID.NULL
@@ -525,7 +554,8 @@ Public Class ShellNumberPanelVM
EgtDraw()
' rimetto la selezione scena a null
Map.refSceneHostVM.MainScene.SetStatusNull()
Case Controller.CMD.GRID_ELEVATION, Controller.CMD.GRID_3P, Controller.CMD.GRID_ORIGIN, Controller.CMD.GRID_PERPCURVE, Controller.CMD.GRID_ROTATE, Controller.CMD.GRID_ROTATE3D, Controller.CMD.GRID_OBJ
Case Controller.CMD.GRID_ELEVATION, Controller.CMD.GRID_3P, Controller.CMD.GRID_ORIGIN, Controller.CMD.GRID_PERPCURVE,
Controller.CMD.GRID_ROTATE, Controller.CMD.GRID_ROTATE3D, Controller.CMD.GRID_OBJ
' rimetto la selezione scena a null
Map.refSceneHostVM.MainScene.SetStatusNull()
End Select
@@ -1166,6 +1196,7 @@ Public Class ShellNumberPanelVM
Public Sub CPlaneObj(ByVal param As Object)
If Map.refSceneHostVM.MainController.GetStep <> 0 Then Return
' salvo selezione precedente e deseleziono altri oggetti
m_PrevSelObjs.Clear()
Dim nSelObjId As Integer = EgtGetFirstSelectedObj()
While nSelObjId <> GDB_ID.NULL
m_PrevSelObjs.Add(nSelObjId)
@@ -1308,7 +1339,7 @@ Public Class ShellNumberEntity
Sub New(Type As ShellNumberTypes, nId As Integer)
m_nIndex = nSharedIndex
m_Type = Type
EgtSetInfo(nId, KEY_RIB_TYPE, Type)
EgtSetInfo(nId, KEY_SHELLNBR_TYPE, Type)
Select Case Type
Case ShellNumberTypes.FROMDRAW
m_nCurveId = nId
+7 -1
View File
@@ -506,6 +506,11 @@ Public Class SliceManagerVM
m_bCalculating = False
Return
End If
If IsNothing(Map.refTopPanelVM.SelMaterial) Then
MessageBox.Show("No print material set!", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
m_bCalculating = False
Return
End If
If IsNothing(Map.refTopPanelVM.SelMachining) OrElse IsNothing(Map.refTopPanelVM.CurrMachining) OrElse Map.refTopPanelVM.CurrMachining.dCurrStrandH <= 0 Then
MessageBox.Show("No print parameters set!", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
m_bCalculating = False
@@ -611,9 +616,10 @@ Public Class SliceManagerVM
Dim nTabPartId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, TABLE)
If nTabPartId <> GDB_ID.NULL Then
EgtGetInfo(nTabPartId, KEY_ISOFILE_PATH, sIsoFilePath)
If String.IsNullOrWhiteSpace(sIsoFilePath) Then
If String.IsNullOrWhiteSpace(sIsoFilePath) OrElse Not Directory.Exists(Path.GetDirectoryName(sIsoFilePath)) Then
EgtGetCurrFilePath(sIsoFilePath)
sIsoFilePath = System.IO.Path.ChangeExtension(sIsoFilePath, sExtension)
EgtSetInfo(nTabPartId, KEY_ISOFILE_PATH, sIsoFilePath)
End If
End If
End If
+4 -4
View File
@@ -73,7 +73,7 @@ Public Class SliderManagerVM
Case ViewSliderType.ONLY_SELECTED
If Not IsNothing(Map.refTopPanelVM.SelPart) Then
' riporto vecchio strato a visualizzazione di tutti i solidi
If m_nLayerIndex > 0 Then dLayerAdvancement = 100
If m_nLayerIndex > 0 AndAlso m_nLayerIndex < Map.refTopPanelVM.SelPart.LayerList.Count Then dLayerAdvancement = 100
For nLayerInd = 0 To Map.refTopPanelVM.SelPart.LayerList.Count - 1
If nLayerInd = value - 1 Then
EgtSetStatus(Map.refTopPanelVM.SelPart.LayerList(nLayerInd).nLayerId, GDB_ST.ON_)
@@ -88,7 +88,7 @@ Public Class SliderManagerVM
Case ViewSliderType.UNTIL_SELECTED
If Not IsNothing(Map.refTopPanelVM.SelPart) Then
' riporto vecchio strato a visualizzazione di tutti i solidi
If m_nLayerIndex > 0 Then dLayerAdvancement = 100
If m_nLayerIndex > 0 AndAlso m_nLayerIndex < Map.refTopPanelVM.SelPart.LayerList.Count Then dLayerAdvancement = 100
For nLayerInd = 0 To Map.refTopPanelVM.SelPart.LayerList.Count - 1
If nLayerInd <= value - 1 Then
EgtSetStatus(Map.refTopPanelVM.SelPart.LayerList(nLayerInd).nLayerId, GDB_ST.ON_)
@@ -103,7 +103,7 @@ Public Class SliderManagerVM
Case ViewSliderType.FROM_SELECTED
If Not IsNothing(Map.refTopPanelVM.SelPart) Then
' riporto vecchio strato a visualizzazione di tutti i solidi
If m_nLayerIndex > 0 Then dLayerAdvancement = 100
If m_nLayerIndex > 0 AndAlso m_nLayerIndex < Map.refTopPanelVM.SelPart.LayerList.Count Then dLayerAdvancement = 100
For nLayerInd = 0 To Map.refTopPanelVM.SelPart.LayerList.Count - 1
If nLayerInd >= value - 1 Then
EgtSetStatus(Map.refTopPanelVM.SelPart.LayerList(nLayerInd).nLayerId, GDB_ST.ON_)
@@ -353,7 +353,7 @@ Public Class SliderManagerVM
NotifyPropertyChanged(NameOf(nLayerIndex_Minimum))
NotifyPropertyChanged(NameOf(nLayerIndex_Maximum))
NotifyPropertyChanged(NameOf(ghShowMaximum))
SetLayerIndex(m_nLayerIndex)
SetLayerIndex(If(m_nLayerIndex < nMax, m_nLayerIndex, nMax))
End Sub
Friend Sub SetLayerIndexToMax()
@@ -189,6 +189,7 @@
Grid.Row="6"
Content="Grid"
IsChecked="{Binding bGrid_IsChecked}"
IsEnabled="{Binding bGrid_IsEnabled}"
Style="{StaticResource ToolBar_TextToggleButton}"/>
<Border Grid.Column="1"
Grid.Row="5"
+35 -12
View File
@@ -36,7 +36,7 @@ Public Class StartMachPanelVM
End Get
Set(value As StartEntity)
m_SelStart = value
EgtDeselectLayerObjs(m_nStartMachLayerId)
EgtDeselectAll()
If Not IsNothing(value) Then
EgtSelectObj(value.nId)
' aggiorno visibilita' bottoni edit
@@ -66,7 +66,7 @@ Public Class StartMachPanelVM
Dim dNewXPos As Double = ptReference.x
StringToLen(value, dNewXPos)
If dNewXPos >= 0 AndAlso dNewXPos <= CurrentMachine.b3Tab.DimX Then
EgtMove(m_SelStart.nId, New Point3d(dNewXPos, ptReference.y, ptReference.z) - ptReference)
EgtMove(m_SelStart.nId, New Point3d(dNewXPos, ptReference.y, ptReference.z) - ptReference, GDB_RT.GLOB)
EgtDraw()
Else
NotifyPropertyChanged(NameOf(sXPos))
@@ -92,7 +92,7 @@ Public Class StartMachPanelVM
Dim dNewYPos As Double = ptReference.y
StringToLen(value, dNewYPos)
If dNewYPos >= 0 AndAlso dNewYPos <= CurrentMachine.b3Tab.DimY Then
EgtMove(m_SelStart.nId, New Point3d(ptReference.x, dNewYPos, ptReference.z) - ptReference)
EgtMove(m_SelStart.nId, New Point3d(ptReference.x, dNewYPos, ptReference.z) - ptReference, GDB_RT.GLOB)
EgtDraw()
Else
NotifyPropertyChanged(NameOf(sYPos))
@@ -118,7 +118,7 @@ Public Class StartMachPanelVM
Dim dNewZPos As Double = ptReference.z
StringToLen(value, dNewZPos)
If dNewZPos >= 0 Then
EgtMove(m_SelStart.nId, New Point3d(ptReference.x, ptReference.y, dNewZPos) - ptReference)
EgtMove(m_SelStart.nId, New Point3d(ptReference.x, ptReference.y, dNewZPos) - ptReference, GDB_RT.GLOB)
EgtDraw()
Else
NotifyPropertyChanged(NameOf(sZPos))
@@ -129,12 +129,28 @@ Public Class StartMachPanelVM
End Property
Private m_RotAxes() As Boolean = {False, False, True}
Public Property RotAxes As Boolean()
Public Property RotX As Boolean
Get
Return m_RotAxes
Return m_RotAxes(0)
End Get
Set(value As Boolean())
m_RotAxes = value
Set(value As Boolean)
m_RotAxes(0) = value
End Set
End Property
Public Property RotY As Boolean
Get
Return m_RotAxes(1)
End Get
Set(value As Boolean)
m_RotAxes(1) = value
End Set
End Property
Public Property RotZ As Boolean
Get
Return m_RotAxes(2)
End Get
Set(value As Boolean)
m_RotAxes(2) = value
End Set
End Property
@@ -144,7 +160,7 @@ Public Class StartMachPanelVM
Return Vector3d.X_AX
ElseIf m_RotAxes(1) Then
Return Vector3d.Y_AX
ElseIf m_RotAxes(2) Then
Else
Return Vector3d.Z_AX
End If
End Get
@@ -164,16 +180,16 @@ Public Class StartMachPanelVM
End If
Dim b3PrintSolid As New BBox3d
EgtGetBBoxGlob(Map.refTopPanelVM.SelPart.nPartId, GDB_BB.STANDARD, b3PrintSolid)
If EgtRotate(Map.refTopPanelVM.SelPart.nPartId, b3PrintSolid.Center, vtSelRotAxes, dNewAngle) Then
If EgtRotate(Map.refTopPanelVM.SelPart.nPartId, b3PrintSolid.Center, vtSelRotAxes, dNewAngle, GDB_RT.GLOB) Then
EgtDraw()
RefreshPos()
m_sRotAngle = 0
NotifyPropertyChanged(NameOf(sRotAngle))
' Imposto flag di ricalcolo slice
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
Else
m_sRotAngle = value
End If
' Imposto flag di ricalcolo slice
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
End Set
End Property
@@ -243,6 +259,12 @@ Public Class StartMachPanelVM
End Set
End Property
Public ReadOnly Property bGrid_IsEnabled As Boolean
Get
Return Map.refMyStatusBarVM.bGridVisibility
End Get
End Property
Private m_bMove_IsChecked As Boolean
Public Property bMove_IsChecked As Boolean
Get
@@ -836,6 +858,7 @@ Public Class StartMachPanelVM
Public Sub CPlaneObj(ByVal param As Object)
If Map.refSceneHostVM.MainController.GetStep <> 0 Then Return
' salvo selezione precedente e deseleziono altri oggetti
m_PrevSelObjs.Clear()
Dim nSelObjId As Integer = EgtGetFirstSelectedObj()
While nSelObjId <> GDB_ID.NULL
m_PrevSelObjs.Add(nSelObjId)
+4
View File
@@ -23,9 +23,13 @@ Public Class MyStatusBarVM
Return m_bGridVisibility
End Get
Set(value As Boolean)
If Map.refRibPanelVM.bGrid_IsChecked Or Map.refStartMachPanelVM.bGrid_IsChecked Or Map.refShellNumberPanelVM.bGrid_IsChecked Then Return
m_bGridVisibility = value
EgtSetGridShow(value, value)
EgtDraw()
Map.refRibPanelVM.NotifyPropertyChanged(NameOf(Map.refRibPanelVM.bGrid_IsEnabled))
Map.refStartMachPanelVM.NotifyPropertyChanged(NameOf(Map.refStartMachPanelVM.bGrid_IsEnabled))
Map.refShellNumberPanelVM.NotifyPropertyChanged(NameOf(Map.refShellNumberPanelVM.bGrid_IsEnabled))
End Set
End Property
+23 -1
View File
@@ -72,15 +72,32 @@
Margin="2.5,0,2.5,0"
Style="{StaticResource ControllerInputPanel_TextBox}"/>
</Grid>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Text="Wait:"
Visibility="{Binding Wait_Visibility}"
Margin="2.5,0,2.5,0"
Style="{StaticResource TSFEditor_TextBlock}"/>
<TextBox Grid.Column="1"
Text="{Binding sWait}"
Width="50"
Visibility="{Binding Wait_Visibility}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ControllerInputPanel_TextBox}"/>
</Grid>
<StackPanel Grid.Column="1"
Orientation="Horizontal">
<Button Content="Set"
Command="{Binding Set_Command}"
Visibility="{Binding FCurr_Visibility}"
Visibility="{Binding Set_Visibility}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ToolBar_TextButton}"/>
<Button Content="Media"
Command="{Binding Media_Command}"
Visibility="{Binding Media_Visibility}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ToolBar_TextButton}"/>
<Button Content="Reset"
@@ -135,6 +152,8 @@
Width="1*"/>
<DataGridTextColumn Header="TWait"
Binding="{Binding sTWait}"
Visibility="{Binding DataContext.ColWait_Visibility,
Source={x:Reference TFSEditorStackPanel}}"
Width="1*"/>
<DataGridTextColumn Header="FMin"
Binding="{Binding sFMin}"
@@ -181,6 +200,9 @@
Command="{Binding Extend_Command}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ToolBar_TextButton}"/>
<CheckBox Content="Wait"
IsChecked="{Binding bWaitingTime}"
VerticalAlignment="Center"/>
</StackPanel>
</Grid>
</Border>
+97 -6
View File
@@ -16,6 +16,7 @@ Public Class TFSEditorVM
HEIGHT = 1
SECTIONCHANGE = 2
SELECTION = 3
SELECTION_WAIT = 4
End Enum
Public Enum Filters As Integer
@@ -58,7 +59,7 @@ Public Class TFSEditorVM
End Set
End Property
Private m_MediaTypeList As New List(Of String)({"Slice Number", "Section change", "Selection"})
Private m_MediaTypeList As New List(Of String)({"Slice Number", "Section change", "Selection", "Selection Wait"})
Public ReadOnly Property MediaTypeList As List(Of String)
Get
Return m_MediaTypeList
@@ -77,14 +78,30 @@ Public Class TFSEditorVM
SetMediaHeightVisibility(True)
SetFCurrVisibility(False)
SetDifference_Visibility(False)
SetWaitVisibility(False)
SetSetVisibility(False)
SetMediaVisibility(True)
Case MediaTypes.SECTIONCHANGE
SetMediaHeightVisibility(False)
SetFCurrVisibility(False)
SetDifference_Visibility(True)
SetWaitVisibility(False)
SetSetVisibility(False)
SetMediaVisibility(True)
Case MediaTypes.SELECTION
SetMediaHeightVisibility(False)
SetFCurrVisibility(True)
SetDifference_Visibility(False)
SetWaitVisibility(False)
SetSetVisibility(True)
SetMediaVisibility(True)
Case MediaTypes.SELECTION_WAIT
SetMediaHeightVisibility(False)
SetFCurrVisibility(False)
SetDifference_Visibility(False)
SetWaitVisibility(True)
SetSetVisibility(True)
SetMediaVisibility(False)
End Select
End Set
End Property
@@ -167,6 +184,54 @@ Public Class TFSEditorVM
NotifyPropertyChanged(NameOf(FCurr_Visibility))
End Sub
Private m_dWait As Double
Public Property sWait As String
Get
Return LenToString(m_dWait, 2)
End Get
Set(value As String)
Dim nNewValue As Integer = 0
If StringToLen(value, nNewValue) Then
m_dWait = nNewValue
Else
NotifyPropertyChanged(NameOf(sWait))
End If
End Set
End Property
Private m_Wait_Visibility As Visibility = Visibility.Collapsed
Public ReadOnly Property Wait_Visibility As Visibility
Get
Return m_Wait_Visibility
End Get
End Property
Private Sub SetWaitVisibility(bValue As Boolean)
m_Wait_Visibility = If(bValue, Visibility.Visible, Visibility.Collapsed)
NotifyPropertyChanged(NameOf(Wait_Visibility))
End Sub
Private m_Media_Visibility As Visibility = Visibility.Visible
Public ReadOnly Property Media_Visibility As Visibility
Get
Return m_Media_Visibility
End Get
End Property
Private Sub SetMediaVisibility(bValue As Boolean)
m_Media_Visibility = If(bValue, Visibility.Visible, Visibility.Collapsed)
NotifyPropertyChanged(NameOf(Media_Visibility))
End Sub
Private m_Set_Visibility As Visibility = Visibility.Collapsed
Public ReadOnly Property Set_Visibility As Visibility
Get
Return m_Set_Visibility
End Get
End Property
Private Sub SetSetVisibility(bValue As Boolean)
m_Set_Visibility = If(bValue, Visibility.Visible, Visibility.Collapsed)
NotifyPropertyChanged(NameOf(Set_Visibility))
End Sub
Private m_FilterList As New List(Of String)({"", "Time Lower", "Time Ok", "Time Upper", "Speed Min", "Speed Max"})
Public ReadOnly Property FilterList As List(Of String)
Get
@@ -208,6 +273,28 @@ Public Class TFSEditorVM
NotifyPropertyChanged(NameOf(bTFSEditor_IsEnabled))
End Sub
Private m_bWaitingTime As Boolean = False
Public Property bWaitingTime As Boolean
Get
Return m_bWaitingTime
End Get
Set(value As Boolean)
m_bWaitingTime = value
Dim nLayTFSCalcId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, LAY_TFSCALC)
If m_bWaitingTime Then
EgtSetInfo(nLayTFSCalcId, KEY_EMITWAITINGTIME, True)
Else
EgtRemoveInfo(nLayTFSCalcId, KEY_EMITWAITINGTIME)
End If
NotifyPropertyChanged(NameOf(ColWait_Visibility))
End Set
End Property
Public ReadOnly Property ColWait_Visibility As Visibility
Get
Return If(m_bWaitingTime, Visibility.Visible, Visibility.Collapsed)
End Get
End Property
' Definizione comandi
Private m_cmdSet As ICommand
Private m_cmdMedia As ICommand
@@ -332,12 +419,16 @@ Public Class TFSEditorVM
For Each Layer In m_SelLayers
Layer.SetFCurr(m_dFCurr)
Next
Case MediaTypes.SELECTION_WAIT
For Each Layer In m_SelLayers
Layer.SetTWait(m_dWait)
Next
End Select
' salvo selezione corrente
Dim SelIndexList As New List(Of Integer)
For Each SelLayer In m_SelLayers
SelIndexList.Add(SelLayer.nIndex)
Next
'' salvo selezione corrente
'Dim SelIndexList As New List(Of Integer)
'For Each SelLayer In m_SelLayers
' SelIndexList.Add(SelLayer.nIndex)
'Next
'' ricalcolo valori
'Map.refSliceManagerVM.CalcSlice(False, True)
'' ripristino layer selezionati
+1 -1
View File
@@ -277,7 +277,7 @@ Public Class TopPanelVM
m_MachiningList.Remove(MachiningIndex.Empty())
End If
' se nuova lavorazione e' none
If SelMachining.sGUID = Guid.Empty AndAlso Not MachiningList.Any(Function(x) x.sGUID = MachiningIndex.Empty.sGUID) Then
If Not IsNothing(m_SelMachining) AndAlso SelMachining.sGUID = Guid.Empty AndAlso Not MachiningList.Any(Function(x) x.sGUID = MachiningIndex.Empty.sGUID) Then
' aggiungo lavorazione vuota
MachiningList.Insert(0, MachiningIndex.Empty())
End If
+19 -16
View File
@@ -42,6 +42,9 @@ Public Module CurrentMachine
Return m_sMachiningFilePath
End Get
End Property
Friend Sub SetMachiningFilePath(sValue As String)
m_sMachiningFilePath = sValue
End Sub
' Cartella dei materiali
Private m_sMaterialsFilePath As String = String.Empty
Friend ReadOnly Property sMaterialsFilePath As String
@@ -126,8 +129,8 @@ Public Module CurrentMachine
DisableMgr.ReEnable()
End Sub
Friend Function ReadMachiningParamString(lpAppName As String, lpKeyName As String, lpDefault As String, ByRef lpString As String) As Integer
Dim nResult As Integer = GetPrivateProfileString(lpAppName, lpKeyName, "", lpString, m_sMachiningFilePath)
Friend Function ReadMachiningParamString(lpAppName As String, lpKeyName As String, lpDefault As String, ByRef lpString As String, Optional sFilePath As String = "") As Integer
Dim nResult As Integer = GetPrivateProfileString(lpAppName, lpKeyName, "", lpString, If(Not String.IsNullOrWhiteSpace(sFilePath), sFilePath, m_sMachiningFilePath))
If Not String.IsNullOrWhiteSpace(lpString) Then
lpString = EgwCrypto.PowerDecryptString(lpString, m_Salt)
Else
@@ -136,8 +139,8 @@ Public Module CurrentMachine
Return nResult
End Function
Friend Function ReadMachiningParamSplit(lpAppName As String, lpKeyName As String, lpDefault As String, ByRef lpString As String) As Integer
Dim nResult As Integer = GetPrivateProfileString(lpAppName, lpKeyName, "", lpString, m_sMachiningFilePath)
Friend Function ReadMachiningParamSplit(lpAppName As String, lpKeyName As String, lpDefault As String, ByRef lpString As String, Optional sFilePath As String = "") As Integer
Dim nResult As Integer = GetPrivateProfileString(lpAppName, lpKeyName, "", lpString, If(Not String.IsNullOrWhiteSpace(sFilePath), sFilePath, m_sMachiningFilePath))
If Not String.IsNullOrWhiteSpace(lpString) Then
Dim Values() As String = lpString.Split(";"c)
Dim sCryptoValues As String = ""
@@ -151,33 +154,33 @@ Public Module CurrentMachine
Return nResult
End Function
Friend Function ReadMachiningParamDouble(lpAppName As String, lpKeyName As String, dDefault As Double) As Double
Friend Function ReadMachiningParamDouble(lpAppName As String, lpKeyName As String, dDefault As Double, Optional sFilePath As String = "") As Double
Dim sParam As String = ""
Dim dParam As Double = dDefault
ReadMachiningParamString(lpAppName, lpKeyName, dDefault, sParam)
ReadMachiningParamString(lpAppName, lpKeyName, dDefault, sParam, sFilePath)
StringToDouble(sParam, dParam)
Return dParam
End Function
Friend Function WriteMachiningParam(lpAppName As String, lpKeyName As String, lpString As String) As Boolean
Return WritePrivateProfileString(lpAppName, lpKeyName, EgwCrypto.PowerEncryptString(lpString, m_Salt), m_sMachiningFilePath)
Friend Function WriteMachiningParam(lpAppName As String, lpKeyName As String, lpString As String, Optional sFilePath As String = "") As Boolean
Return WritePrivateProfileString(lpAppName, lpKeyName, EgwCrypto.PowerEncryptString(lpString, m_Salt), If(Not String.IsNullOrWhiteSpace(sFilePath), sFilePath, m_sMachiningFilePath))
End Function
Friend Function WriteMachiningParamSplit(lpAppName As String, lpKeyName As String, lpString As String) As Boolean
Friend Function WriteMachiningParamSplit(lpAppName As String, lpKeyName As String, lpString As String, Optional sFilePath As String = "") As Boolean
If Not String.IsNullOrWhiteSpace(lpString) Then
Dim Values() As String = lpString.Split(";"c)
Dim sCryptoValues As String = ""
For ValueIndex = 0 To Values.Count - 1
sCryptoValues += EgwCrypto.PowerEncryptString(Values(ValueIndex), m_Salt) & If(ValueIndex < Values.Count - 1, ";", "")
Next
Return WritePrivateProfileString(lpAppName, lpKeyName, sCryptoValues, m_sMachiningFilePath)
Return WritePrivateProfileString(lpAppName, lpKeyName, sCryptoValues, If(Not String.IsNullOrWhiteSpace(sFilePath), sFilePath, m_sMachiningFilePath))
Else
Return False
End If
End Function
Friend Function ReadMaterialParamString(lpAppName As String, lpKeyName As String, lpDefault As String, ByRef lpString As String) As Integer
Dim nResult As Integer = GetPrivateProfileString(lpAppName, lpKeyName, lpDefault, lpString, m_sMaterialsFilePath)
Friend Function ReadMaterialParamString(lpAppName As String, lpKeyName As String, lpDefault As String, ByRef lpString As String, Optional sFilePath As String = "") As Integer
Dim nResult As Integer = GetPrivateProfileString(lpAppName, lpKeyName, lpDefault, lpString, If(Not String.IsNullOrWhiteSpace(sFilePath), sFilePath, m_sMaterialsFilePath))
If Not String.IsNullOrWhiteSpace(lpString) Then
lpString = EgwCrypto.PowerDecryptString(lpString, m_Salt)
Else
@@ -186,16 +189,16 @@ Public Module CurrentMachine
Return nResult
End Function
Friend Function ReadMaterialParamDouble(lpAppName As String, lpKeyName As String, dDefault As Double) As Double
Friend Function ReadMaterialParamDouble(lpAppName As String, lpKeyName As String, dDefault As Double, Optional sFilePath As String = "") As Double
Dim sParam As String = ""
Dim dParam As Double = dDefault
ReadMaterialParamString(lpAppName, lpKeyName, dDefault, sParam)
ReadMaterialParamString(lpAppName, lpKeyName, dDefault, sParam, sFilePath)
StringToDouble(sParam, dParam)
Return dParam
End Function
Friend Function WriteMaterialParam(lpAppName As String, lpKeyName As String, lpString As String) As Boolean
Return WritePrivateProfileString(lpAppName, lpKeyName, EgwCrypto.PowerEncryptString(lpString, m_Salt), m_sMaterialsFilePath)
Friend Function WriteMaterialParam(lpAppName As String, lpKeyName As String, lpString As String, Optional sFilePath As String = "") As Boolean
Return WritePrivateProfileString(lpAppName, lpKeyName, EgwCrypto.PowerEncryptString(lpString, m_Salt), If(Not String.IsNullOrWhiteSpace(sFilePath), sFilePath, m_sMaterialsFilePath))
End Function
#End Region 'Methods
+183 -6
View File
@@ -1,57 +1,234 @@
Imports EgtUILib
Imports EgtWPFLib5
Module GeomEntityColors
Public Enum LayerType As Integer
PRINTPART = 1
RIBS = 2
SHELLNUMBERS = 3
AUXSOLIDS = 4
MACHSTART = 5
OTHERS = 6
ALL = 10
End Enum
Private m_c3Print As Color3d
Public ReadOnly Property c3Print As Color3d
Get
Return m_c3Print
Dim c3Temp As Color3d
If Not GetMainPrivateProfileColor(S_COLORS, K_CLR_PRINTPART, c3Temp) Then
c3Temp.FromColor(System.Drawing.Color.Aqua)
End If
Return c3Temp
End Get
End Property
Private m_c3MachStart As Color3d
Public ReadOnly Property c3MachStart As Color3d
Get
Return m_c3MachStart
Dim c3Temp As Color3d
If Not GetMainPrivateProfileColor(S_COLORS, K_CLR_MACHSTART, c3Temp) Then
c3Temp.FromColor(System.Drawing.Color.Red)
End If
Return c3Temp
End Get
End Property
Private m_c3Rib As Color3d
Public ReadOnly Property c3Rib As Color3d
Get
Return m_c3Rib
Dim c3Temp As Color3d
If Not GetMainPrivateProfileColor(S_COLORS, K_CLR_RIBS, c3Temp) Then
c3Temp.FromColor(System.Drawing.Color.MediumOrchid)
End If
Return c3Temp
End Get
End Property
Private m_c3ShellNumber As Color3d
Public ReadOnly Property c3ShellNumber As Color3d
Get
Return m_c3ShellNumber
Dim c3Temp As Color3d
If Not GetMainPrivateProfileColor(S_COLORS, K_CLR_SHELLNUMBERS, c3Temp) Then
c3Temp.FromColor(System.Drawing.Color.Lime)
End If
Return c3Temp
End Get
End Property
Private m_c3AuxSolids As Color3d
Public ReadOnly Property c3AuxSolids As Color3d
Get
Return m_c3AuxSolids
Dim c3Temp As Color3d
If Not GetMainPrivateProfileColor(S_COLORS, K_CLR_AUXSOLIDS, c3Temp) Then
c3Temp.FromColor(System.Drawing.Color.DarkGoldenrod)
End If
Return c3Temp
End Get
End Property
Private m_c3Others As Color3d
Public ReadOnly Property c3Others As Color3d
Get
Return m_c3Others
Dim c3Temp As Color3d
If Not GetMainPrivateProfileColor(S_COLORS, K_CLR_OTHERS, c3Temp) Then
c3Temp.FromColor(System.Drawing.Color.LightGray)
End If
Return c3Temp
End Get
End Property
Sub New()
' imposto colori superfici
m_c3Print.FromColor(System.Drawing.Color.Aqua)
GetMainPrivateProfileColor(S_COLORS, K_CLR_PRINTPART, m_c3Print)
m_c3MachStart.FromColor(System.Drawing.Color.Red)
GetMainPrivateProfileColor(S_COLORS, K_CLR_MACHSTART, m_c3MachStart)
m_c3Rib.FromColor(System.Drawing.Color.MediumOrchid)
GetMainPrivateProfileColor(S_COLORS, K_CLR_RIBS, m_c3Rib)
m_c3ShellNumber.FromColor(System.Drawing.Color.Lime)
GetMainPrivateProfileColor(S_COLORS, K_CLR_SHELLNUMBERS, m_c3ShellNumber)
m_c3AuxSolids.FromColor(System.Drawing.Color.DarkGoldenrod)
GetMainPrivateProfileColor(S_COLORS, K_CLR_AUXSOLIDS, m_c3AuxSolids)
m_c3Others.FromColor(System.Drawing.Color.LightGray)
GetMainPrivateProfileColor(S_COLORS, K_CLR_OTHERS, m_c3Others)
End Sub
Friend Sub SetColor(Type As LayerType, c3Color As Color3d)
Dim c3Temp As Color3d
Dim sIniKey As String
Select Case Type
Case LayerType.PRINTPART
c3Temp = c3Print
sIniKey = K_CLR_PRINTPART
Case LayerType.RIBS
c3Temp = c3Rib
sIniKey = K_CLR_RIBS
Case LayerType.SHELLNUMBERS
c3Temp = c3ShellNumber
sIniKey = K_CLR_SHELLNUMBERS
Case LayerType.AUXSOLIDS
c3Temp = c3AuxSolids
sIniKey = K_CLR_AUXSOLIDS
Case LayerType.MACHSTART
c3Temp = c3MachStart
sIniKey = K_CLR_MACHSTART
Case LayerType.OTHERS
c3Temp = c3Others
sIniKey = K_CLR_OTHERS
End Select
c3Temp.R = c3Color.R
c3Temp.G = c3Color.G
c3Temp.B = c3Color.B
WritePrivateProfileColor(S_COLORS, sIniKey, c3Temp)
UpdateColors(Type)
End Sub
Friend Sub SetAlpha(Type As LayerType, dAlpha As Double)
Dim c3Temp As Color3d = c3Print
Dim sIniKey As String
Select Case Type
Case LayerType.PRINTPART
c3Temp = c3Print
sIniKey = K_CLR_PRINTPART
Case LayerType.RIBS
c3Temp = c3Rib
sIniKey = K_CLR_RIBS
Case LayerType.SHELLNUMBERS
c3Temp = c3ShellNumber
sIniKey = K_CLR_SHELLNUMBERS
Case LayerType.AUXSOLIDS
c3Temp = c3AuxSolids
sIniKey = K_CLR_AUXSOLIDS
Case LayerType.MACHSTART
c3Temp = c3MachStart
sIniKey = K_CLR_MACHSTART
Case LayerType.OTHERS
c3Temp = c3Others
sIniKey = K_CLR_OTHERS
End Select
c3Temp.A = dAlpha
WritePrivateProfileColor(S_COLORS, sIniKey, c3Temp)
UpdateColors(Type)
End Sub
Public Function WritePrivateProfileColor(IpAppName As String, IpKeyName As String, ByRef Color As Color3d) As Boolean
Dim sColor As String = Color.R & "," & Color.G & "," & Color.B & "," & Color.A
Return EgtUILib.WritePrivateProfileString(IpAppName, IpKeyName, sColor, m_sIniFile)
End Function
Sub UpdateColors(Type As LayerType)
Dim nPartId As Integer = EgtGetFirstPart()
While nPartId <> GDB_ID.NULL
Dim nIsOnTable As Integer = 0
If Not EgtGetInfo(nPartId, "PartOnTable", nIsOnTable) OrElse nIsOnTable <> 1 Then
nPartId = EgtGetNextPart(nPartId)
Continue While
End If
' Disabilito segnalazione modificato
Dim DisableMgr As New DisableModifiedMgr
' rimuovo eventuali colori da entita' e li assegno ai layer
If Type = LayerType.PRINTPART OrElse Type = LayerType.ALL Then
Dim nPrintPartLayerId As Integer = EgtGetFirstNameInGroup(nPartId, PRINT_SOLID)
Dim nPrintPartEntityId = EgtGetFirstInGroup(nPrintPartLayerId)
While nPrintPartEntityId <> GDB_ID.NULL
EgtResetColor(nPrintPartEntityId)
nPrintPartEntityId = EgtGetNext(nPrintPartEntityId)
End While
EgtSetColor(nPrintPartLayerId, GeomEntityColors.c3Print)
End If
If Type = LayerType.RIBS OrElse Type = LayerType.ALL Then
Dim nRibsLayerId As Integer = EgtGetFirstNameInGroup(nPartId, LAY_RIBS)
Dim nRibsEntityId = EgtGetFirstInGroup(nRibsLayerId)
While nRibsEntityId <> GDB_ID.NULL
EgtResetColor(nRibsEntityId)
nRibsEntityId = EgtGetNext(nRibsEntityId)
End While
EgtSetColor(nRibsLayerId, GeomEntityColors.c3Rib)
End If
If Type = LayerType.SHELLNUMBERS OrElse Type = LayerType.ALL Then
Dim nShellNumberLayerId As Integer = EgtGetFirstNameInGroup(nPartId, LAY_SHELL_NBR)
Dim nShellNumberEntityId = EgtGetFirstInGroup(nShellNumberLayerId)
While nShellNumberEntityId <> GDB_ID.NULL
EgtResetColor(nShellNumberEntityId)
nShellNumberEntityId = EgtGetNext(nShellNumberEntityId)
End While
EgtSetColor(nShellNumberLayerId, GeomEntityColors.c3ShellNumber)
End If
If Type = LayerType.AUXSOLIDS OrElse Type = LayerType.ALL Then
Dim nAuxSolidsLayerId As Integer = EgtGetFirstNameInGroup(nPartId, LAY_AUX_SOLIDS)
Dim nAuxSolidsEntityId = EgtGetFirstInGroup(nAuxSolidsLayerId)
While nAuxSolidsEntityId <> GDB_ID.NULL
EgtResetColor(nAuxSolidsEntityId)
nAuxSolidsEntityId = EgtGetNext(nAuxSolidsEntityId)
End While
EgtSetColor(nAuxSolidsLayerId, GeomEntityColors.c3AuxSolids)
End If
If Type = LayerType.MACHSTART OrElse Type = LayerType.ALL Then
Dim nMachStartLayerId As Integer = EgtGetFirstNameInGroup(nPartId, LAY_MACH_START)
Dim nMachStartEntityId = EgtGetFirstInGroup(nMachStartLayerId)
While nMachStartEntityId <> GDB_ID.NULL
EgtResetColor(nMachStartEntityId)
nMachStartEntityId = EgtGetNext(nMachStartEntityId)
End While
EgtSetColor(nMachStartLayerId, GeomEntityColors.c3MachStart)
End If
If Type = LayerType.OTHERS OrElse Type = LayerType.ALL Then
Dim nOthersLayerId As Integer = EgtGetFirstNameInGroup(nPartId, LAY_OTHERS)
Dim nOthersEntityId = EgtGetFirstInGroup(nOthersLayerId)
While nOthersEntityId <> GDB_ID.NULL
EgtResetColor(nOthersEntityId)
nOthersEntityId = EgtGetNext(nOthersEntityId)
End While
EgtSetColor(nOthersLayerId, GeomEntityColors.c3Others)
End If
' Ripristino stato segnalazione modifica
DisableMgr.ReEnable()
nPartId = EgtGetNextPart(nPartId)
End While
EgtDraw()
End Sub
End Module
+2 -1
View File
@@ -69,7 +69,8 @@ Module LuaExec
Dim sIsoFilePath As String = ""
Dim nTabPartId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, TABLE)
If nTabPartId <> GDB_ID.NULL Then
If Not EgtGetInfo(nTabPartId, KEY_ISOFILE_PATH, sIsoFilePath) Then
If Not EgtGetInfo(nTabPartId, KEY_ISOFILE_PATH, sIsoFilePath) OrElse
Not IO.Directory.Exists( IO.Path.GetDirectoryName(sIsoFilePath)) Then
EgtGetCurrFilePath(sIsoFilePath)
Dim sExtension As String = ""
GetPrivateProfileString(S_PARTPROGRAM, K_EXTENSION, "", sExtension, CurrentMachine.sMachIniFile)
+18 -1
View File
@@ -56,7 +56,7 @@ Public Class ViewLayerManagerVM
WriteMainPrivateProfileString(S_VIEWLAYER, K_SLC_SOLIDSLICE, "0")
ElseIf Map.refTopPanelVM.SelPage = Pages.SLICE Then
WriteMainPrivateProfileString(S_VIEWLAYER, K_MOD_SOLIDSLICE, "0")
ElseIf Map.refTopPanelVM.SelPage = Pages.NULL then
ElseIf Map.refTopPanelVM.SelPage = Pages.NULL Then
WriteMainPrivateProfileString(S_VIEWLAYER, K_MOD_SOLIDSLICE, "0")
WriteMainPrivateProfileString(S_VIEWLAYER, K_SLC_SOLIDSLICE, "0")
End If
@@ -229,6 +229,23 @@ Public Class ViewLayer
EgtSetStatus(CurrPart.nOthersLayerId, Status)
End Select
Next
'' se sono in importazione, dis/attivo anche queste superfici
'If Map.refTopPanelVM.SelPage = Pages.IMPORT Then
' For Each CurrPart In Map.refManagePartPanelVM.ManagerPartList
' For Each Layer In CurrPart.LayerList
' If (Layer.Type = ManagePart_Layer.LayerType.PRINT_SOLID AndAlso m_Type = ViewLayerType.PRINT_SOLID) OrElse
' (Layer.Type = ManagePart_Layer.LayerType.MACH_START AndAlso m_Type = ViewLayerType.START_MACHINING) OrElse
' (Layer.Type = ManagePart_Layer.LayerType.RIBS AndAlso m_Type = ViewLayerType.RIBS) OrElse
' (Layer.Type = ManagePart_Layer.LayerType.SHELL_NUMBER AndAlso m_Type = ViewLayerType.SHELL_NUMBER) OrElse
' (Layer.Type = ManagePart_Layer.LayerType.AUX_SOLIDS AndAlso m_Type = ViewLayerType.AUX_SOLIDS) OrElse
' (Layer.Type = ManagePart_Layer.LayerType.OTHERS AndAlso m_Type = ViewLayerType.OTHERS) Then
' For Each Entity In Layer.EntityList
' EgtSetStatus(Entity.nId, Status)
' Next
' End If
' Next
' Next
'End If
' Ripristino stato segnalazione modifica
DisableMgr.ReEnable()
End Sub