diff --git a/DrawImport/DrawPageUC.xaml.vb b/DrawImport/DrawPageUC.xaml.vb index 4a5faae..797208f 100644 --- a/DrawImport/DrawPageUC.xaml.vb +++ b/DrawImport/DrawPageUC.xaml.vb @@ -105,6 +105,9 @@ Public Class DrawPageUC Return m_nSelectedLayer End Get End Property + Public Sub SetCurrLayer(ByVal nCurrLayer As Integer) + m_nSelectedLayer = nCurrLayer + End Sub Enum Pages MainComponent diff --git a/DrawImport/SideAngleUc.xaml.vb b/DrawImport/SideAngleUc.xaml.vb index a30f4b1..11857f9 100644 --- a/DrawImport/SideAngleUc.xaml.vb +++ b/DrawImport/SideAngleUc.xaml.vb @@ -75,10 +75,12 @@ Public Class SideAngleUC ' Inizializzo lati per angoli e per gocciolatoi (ne compilo la lista e aggiungo la scritta nel disegno) InitSides() - ' Aggiorno testi nel disegno e creo i gocciolatoi - RefreshSideAngleText() + '' Aggiorno testi nel disegno e creo i gocciolatoi + 'RefreshSideAngleText() ' Aggiorno check e valori RefreshCheckAndValue() + ' Aggiorno testi nel disegno e creo i gocciolatoi + RefreshSideAngleText() ' Gestisco visualizzazione di tutti i parametri If m_Mode = ModeOpt.SIDEANGLE Then @@ -179,6 +181,10 @@ Public Class SideAngleUC ' Imposto contesto corrente EgtSetCurrentContext(m_MainWindow.m_DrawPageUC.DrawScene.GetCtx()) ' Ricavo nome primo pezzo e lo sistemo + If m_Mode = ModeOpt.ENGRAVE And m_MainWindow.m_DrawPageUC.SelectedLayer = GDB_ID.NULL Then + PartId = EgtGetFirstPart() + m_MainWindow.m_DrawPageUC.SetCurrLayer(EgtGetFirstNameInGroup(PartId, NAME_OUTLOOP)) + End If PartId = If(m_MainWindow.m_DrawPageUC.SelectedLayer <> GDB_ID.NULL, EgtGetFirstPart(), GDB_ID.NULL) ' Recupero nome layer con geometria di contorno (esterno o interno) del pezzo LoopId = m_MainWindow.m_DrawPageUC.SelectedLayer @@ -275,8 +281,8 @@ Public Class SideAngleUC ' Attualmente il vaore m_nCount è inizializzato ad "1".. ' Bottoni Prev Next If m_nCount <= MAX_LINES Then - PrevBtn.Visibility = Windows.Visibility.Hidden - NextBtn.Visibility = Windows.Visibility.Hidden + PrevBtn.Visibility= Windows.Visibility.Hidden + NextBtn.Visibility= Windows.Visibility.Hidden Else Grid.SetRow(PrevBtn, MAX_LINES - m_nShow) PrevBtn.Visibility = Windows.Visibility.Visible @@ -497,11 +503,10 @@ Public Class SideAngleUC If m_CallingPage = MainWindow.Pages.Draw Then ' Imposto contesto corrente EgtSetCurrentContext(m_MainWindow.m_DrawPageUC.DrawScene.GetCtx()) - ' Ricavo nome primo pezzo PartId = If(m_MainWindow.m_DrawPageUC.SelectedLayer <> GDB_ID.NULL, EgtGetFirstPart(), GDB_ID.NULL) ' Recupero nome layer con geometria di contorno (esterno o interno) del pezzo LoopId = m_MainWindow.m_DrawPageUC.SelectedLayer - ElseIf m_CallingPage = MainWindow.Pages.Import Then + ElseIf m_CallingPage = MainWindow.Pages.Import Then ' Imposto contesto corrente EgtSetCurrentContext(m_MainWindow.m_ImportPageUC.ImportScene.GetCtx()) ' Recupero nome pezzo @@ -568,8 +573,20 @@ Public Class SideAngleUC ' verifico se l'entità ha un gocciolatoio GetChBxFromIndex(nChIndex).IsChecked = Entity.bHaveDrip ' aggiorno i valore delle caselle di testo per le entità caricate (Start/End) - GetAngleTxBxFromIndex(nChIndex).Text = DoubleToString(Entity.dShortStart, 1) - GetHeelTxBxFromIndex(nChIndex).Text = LenToString(Entity.dShortStart, 1) + If m_Mode = ModeOpt.ENGRAVE Then + Dim dVal As Double = 0 + If StringToLen(GetPrivateProfileDouble(S_SIDES, K_ENGRAVESHORT & "A" & nIndex.ToString & "_Start", 0, m_MainWindow.GetIniFile()), dVal) Then + Entity.dShortStart = dVal + End If + If StringToLen(GetPrivateProfileDouble(S_SIDES, K_ENGRAVESHORT & "A" & nIndex.ToString & "_End", 0, m_MainWindow.GetIniFile()), dVal) Then + Entity.dShortEnd = dVal + End If + Else + 'GetAngleTxBxFromIndex(Index).Text = GetPrivateProfileDouble(S_SIDES, K_DRIPSHORT & "A" & nI.ToString & "_Start", 0, m_MainWindow.GetIniFile()) + 'GetHeelTxBxFromIndex(Index).Text = GetPrivateProfileDouble(S_SIDES, K_DRIPSHORT & "A" & nI.ToString & "_End", 0, m_MainWindow.GetIniFile()) + End If + GetAngleTxBxFromIndex(nChIndex).Text = LenToString(Entity.dShortStart, 1) + GetHeelTxBxFromIndex(nChIndex).Text = LenToString(Entity.dShortEnd, 1) Next End If End Sub