Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6981bcafbb | |||
| 99d69a4ffe | |||
| 4355deafb3 | |||
| e0a8f73b12 | |||
| a0c934f139 | |||
| 99a3ecad0a | |||
| 325d3af0b1 | |||
| 3c7c094fa2 | |||
| b55027a7fc | |||
| bb56d619d3 | |||
| 59fba24e6f | |||
| ed7e46596e | |||
| ae55084292 |
@@ -1847,8 +1847,8 @@ Public Class Assembly
|
||||
Door.CompoList(IndexCompo).refJambCompo = Jamb.CompoList(IndexCompoJamb)
|
||||
Jamb.CompoList(IndexCompoJamb).refCompoDoor = Door.CompoList(IndexCompo)
|
||||
Door.CompoList(IndexCompo).refJambCompo.VisibilitiReloadBtn = Visibility.Visible
|
||||
Door.CompoList(IndexCompo).refJambCompo.IsReadOnly = False
|
||||
Door.CompoList(IndexCompo).IsReadOnly = True
|
||||
Door.CompoList(IndexCompo).refJambCompo.IsReadOnly = True
|
||||
Door.CompoList(IndexCompo).IsReadOnly = False
|
||||
' definisco la proprietà ReadOnly per i parametri inseriti
|
||||
If Not LoadCompoParam(Door.CompoList(IndexCompo), Door.TypePart) Then Return
|
||||
For IndexParam As Integer = 0 To Door.CompoList(IndexCompo).refJambCompo.CompoParamList.Count - 1
|
||||
@@ -1872,7 +1872,7 @@ Public Class Assembly
|
||||
End If
|
||||
Next
|
||||
Else
|
||||
Door.CompoList(IndexCompo).IsReadOnly = True
|
||||
Door.CompoList(IndexCompo).IsReadOnly = False
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
@@ -263,7 +263,7 @@ Public Class AssemblyPageVM
|
||||
Case ConstGen.PART_FRAME_BOTTOM
|
||||
bOkSelection = LoadSelectedPartDoor(ConstGen.PART_FRAME_BOTTOM, OptionModule.m_CompoPanelFrameVisibility, True)
|
||||
Case Else
|
||||
bOkSelection = LoadSelectedPartDoor(SelectPart, Visibility.Visible, False)
|
||||
bOkSelection = LoadSelectedPartDoor(SelectPart, Visibility.Visible, OptionModule.ReadOnlyDDF)
|
||||
End Select
|
||||
If bOkSelection Then Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nDDFPage
|
||||
' aggiorno elenco quotature
|
||||
|
||||
@@ -1633,6 +1633,7 @@ Public Class AssemblyManagerVM
|
||||
' aggiungo il nome del file alla lista degli assemblati
|
||||
Dim Local_AssemblyName As New AssemblyName
|
||||
Local_AssemblyName.Name = SaveFileDialog.FileName
|
||||
Local_AssemblyName.GraphicName = Path.GetFileNameWithoutExtension(Local_AssemblyName.Name)
|
||||
m_CurrProject.AssemblyList.Add(Local_AssemblyName)
|
||||
' Seleziono AssembyName creato
|
||||
m_CurrProject.SelAssemblyName = Local_AssemblyName
|
||||
|
||||
@@ -11,7 +11,9 @@ Public Class AssemblyName
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_Name = value
|
||||
m_GraphicName = Path.GetFileNameWithoutExtension(m_Name)
|
||||
If m_IsModified Then
|
||||
MakeTitle()
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -31,21 +33,22 @@ Public Class AssemblyName
|
||||
' immagine senza asterisco
|
||||
Map.refProjectManagerVM.IsModifiedImage = "/Resources/TopCommandBar/Save.png"
|
||||
End If
|
||||
If OptionModule.m_SingleDoor AndAlso Map.refMainWindowVM.SelectedPage <> MainWindowVM.ListPageEnum.nHardwarePage AndAlso
|
||||
Not IsNothing(Map.refMainWindowVM.ProjectNameMsg) Then
|
||||
Dim sTitle As String = m_Name
|
||||
If m_GraphicName.Contains("*") Then sTitle &= "*"
|
||||
Map.refMainWindowVM.ProjectNameMsg = sTitle
|
||||
ElseIf Not OptionModule.m_SingleDoor AndAlso Map.refMainWindowVM.SelectedPage <> MainWindowVM.ListPageEnum.nHardwarePage AndAlso
|
||||
Not IsNothing(Map.refMainWindowVM.ProjectNameMsg) Then
|
||||
Dim sTitle As String = Path.GetDirectoryName(m_Name)
|
||||
Map.refMainWindowVM.ProjectNameMsg = sTitle
|
||||
End If
|
||||
'If OptionModule.m_SingleDoor AndAlso Map.refMainWindowVM.SelectedPage <> MainWindowVM.ListPageEnum.nHardwarePage AndAlso
|
||||
' Not IsNothing(Map.refMainWindowVM.ProjectNameMsg) Then
|
||||
' Dim sTitle As String = m_Name
|
||||
' If m_GraphicName.Contains("*") Then sTitle &= "*"
|
||||
' Map.refMainWindowVM.ProjectNameMsg = sTitle
|
||||
'ElseIf Not OptionModule.m_SingleDoor AndAlso Map.refMainWindowVM.SelectedPage <> MainWindowVM.ListPageEnum.nHardwarePage AndAlso
|
||||
' Not IsNothing(Map.refMainWindowVM.ProjectNameMsg) Then
|
||||
' Dim sTitle As String = Path.GetDirectoryName(m_Name)
|
||||
' Map.refMainWindowVM.ProjectNameMsg = sTitle
|
||||
'End If
|
||||
MakeTitle()
|
||||
NotifyPropertyChanged("GraphicName")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_GraphicName As String
|
||||
Private m_GraphicName As String = String.Empty
|
||||
Public Property GraphicName As String
|
||||
Get
|
||||
Return m_GraphicName
|
||||
@@ -66,4 +69,17 @@ Public Class AssemblyName
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Sub MakeTitle()
|
||||
If OptionModule.m_SingleDoor AndAlso Map.refMainWindowVM.SelectedPage <> MainWindowVM.ListPageEnum.nHardwarePage AndAlso
|
||||
Not IsNothing(Map.refMainWindowVM.ProjectNameMsg) Then
|
||||
Dim sTitle As String = m_Name
|
||||
If m_GraphicName.Contains("*") Then sTitle &= "*"
|
||||
Map.refMainWindowVM.ProjectNameMsg = sTitle
|
||||
ElseIf Not OptionModule.m_SingleDoor AndAlso Map.refMainWindowVM.SelectedPage <> MainWindowVM.ListPageEnum.nHardwarePage AndAlso
|
||||
Not IsNothing(Map.refMainWindowVM.ProjectNameMsg) Then
|
||||
Dim sTitle As String = Path.GetDirectoryName(m_Name)
|
||||
Map.refMainWindowVM.ProjectNameMsg = sTitle
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -7,7 +7,7 @@
|
||||
<KeyBinding Key="Enter" Command="{Binding RefreshCmd}"/>
|
||||
</UserControl.InputBindings>
|
||||
|
||||
<Grid>
|
||||
<Grid>
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="16*"/>
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
|
||||
<ItemsControl ItemsSource="{Binding CompoTypeList}" Focusable="True"
|
||||
Visibility="{Binding IsVisible}">
|
||||
Visibility="{Binding IsVisible}" IsEnabled="{Binding EnableModify}">
|
||||
|
||||
<ItemsControl.InputBindings>
|
||||
<KeyBinding Key="Enter" Command="{Binding RefreshCmd}"/>
|
||||
|
||||
@@ -44,6 +44,12 @@ Public Class CompoPanelVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property EnableModify As Boolean
|
||||
Get
|
||||
Return Not OptionModule.ReadOnlyDDF
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Definizione comando
|
||||
Private m_CmdCompoBtn As ICommand
|
||||
Private m_CmdGoToAssemblyBtn As ICommand
|
||||
@@ -142,7 +148,9 @@ Public Class CompoPanelVM
|
||||
' aggiorno lista hardware di quotatura
|
||||
Map.refDimensioningPanelVM.LoadHardwareDimList()
|
||||
' aggiungo le componenti sui Jamb
|
||||
Map.refAssemblyPageVM.CurrAssembly.CreateCompoOnJamb(NewCompo, "")
|
||||
If IsNothing(Map.refAssemblyPageVM.CurrAssembly) Then
|
||||
Map.refAssemblyPageVM.CurrAssembly.CreateCompoOnJamb(NewCompo, "")
|
||||
End If
|
||||
Map.refSceneManagerVM.RefreshBtn()
|
||||
Else
|
||||
MessageBox.Show(EgtMsg(50108), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Exclamation)
|
||||
|
||||
@@ -137,13 +137,14 @@ Public Class Compo
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_IsReadOnly As Boolean = True
|
||||
Private m_IsReadOnly As Boolean = False
|
||||
Public Property IsReadOnly As Boolean
|
||||
Get
|
||||
Return m_IsReadOnly
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_IsReadOnly = value
|
||||
NotifyPropertyChanged("IsReadOnly")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -1981,6 +1982,7 @@ Public Class Compo
|
||||
' creo una copia dell'oggetto
|
||||
Sub New(CompoType As CompoType)
|
||||
m_CompoType = CompoType.DeepCopy()
|
||||
If OptionModule.ReadOnlyDDF Then IsReadOnly = OptionModule.ReadOnlyDDF
|
||||
End Sub
|
||||
|
||||
' creo un riferiemento all'oggetto
|
||||
|
||||
+12
-6
@@ -232,12 +232,16 @@ Public Class Part
|
||||
OptionModule.m_CurrMaterial = m_SelectedMaterial
|
||||
' ogni volta che cambio la selezione del materiale azzero tutte le selezioni delle proprietà
|
||||
If Not IsNothing(m_SelectedMaterial.PropertiesList) Then
|
||||
For Each ItemProperty In m_SelectedMaterial.PropertiesList
|
||||
'ItemProperty.IsChecked = False
|
||||
Next
|
||||
m_PropertiesList = m_SelectedMaterial.PropertiesList
|
||||
m_SelectedProperty = m_PropertiesList(0)
|
||||
PropertiesIsVisible = Visibility.Visible
|
||||
If m_SelectedMaterial.PropertiesList.Count > 0 Then
|
||||
For Each ItemProperty In m_SelectedMaterial.PropertiesList
|
||||
'ItemProperty.IsChecked = False
|
||||
Next
|
||||
m_PropertiesList = m_SelectedMaterial.PropertiesList
|
||||
m_SelectedProperty = m_PropertiesList(0)
|
||||
PropertiesIsVisible = Visibility.Visible
|
||||
Else
|
||||
PropertiesIsVisible = Visibility.Collapsed
|
||||
End If
|
||||
Else
|
||||
PropertiesIsVisible = Visibility.Collapsed
|
||||
End If
|
||||
@@ -2807,6 +2811,8 @@ Public Class Part
|
||||
End If
|
||||
' Inserisco il componente in lista
|
||||
m_CurrCompo.FontBold = FontWeights.Normal
|
||||
' forzo la non modificabilità dei parametri della compo
|
||||
If OptionModule.ReadOnlyDDF Then m_CurrCompo.IsReadOnly = OptionModule.ReadOnlyDDF
|
||||
m_CompoList.Add(m_CurrCompo)
|
||||
End While
|
||||
Return Index
|
||||
|
||||
@@ -135,7 +135,8 @@
|
||||
ToolTip="{Binding CurrPart.ToolTipEvaluatedWeight}"
|
||||
MaxWidth="120" Margin="0.4,2,10,3.2"
|
||||
VerticalAlignment="Stretch" Height="Auto"
|
||||
Visibility="{Binding CurrPart.VisibilityWeight}"/>
|
||||
Visibility="{Binding CurrPart.VisibilityWeight}"
|
||||
IsReadOnly="{Binding IsRaedOnly}"/>
|
||||
|
||||
<!--Seconda colonna -->
|
||||
<!-- Profiles-->
|
||||
@@ -195,13 +196,13 @@
|
||||
Name="LockHingeEdge"
|
||||
Margin="0,0,20,0"
|
||||
Style="{StaticResource DoorParamsChBx}"
|
||||
Visibility="Collapsed"/>
|
||||
Visibility="Collapsed"/>
|
||||
<CheckBox Grid.Column="4" Grid.Row="3" Grid.RowSpan="2"
|
||||
IsChecked="{Binding CurrPart.ResizeTopBottom}"
|
||||
Name="TopBottomEdge"
|
||||
Margin="0,0,20,0"
|
||||
Style="{StaticResource DoorParamsChBx}"
|
||||
Visibility="Collapsed"/>
|
||||
Visibility="Collapsed"/>
|
||||
<!--Machining-->
|
||||
<CheckBox Grid.Column="5" Grid.Row="1"
|
||||
Name="LockEdge" Style="{StaticResource DoorParamsChBx}"
|
||||
@@ -288,11 +289,12 @@
|
||||
Visibility="{Binding AllignGropBox}"
|
||||
Style="{StaticResource DoorParamsChBx}"
|
||||
VerticalAlignment="Stretch"
|
||||
Margin="2,0,0.2,0"/>
|
||||
Margin="2,0,0.2,0"
|
||||
IsEnabled="{Binding IsRaedOnly, Converter={StaticResource TrueToFalse}}"/>
|
||||
<ComboBox Style="{StaticResource DoorParamsCmBx}" Width="100"
|
||||
Visibility="{Binding AllignGropBox}"
|
||||
VerticalAlignment="Stretch" Height="Auto"
|
||||
Margin="2,0,0,0"/>
|
||||
Margin="2,0,0,0" IsEnabled="{Binding IsRaedOnly, Converter={StaticResource TrueToFalse}}"/>
|
||||
</StackPanel>
|
||||
</GroupBox.Header>
|
||||
|
||||
@@ -353,6 +355,7 @@
|
||||
Visibility="{Binding CurrPart.MaterialIsVisible}"
|
||||
ItemsSource="{Binding CurrPart.MaterialsList}"
|
||||
SelectedItem="{Binding CurrPart.SelectedMaterial}"
|
||||
IsEnabled="{Binding IsRaedOnly, Converter={StaticResource TrueToFalse}}"
|
||||
DisplayMemberPath="Name">
|
||||
</ComboBox>
|
||||
<!--lLsta proprietà-->
|
||||
@@ -362,6 +365,7 @@
|
||||
Visibility="{Binding CurrPart.PropertiesIsVisible}"
|
||||
ItemsSource="{Binding CurrPart.PropertiesList}"
|
||||
SelectedItem="{Binding CurrPart.SelectedProperty}"
|
||||
IsEnabled="{Binding IsRaedOnly, Converter={StaticResource TrueToFalse}}"
|
||||
DisplayMemberPath="GraphicName">
|
||||
</ComboBox>
|
||||
</Grid>
|
||||
@@ -382,12 +386,14 @@
|
||||
Style="{StaticResource DoorParamsChBx}"
|
||||
IsChecked="{Binding CurrPart.TopShapeIsChecked}"
|
||||
VerticalAlignment="Stretch"
|
||||
IsEnabled="{Binding IsRaedOnly, Converter={StaticResource TrueToFalse}}"
|
||||
Margin="2,0,0.2,0"/>
|
||||
<ComboBox Style="{StaticResource DoorParamsCmBx}" Width="100"
|
||||
ItemsSource="{Binding CurrPart.TopShapeList}"
|
||||
SelectedItem="{Binding CurrPart.SelectedShape}"
|
||||
VerticalAlignment="Stretch" Height="Auto"
|
||||
Margin="2,0,0,0"
|
||||
IsEnabled="{Binding IsRaedOnly, Converter={StaticResource TrueToFalse}}"
|
||||
DisplayMemberPath="Name"/>
|
||||
</StackPanel>
|
||||
</GroupBox.Header>
|
||||
@@ -545,7 +551,7 @@
|
||||
</Grid>
|
||||
</GroupBox>-->
|
||||
|
||||
<!--Cut-->
|
||||
<!--Cut NON IN USO-->
|
||||
<GroupBox Grid.Row="6" Grid.Column="1" Margin="2,0,2,0" Visibility="Collapsed">
|
||||
<GroupBox.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
@@ -631,9 +637,8 @@
|
||||
</ListBox.ItemContainerStyle>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<GroupBox
|
||||
Width="{Binding ActualWidth,ElementName=DoorParamsItemsControl,
|
||||
Converter={StaticResource SplitConverter},ConverterParameter=2}" Padding="0,0,1,0">
|
||||
<GroupBox Width="{Binding ActualWidth,ElementName=DoorParamsItemsControl,
|
||||
Converter={StaticResource SplitConverter},ConverterParameter=2}" Padding="0,0,1,0">
|
||||
<GroupBox.Style>
|
||||
<Style TargetType="GroupBox">
|
||||
<Setter Property="BorderBrush" Value="LightGray"/>
|
||||
@@ -651,7 +656,7 @@
|
||||
</Style>
|
||||
</GroupBox.Style>
|
||||
<GroupBox.Header >
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<StackPanel Orientation="Horizontal" IsEnabled="{Binding IsReadOnly, Converter={StaticResource TrueToFalse}}">
|
||||
<Button x:Name="ReloadCompoRef"
|
||||
Visibility="{Binding VisibilitiReloadBtn}"
|
||||
ToolTip="{Binding DataContext.ReloadCompoRefToolTip,RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
|
||||
@@ -696,6 +701,7 @@
|
||||
</StackPanel>
|
||||
</GroupBox.Header>
|
||||
<StackPanel >
|
||||
<!--Brand Template-->
|
||||
<UniformGrid Columns="2" Visibility="{Binding TemplateVisibility}">
|
||||
<!--Brand-->
|
||||
<TextBlock Text="{Binding BrandMsg}">
|
||||
@@ -712,12 +718,11 @@
|
||||
</Style>
|
||||
</TextBlock.Style>
|
||||
</TextBlock>
|
||||
<ComboBox ItemsSource="{Binding BrandListPart,
|
||||
Converter={StaticResource TemplateListConverter}}"
|
||||
<ComboBox ItemsSource="{Binding BrandListPart, Converter={StaticResource TemplateListConverter}}"
|
||||
Margin="0,0,0,2"
|
||||
SelectedItem="{Binding SelBrandPart}"
|
||||
Style="{StaticResource DoorParamsCmBx}"
|
||||
IsEnabled="{Binding IsReadOnly}"/>
|
||||
IsEnabled="{Binding IsReadOnly, Converter={StaticResource TrueToFalse}}"/>
|
||||
<!--File-->
|
||||
<TextBlock Text="{Binding TemplateName}">
|
||||
<TextBlock.Style>
|
||||
@@ -732,12 +737,11 @@
|
||||
</Style>
|
||||
</TextBlock.Style>
|
||||
</TextBlock>
|
||||
<ComboBox ItemsSource="{Binding FileList,
|
||||
Converter={StaticResource TemplateListConverter}}"
|
||||
<ComboBox ItemsSource="{Binding FileList, Converter={StaticResource TemplateListConverter}}"
|
||||
Margin="0,0,0,2"
|
||||
SelectedItem="{Binding SelFile}"
|
||||
Style="{StaticResource DoorParamsCmBx}"
|
||||
IsEnabled="{Binding IsReadOnly}"/>
|
||||
IsEnabled="{Binding IsReadOnly, Converter={StaticResource TrueToFalse}}"/>
|
||||
</UniformGrid>
|
||||
|
||||
<!--Lista dei parametri-->
|
||||
@@ -764,18 +768,18 @@
|
||||
<ComboBox ItemsSource="{Binding ItemList}" Margin="0,0,0,2"
|
||||
SelectedItem="{Binding SelItem}"
|
||||
Style="{StaticResource DoorParamsCmBx}"
|
||||
IsEnabled="{Binding IsRaedOnly}"/>
|
||||
IsEnabled="{Binding CurrCompo.IsReadOnly, Converter={StaticResource TrueToFalse}}"/>
|
||||
</UniformGrid>
|
||||
</DataTemplate>
|
||||
<!-- ComboBoxOnOff -->
|
||||
<DataTemplate DataType="{x:Type local:ComboBoxOnOffParam}">
|
||||
<Grid>
|
||||
<Grid IsEnabled="{Binding CurrCompo.IsReadOnly, Converter={StaticResource TrueToFalse}}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Grid>
|
||||
<Grid >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
@@ -783,8 +787,7 @@
|
||||
|
||||
<CheckBox Name="ChBxBox" IsChecked="{Binding IsActive}"
|
||||
Style="{StaticResource DoorParamsChBx}"
|
||||
VerticalAlignment="Top"
|
||||
IsEnabled="{Binding IsRaedOnly, Converter={StaticResource TrueToFalse}}"/>
|
||||
VerticalAlignment="Top"/>
|
||||
<TextBlock Text="{Binding Name}" Grid.Column="1"
|
||||
Margin="2,0,0,2">
|
||||
<TextBlock.Style>
|
||||
@@ -835,7 +838,7 @@
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Margin="0,0,0,2"
|
||||
ToolTip="{Binding ToolTipValue}"
|
||||
IsEnabled="{Binding IsReadOnly}"/>
|
||||
IsReadOnly="{Binding CurrCompo.IsReadOnly}"/>
|
||||
</UniformGrid>
|
||||
</DataTemplate>
|
||||
<!-- TextBoxOnOff -->
|
||||
@@ -855,7 +858,7 @@
|
||||
<CheckBox Name="ChBx" IsChecked="{Binding IsActive}"
|
||||
Style="{StaticResource DoorParamsChBx}"
|
||||
VerticalAlignment="Top"
|
||||
IsEnabled="{Binding IsRaedOnly, Converter={StaticResource TrueToFalse}}"/>
|
||||
IsEnabled="{Binding CurrCompo.IsReadOnly, Converter={StaticResource TrueToFalse}}"/>
|
||||
<TextBlock Text="{Binding Name}" Grid.Column="1"
|
||||
Margin="2,0,0,2">
|
||||
<TextBlock.Style>
|
||||
@@ -875,6 +878,7 @@
|
||||
<TextBox Text="{Binding Value,UpdateSourceTrigger=PropertyChanged}" Grid.Column="2"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
IsEnabled="{Binding IsChecked, ElementName=ChBx}"
|
||||
IsReadOnly="{Binding CurrCompo.IsReadOnly}"
|
||||
Margin="0,0,0,2"
|
||||
ToolTip="{Binding ToolTipValue,UpdateSourceTrigger=PropertyChanged}"/>
|
||||
</Grid>
|
||||
|
||||
@@ -27,4 +27,7 @@
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub UserControl_IsEnabledChanged(sender As Object, e As DependencyPropertyChangedEventArgs)
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
@@ -80,6 +80,7 @@ Public Class PartPageVM
|
||||
If IsNothing(Map.refCompoPanelVM) Then Map.SetRefCompoPanelVM(New CompoPanelVM("PartPage"))
|
||||
If IsNothing(m_CompoPanelPart) Then m_CompoPanelPart = New CompoPanelV
|
||||
m_CompoPanelPart.DataContext = Map.refCompoPanelVM
|
||||
m_IsReadOnly = OptionModule.ReadOnlyDDF
|
||||
End Sub
|
||||
|
||||
Sub PrepareEvent()
|
||||
|
||||
@@ -25,6 +25,8 @@ Friend Module IniFile
|
||||
DOORS = 2
|
||||
DOORCREATOR = 8
|
||||
JAMBS = 32
|
||||
STEELDOOR = 256
|
||||
READ_ONLY = 512
|
||||
End Enum
|
||||
|
||||
' Path cartella Data
|
||||
|
||||
@@ -57,8 +57,8 @@ Friend Class MainWindowModel
|
||||
EgtUILib.GetPrivateProfileString(S_LICENCE, K_KEY, "", sKey, sLicFile)
|
||||
EgtSetKey(sKey)
|
||||
' Recupero livello e opzioni della chiave
|
||||
Dim bKey As Boolean = EgtGetKeyLevel(3279, 2310, 1, IniFile.m_nKeyLevel) And
|
||||
EgtGetKeyOptions(3279, 2310, 1, IniFile.m_nKeyOptions)
|
||||
Dim bKey As Boolean = EgtGetKeyLevel(3279, 2404, 1, IniFile.m_nKeyLevel) And
|
||||
EgtGetKeyOptions(3279, 2404, 1, IniFile.m_nKeyOptions)
|
||||
'Inizializzazione generale di EgtInterface
|
||||
m_nDebug = GetMainPrivateProfileInt(S_GENERAL, K_DEBUG, 0)
|
||||
Dim sLogFile As String = IniFile.m_sTempDir & "\" & GENLOG_FILE_NAME.Replace("#", m_nInstance.ToString())
|
||||
@@ -101,6 +101,7 @@ Friend Class MainWindowModel
|
||||
EgtLuaRequire(sLuaBaseLib)
|
||||
' Imposto path IniFile
|
||||
EgtSetIniFile(IniFile.m_sIniFile)
|
||||
' Imposto la modalità di lettura dei file ddf
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -331,11 +331,13 @@ Public Class MainWindowVM
|
||||
|
||||
'Public Sub CloseApplication(ByVal param As Object)
|
||||
Public Sub CloseApplication()
|
||||
m_StopClosingApplication = False
|
||||
' verifico se selezionato esiste e modificato
|
||||
Select Case SelectedPage
|
||||
Case ListPageEnum.nHardwarePage
|
||||
If Not IsNothing(Map.refHardwarePageVM) And Not IsNothing(Map.refHardwarePageVM.CurrHardware) Then
|
||||
If Map.refHardwarePageVM.CurrHardware.SaveControl() = Hardware.SaveResult.nCancel Then
|
||||
m_StopClosingApplication = True
|
||||
Return
|
||||
ElseIf Map.refHardwarePageVM.CurrHardware.SaveControl() = Hardware.SaveResult.nYes Then
|
||||
Map.refHardwarePageVM.CurrHardware.Save()
|
||||
@@ -349,10 +351,15 @@ Public Class MainWindowVM
|
||||
Select Case MessageBox.Show(sText, "", MessageBoxButton.YesNoCancel, MessageBoxImage.Question)
|
||||
Case MessageBoxResult.Yes
|
||||
Map.refAssemblyManagerVM.Save(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName)
|
||||
If Not DdfFile.DDFIsCorrect Then Return ' se il ddf non è corretto non permetto il salvataggio
|
||||
' se il ddf non è corretto non permetto il salvataggio
|
||||
If Not DdfFile.DDFIsCorrect Then
|
||||
m_StopClosingApplication = True
|
||||
Return
|
||||
End If
|
||||
Case MessageBoxResult.No
|
||||
' Non faccio alcunchè
|
||||
Case MessageBoxResult.Cancel
|
||||
m_StopClosingApplication = True
|
||||
Return
|
||||
End Select
|
||||
End If
|
||||
@@ -375,6 +382,14 @@ Public Class MainWindowVM
|
||||
|
||||
End Sub
|
||||
|
||||
Private m_StopClosingApplication As Boolean = False
|
||||
Public ReadOnly Property StopClosingApplication As Boolean
|
||||
Get
|
||||
' restituisce vero se l'operazione di chiusura del programma è stata interotta
|
||||
Return m_StopClosingApplication
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' CloseApplicationCommand
|
||||
|
||||
Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
|
||||
|
||||
@@ -72,5 +72,5 @@ Imports System.Windows
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.3.10.1")>
|
||||
<Assembly: AssemblyFileVersion("2.3.10.1")>
|
||||
<Assembly: AssemblyVersion("2.4.4.1")>
|
||||
<Assembly: AssemblyFileVersion("2.4.4.1")>
|
||||
|
||||
@@ -4,6 +4,8 @@ Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Friend Module OptionModule
|
||||
' flag per modalità di visualizzazione file (solo lettura)
|
||||
Friend ReadOnlyDDF As Boolean = False
|
||||
|
||||
' Parametri che contengono lista delle lingue disponibili e lingua selezionata
|
||||
Friend m_LanguageList As New ObservableCollection(Of Language)
|
||||
@@ -216,6 +218,15 @@ Friend Module OptionModule
|
||||
m_ConfigurationSoftware = ConfigType.Door
|
||||
End If
|
||||
|
||||
' verifico se il programma è in modalità di sola lettura DDF
|
||||
If (IniFile.m_nKeyOptions And KEY_OPT.READ_ONLY) <> 0 Then
|
||||
OptionModule.ReadOnlyDDF = True
|
||||
ElseIf GetMainPrivateProfileInt(S_GENERAL, "ReadOnly", 0) <> 0 Then
|
||||
OptionModule.ReadOnlyDDF = True
|
||||
Else
|
||||
OptionModule.ReadOnlyDDF = False
|
||||
End If
|
||||
|
||||
' imposto unità di misura per interfaccia utente
|
||||
m_bIsMmUnit = (GetMainPrivateProfileInt(S_SCENE, K_MMUNITS, 1) <> 0)
|
||||
EgtSetUiUnits(m_bIsMmUnit)
|
||||
|
||||
@@ -1711,7 +1711,7 @@ Public Class OptionsVM
|
||||
Private m_VisibilityConfiguration As Visibility = Visibility.Collapsed
|
||||
Public ReadOnly Property VisibilityConfiguration As Visibility
|
||||
Get
|
||||
If (GetMainPrivateProfileInt(S_GENERAL, "Debug", 0) > 4) Then
|
||||
If (GetMainPrivateProfileInt(S_GENERAL, "EnableSettingAsOpt", 0) = 1) Then
|
||||
m_VisibilityConfiguration = Visibility.Visible
|
||||
End If
|
||||
Return m_VisibilityConfiguration
|
||||
@@ -1724,6 +1724,19 @@ Public Class OptionsVM
|
||||
Return m_EnableAssembly
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
' chiedo se desidera procedere con lo spegnimento del programma
|
||||
If MessageBox.Show("The program will be shut down, do you want to proced?", "Warning", MessageBoxButton.OKCancel, MessageBoxImage.Exclamation, MessageBoxResult.Cancel) = MessageBoxResult.OK Then
|
||||
' procedo alla chiusura del programma
|
||||
Map.refMainWindowVM.CloseApplication()
|
||||
Else
|
||||
' esco senza salvare la selezione
|
||||
Return
|
||||
End If
|
||||
' sa la chiusura del porgramma è stata interotta
|
||||
If Map.refMainWindowVM.StopClosingApplication Then
|
||||
' esco senza salvare la selezione
|
||||
Return
|
||||
End If
|
||||
m_EnableAssembly = value
|
||||
WriteMainPrivateProfileString(S_GENERAL, K_RUNAS, If(m_EnableAssembly, "1", "0"))
|
||||
NotifyPropertyChanged("EnableAssembly")
|
||||
|
||||
+17
-6
@@ -1,6 +1,7 @@
|
||||
<EgtWPFLib5:EgtCustomWindow x:Class="OrderV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtDOORCreator="clr-namespace:EgtDOORCreator"
|
||||
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
||||
Title="{Binding Title}" Icon="/Resources/EgtDOOR.ico"
|
||||
TitleBarBrush="{StaticResource EgaltechBlue1}"
|
||||
@@ -10,7 +11,11 @@
|
||||
CloseCommand="{Binding CloseOptionsCommand,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}"
|
||||
Height="250" Width="350">
|
||||
|
||||
<Grid Margin="2">
|
||||
<Window.Resources>
|
||||
<EgtDOORCreator:TrueToFalse x:Key="TrueToFalse"/>
|
||||
</Window.Resources>
|
||||
|
||||
<Grid Margin="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.6*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
@@ -26,31 +31,36 @@
|
||||
</Grid.RowDefinitions>
|
||||
<TextBox Grid.Column="1" Grid.Row="0" Text="{Binding Customer}"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Margin="5,0,15,5"/>
|
||||
Margin="5,0,15,5"
|
||||
IsReadOnly="{Binding IsReadOnly}"/>
|
||||
<TextBlock Grid.Column="0" Grid.Row="0" Text="{Binding CustomerMsg}" VerticalAlignment="Center"
|
||||
Margin="15,0,0,0"
|
||||
Style="{StaticResource DoorParamsTxBl}"/>
|
||||
<TextBox Grid.Column="1" Grid.Row="1" Text="{Binding Elevation}"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Margin="5,0,15,5"/>
|
||||
Margin="5,0,15,5"
|
||||
IsReadOnly="{Binding IsReadOnly}"/>
|
||||
<TextBlock Grid.Column="0" Grid.Row="1" Text="{Binding ElevationMsg}" VerticalAlignment="Center"
|
||||
Margin="15,0,0,0"
|
||||
Style="{StaticResource DoorParamsTxBl}"/>
|
||||
<TextBox Grid.Column="1" Grid.Row="2" Text="{Binding Project}"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Margin="5,0,15,5"/>
|
||||
Margin="5,0,15,5"
|
||||
IsReadOnly="{Binding IsReadOnly}"/>
|
||||
<TextBlock Grid.Column="0" Grid.Row="2" Text="{Binding ProjectMsg}" VerticalAlignment="Center"
|
||||
Margin="15,0,0,0"
|
||||
Style="{StaticResource DoorParamsTxBl}"/>
|
||||
<TextBox Grid.Column="1" Grid.Row="3" Text="{Binding PO}"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Margin="5,0,15,5"/>
|
||||
Margin="5,0,15,5"
|
||||
IsReadOnly="{Binding IsReadOnly}"/>
|
||||
<TextBlock Grid.Column="0" Grid.Row="3" Text="{Binding POMsg}" VerticalAlignment="Center"
|
||||
Margin="15,0,0,0"
|
||||
Style="{StaticResource DoorParamsTxBl}"/>
|
||||
<TextBox Grid.Column="1" Grid.Row="4" Text="{Binding Line}"
|
||||
Style="{StaticResource DoorParamsTxBx}"
|
||||
Margin="5,0,15,5"/>
|
||||
Margin="5,0,15,5"
|
||||
IsReadOnly="{Binding IsReadOnly}"/>
|
||||
<TextBlock Grid.Column="0" Grid.Row="4" Text="{Binding LineMsg}" VerticalAlignment="Center"
|
||||
Margin="15,0,0,0"
|
||||
Style="{StaticResource DoorParamsTxBl}"/>
|
||||
@@ -62,6 +72,7 @@
|
||||
SelectedItem="{Binding Configuration}"/>-->
|
||||
<Button Grid.Column="1" Grid.Row="5" Margin="70,2,30,2"
|
||||
Content="{Binding SaveMsg}"
|
||||
IsEnabled="{Binding IsReadOnly, Converter={StaticResource TrueToFalse}}"
|
||||
IsDefault="True"
|
||||
IsCancel="True"/>
|
||||
</Grid>
|
||||
|
||||
@@ -60,6 +60,12 @@ Public Class OrderVM
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
Public ReadOnly Property IsReadOnly As Boolean
|
||||
Get
|
||||
Return OptionModule.ReadOnlyDDF
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property Customer As String
|
||||
Get
|
||||
If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) AndAlso
|
||||
|
||||
@@ -5,11 +5,13 @@
|
||||
<StackPanel Orientation="Horizontal" IsEnabled="{Binding EnableProjectManager}" Height="32">
|
||||
|
||||
<!--Barra superiore dei comandi-->
|
||||
<Button Command="{Binding NewCommand}" ToolTip="{Binding NewToolTip}" Focusable="False">
|
||||
<Button Command="{Binding NewCommand}" ToolTip="{Binding NewToolTip}" Focusable="False"
|
||||
IsEnabled="{Binding EnableModifyDDF}">
|
||||
<Image Source="{Binding NewProjectImg}" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<!--Visibility="{Binding VisibilityDeleteDDF}"-->
|
||||
<Button Command="{Binding DeleteCommand}" ToolTip="{Binding DeleteToolTip}" Focusable="False">
|
||||
<Button Command="{Binding DeleteCommand}" ToolTip="{Binding DeleteToolTip}" Focusable="False"
|
||||
IsEnabled="{Binding EnableModifyDDF}">
|
||||
<Image Source="{Binding DeleteProjectImg}" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Command="{Binding OpenCommand}" ToolTip="{Binding OpenToolTip}"
|
||||
@@ -31,31 +33,35 @@
|
||||
</Button.ContextMenu>
|
||||
<Image Source="/Resources/TopCommandBar/Open.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Command="{Binding ReloadCommand}" ToolTip="{Binding ReloadToolTip}" Focusable="False">
|
||||
<Button Command="{Binding ReloadCommand}" ToolTip="{Binding ReloadToolTip}" Focusable="False"
|
||||
IsEnabled="{Binding EnableModifyDDF}">
|
||||
<Image Source="/Resources/Refresh/RefreshDir.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Command="{Binding SaveCommand}" ToolTip="{Binding SaveToolTip}" Focusable="False">
|
||||
<Button Command="{Binding SaveCommand}" ToolTip="{Binding SaveToolTip}" Focusable="False"
|
||||
IsEnabled="{Binding EnableModifyDDF}">
|
||||
<Image Source="/Resources/TopCommandBar/Save.png" Stretch="Uniform"/>
|
||||
<!--<Image Source="{Binding IsModifiedImage}" Stretch="Uniform"/>-->
|
||||
</Button>
|
||||
<Button Command="{Binding DuplicaCommand}" ToolTip="{Binding DuplicaToolTip}" Focusable="False">
|
||||
<Button Command="{Binding DuplicaCommand}" ToolTip="{Binding DuplicaToolTip}" Focusable="False"
|
||||
IsEnabled="{Binding EnableModifyDDF}">
|
||||
<ContentControl>
|
||||
<Image Source="/Resources/TopCommandBar/SaveAs.png" Stretch="Uniform" />
|
||||
</ContentControl>
|
||||
</Button>
|
||||
<Button Command="{Binding CreateTemplateCommand}" ToolTip="{Binding TemplateDoorToolTip}" Focusable="False"
|
||||
Visibility="{Binding VisibilityTemplate}">
|
||||
Visibility="{Binding VisibilityTemplate}" IsEnabled="{Binding EnableModifyDDF}">
|
||||
<ContentControl>
|
||||
<Image Source="/Resources/TopCommandBar/SaveAsTemplate.png" Stretch="Uniform" />
|
||||
</ContentControl>
|
||||
</Button>
|
||||
<Button Command="{Binding CopyCommand}" ToolTip="{Binding CopyToolTip}" Focusable="False">
|
||||
<Button Command="{Binding CopyCommand}" ToolTip="{Binding CopyToolTip}" Focusable="False"
|
||||
IsEnabled="{Binding EnableModifyDDF}">
|
||||
<ContentControl>
|
||||
<Image Source="/Resources/TopCommandBar/Export.png" Stretch="Uniform" />
|
||||
</ContentControl>
|
||||
</Button>
|
||||
<Button Command="{Binding OpenCamCommand}" ToolTip="{Binding OpenCamToolTip}" Focusable="False"
|
||||
Visibility="{Binding VisibilityEgtCAM}">
|
||||
Visibility="{Binding VisibilityEgtCAM}" IsEnabled="{Binding EnableModifyDDF}">
|
||||
<ContentControl>
|
||||
<Image Source="/Resources/EgtCAM5.png" Stretch="Uniform" />
|
||||
</ContentControl>
|
||||
@@ -76,16 +82,17 @@
|
||||
</ContentControl>
|
||||
</Button>-->
|
||||
<Button Command="{Binding CreateAssemblyCommand}" ToolTip="{Binding CreateAssemblyToolTip}" Focusable="False"
|
||||
Visibility="{Binding VisibilityCreateAssembly}">
|
||||
Visibility="{Binding VisibilityCreateAssembly}" IsEnabled="{Binding EnableModifyDDF}">
|
||||
<ContentControl>
|
||||
<Image Source="/Resources/TopCommandBar/Create Assembly.png" Stretch="Uniform" />
|
||||
</ContentControl>
|
||||
</Button>
|
||||
<Button Command="{Binding OptionsCommand}" ToolTip="{Binding OptionsToolTip}" Focusable="False"
|
||||
Width="{Binding RelativeSource={RelativeSource Self}, Path=ActualHeight}">
|
||||
Width="{Binding RelativeSource={RelativeSource Self}, Path=ActualHeight}" IsEnabled="{Binding EnableModifyDDF}">
|
||||
<Image Source="/Resources/TopCommandBar/Options.png" Height="22" />
|
||||
</Button>
|
||||
<Button Command="{Binding SendFeedbackCommand}" ToolTip="{Binding SendFeedbackToolTip}" Focusable="False">
|
||||
<Button Command="{Binding SendFeedbackCommand}" ToolTip="{Binding SendFeedbackToolTip}" Focusable="False"
|
||||
IsEnabled="{Binding EnableModifyDDF}">
|
||||
<Image Source="/Resources/TopCommandBar/Send.png" Height="22" Margin="3,0,3,0" />
|
||||
</Button>
|
||||
<Button Command="{Binding GuideCommand}" ToolTip="{Binding GuideToolTip}" Focusable="False">
|
||||
@@ -97,12 +104,14 @@
|
||||
<RadioButton Style="{StaticResource ModeButton}" Visibility="{Binding DisableHM}"
|
||||
ToolTip="{Binding DoorToolTip}"
|
||||
IsChecked="{Binding DoorIsChecked}"
|
||||
Content="{Binding DoorToolTip}">
|
||||
Content="{Binding DoorToolTip}"
|
||||
IsEnabled="{Binding EnableModifyDDF}">
|
||||
</RadioButton>
|
||||
<!--Hardware-->
|
||||
<RadioButton Style="{StaticResource ModeButton}" Visibility="{Binding DisableHM}"
|
||||
Command="{Binding HardwareCommand}" ToolTip="{Binding HardwareToolTip}"
|
||||
Content="{Binding HardwareToolTip}">
|
||||
Content="{Binding HardwareToolTip}"
|
||||
IsEnabled="{Binding EnableModifyDDF}">
|
||||
</RadioButton>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
|
||||
@@ -120,6 +120,13 @@ Public Class ProjectManagerVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' se in sola lettura il programma allora abilito solo i camndi Apertura e Stampa
|
||||
Public ReadOnly Property EnableModifyDDF As Boolean
|
||||
Get
|
||||
Return Not OptionModule.ReadOnlyDDF
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdNew As ICommand
|
||||
Private m_cmdDelete As ICommand
|
||||
@@ -321,7 +328,22 @@ Public Class ProjectManagerVM
|
||||
End If
|
||||
' se annullo la creazione di un nuovo direttorio, rimango in quello attuale (verifico che l'ultimo file non sia già in lettura)
|
||||
If Not SaveFileDialogWnd.ShowDialog Then
|
||||
Utility.OutLog("Annullata la creazione di un nuovo progetto")
|
||||
Utility.OutLog("Annullata la creazione di un nuovo progetto")
|
||||
If Not IsNothing(Map.refAssemblyManagerVM.CurrProject) AndAlso Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) Then
|
||||
If Not String.IsNullOrEmpty(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.GraphicName) Then
|
||||
If Not Utility.IsFileLocked(Map.refAssemblyManagerVM.CurrProject.Name, Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.GraphicName) Then
|
||||
Utility.OutLog("Apertura progetto : " & Map.refAssemblyManagerVM.CurrProject.Name)
|
||||
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName = Map.refAssemblyManagerVM.CurrProject.SelAssemblyName
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Return
|
||||
End If
|
||||
' Se decido di continuare la creazione controllo che il direttorio non esista
|
||||
Dim MsgResult As MessageBoxResult = MessageBoxResult.Yes
|
||||
If Directory.Exists(SaveFileDialog.FileName) Then
|
||||
' se il direttorio contiene almento un file di .lock esco
|
||||
If Utility.IsFileLocked(SaveFileDialog.FileName) Then
|
||||
If Not IsNothing(Map.refAssemblyManagerVM.CurrProject) AndAlso Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) Then
|
||||
If Not String.IsNullOrEmpty(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.GraphicName) Then
|
||||
If Not Utility.IsFileLocked(Map.refAssemblyManagerVM.CurrProject.Name, Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.GraphicName) Then
|
||||
@@ -332,78 +354,63 @@ Public Class ProjectManagerVM
|
||||
End If
|
||||
Return
|
||||
End If
|
||||
' Se decido di continuare la creazione controllo che il direttorio non esista
|
||||
Dim MsgResult As MessageBoxResult = MessageBoxResult.Yes
|
||||
If Directory.Exists(SaveFileDialog.FileName) Then
|
||||
' se il direttorio contiene almento un file di .lock esco
|
||||
If Utility.IsFileLocked(SaveFileDialog.FileName) Then
|
||||
If Not IsNothing(Map.refAssemblyManagerVM.CurrProject) AndAlso Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) Then
|
||||
If Not String.IsNullOrEmpty(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.GraphicName) Then
|
||||
If Not Utility.IsFileLocked(Map.refAssemblyManagerVM.CurrProject.Name, Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.GraphicName) Then
|
||||
Utility.OutLog("Apertura progetto : " & Map.refAssemblyManagerVM.CurrProject.Name)
|
||||
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName = Map.refAssemblyManagerVM.CurrProject.SelAssemblyName
|
||||
End If
|
||||
|
||||
' Vuoi sovrascrivere il direttorio?
|
||||
String.Format(EgtMsg(50526), SaveFileDialog.FileName)
|
||||
MsgResult = MessageBox.Show(String.Format(EgtMsg(50526), SaveFileDialog.FileName), EgtMsg(50144), MessageBoxButton.YesNo, MessageBoxImage.Asterisk)
|
||||
' se decido di non cancellare il direttorio esco
|
||||
If MsgResult = MessageBoxResult.No Then
|
||||
Utility.OutLog("Annullata sovrascrittura delprogetto esistente : " & SaveFileDialog.FileName)
|
||||
If Not IsNothing(Map.refAssemblyManagerVM.CurrProject) AndAlso Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) Then
|
||||
If Not String.IsNullOrEmpty(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.GraphicName) Then
|
||||
If Not Utility.IsFileLocked(Map.refAssemblyManagerVM.CurrProject.Name, Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.GraphicName) Then
|
||||
Utility.OutLog("Apertura progetto : " & Map.refAssemblyManagerVM.CurrProject.Name)
|
||||
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName = Map.refAssemblyManagerVM.CurrProject.SelAssemblyName
|
||||
End If
|
||||
End If
|
||||
Return
|
||||
End If
|
||||
|
||||
' Vuoi sovrascrivere il direttorio?
|
||||
String.Format(EgtMsg(50526), SaveFileDialog.FileName)
|
||||
MsgResult = MessageBox.Show(String.Format(EgtMsg(50526), SaveFileDialog.FileName), EgtMsg(50144), MessageBoxButton.YesNo, MessageBoxImage.Asterisk)
|
||||
' se decido di non cancellare il direttorio esco
|
||||
If MsgResult = MessageBoxResult.No Then
|
||||
Utility.OutLog("Annullata sovrascrittura delprogetto esistente : " & SaveFileDialog.FileName)
|
||||
If Not IsNothing(Map.refAssemblyManagerVM.CurrProject) AndAlso Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) Then
|
||||
If Not String.IsNullOrEmpty(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.GraphicName) Then
|
||||
If Not Utility.IsFileLocked(Map.refAssemblyManagerVM.CurrProject.Name, Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.GraphicName) Then
|
||||
Utility.OutLog("Apertura progetto : " & Map.refAssemblyManagerVM.CurrProject.Name)
|
||||
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName = Map.refAssemblyManagerVM.CurrProject.SelAssemblyName
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Return
|
||||
End If
|
||||
|
||||
' cancello il direttorio
|
||||
Try
|
||||
Directory.Delete(SaveFileDialog.FileName, True)
|
||||
Utility.OutLog("Sovrascrivo il progetto : " & SaveFileDialog.FileName)
|
||||
Catch ex As Exception
|
||||
' 50527 = Impossible to overwrite {0}
|
||||
MessageBox.Show(String.Format(EgtMsg(50527), SaveFileDialog.FileName), EgtMsg(501001), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return
|
||||
End Try
|
||||
Return
|
||||
End If
|
||||
' Se decido di non sovrascrivere allora rimango in quello attuale
|
||||
|
||||
Utility.OutLog("Creazione nuovo progetto : " & SaveFileDialog.FileName)
|
||||
' Creo nuovo progetto
|
||||
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nNothingSelected
|
||||
Directory.CreateDirectory(SaveFileDialog.FileName)
|
||||
Dim CurrProject As Project = New Project
|
||||
' salvo il riferimento al progetto corrente
|
||||
m_CurrProject = CurrProject
|
||||
' salvo path progetto
|
||||
If SaveFileDialog.FileName.EndsWith("\") Then
|
||||
SaveFileDialog.FileName = SaveFileDialog.FileName.Remove(SaveFileDialog.FileName.LastIndexOf("\"))
|
||||
End If
|
||||
CurrProject.Name = SaveFileDialog.FileName
|
||||
' Ripulisco lista porte
|
||||
CurrProject.AssemblyList.Clear()
|
||||
EgtNewFile()
|
||||
EgtZoom(ZM.ALL)
|
||||
Map.refAssemblyManagerVM.CurrProject = CurrProject
|
||||
Map.refMainWindowVM.ProjectNameMsg = CurrProject.Name
|
||||
' Creo nuova porta
|
||||
Map.refAssemblyManagerVM.AddAssembly()
|
||||
' Map.refOptionsVM.MyProjectDir = CurrProject.Name
|
||||
If Not IsNothing(CurrProject.SelAssemblyName) AndAlso Not String.IsNullOrEmpty(CurrProject.SelAssemblyName.GraphicName) Then
|
||||
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName = CurrProject.SelAssemblyName
|
||||
End If
|
||||
Map.refAssemblyManagerVM.VisibilityDoorList = Visibility.Visible
|
||||
Return
|
||||
' cancello il direttorio
|
||||
Try
|
||||
Directory.Delete(SaveFileDialog.FileName, True)
|
||||
Utility.OutLog("Sovrascrivo il progetto : " & SaveFileDialog.FileName)
|
||||
Catch ex As Exception
|
||||
' 50527 = Impossible to overwrite {0}
|
||||
MessageBox.Show(String.Format(EgtMsg(50527), SaveFileDialog.FileName), EgtMsg(501001), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return
|
||||
End Try
|
||||
End If
|
||||
' Se decido di non sovrascrivere allora rimango in quello attuale
|
||||
|
||||
Utility.OutLog("Creazione nuovo progetto : " & SaveFileDialog.FileName)
|
||||
' Creo nuovo progetto
|
||||
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nNothingSelected
|
||||
Directory.CreateDirectory(SaveFileDialog.FileName)
|
||||
Dim CurrProject As Project = New Project
|
||||
' salvo il riferimento al progetto corrente
|
||||
m_CurrProject = CurrProject
|
||||
' salvo path progetto
|
||||
If SaveFileDialog.FileName.EndsWith("\") Then
|
||||
SaveFileDialog.FileName = SaveFileDialog.FileName.Remove(SaveFileDialog.FileName.LastIndexOf("\"))
|
||||
End If
|
||||
CurrProject.Name = SaveFileDialog.FileName
|
||||
' Ripulisco lista porte
|
||||
CurrProject.AssemblyList.Clear()
|
||||
EgtNewFile()
|
||||
EgtZoom(ZM.ALL)
|
||||
Map.refAssemblyManagerVM.CurrProject = CurrProject
|
||||
Map.refMainWindowVM.ProjectNameMsg = CurrProject.Name
|
||||
' Creo nuova porta
|
||||
Map.refAssemblyManagerVM.AddAssembly()
|
||||
' Map.refOptionsVM.MyProjectDir = CurrProject.Name
|
||||
If Not IsNothing(CurrProject.SelAssemblyName) AndAlso Not String.IsNullOrEmpty(CurrProject.SelAssemblyName.GraphicName) Then
|
||||
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName = CurrProject.SelAssemblyName
|
||||
End If
|
||||
Map.refAssemblyManagerVM.VisibilityDoorList = Visibility.Visible
|
||||
Return
|
||||
End If
|
||||
'-------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
'Prima di tutto chiedo se vuole aprire un template
|
||||
@@ -469,6 +476,7 @@ Public Class ProjectManagerVM
|
||||
' creo un nuovo assemblato
|
||||
Dim Local_AssemblyName As New AssemblyName
|
||||
Local_AssemblyName.Name = FilePathComplete
|
||||
Local_AssemblyName.GraphicName = Path.GetFileNameWithoutExtension(FilePathComplete)
|
||||
m_CurrProject.AssemblyList.Add(Local_AssemblyName)
|
||||
' Seleziono AssembyName creato
|
||||
m_CurrProject.SelAssemblyName = Local_AssemblyName
|
||||
@@ -1011,9 +1019,10 @@ Public Class ProjectManagerVM
|
||||
End If
|
||||
CurrProject.SelAssemblyName = ItemFile
|
||||
'If OptionModule.m_SingleDoor Then
|
||||
Map.refMainWindowVM.ProjectNameMsg = OptionModule.m_sLastProject
|
||||
Utility.OutLog("Blocco progetto : " & CurrProject.SelAssemblyName.GraphicName)
|
||||
Utility.LockDir(CurrProject.Name, CurrProject.SelAssemblyName.GraphicName)
|
||||
'Map.refMainWindowVM.ProjectNameMsg = OptionModule.m_sLastProject
|
||||
Dim sFileName As String = Path.GetFileNameWithoutExtension(CurrProject.SelAssemblyName.Name)
|
||||
Utility.OutLog("Blocco progetto : " & sFileName)
|
||||
Utility.LockDir(CurrProject.Name, sFileName)
|
||||
'End If
|
||||
Return
|
||||
End If
|
||||
@@ -1311,11 +1320,26 @@ Public Class ProjectManagerVM
|
||||
Return
|
||||
End If
|
||||
'Verifico che tutto sia salvato, altrimenti esco con messaggio
|
||||
If Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified() Then
|
||||
' Project must be saved before copying
|
||||
MessageBox.Show(EgtMsg(50186), EgtMsg(50144), MessageBoxButton.OK, MessageBoxImage.Warning)
|
||||
Return
|
||||
If Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified Then
|
||||
'' Project must be saved before copying
|
||||
'MessageBox.Show(EgtMsg(50186), EgtMsg(50144), MessageBoxButton.OK, MessageBoxImage.Warning)
|
||||
' 50177=Do you want to save the current changes?
|
||||
Dim ResultMsg As MessageBoxResult = MessageBox.Show(EgtMsg(50177), EgtMsg(50144), MessageBoxButton.OKCancel, MessageBoxImage.Warning)
|
||||
If ResultMsg = MessageBoxResult.OK Then
|
||||
' salvo e continuo
|
||||
Save()
|
||||
Else
|
||||
' esco
|
||||
Return
|
||||
End If
|
||||
End If
|
||||
'' elimino eventuali file .txt associati a ddf corrente (per lettura dei messaggi di errore stampati nel dal log del CAM5)
|
||||
'Dim FileLog As String = Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.Name
|
||||
'FileLog = FileLog.Replace(DDF_EXTENSION, ".txt")
|
||||
'Try
|
||||
' File.Delete(FileLog)
|
||||
'Catch
|
||||
'End Try
|
||||
Dim Proc As New Process
|
||||
' Dim CurrFile As String = IniFile.m_sTempDir & "\CurrPart" & DDF_EXTENSION
|
||||
Dim CurrFile As String = Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.Name
|
||||
@@ -1323,7 +1347,8 @@ Public Class ProjectManagerVM
|
||||
Proc.StartInfo.FileName = IniFile.m_sEgtCameEXEPath
|
||||
' 0: creata una porta come descritta nel file riferito
|
||||
' 1 viene creata la porta e il suo programma di lavorazione sul centro di lavoro preconfigurato
|
||||
Proc.StartInfo.Arguments = """" & CurrFile & """ " & If((Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift, """1""", """0""")
|
||||
' Proc.StartInfo.Arguments = """" & CurrFile & """ " & If((Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift, """1""", """0""")
|
||||
Proc.StartInfo.Arguments = """" & CurrFile & """ " & """0"""
|
||||
If Not Proc.Start() Then
|
||||
' Error in starting EgtCam5.exe
|
||||
MessageBox.Show(EgtMsg(50567), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
@@ -1332,16 +1357,22 @@ Public Class ProjectManagerVM
|
||||
' Error in starting EgtCam5.exe
|
||||
MessageBox.Show(EgtMsg(50567), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
End Try
|
||||
Dim sError As String = String.Empty
|
||||
Dim nType As Integer = 0
|
||||
ShowGraphicError(sError, nType)
|
||||
If Not String.IsNullOrEmpty(sError) And nType > 0 Then
|
||||
'Proc.Kill()
|
||||
MessageBox.Show(sError, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
ElseIf Not String.IsNullOrEmpty(sError) And nType < 0 Then
|
||||
'Proc.Kill()
|
||||
MessageBox.Show(sError, EgtMsg(50144), MessageBoxButton.OK, MessageBoxImage.Warning)
|
||||
End If
|
||||
'Dim sError As String = String.Empty
|
||||
'Dim nType As Integer = 0
|
||||
'Dim nCountCycle As Integer = 0
|
||||
'' al massimo attendo 5 secondi
|
||||
'While Not (Proc.HasExited Or File.Exists(FileLog)) And nCountCycle < 50
|
||||
' Threading.Thread.Sleep(100)
|
||||
' nCountCycle += 1
|
||||
'End While
|
||||
'ShowGraphicError(sError, nType)
|
||||
'If Not String.IsNullOrEmpty(sError) And nType > 0 Then
|
||||
' 'Proc.Kill()
|
||||
' MessageBox.Show(sError, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
'ElseIf Not String.IsNullOrEmpty(sError) And nType < 0 Then
|
||||
' 'Proc.Kill()
|
||||
' MessageBox.Show(sError, EgtMsg(50144), MessageBoxButton.OK, MessageBoxImage.Warning)
|
||||
'End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Copy
|
||||
@@ -1463,6 +1494,7 @@ Public Class ProjectManagerVM
|
||||
' aggiungo il nome del file alla lista degli assemblati
|
||||
Dim Local_AssemblyName As New AssemblyName
|
||||
Local_AssemblyName.Name = SaveFileDialog.FileName
|
||||
Local_AssemblyName.GraphicName = Path.GetFileNameWithoutExtension(SaveFileDialog.FileName)
|
||||
LocalCurrProject.AssemblyList.Add(Local_AssemblyName)
|
||||
|
||||
' devo creare tutto l'assemblato (comando GoBack nel CompoPanel)
|
||||
@@ -1703,6 +1735,7 @@ Public Class ProjectManagerVM
|
||||
ErrorMessages = String.Empty
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Commands
|
||||
|
||||
Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
|
||||
|
||||
@@ -173,10 +173,15 @@ Public Class InstrumentPanelVM
|
||||
Private m_DimensioningLayer As Integer
|
||||
Public Sub LinearDimension(ByVal param As Object)
|
||||
GetDistIsChecked = False
|
||||
EgtSetCurrPartLayer(EgtGetFirstPart(), m_DimensioningLayer)
|
||||
If EgtSetCurrPartLayer(1, m_DimensioningLayer) Then
|
||||
|
||||
Dim nIndFirstPart As Integer = EgtGetFirstPart()
|
||||
m_DimensioningLayer = EgtGetFirstNameInGroup(nIndFirstPart, "AUX")
|
||||
If Not EgtSetCurrPartLayer(nIndFirstPart, m_DimensioningLayer) Then
|
||||
Map.refSceneManagerVM.GetController.ExecuteCommand(Controller.CMD.NEWPART)
|
||||
Map.refSceneManagerVM.GetController.ExecuteCommand(Controller.CMD.NEWLAYER)
|
||||
nIndFirstPart = EgtGetFirstPart()
|
||||
m_DimensioningLayer = EgtGetCurrLayer()
|
||||
EgtSetCurrPartLayer(1, m_DimensioningLayer)
|
||||
'EgtSetColor(m_DimensioningLayer, "BLACK")
|
||||
End If
|
||||
' blocco la pagina corrente
|
||||
|
||||
@@ -453,6 +453,7 @@ Public Class SceneManagerVM
|
||||
End Sub
|
||||
|
||||
Private Sub OnMouseSelectedPoint(ByVal sender As Object, ByVal PtP As Point3d, ByVal nSep As SEP, ByVal nId As Integer) Handles m_ProjectScene.OnMouseSelectedPoint
|
||||
EgtSetCurrentContext(Map.refSceneManagerVM.ProjectScene.GetCtx())
|
||||
Dim bDone As Boolean = (Keyboard.Modifiers And ModifierKeys.Control) <> ModifierKeys.Control
|
||||
m_Controller.MouseSelectedPoint(PtP, nSep, nId, bDone)
|
||||
End Sub
|
||||
|
||||
Reference in New Issue
Block a user