Retour sommaire : Direct Planning - Formules - Voir aussi : Syntaxe Visual Basic

Information technique principale

Sur le ticket on souhaite afficher en 3eme ligne l’information technique essentielle.

Selon la section du ticket, la nature de l’information à afficher est différente.

'-------------------------------------------------------------------------------------------
' Première ligne d'infos techniques selon la section
'-------------------------------------------------------------------------------------------
Select Case Tache.Code_Section
    
Case "IMP"
    '------ Impression ------
              
    ' Teintes de la tache courante
    Dim ListeTeintes as new System.Collections.Generic.List(of String)()
    ListeTeintes.add(Tache.Information_Process(3).Zone_Configurable_1)
    ListeTeintes.add(Tache.Information_Process(3).Zone_Configurable_2)
    ListeTeintes.add(Tache.Information_Process(3).Zone_Configurable_3)
    ListeTeintes.add(Tache.Information_Process(3).Zone_Configurable_4)
    ListeTeintes.add(Tache.Information_Process(3).Zone_Configurable_5)
    ListeTeintes.add(Tache.Information_Process(3).Zone_Configurable_6)
    
    ' Teintes de la tache précédente
    Dim ListeTeintes_Prec as new System.Collections.Generic.List(of String)()
    ListeTeintes_Prec.add(TachePrecedente.Information_Process(3).Zone_Configurable_1)
    ListeTeintes_Prec.add(TachePrecedente.Information_Process(3).Zone_Configurable_2)
    ListeTeintes_Prec.add(TachePrecedente.Information_Process(3).Zone_Configurable_3)
    ListeTeintes_Prec.add(TachePrecedente.Information_Process(3).Zone_Configurable_4)
    ListeTeintes_Prec.add(TachePrecedente.Information_Process(3).Zone_Configurable_5)
    ListeTeintes_Prec.add(TachePrecedente.Information_Process(3).Zone_Configurable_6)
    
    ' On consitue la listes des teintes
    ' Après chaque teinte on met une étoile si elle est nouvelle par rapport à la tache précédente
    '----------------------------------------------------------------------------------------------
    Dim ChaineListeTeintes as string = ""
    
    For Each Teinte As String In ListeTeintes
        if Teinte <> "" then
            if  ListeTeintes_Prec.contains(Teinte) then
                ' Couleur existant dans la tache précédente
                ChaineListeTeintes &= Teinte & "  "
            else
                ' Nouvelle couleur, pas présente dans la liste des teintes des tâches précédentes
                ChaineListeTeintes &= Teinte & "(*)  "
            end if
        end if
    Next

    '----- Construction du libellé ------------
    ' On va afficher d'abord les couleurs primaires sous la forme compacte : BCMY
    ' puis on va ajouter à la suite le nombre de couleurs non primaires
    ' Exemple : CY+3c , pour une impression 5 couleurs, dont 2 primaires CYAN et YELLOW et 3 teintes non primaires
    
    ' Nb couleurs 
    Dim NbCouleurs as integer = Tache.Information_Process(2).Zone_Configurable_2
    Dim NbTeintesHorsPrimaire as Integer = NbCouleurs

    Libelle = ""
    
    if ListeTeintes.contains("BLACK") Then
        Libelle &= "B"
        NbTeintesHorsPrimaire -= 1
    end if
    if ListeTeintes.contains("CYAN") Then
        Libelle &= "C"
        NbTeintesHorsPrimaire -= 1
    end if
    if ListeTeintes.contains("MAGENTA") Then
        Libelle &= "M"
        NbTeintesHorsPrimaire -= 1
    end if
    if ListeTeintes.contains("YELLOW") Then
        Libelle &= "Y"
        NbTeintesHorsPrimaire -= 1
    end if
    NbTeintesHorsPrimaire = math.max(NbTeintesHorsPrimaire,0)    ' Pas de nb de teintes négatives (en cas d'erreur de saisie)
    
    ' Nb teintes hors QUADRI
    if NbTeintesHorsPrimaire > 0 Then
        if Libelle <> "" then
            libelle &= "+"
        end if
        Libelle &= NbTeintesHorsPrimaire & "c"
    end if
    
    if libelle = "" then
        Libelle = "Vernis seul"
    Else
        ' On ajoute la liste des teintes à la fin
        Libelle &= " : " & ChaineListeTeintes
    end if
    
    ' Si plaque vernis on l'indique
    Dim PlaqueVernis as string = Tache.Information_Process(3).Zone_Configurable_9
    if PlaqueVernis <> "" Then
        Libelle &= " / " & PlaqueVernis.replace("PV0","") & " Plaq.Vernis"
    end If
    
    
    
