1. Ce site utilise des cookies. En continuant à utiliser ce site, vous acceptez l'utilisation des cookies. En savoir plus.
  2. Bonjour tout le monde ! Veillez consulter la Politique de forum pour comprendre nos règles, Merci a vous !
    Rejeter la notice

WM Champ Caméra pour lecture des codes Barres android

Discussion dans 'Windev Mobile' créé par LAPIPE2018, Sept 8, 2019.

  1. LAPIPE2018

    LAPIPE2018 Active Member
    MEMBRE WX

    Inscrit:
    Fev 17, 2018
    Messages:
    378
    J'aime reçus:
    158
    Bonsoir,
    Dans le champ Caméra pour lire le code
    il y a l'évènement décodage code barre
    il avec le code
    Code (Text):
    PROCÉDURE DécodeCodeBarre(cb est un CodeBarres)
    SAI_SansNom1=cb.ValeurBrute
     
    COmment faire. SVp, je cherche un exemple qui marche. Je trouve CBacpture lourd pour Android.
    Merci
     
    Tags:
  2. C0mrade

    C0mrade New Member

    Inscrit:
    Juil 25, 2019
    Messages:
    23
    J'aime reçus:
    3
    H
    you're actually on the right track.
    Read the contents of the QR Code / Bar Code at the "decodage of a bar code" event.
    All you have to do is display the result code.
    There is nothing more.
    windev decodes in string for you.
    This is (for guide and example) my decode part:

    [windev]
    PROCÉDURE DécodeCodeBarre(_barCode est un CodeBarres)
    i is int = 0
    _ScanNumIscr,_ScanGUIDAss,_ScanNomin is string
    _TerminalType is int

    FOR ALL STRING _currentStr OF _barCode.Content SEPARATED BY ";"
    i++
    SWITCH i
    CASE 1
    _ScanGUIDAss = _currentStr
    CASE 2
    _ScanNumIscr = _currentStr
    CASE 3
    _ScanNomin = _currentStr
    CASE 4
    _TerminalType = _currentStr
    END
    END

    <COMPILE SI TypeConfiguration=Android>
    VibrationTrigger(1000)
    <FIN>
    <COMPILE SI TypeConfiguration=iOS>
    VibrationTrigger()
    <FIN>

    _Obj_Scan.Nominativo = _ScanNomin
    _Obj_Scan.NumIscriz = _ScanNumIscr
    _Obj_Scan.GUIDAssociato = _ScanGUIDAss

    IF _TerminalType > 0 THEN
    _Obj_Scan.TerminalType = _TerminalType
    INT_InviaNotifica = True
    INT_InviaNotifica..State = Active
    ELSE
    INT_InviaNotifica = False
    INT_InviaNotifica..State = Grayed
    END

    IF _TerminalType > 0 THEN
    IF _TerminalType = 1 THEN
    STR_Codice = "Associato: "+ _ScanNomin + CR + "N. Iscrizione: " + _ScanNumIscr+ CR +"Terminale Android"
    ELSE IF _TerminalType = 2
    STR_Codice = "Associato: "+ _ScanNomin + CR + "N. Iscrizione: " + _ScanNumIscr+ CR +"Terminale iOS"
    END
    ELSE IF _TerminalType <= 0 THEN
    STR_Codice = "Associato: "+ _ScanNomin + CR + "N. Iscrizione: " + _ScanNumIscr+ CR +"WebScan/App v. 1"
    END
    [/windev]
     
    WX1331 et LAPIPE2018 aiment ça.
  3. LAPIPE2018

    LAPIPE2018 Active Member
    MEMBRE WX

    Inscrit:
    Fev 17, 2018
    Messages:
    378
    J'aime reçus:
    158

    Bonjour visiteur, Merci de vous Inscrire ou de vous connectez pour voir les liens!

    H
    you're actually on the right track.
    Read the contents of the QR Code / Bar Code at the "decodage of a bar code" event.
    All you have to do is display the result code.
    There is nothing more.
    windev decodes in string for you.
    This is (for guide and example) my decode part:

    [windev]
    PROCÉDURE DécodeCodeBarre(_barCode est un CodeBarres)
    i is int = 0
    _ScanNumIscr,_ScanGUIDAss,_ScanNomin is string
    _TerminalType is int

    FOR ALL STRING _currentStr OF _barCode.Content SEPARATED BY ";"
    i++
    SWITCH i
    CASE 1
    _ScanGUIDAss = _currentStr
    CASE 2
    _ScanNumIscr = _currentStr
    CASE 3
    _ScanNomin = _currentStr
    CASE 4
    _TerminalType = _currentStr
    END
    END

    <COMPILE SI TypeConfiguration=Android>
    VibrationTrigger(1000)
    <FIN>
    <COMPILE SI TypeConfiguration=iOS>
    VibrationTrigger()
    <FIN>

    _Obj_Scan.Nominativo = _ScanNomin
    _Obj_Scan.NumIscriz = _ScanNumIscr
    _Obj_Scan.GUIDAssociato = _ScanGUIDAss

    IF _TerminalType > 0 THEN
    _Obj_Scan.TerminalType = _TerminalType
    INT_InviaNotifica = True
    INT_InviaNotifica..State = Active
    ELSE
    INT_InviaNotifica = False
    INT_InviaNotifica..State = Grayed
    END

    IF _TerminalType > 0 THEN
    IF _TerminalType = 1 THEN
    STR_Codice = "Associato: "+ _ScanNomin + CR + "N. Iscrizione: " + _ScanNumIscr+ CR +"Terminale Android"
    ELSE IF _TerminalType = 2
    STR_Codice = "Associato: "+ _ScanNomin + CR + "N. Iscrizione: " + _ScanNumIscr+ CR +"Terminale iOS"
    END
    ELSE IF _TerminalType <= 0 THEN
    STR_Codice = "Associato: "+ _ScanNomin + CR + "N. Iscrizione: " + _ScanNumIscr+ CR +"WebScan/App v. 1"
    END
    [/windev]
    Cliquez pour agrandir...
    I was expecting the picture field to close autmaticaly. That is not the case. The think is who is suppose to close it ?
    Should I pour a Buton to close it ?
    Even the sample distribute by PCSOFT himself does not close. That's where I am confuse
     
  • LAPIPE2018

    LAPIPE2018 Active Member
    MEMBRE WX

    Inscrit:
    Fev 17, 2018
    Messages:
    378
    J'aime reçus:
    158

    Bonjour visiteur, Merci de vous Inscrire ou de vous connectez pour voir les liens!

    H
    you're actually on the right track.
    Read the contents of the QR Code / Bar Code at the "decodage of a bar code" event.
    All you have to do is display the result code.
    There is nothing more.
    windev decodes in string for you.
    This is (for guide and example) my decode part:

    [windev]
    PROCÉDURE DécodeCodeBarre(_barCode est un CodeBarres)
    i is int = 0
    _ScanNumIscr,_ScanGUIDAss,_ScanNomin is string
    _TerminalType is int

    FOR ALL STRING _currentStr OF _barCode.Content SEPARATED BY ";"
    i++
    SWITCH i
    CASE 1
    _ScanGUIDAss = _currentStr
    CASE 2
    _ScanNumIscr = _currentStr
    CASE 3
    _ScanNomin = _currentStr
    CASE 4
    _TerminalType = _currentStr
    END
    END

    <COMPILE SI TypeConfiguration=Android>
    VibrationTrigger(1000)
    <FIN>
    <COMPILE SI TypeConfiguration=iOS>
    VibrationTrigger()
    <FIN>

    _Obj_Scan.Nominativo = _ScanNomin
    _Obj_Scan.NumIscriz = _ScanNumIscr
    _Obj_Scan.GUIDAssociato = _ScanGUIDAss

    IF _TerminalType > 0 THEN
    _Obj_Scan.TerminalType = _TerminalType
    INT_InviaNotifica = True
    INT_InviaNotifica..State = Active
    ELSE
    INT_InviaNotifica = False
    INT_InviaNotifica..State = Grayed
    END

    IF _TerminalType > 0 THEN
    IF _TerminalType = 1 THEN
    STR_Codice = "Associato: "+ _ScanNomin + CR + "N. Iscrizione: " + _ScanNumIscr+ CR +"Terminale Android"
    ELSE IF _TerminalType = 2
    STR_Codice = "Associato: "+ _ScanNomin + CR + "N. Iscrizione: " + _ScanNumIscr+ CR +"Terminale iOS"
    END
    ELSE IF _TerminalType <= 0 THEN
    STR_Codice = "Associato: "+ _ScanNomin + CR + "N. Iscrizione: " + _ScanNumIscr+ CR +"WebScan/App v. 1"
    END
    [/windev]
    Cliquez pour agrandir...
    Hi,
    One more thing, what is _Obj_Scan ?
    Sorry, but I would like to share the project, so that you can test and see what to to.
     
  • C0mrade

    C0mrade New Member

    Inscrit:
    Juil 25, 2019
    Messages:
    23
    J'aime reçus:
    3
    hi

    _Obj_Scan is my class for stored result.

    I have created for you example with the plan the QR Code.

    Bonjour visiteur, Merci de vous Inscrire ou de vous connectez pour voir les liens!

    (project)

    Bonjour visiteur, Merci de vous Inscrire ou de vous connectez pour voir les liens!

    (app apk)
     
    suenodesign apprécie ceci.
  • LAPIPE2018

    LAPIPE2018 Active Member
    MEMBRE WX

    Inscrit:
    Fev 17, 2018
    Messages:
    378
    J'aime reçus:
    158
    Hi,

    Bonjour visiteur, Merci de vous Inscrire ou de vous connectez pour voir les liens!

    hi

    _Obj_Scan is my class for stored result.

    I have created for you example with the plan the QR Code.

    Bonjour visiteur, Merci de vous Inscrire ou de vous connectez pour voir les liens!

    (project)

    Bonjour visiteur, Merci de vous Inscrire ou de vous connectez pour voir les liens!

    (app apk)
    Cliquez pour agrandir...
    Thx, let me test
     
  • C0mrade

    C0mrade New Member

    Inscrit:
    Juil 25, 2019
    Messages:
    23
    J'aime reçus:
    3
    I hope I was helpful.
     
  • LAPIPE2018

    LAPIPE2018 Active Member
    MEMBRE WX

    Inscrit:
    Fev 17, 2018
    Messages:
    378
    J'aime reçus:
    158

    Bonjour visiteur, Merci de vous Inscrire ou de vous connectez pour voir les liens!

    hi

    _Obj_Scan is my class for stored result.

    I have created for you example with the plan the QR Code.

    Bonjour visiteur, Merci de vous Inscrire ou de vous connectez pour voir les liens!

    (project)

    Bonjour visiteur, Merci de vous Inscrire ou de vous connectez pour voir les liens!

    (app apk)
    Cliquez pour agrandir...
    It's OK for sample 1, 2 is not stable.
     
  • C0mrade

    C0mrade New Member

    Inscrit:
    Juil 25, 2019
    Messages:
    23
    J'aime reçus:
    3
    I tried it on Android 9/8 and 4.4w and had no problems.
    With which version of the system are you testing?
    Consider that I wanted to pass on the methodology, the app is certainly not a build version :).
     
  • LAPIPE2018

    LAPIPE2018 Active Member
    MEMBRE WX

    Inscrit:
    Fev 17, 2018
    Messages:
    378
    J'aime reçus:
    158

    Bonjour visiteur, Merci de vous Inscrire ou de vous connectez pour voir les liens!

    I tried it on Android 9/8 and 4.4w and had no problems.
    With which version of the system are you testing?
    Consider that I wanted to pass on the methodology, the app is certainly not a build version :).
    Cliquez pour agrandir...
    Hi,
    I am still diagnocising
     
  • Partager cette page

    Chargement...