Aggiunto metodo x salvare bunk...

This commit is contained in:
Samuele E. Locatelli
2019-11-06 19:39:56 +01:00
parent bf6b28d594
commit cb604cf9bf
6 changed files with 300 additions and 148 deletions
+78 -35
View File
@@ -1,5 +1,4 @@
Imports NKC_SDK
Imports SteamWare
Public Class Form1
@@ -9,53 +8,50 @@ Public Class Form1
' DEV: https : http://localhost:44388/
Dim baseUrl As String = "http://seriate.steamware.net:8083/NKC/"
Dim currNKC As NKC = New NKC(baseUrl)
Dim currentBunk As ProdBunk = Nothing
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
' invio notifica che c'è una busta da processare
Dim redKey = $"PROVA:CURR"
' scrivo su REDIS
memLayer.ML.setRSV(redKey, "ciao " & DateTime.Now.ToString())
'ComLib.sendMaterials()
Label1.Text = memLayer.ML.getRSV(redKey)
'Dim x As New Takt
'x = readTakt("PROD", "20190821.1")
'x.StackList(0).PanelsList(0).Printing()
'Dim d = memLayer.ML.connRedis.Configure.
'Dim h = memLayer.ML.connRedis
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles btnReset.Click
' resetto TUTTE le date e salvo il bunk!
currentBunk.SheetList(cmbSheet.SelectedIndex).Printing.DtStart = Nothing
currentBunk.SheetList(cmbSheet.SelectedIndex).Printing.DtEnd = Nothing
currentBunk.SheetList(cmbSheet.SelectedIndex).Machining.DtStart = Nothing
currentBunk.SheetList(cmbSheet.SelectedIndex).Machining.DtEnd = Nothing
currentBunk.SheetList(cmbSheet.SelectedIndex).Unloading.DtStart = Nothing
currentBunk.SheetList(cmbSheet.SelectedIndex).Unloading.DtEnd = Nothing
' salvo!
currNKC.saveBunk(currentBunk)
'' invio notifica che c'è una busta da processare
'Dim redKey = $"PROVA:CURR"
'' scrivo su REDIS
'memLayer.ML.setRSV(redKey, "ciao " & DateTime.Now.ToString())
''ComLib.sendMaterials()
'Label1.Text = memLayer.ML.getRSV(redKey)
''Dim x As New Takt
''x = readTakt("PROD", "20190821.1")
''x.StackList(0).PanelsList(0).Printing()
''Dim d = memLayer.ML.connRedis.Configure.
''Dim h = memLayer.ML.connRedis
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
' recupero BUNK!
Dim getFirstBunk = currNKC.getFirstBunk
'' chiamata diretta redis + DB
'Dim getFirstBunk = ComLib.prodGetFirstBunk()
' ho un bunk coi suoi pannelli...
Label1.Text = $"Trovato il bunk {getFirstBunk.BunkId} costituito da {getFirstBunk.SheetList.Count} pannelli"
' salvo bunk corrente
txtCurrBunk.Text = getFirstBunk.BunkId
' visualizzo btn nextBunk
btnNextBunk.Visible = True
lblNextBunk.Visible = True
lblNextBunk.Text = "..."
End Sub
Private Sub cmbSheet_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cmbSheet.SelectedIndexChanged
' selezione cambiata su elenco sheet (dal primo all'ultimo a runtime OBBLIGATORIO)
updateDataButtons()
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles btnPrintStart.Click
' iniziato paint x sheet selezionato
End Sub
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles btnPrintEnd.Click
' completato paint x sheet selezionato
End Sub
@@ -77,4 +73,51 @@ Public Class Form1
End If
End Sub
Private Sub btnLoadBunk_Click(sender As Object, e As EventArgs) Handles btnLoadBunk.Click
' recupero BUNK!
currentBunk = currNKC.getFirstBunk
'' chiamata diretta redis + DB
'Dim getFirstBunk = ComLib.prodGetFirstBunk()
' ho un bunk coi suoi pannelli...
Label1.Text = $"Trovato il bunk {currentBunk.BunkId} costituito da {currentBunk.SheetList.Count} pannelli"
' salvo bunk corrente
txtCurrBunk.Text = currentBunk.BunkId
' visualizzo btn nextBunk
btnNextBunk.Visible = True
lblNextBunk.Visible = True
lblNextBunk.Text = "..."
' popolo il selettore dei fogli...
cmbSheet.DataSource = currentBunk.SheetList
updateDataButtons()
End Sub
Private Sub updateDataButtons()
' imposto dateora ed in base ai valori dt del currBunk abilito o meno i buttons...
txtPrintStart.Text = currentBunk.SheetList(cmbSheet.SelectedIndex).Printing.DtStart.ToString()
txtPrintEnd.Text = currentBunk.SheetList(cmbSheet.SelectedIndex).Printing.DtEnd.ToString()
txtWorkStart.Text = currentBunk.SheetList(cmbSheet.SelectedIndex).Machining.DtStart.ToString()
txtWorkEnd.Text = currentBunk.SheetList(cmbSheet.SelectedIndex).Machining.DtEnd.ToString()
txtUnlStart.Text = currentBunk.SheetList(cmbSheet.SelectedIndex).Unloading.DtStart.ToString()
txtUnlEnd.Text = currentBunk.SheetList(cmbSheet.SelectedIndex).Unloading.DtEnd.ToString()
btnPrintStart.Enabled = String.IsNullOrWhiteSpace(txtPrintStart.Text)
btnPrintEnd.Enabled = String.IsNullOrWhiteSpace(txtPrintEnd.Text)
btnWorkStart.Enabled = String.IsNullOrWhiteSpace(txtWorkStart.Text)
btnWorkEnd.Enabled = String.IsNullOrWhiteSpace(txtWorkEnd.Text)
btnUnlStart.Enabled = String.IsNullOrWhiteSpace(txtUnlStart.Text)
btnUnlEnd.Enabled = String.IsNullOrWhiteSpace(txtUnlEnd.Text)
End Sub
End Class