Case "DEC"
    '------ Découpe ------
    ' Forme de découpe et Nb poses
    Dim FormeDecoupe as string = Tache.Entite(2).Zone_Configurable_4
    libelle = FormeDecoupe.replace("EP0", "") & " Forme " & Tache.Information_Process(5).Zone_Configurable_2 & " poses"
    
    '---- compléxité de découpe ----
    Dim CodeDifficulteDecoupe as string = Tache.Information_Process(5).Zone_Configurable_10
    if CodeDifficulteDecoupe = "2" Then
        '- si découpe complexe ou ajoute une étoile devant le N° de forme
        Libelle = "*" & libelle & " - Découpe complexe"
    end if
    
Case "COL"
    '------ Collage ------
    ' Forme de découpe (si même forme de découpe les réglage de la plieuse/colleuse seront identiques)
    libelle = Tache.Entite(2).Zone_Configurable_4.replace("EP0", "") 
    
End Select

Information technique secondaire

Sur le ticket on souhaite afficher en 4eme ligne une information technique complémentaire.

Select Case Tache.Code_Section
    
Case "IMP"
    '---- Impression ----
    ' Nb de teintes nouvelles par rapport à la tâche précédentes
    
    Dim ListeTeintes as new System.Collections.Generic.List(of String)()
    ListeTeintes.add(Tache.Information_Process(3).Zone_Configurable_1)
    ListeTeintes.add(Tache.Information_Process(3).Zone_Configurable_2)
    ListeTeintes.add(Tache.Information_Process(3).Zone_Configurable_3)
    ListeTeintes.add(Tache.Information_Process(3).Zone_Configurable_4)
    ListeTeintes.add(Tache.Information_Process(3).Zone_Configurable_5)
    ListeTeintes.add(Tache.Information_Process(3).Zone_Configurable_6)
    
    ' Teintes de la tache précédente
    Dim ListeTeintes_Prec as new System.Collections.Generic.List(of String)()
    ListeTeintes_Prec.add(TachePrecedente.Information_Process(3).Zone_Configurable_1)
    ListeTeintes_Prec.add(TachePrecedente.Information_Process(3).Zone_Configurable_2)
    ListeTeintes_Prec.add(TachePrecedente.Information_Process(3).Zone_Configurable_3)
    ListeTeintes_Prec.add(TachePrecedente.Information_Process(3).Zone_Configurable_4)
    ListeTeintes_Prec.add(TachePrecedente.Information_Process(3).Zone_Configurable_5)
    ListeTeintes_Prec.add(TachePrecedente.Information_Process(3).Zone_Configurable_6)
    
    Dim NbCouleursDifferentes as integer = 0
    
    For Each Teinte As String In ListeTeintes
        if Teinte <> "" then
            if ListeTeintes_Prec.contains(Teinte) then
            else
                NbCouleursDifferentes += 1
            end if
        end if
    Next

    ' On affiche le nombre de couleurs différentes, par rapport à la tâche précédente
    if NbCouleursDifferentes = 0 then
        Libelle = "Aucune nouvelle couleur par rapport à la tâche précédente"
    else
        Libelle = NbCouleursDifferentes & " coul. différentes par rapport à la tâche précédente"
    end If
    
    
Case "DEC"
    '------ Découpe ------
    ' Forme braille intégré
    Dim FormeBraille as string = Tache.Information_Process(5).Zone_Configurable_3
    if FormeBraille <> "" then
        Libelle = FormeBraille.replace("BI0","") & " Braille"
    end if
    
Case "COL"
    '------ Collage ------
    ' Si opération accubraille
    if Tache.Code_Operation = "COLACC" Then
        Libelle = "Accubraille - " 
    end If
    ' ECMA + ABH
    Libelle = Libelle & Tache.Entite(2).Zone_Configurable_6 & " - " & Tache.Entite(2).Zone_Configurable_1
    
End Select