Unused code - VI Analyzer

So, when you use the VI Analyzer, I said that I have a unused code segment and wonder if this is not the way to perform the operation, I'm eager. I'm sure that the code segment is indeed, but perhaps the question lies in the way that I'm trying to achieve. I'm trying to activate/disable menu items in the short program / stops. During the auto-indexation of an array in a loop for which can be done twice with the expected results?

If I have 2 paintings, 2 elements in each array, with those who go into a loop FOR. As FOR the loop run twice and pull the first elements in the first round, as both second in the second iteration?

A photo it probably a better way to illustrate this.

I am told that the 'Instruments' string constant is of unused code. Please help me to understand why this is?

I have not looked into the method VI analyzer uses to detect dead code, but the compiler is constant matrix building and silently replaces your constants + table build with just the constant table built.  I suggest do you the same thing, constant matrix use on the comic rather than build an array of constants.

Tags: NI Software

Similar Questions

  • Automatic temporal and speech codes Edition analyzes

    Hello

    I just got a whole lot of time codes (sequence) as part of an workflow of paper edition.

    Is it possible to import the time codes and be the first to create a new sequence of these timecodes?

    Also removed discourse analysis function, I had hoped there would be a way to analyze the speech of a sequence?

    Thanks for the tips

    Spencer

    Looks like you need to create a former EDL (Edit Decision List)

    Adobe Premiere Pro will import a format compatible with the CMX 3600

    Apple has very good explanation of what is an EDL and what he does.

    Information there at EDLMax on the appropriate formatting.

    It should be a model of spreadsheet somewhere, an EDL CMX generator out there somewhere, although I couldn't find one.

    There may be a solution using Adobe prelude - or at least use it in the future.

  • Norton 360, diagnosed with a peripheral unusable code-19

    Initial flag in Device Manager...

    Hardware devices inoperable

    Show invisible characters

    Problem: Norton 360 detected hardware devices inoperable.  Recommendation: You can configure these hardware devices. Run Device Manager to configure the hardware devices.

    Fix now... (Do not)

    This section lists the hardware devices that do not work. (is functional but with indicator in DM)

    Description and Data Type device problem

    Type CF Reader USB device

    Failure status of devices using the charger VxD (Code 19).

    Plug and Play ID WPDBUSENUMROOT\UMB\2 & 37C186B & 1 & STORAGE #VOLUME #1 & 19F7E59C & 0 & _? _USBSTOR #DISK & VEN_GENERIC...

    Type of device USB MS Reader

    Failure status of devices using the charger VxD (Code 19).

    Plug and Play ID WPDBUSENUMROOT\UMB\2 & 37C186B & 1 & STORAGE #VOLUME #1 & 19F7E59C & 0 & _? _USBSTOR #DISK & VEN_GENERIC...

    Type USB SD readers

    Failure status of devices using the charger VxD (Code 19).

    Plug and Play ID WPDBUSENUMROOT\UMB\2 & 37C186B & 1 & STORAGE #VOLUME #1 & 19F7E59C & 0 & _? _USBSTOR #DISK & VEN_GENERIC...

    Type of device USB SM Reader

    Failure status of devices using the charger VxD (Code 19).

    Plug and Play ID WPDBUSENUMROOT\UMB\2 & 37C186B & 1 & STORAGE #VOLUME #1 & 19F7E59C & 0 & _? _USBSTOR #DISK & VEN_GENERIC...

    Windows Vista operating system.   Unable to update the drivers, shoot bad shows in dir.  Help, please.

    Hello

    Sorry for the inconvenience. I'm Vineeth and I Support of Norton team.

    Can you please try the following steps:

    1. Open the Diagnostic report.
    2. Make a note of the name of the file that is displayed as a useless device.
    3. Open the Device Manager.
    4. Go to the view menu, and then click Show hidden devices.
    5. Under the list of hidden devices, check if the name of the file that you wrote in the diagnostic report is a symbol of yellow exclamation point or a red X mark.
    6. If all these entries are found, right click and then uninstall it.
    7. Restart the computer.

    Thank you!

    Vineeth

    Norton support

  • Analyze the table of variants

    I have a request, where we read binary data by Ethernet to high speed (~ 500 Hz). This data consists of hundreds of measures and other variables of all types (floats, integers, strings, etc.). I already have the code to analyze these data and store it in an array of variant.

    Now, I would like to take this array of variant and map each element to a particular variable.

    Because the data is stored in a predefined sequence (element #1 = speed, element #2 = power, element #3 =...), I considered looping through the array of varying and using a structure dealing with a case for each index of the array (see attachment). However, it is very heavy because the case structure has hundreds of cases (one for each element of the array) and it is impossible to insert a new item in the structure of business without dialing manually anyway.

    Can someone point me to a simpler implementation? If I was using C, I'd probably memcpy binary data directly in a structure aligned bytes. Is there any equivalent in LabVIEW, you use clusters?

    (Note: using LabVIEW 2014)

    Very well.  I thought about such a VI came out probably somewhere in vi.lib.

    However, I have also been concerned about the case where the table of variants isn't an different LabVIEW application.  In this case, I don't expect that the name and information of TypeDef would be in the variants, as specific to LabVIEW, so I was thinking something like this:

  • Problems with the .cod files

    Hello

    I'm selling my app in MobiHand but I'm having a problem downloading my app to download.  I am trying to download my .jad and .cod files but I get this error message:

    "Some of the COD files mentioned in the JAD file, are not uploaded"

    If I look in my .jad file I can see a reference to a - 1.cod beside that file: RIM-COD-URL-1:

    I read that if you change the extension of the .cod file in a zip file, you can then extract other .cod files.  This has not worked for me. I have only 1 file of cod in my build directory.  I use the eclipse plugin.

    Thanks for any help.

    Make sure you are deleing files JAD and cod before making your build of 'production '.

    If you app has crossed the line of 64K at a time, then came back, your JAD will still retain this obsolete reference to the unused COD file.

  • Registration code original to collection master cs6 is not accepted. How can I fix it?

    I recently tried to install CS6 Master Collection for Windows (bought in 2013), but he would not accept the registration (original and hitherto unused) code. Can someone help me with this?

    Hi erikg53501011,

    Please refer to the doc KB mentioned below to help: -.

    Kind regards
    Nicos

  • Hello, I recently created a website for a client. I also created a brochure with a QR code that automatically redirects visitors to a single page in the site. Well, I had to make changes to the site and I had to change the name of the page in which t

    Hello, I recently created a website for a client. I also created a brochure with a QR code that automatically redirects visitors to a single page in the site. Well, I had to make changes to the site and I had to change the name of the page in which the QR code pointing to. Is it possible to keep the current name of the page but create a page of automatic redirect named like the QR code? Basically, the brochures have all been printed already, so I need the QR code when analyzed in order to continue working. Now, it is not the case.

    Nevermind, I figured it. I've reproduced the page, renamed the QR that indicates the code of the page, and then he hid in the menu of page properties.

  • Stupid mistake with Bundle by name

    I recently spent too much time to research an error in the code "that used to work.  So I asked a student to look over my shoulder while I explained what was supposed to happen.  The bug is illustrated in this code snippet:

    I do a simple package by name, using a predefined TypeDef to define the cluster.  What I expected to get are indicated on the left, and I have actually is shown to the right.  The code looks the same, but the result is very different!

    My student asked innocently if I saw, in fact, the default value of my TypeDef (answer - Yes).  He then asked if I had connected the TypeDef to the terminal of output "by mistake."  This turns out to be almost right - what I did was to wire the flag, not the Terminal output, but by mistake, to the input Terminal.

    Note the two beige rectangles on the right edge of the boot by name.  The rightmost output, the more to the left is the entrance (this is where the wire to TypeDef comes in).  What I carelessly did was drag a wire from the indicator "far enough" to establish a connection, but, in fact, I dragged too far for that its entry into the entry box.  Here's big plans to correct and bad sons with highlight - it is not easy to see, but the highlighting on the wrong wire extends into the beige rectangle to the left.  If you bring your pointer in very carefully at the junction, you can sometimes see a point of strain on the edge of the function of the bundle, but I couldn't catch him.

       

    Needless to say that this behavior, the ability to 'evil' a bundle by name function wire, was quite unexpected (by me)-I spent most of my time, suspecting of subtle errors in my code and logic, not the errors of cabling!

    You can bet I checked the other places where the beam by a name appears in my code.  I'm posting here in the hope that others do not fall into the same trap.

    Schor (embarrassed) Bob

    Sorry to beat a dead horse, but I wanted some close this topic and comment on some of the useful responses.  A revised version of the extract is also included below.

    • Oligarlicky and tst are correct - I must have inadvertently 'fixed' the original extract before posting, as the code snippet below show fact error (I tested this time!).

    • TST is also correct that having the Option "Enable automatic wire routing" is enabled (the default behavior) would prevent this problem, with the result the obviously involuntary wireframe diagram of Test 3.  I always disable this Option when I am configuring LabVIEW, I like to control the placement of wire.

    • Many sons of "misplaced" (or incorrect) seem to be "taken" by the VI Analyzer, so I 'analyzed' this VI.  When I read his conclusions, I said "Oh, he missed the error!  But I was wrong - included an annotation of unused Code that says "service"Bundle by name"has none of its outputs one cable and therefore performs so no useful operation.»  Consider removing this function from your schema. "It was not really until I've created version 'Activate the automatic routing of the wires' reproduced by 3 tests that I realized he was talking (somewhat loosely) on my thread wrong.

    • One of my colleagues said I should stop wiring "in Hebrew" (creation of my son from right to left) - which could also prevent this error, but I prefer the "Ambidextrous" style of wiring, which means I'm leaving of whatever connection I happen to be nearby and the driver to the everywhere where it should go.

    I hope that I can remember these lessons six months from now...

    Bob Schor

  • Safari has locked up - malware

    Can you help me get rid of this: I can't use "Safari" now on my computer.

    I have OS X EL Capitan running on my computer bought in 2012.

    I am able to use Firefox, Word, E-mail, etc..

    The message that appears when I open Safari is the following:

    Of "http://www.mac/warning- notice 981a1.com.

    Apple urgent Virus Alert! -Call Mac certified technicians Now *.
    Critical security warning! Your Internet is infected by a malicious virus attack.

    Immediately call 1-877-796-1252 Mac support and provide the error WB988.178.170.265.8 code to analyze and solve any potential threat to your personal and financial information, which was followed by a suspicious connection.

    Contact the Mac Support for an immediate fix 1-877-796-1252.

    Thanks for any help you can give.

    Choose force quit from the Apple menu, close Safari and then run it with the SHIFT key is pressed. If the message reappears, disconnect the computer from the Internet and close the tab Popup came.

    (140815)

  • Malware doesn't let me access the Safari preferences.  Help!

    This window pops up suddenly while I was with Safari:

    Of "'http://macintosh-help.com ': "

    Are you sure you want to leave this page?

    At risk security system *.

    Critical security warning! Your Mac has detected an attack on this system, as your IP address seems to be accessible from two different places at the same time. A suspicious connection was attempting to access your Logins, Banking details & tracking of your Internet business.

    Please contact Support Mac team immediately at 1-888-398-6257 (TOLL FREE) and provide the UR97L1DA2TA error code to analyze and solve the

    Trying to close the window just opens a new window with the same or similar message.  I suspect that it is malware taking advantage of a flaw in JAVA.  All resolutions, I watched that require to open Safari preferences but this malware won't let me access the Security tab in the Preferences window.   Help!

    Choose force quit from the Apple menu, close Safari and then run it with the SHIFT key is pressed. If the message reappears, disconnect the computer from the Internet and close the tab Popup came.

    (138731)

  • ADO error: x 0 00000061 unknown system error in NI_Database_API.lvllib: DB tools close Connection.vi

    What I do literally trying to save a bar code previously analyzed. The scanner is connected to COM11 (serial port) using VISA. Then through a chain I insert information into a Subvi, which records the information in an access database. The program will save in two columns of different information, depending on whether the scanned barcode starts with 'X' or 'I '. After you run the VI and scanning of bar codes, the error message is displayed.

    So my assumption is that the problem lies in the Subvi, because the message only when I scan a barcode, in other words: when the string is detected the com and inserted to the database until the connection is close, is when the error appears.

    Also very weird, when I opened the Subvi, and run the VI from there, the message also upwards.

    But I really have no idea what is wrong... I don't have much experience with LabVIEW and beer begins to know databases and its respective connections as well.

    Can someone help me! PLEASEEE!

    JLuna wrote:

    In the UDL is one that refers to the database in access. In the Subvi, on the façade, you specify the name of the new or existing table, you name the columns.

    The Subvi has not all default values, so whenever the vi is called, it has NO data in the two controls, the Table and the column name.

  • Dependencies in vi.lib and loading of the wrong place user.lib

    Hello

    I'm having a weird problem trying to load a LabVIEW project in 2013. Whenever I open the project folder, it keeps looking for files in vi.lib and user.lib in the wrong place. Instead of search in files (x 86) C:\Project \National Instruments\LabVIEW 2013\vi.lib, he look in C:\Program Files (x 86) \National Instruments\Targets\vi.lib

    I have manually browse for each file in the directories vi.lib and user.lib and point each a return to real folders. But in the project folder itself, all the files I have loaded just said that it is still in conflict. When I try to resolve conflicts of files, they disappear for a second then come back.

    I can't make LabVIEW for functions in the directories user.lib and vi.lib normal, it keeps adding targets in the destination.

    I tried to do a recompilation of mass, and which does not at all help.

    When I load the project, select a few dozen files vi.lib and user.lib, do a save all, close the project, and then re - open, I need to reconnect every file again.  It still seems for all... \Targets\vi.lib instead of just \vi.lib.

    This isn't the case for all projects, just this one it seems.

    The files are in the right place based on the path under "loading". If she says it's in : \Waveform\WDTOps.llb\WDT number of waveform samples DBL.vi, it really is. The path on the top is right, I don't know why LabVIEW is not find anything.

    Any idea how I can get this project to stop looking for vi.lib in the folder target?

    ng1902 wrote:

    I managed to get the errors to stop copying vi.lib and user.lib files in the subfolder of targets.

    This could be dangerous and cause problems.  If it's possible after your project.

    When I saw this sort of thing in the past, it was usually because of a broken dependency I got didn't really need.  I would say through your dependencies (in project) and search for the odd elements glyphs showing errors.  Try to find out why those are dependencies and remove unused code, or links to the missing code.  Resolve all conflicts and then make a backup of all.

    In the past, it happened when I tried to copy a project as a new project, and then changes the code snatch which was unnecessary, but there was always a code in a disabled structure that could not be loaded causing a kind of problem of linkage project.

  • too many comm usb ports

    Hello

    I ran into what may be soon, where we test units that have built in USB ports that appear as serial comm ports. The problem is that whenever we connect to an object that has not been run on this computer until Windows assigns it a new com port number to measure. My concern is that fast enough, as the production line is in full swing, we will hit the 'magic number' of 255, the highest number of com port and I have not any idea that Windows will do at this point. Before you begin to write the code to analyze the new com port number returned by VISA and adjust"registry entries accordingly, I want to know if it's necessary. I think there are a couple of possible scenarios, Windows complains and it won't deliver a com port #, that Windows starts from the beginning, or that Windows strikes only 255, then keeps the front it. I'd rather it be at least two, won't my program messing around in the registry and really have no time at the moment, nor access to the machine (s) to experiment to see.

    Thank you


  • Number of unknown member during an attempt to propertyMap

    In my application, I have a main.qml that has a TabbedPane.

    The 2nd part is the LeadInformation.qml page, which has a NavigationPane manipulated a several page questionnaire.

    From the first page, I have a menu option that pushes a page of BarcodeScan.qml to scan the barcode.  When data is read, I want to fill in the fields on the LeadInformation.qml.

    I added a function in the ApplicationUI to analyze the data of barcode.

    When the data are analyzed, I try to use the propertyMap update fields on the page.

    QmlDocument *qml = QmlDocument::create("asset:///LeadInformation.qml");
    QDeclarativePropertyMap* propertyMap = new QDeclarativePropertyMap;
    
    propertyMap->insert("iFirstName", data.mid(m_startSpot, m_endSpot - m_startSpot));
    
    qml->setContextProperty("propertyMap", propertyMap);
    

    And in the LeadInformation.qml page

    TextField {
                        id: tfLeadFirstName
                        hintText: "Lead First Name"
                        input.submitKey: SubmitKey.None
                        text: propertyMap.iFirstName;
    
                    }
    

    In the qml page, I get one! symbol and 'unknown member '.

    I guess I need to declare something somewhere else to make it work.  Examples are to change the values in the main.qml page.  I have not seen an example to change values on another page.

    This is what worked.

    Instead of calling to a source of the page, I just added the Page as an object.

    In the main.qml, I added the NavigationPane (LeadInformation.qml)

    import bb.cascades 1.0
    import bb.system 1.0
    
    TabbedPane {
        id: mainTabPane
        showTabsOnActionBar: true
    
        property bool databaseOpen: false
    
        tabs: [
            Tab {
                title: qsTr("User List")
                imageSource: "asset:///icons/ic_view_list.png"
    
                PageBase {
                    databaseOpen: mainTabPane.databaseOpen
                    page: "LeadsList.qml"
                }
            },
            Tab {
                title: qsTr("Add User")
                imageSource: "asset:///icons/AddSubscription.png"
                LeadInformation {
    
                }
            }
        ]
    }
    

    In the Navigation pane, which contains all of the fields that fills in the barcode data, I added the BarcodeScan page in the ComponentDefinition for action that calls the bar code

    import bb.cascades 1.0
    import bb.system 1.0
    
    NavigationPane {
        id: navigationPane
        property string barcodeOutput;
        property int currentLeadID;
    
        onCreationCompleted: {
            _app.setLastLeadID(0);
        }
    
        Page {
            id: leadsInformation
            titleBar: TitleBar {
                // Localized text with the dynamic translation and locale updates support
                title: qsTr("Lead Information") + Retranslate.onLocaleOrLanguageChanged
                appearance: TitleBarAppearance.Branded;
            }  
    
            ScrollView {
                scrollViewProperties.scrollMode: ScrollMode.Vertical
                Container {
                    layoutProperties: FlowListLayoutProperties {}
                    clipContentToBounds: false
    
                    Picker {
                        id: pkEmployee
                        title: "Bell and Howell Employee"
                        kind: PickerKind.Expandable
    
                        rootIndexPath: []
                        dataModel: XmlDataModel {
                            id: dmEmployees
                            source: "xml/employees.xml" }
    
                        pickerItemComponents: [
    
                            PickerItemComponent {
                                type: "employee"
                                content: Container {
                                    Label {
                                        text: pickerItemData.email
                                    }
                                }
                            }
    
                        ]
    
                        onSelectedValueChanging: {
                            console.debug("selectedIndex = " + selectedIndex(0))
                            var selectedEmployee = dataModel.data([0, selectedIndex(0)])
                            console.debug("selectedEmployee 0,0 email = " + selectedEmployee.email)
    
                            lbEmployee.text = selectedEmployee.email
                        }
    
                        onSelectedValueChanged: {
                            console.debug("selectedIndex = " + selectedIndex(0))
                            var selectedEmployee = dataModel.data([0, selectedIndex(0)])
                            console.debug("selectedEmployee 0,0 email = " + selectedEmployee.email)
    
                            lbEmployee.text = selectedEmployee.email
    
                            if(lbEmployee.text.length > 2 && lbSelectedShow.text.length > 2) {
                                if(aiNextButton.enabled == false) { aiNextButton.enabled = true }
                            }
                        }
                    }
                    Label {
                        id: lbEmployee
                        textStyle.fontStyle: FontStyle.Italic
                        textStyle.fontWeight: FontWeight.Bold
                    }
    
                    Picker {
                        id: pkShow
                        title: "Show"
                        kind: PickerKind.Expandable
    
                        rootIndexPath: []
                        dataModel: XmlDataModel { source: "xml/show.xml" }
    
                        pickerItemComponents: [
                            PickerItemComponent {
                                type: "show"
    
                                content: Container {
                                    Label {
                                        text: pickerItemData.name
                                    }
                                }
                            }
                        ]
    
                        onSelectedValueChanging: {
                            console.debug("selectedIndex = " + selectedIndex(0))
                            var selectedShow = dataModel.data([0, selectedIndex(0)])
                            console.debug("selectedShow 0,0 name = " + selectedShow.name)
    
                            lbSelectedShow.text = selectedShow.name
                        }
    
                        onSelectedValueChanged: {
                            console.debug("selectedIndex = " + selectedIndex(0))
                            var selectedShow = dataModel.data([0, selectedIndex(0)])
                            console.debug("selectedShow 0,0 name = " + selectedShow.name)
    
                            lbSelectedShow.text = selectedShow.name
    
                            if(lbEmployee.text.length > 2 && lbSelectedShow.text.length > 2) {
                                if(aiNextButton.enabled == false) { aiNextButton.enabled = true }
                            }
                        }
    
                    }
    
                    Label {
                        id: lbSelectedShow
                        textStyle.fontStyle: FontStyle.Italic
                        textStyle.fontWeight: FontWeight.Bold
                    }
    
                    Header {
                        title: "Lead Information"
                    }
    
                    TextField {
                        id: tfLeadFirstName
                        hintText: "Lead First Name"
                        input.submitKey: SubmitKey.None
    
                    }
    
                    TextField {
                        id: tfLeadLastName
                        hintText: "Lead Last Name"
                        input.submitKey: SubmitKey.None
    
                    }
    
                    Header {
                        title: "Company Information"
    
                    }
                    TextField {
                        id: tfCompanyName
                        hintText: "Company Name"
                        input.submitKey: SubmitKey.None
    
                    }
                    TextField {
                        id: tfJobTitle
                        hintText: "Job Title"
                        input.submitKey: SubmitKey.None
    
                    }
                    TextField {
                        id: tfAddrLine1
                        hintText: "Address Line 1"
                        input.submitKey: SubmitKey.None
                    }
                    TextField {
                        id: tfAddrLine2
                        hintText: "Address Line 2"
                        input.submitKey: SubmitKey.None
    
                    }
                    TextField {
                        id: tfCity
                        hintText: "City"
                        input.submitKey: SubmitKey.None
                    }
                    TextField {
                        id: tfStateRegion
                        hintText: "State / Region"
                        input.submitKey: SubmitKey.None 
    
                    }
                    TextField {
                        id: tfCountry
                        hintText: "Country"
                        input.submitKey: SubmitKey.None
    
                    }
                    TextField {
                        id: tfPostalCode
                        hintText: "PostalCode"
                        input.submitKey: SubmitKey.None
    
                    }
                    Header {
                        title: "Contact Information"
    
                    }
                    TextField {
                        id: tfPhone
                        hintText: "Phone"
                        inputMode: TextFieldInputMode.PhoneNumber
                        input.submitKey: SubmitKey.None
    
                    }
                    TextField {
                        id: tfPhoneExt
                        hintText: "Phone Extension"
                        input.submitKey: SubmitKey.None
    
                    }
                    TextField {
                        id: tfFax
                        hintText: "Fax"
                        inputMode: TextFieldInputMode.PhoneNumber
                        input.submitKey: SubmitKey.None
    
                    }
                    TextField {
                        id: tfEmail
                        hintText: "eMail"
                        inputMode: TextFieldInputMode.EmailAddress
                        input.submitKey: SubmitKey.None
    
                    }
                }
            }
            actions: [
                ActionItem {
                    id: aiNextButton
                    enabled: false
                    title: qsTr("Purchasing Timeframe") + Retranslate.onLocaleOrLanguageChanged
                    ActionBar.placement: ActionBarPlacement.OnBar
                    imageSource: "asset:///icons/ic_next.png"
    
                    onTriggered: {
                        currentLeadID = _app.getLastLeadID();
                        if(currentLeadID == 0) {
                            // Create new Sales Leads
                            _app.createLeadRecord(
                                tfLeadFirstName.text,
                                tfLeadLastName.text,
                                tfCompanyName.text,
                                tfJobTitle.text,
                                tfAddrLine1.text,
                                tfAddrLine2.text,
                                tfCity.text,
                                tfStateRegion.text,
                                tfCountry.text,
                                tfPostalCode.text,
                                tfEmail.text,
                                tfPhone.text,
                                tfPhoneExt.text,
                                tfFax.text,
                                lbEmployee.text,
                                lbSelectedShow.text);
                            console.debug("New Sales Lead - Create")
                        } else {
                            // Update current Sales Lead
                            _app.updateLeadRecord(
                                currentLeadID,
                                tfLeadFirstName.text,
                                tfLeadLastName.text,
                                tfCompanyName.text,
                                tfJobTitle.text,
                                tfAddrLine1.text,
                                tfAddrLine2.text,
                                tfCity.text,
                                tfStateRegion.text,
                                tfCountry.text,
                                tfPostalCode.text,
                                tfEmail.text,
                                tfPhone.text,
                                tfPhoneExt.text,
                                tfFax.text,
                                lbEmployee.text,
                                lbSelectedShow.text);
                                console.debug("Existing Sales Lead - Update Sales Lead ID: " + currentLeadID)
                        }
                        _app.readLeadRecords(); // Refresh the list view.
                        _marketingWS.insertSalesLead(1);
                        //navigationPane.push(purchasingTimeframeDefinition.createObject());
    
                    }
                },
                ActionItem {
                    id: aiScanButton
                    enabled: true
                    title: qsTr("Scan Barcode") + Retranslate.onLocaleOrLanguageChanged
                    ActionBar.placement: ActionBarPlacement.InOverflow
                    imageSource: "asset:///icons/ic_scan_barcode.png"
    
                    onTriggered: {
                        navigationPane.push(barcodeScanDefinition.createObject())
                    }
    
                }
    
            ]
    
            attachedObjects: [
                // Definition of the second Page, used to dynamically create the Page above.
                ComponentDefinition {
                    id: purchasingTimeframeDefinition
                    source: "PurchasingTimeframe.qml"
                },
                ComponentDefinition {
                    id: barcodeScanDefinition
                    BarcodeScan {
    
                    }
                }
            ]
    
        }
    
        onPopTransitionEnded: {
            // Destroy the popped Page once the back transition has ended.
            page.destroy();
        }
        backButtonsVisible: false
    
    }
    

    Then, on the page BarcodeScan.qml, I just referenced the fields and added to the white list.  Instead of calling C++ code to analyze the data, I just analyzed it on the page.  QString provides a better string manager that the regular chain, so it's not as clean as I wanted it to be.

    Page {
        property string decodeString
        property string tmpString
        property int initStartSpot: 0;
        property int startSpot: 0;
        property int endSpot: 0;
        property int x:0;
    
        property int vcard: 0
        property int vcard2_1: 1
        property int vcard3: 2
        property int print2013: 3
        property int codeType: 0
    
        Container {
            id: cMain
            layout: StackLayout {
    
            }
            horizontalAlignment: HorizontalAlignment.Center
            verticalAlignment: VerticalAlignment.Center
            background: Color.create(0x9CDCF6)
    
            Container {
                id: cCameraReader
    
                layout: AbsoluteLayout {
    
                }
                background: Color.White
                horizontalAlignment: HorizontalAlignment.Center
                verticalAlignment: VerticalAlignment.Center
    
                Camera {
                    id: camera
                    preferredWidth: 450
                    preferredHeight: 450
    
                    onCameraOpened: {
                        camera.startViewfinder();
                    }
                }
    
                BarcodeDetectorVisuals {
                    id: bdvScanner
                    preferredWidth: 450
                    preferredHeight: 450
                    barcodeDetector: barcodeDetector
    
                    onDetected: {
                        // Set the UserID to 0
                        _app.setLastLeadID(0);
    
                        decodeString = data;
                        dataArea.text = decodeString;
    
                        if(decodeString.indexOf("VCARD") > 0) {
                            if(decodeString.indexOf("VERSION:3.0") > 0) {
                                codeType = vcard3;
                            } else if(decodeString.indexOf("VERSION:2.1") > 0) {
                                codeType = vcard2_1;
                            } else {
                                codeType = vcard;
                            }
    
                        } else {
                            codeType = print2013;
                        }
    
                        dataArea.text += "\n " + codeType;
    
                        switch(codeType) {
                            case vcard2_1:
                            case vcard:
                            case vcard3:
                                // Get Name
                                tmpString = decodeString.substr(decodeString.indexOf("N:"), decodeString.indexOf("TITLE:"));
    
                                tfLeadFirstName.text = tmpString.substr(0, tmpString.indexOf(";"));
                                tfLeadLastName.text = tmpString.substr(tmpString.indexOf(";") + 1, tmpString.length);
                                break;
                            case print2013:
                                //qDebug() << " Last End spot = " << decodeString.lastIndexOf(QString("$"));
                                //qDebug() << " $ counts = " << decodeString.count(QString("$"));
                                startSpot = 0;
                                initStartSpot = decodeString.indexOf("$", startSpot + 1);
                                for(x=0; x < 22; x++) {
                                    endSpot = decodeString.indexOf("$", startSpot + 1);
    
                                    dataArea.text += "\n x:" + x + " endSpot = " + endSpot;
                                    if(endSpot != -1) {
                                        switch(x) {
                                            case 0:
                                                // badge ID
                                                //qDebug() << " Badget ID = " << decodeString.substr(startSpot, endSpot - startSpot);
                                                break;
                                            case 1:
                                                // blank or Show ID
                                                //qDebug() << " Show ID = " << decodeString.substr(startSpot, endSpot - startSpot);
                                                break;
                                            case 2:
                                                // First Name
                                                tfLeadFirstName.text = decodeString.substr(startSpot, endSpot - startSpot);
                                                break;
                                            case 3:
                                                //Last Name
                                                tfLeadLastName.text = decodeString.substr(startSpot, endSpot - startSpot);
                                                break;
                                            case 4:
                                                //Title
                                                tfJobTitle.text = decodeString.substr(startSpot, endSpot - startSpot);
                                                break;
                                            case 5:
                                                //Company
                                                tfCompanyName.text = decodeString.substr(startSpot, endSpot - startSpot);
                                                break;
                                            case 6:
                                                //AddrLine1
                                                tfAddrLine1.text = decodeString.substr(startSpot, endSpot - startSpot);
                                                break;
                                            case 7:
                                                //AddrLine2
                                                tfAddrLine2.text = decodeString.substr(startSpot, endSpot - startSpot);
                                                break;
                                            case 8:
                                                //City
                                                tfCity.text =  decodeString.substr(startSpot, endSpot - startSpot);
                                                break;
                                            case 9:
                                                //StateRegion
                                                tfStateRegion.text = decodeString.substr(startSpot, endSpot - startSpot);
                                                break;
                                            case 10:
                                                //PostalCode
                                                tfPostalCode.text = decodeString.substr(startSpot, endSpot - startSpot);
                                                break;
                                            case 11:
                                                //Country
                                                tfCountry.text = decodeString.substr(startSpot, endSpot - startSpot);
                                                break;
                                            case 12:
                                                //Phone
                                                tfPhone.text =  decodeString.substr(startSpot, endSpot - startSpot);
                                                break;
                                            case 13:
                                                //PhoneExt
                                                tfPhoneExt.text = decodeString.substr(startSpot, endSpot - startSpot);
                                                break;
                                            case 14:
                                                //Fax
                                                tfFax.text = decodeString.substr(startSpot, endSpot - startSpot);
                                                break;
                                            case 15:
                                                //LeadEmail
                                                tfEmail.text = decodeString.substr(startSpot, endSpot - startSpot);
                                                break;
                                            case 16:
                                                //RegClass
                                                //tftext = decodeString.substr(startSpot, endSpot - startSpot);
                                                break;
                                            case 17:
                                                //PrincipalBusiness
                                                //tftext = decodeString.substr(startSpot, endSpot - startSpot);
                                                break;
                                            case 18:
                                                //Primary Job Function:
                                                //tftext = decodeString.substr(startSpot, endSpot - startSpot);
                                                break;
                                            case 19:
                                                //Influence in your company's buying decision
                                                //tftext = decodeString.substr(startSpot, endSpot - startSpot);
                                                break;
                                            case 20:
                                                //Number of Employees
                                                //tftext = decodeString.substr(startSpot, endSpot - startSpot);
                                                break;
                                            case 21:
                                                //Annual Sales Volume:
                                                //tftext = decodeString.substr(startSpot, endSpot - startSpot);
                                                break;
                                            case 22:
                                                //Products you are interested in (Multiple Answer/Comma Delimited)
                                                //leadContainer.tftext =  decodeString.substr(startSpot, endSpot - startSpot);
                                                break;
                                        }
    
                                        startSpot = endSpot + 1;
                                    } else {
                                        break;
                                    }
                                }
                            }
    
                        navigationPane.pop();
                    }
                }
            }
            attachedObjects: [
    
                BarcodeDetector {
                    id: barcodeDetector
                    formats: BarcodeFormat.Any
                    camera: camera
                }
            ]
            TextArea {
                id:dataArea
                text: ""
                textFormat: TextFormat.Auto
                maximumLength: 400
    
            }
    
        }
        onCreationCompleted: {
           if (camera.allCamerasAccessible) {
                camera.open();
                console.debug("rear camera opened")
           } else {
                dataArea.text = "Cameras are not accessible"
            }
        }
    }
    

    It is the solution.  This works.

    Not the solution I was looking for, but I don't have the time now to try again.

    My guess is that propertyMap will now also work with the way I'm treated Page calls.

  • Maps JSON data with two data in the list

    Hey all,.

    Been working with JSON data and informing the lists for a some time now, but im stuck now on a single set of data.

    The data structure is the following:

    [
         {
              data: {
                   children: [ {
                        {}
                        {}
                        {}
                   } ]
               }
         }
    
         {
              data: {
                   children: [ {
                        {}
                        {}
                        {}
                   } ]
               }
         }
    ]
    

    The data that I take care of normally contains one of these structures and not 2 as in the above data. So what follows could could work:

                                    const QByteArray response(reply->readAll());
            ArrayDataModel *model = new ArrayDataModel();
    
            bb::data::JsonDataAccess jda;
            QVariantMap results = jda.loadFromBuffer(response).toMap();
            QVariantList children = results["data"].toMap()["children"].toList();
    
            model->append(children);
            mListView->setDataModel(model);
    

    However, it is now giving me an empty list. So how can I limit the above code to analyze and insert only the 2nd set of JSON data in the list?

    Please let me know if it needs to be clarified. Any help is appreciated. Thank you!

    Hello

    It contains a list of maps. Have you tried something like the following:

    bb::data::JsonDataAccess jda;
    QVariantList results = jda.loadFromBuffer(response).toList();if (results.size() >= 2){
        QVariantMap secondSet = results.at(1).toMap(); // to get the second map
        QVariantList children = secondSet["data"].toMap()["children"].toList();
        model->append(children);}
    

Maybe you are looking for