Using the XMP library

I was interesting to try the XMP library, so it was nice to see that it has been included here:

https://developer.BlackBerry.com/native/documentation/core/library_support_at_a_glance.html

... with instructions on how to add a library here:

https://developer.BlackBerry.com/native/documentation/core/com.QNX.doc.native_sdk.DevGuide/topic/Add...

However, I'm not sure how to include the files in my project.

The example code I found for the XMP SDK did something like this:

#include
#include
#include
#include

Must be set to instantiate model classes
#define std::string TXMP_STRING_TYPE

Must be set to allow access to XMPFiles
#define XMP_INCLUDE_XMPFILES 1

Ensure that XMP templates are instantiated
#include "public/include/XMP.incl_cpp".

Provide access to the API
#include "public/include/XMP.hpp".

#include
#include

using namespace std;

... they key part being apparently:

Ensure that XMP templates are instantiated
#include "public/include/XMP.incl_cpp".

Provide access to the API
#include "public/include/XMP.hpp".

When I look at the node "Includes" of my project, I see a line pointing to:

E:\bbndkbeta\target_10_2_0_1155\qnx6\usr\include\xmp

... and it does not include the XML.incl_cpp and the XMP.hpp, but when I add those two includes:

"xmp/XMP.incl_cpp" #include
"xmp/XMP.hpp" #include

... in all my file and build, I get all sorts of errors such as:

o.le-V7-g/.obj/PhotosModel.o: In function '. LC333':
PhotosModel.cpp.rodata + 0x2a98): multiple definition OF 'typeinfo for TXMPFiles.
o.le-V7-g/.obj/ImageViewContainer.o:ImageViewContainer.cpp.rodata + 0x4fc): first defined here

This is the exact code I adapted to the sample code for my header file:

#include
#include
#include
#include

Must be set to instantiate model classes
#define std::string TXMP_STRING_TYPE

Must be set to allow access to XMPFiles
#define XMP_INCLUDE_XMPFILES 1

#define UNIX_ENV 1

"xmp/XMP.incl_cpp" #include
"xmp/XMP.hpp" #include

#include
#include

using namespace std;

Thank you
Daniel

Ok.  I stumbled upon the answer, I think.

It seems that registration of:

"xmp/XMP.incl_cpp" /#include

... should be limited to main.cpp and should not be placed in other files of all. On the contrary, simply:

"xmp/XMP.hpp" #include

... in any file you need XMP. I guess that makes sense...

Tags: BlackBerry Developers

Similar Questions

  • Using the bookmark Library, I can locate specific bookmarks, but there is no way of knowing which of my cases, it is in. Is it possible to do this?

    Using the bookmark Library, I can locate specific bookmarks, but there is no way of knowing which of my cases, it is in. Is it possible to do this? I have about 15 cases of bookmarks with a total of about 150 bookmarks. The research of the Library bookmark gives good results insofar as find the specific bookmark, but I IN. WANT to KNOW WHO MY RECORDS THE SPECIFIC BOOKMARK IS how can I do this?

    Take a look on these modules:

    https://addons.Mozilla.org/en-us/Firefox/addon/7372/
    https://addons.Mozilla.org/en-us/Firefox/addon/7377/

  • I use the MODBUS library and can receive data, but I can send it very well?

    Hello

    I use the Modbus Library to communicate with a VFD to control a fan. I use the master write and read vi. I can write data to the drive mechanism and get the fan to do what I want. The VFD is supposed to send a package of confirmation after I told him to do something and I can also read its records. When debugging the VI it shows that the problem is that the buffer always reads zero and the VI timesout. If I look at the USB adapter lights to RS 485, I use to interface with the drive mechanism, I see that the flashes of light RX immediately after I send a message. So I should have something in the buffer. Does anyone have any suggestions?

    Aaron

    OK, here's what has happened to those who have this problem. In the series Receive.vi MB The bytes to the Port of property node has been reading 0 even if there was something in the buffer. Executing the program was then stuck in a loop until it expired and never went to read anything of serial port buffer. I didn't spend too much time wondering why that VI has not worked and created my own. Within a period appropriate after writing to the serial port, I used the same bytes to the Port property node and was able to get the exact number of bytes to the stream and then VISA vi the number of bytes to read. I received the message of the right answer and everything seemed good. But of course that NO! Then I experimented with different speeds of writing to the drive mechanism to get the fan to operate at different speeds. I found a small range of speeds where I get no response to the VFD, either in operation or by sending me a response packet. After a while, I found that there is a mistake in the LRC-8 code in the MODBUS library OR. It does not prescribe that the LRC will be a two-character value. So if your LRC is proving to be a single character such as F value (which should be 0F) you get an incomplete MODBUS message. This has been easily corrected in the vi LRC8 saying "number in hexadecimal string" vi to produce output with a minimum width of two. Then everything worked fine. Moral of the story, it's the MODBUS library is awkward.

  • OR PCI-6542: Creation of dynamic waveforms using the HSDIO library

    Hello!

    I have problems to understand how to create waveforms using the HSDIO library to run on a card PCI-6542. I need to create a program that activates a channel for 12.5 microseconds, waiting for a while (i.e. 100 samples) and activates another channel to 12.5 microseconds.

    This program must be used in a Multielement ultrasound system.

    Here the example of dynamic generation program that transforms the channels 0-2 on 1024 samples.

    /************************************************************************
    *
    * Example program:
    * DynamicGeneration.c
    *
    * Description:
    * Generates a simple model on the specified channel.
    *
    * Pin connection information:
    * None.
    *
    ************************************************************************/

    / * Includes * /.


    #include "niHSDIO.h".

    / * Sets * /.
    #define WAVEFORM_SIZE 1024

    int main (void)
    {
    ViRsrc deviceID = 'Dev1 ';
    ViConstString channelList = "0-2";
    ViReal64 sampleClockRate = 50.0e6;
    DataWidth ViInt32 = 4;

    ViUInt32 waveformDataU32 [WAVEFORM_SIZE];
    ViConstString waveformName = "myWfm";
    ViInt32 timeout = 10000; / * milliseconds * /.

    ViSession vi = VI_NULL;
    Error ViStatus = VI_SUCCESS;
    Bruno errDesc [1024];
    ViInt32 i;

    / * Initialize generation session * /.
    checkErr (niHSDIO_InitGenerationSession)
    Deviceid, VI_FALSE, VI_FALSE, VI_NULL, &vi));

    / * Assign channels for dynamic generation * /.
    checkErr (niHSDIO_AssignDynamicChannels (vi, channelList));

    / * Set up the clock sample parameters * /.
    checkErr (niHSDIO_ConfigureSampleClock)
    VI, NIHSDIO_VAL_ON_BOARD_CLOCK_STR, sampleClockRate));

    / * Query the data Width attribute * /.
    checkErr (niHSDIO_GetAttributeViInt32)
    VI, VI_NULL, NIHSDIO_ATTR_DATA_WIDTH, & dataWidth));

    / * Fill the waveform with ramp data * /.
    < waveform_size;="">
    {
    waveformDataU32 [i] = i;
    }

    checkErr (niHSDIO_WriteNamedWaveformU32)
    VI, waveformName, WAVEFORM_SIZE, waveformDataU32));

    / * Start the generation * /.
    checkErr (niHSDIO_Initiate (vi));

    / * Wait for all the generation * /.
    checkErr (niHSDIO_WaitUntilDone (vi, timeout));

    Error:

    If (error is VI_SUCCESS)
    {
    / * Print result * /.
    printf ("made without error. \n") ;
    }
    on the other
    {
    / * Get the description of the error and print * /.
    niHSDIO_GetError (vi, & error, sizeof (errDesc) /sizeof (petitioner), errDesc);

    printf ("\nError encountered\n===\n%s\n", errDesc);
    }

    / * log * /.
    niHSDIO_close (vi);

    / * prompt to go out (for the popup console windows) * /.
    to continue...\n");
    GetChar ();

    error return;
    }

    Issues related to the:

    How can I change the values in waveformDataU32 to create market reports (instead of just always on)?

    How to select the channel waveformDataU32 is applied to the?

    Thank you!

    Zachary Geier

    The waveformDataU32 table is an array of 32-bit integers. Each bit corresponds to a line on the device.  On the first clock cycle, this program outputs:

    0000 0000 0000 0000 0000 0000 0000 0000

    Then it displays the following, changing at each clock Pulse:

    0000 0000 0000 0000 0000 0000 0000 0001,

    0000 0000 0000 0000 0000 0000 0000 0010,

    ...

    and so on all the way up to 1023:

    0000 0000 0000 0000 00000011 1111 1111

    In the example that you include at the bottom, you set the least significant bit (LSB) to zero and one, actually only change one line on the output. To change all the lines, you must instead use 4 294 967 295 or 0xFFFFFFFF:

    < waveform_size;="">
    < 200){="" if="" sample="" number="" is="" less="" than="">
    waveformDataU32 [i] = 0; Disable channels 0-2
    }
    else {}
    waveformDataU32 [i] = 4 294 967 295; Otherwise turn on all channels to 800 samples
    }
    }

  • Native extension using the shared library

    Hello

    IAM trying to create an extension which will be used in cordova, well the work of foundations... but what I have to do is add a shared library from another company for my project.

    They have a folder with all the files of all and a .so file, how can I add to my project and use it in the extension?

    Thank you.

    You start with the model BB10-Cordova?

    https://github.com/BlackBerry/WebWorks-community-APIs/tree/master/BB10-Cordova/template

    You should be able to add the library to the project using the Add Library Wizard in project-> generation properties C / C++-> the settings-> the tool parameters

    Note: It is recommended that you back up your project first.

  • Problem using the gesture library

    Hello people, I am new on the platform of the Playbook. I read the source code for the most basic of apps sample available on the internet. I am facing some issues now that I am using the gestures library.

    I get an error saying undefined reference to gestures_set_alloc and swipe_gesture_alloc of the IDE, even if I have included the relevant header (gestures/set.h, gestures/swipe.h) files. After this i went ahead and downloaded the GestureSample from github (https://github.com/blackberry/NDK-Samples/blob/master/GestureSample/main.c) and tried to compile it, but I couldn't.

    Can someone help me understand what I am doing wrong?

    Looks like you don't have the library of action specified in your list of libraries.

    If you download the entire GestureSample on github, it has a configuration of a Makefile project which relies completely.  If you want to fix your current project, look at https://github.com/blackberry/NDK-Samples/blob/master/GestureSample/common.mk and make sure that all equivalent settings in your project are defined.

  • How to use the xmp file

    I'm retouching of images of a customer and he suggested that I use the xmp file.  Can someone help me understand how to use it in Photoshop or Lightroom (or bridge).  I understand that the xmp files can contain metadata.  They also contain edit changes customers want as brightenes value, white temp, color etc.?

    Thank you very much

    Lisa

    This is the menu that appears when you open a raw file in Photoshop?

    Yes, this is the Camera Raw plugin.

    The XMP file contains the changes that have been made so far in the file, but cannot contain suggestions for future changes.

    You don't have to do anything to associate the XMP file to the image, except by checking that the two files are in the same folder.

    Camera Raw will automatically read the changes.

  • How to extract information from tree logical structure using the PDF Library?

    How to extract information from tree logical structure using the PDF Library?

    Adobe's PDF Library has PDSEdit APIs to extract information of the logical structure of a tagged PDF file.

    But I couldn't find any example code to demonstrate the C API on PDSEdit layer.

    I google search using different keywords, find none.

    I contact datalogics (which gives me the evaluation of adobe PDF library copy), no code sample on APIs PDSEdit yet.

    Everyone knows any code example can demonstrate extract structure logic tree information PDSEdit APIs (in C/C++ or Java)

    from a tagged PDF file? And is there any sample to demonstrate that connects a tagged logical tree contained in the content stream?

    I thank very you much in advance!

    logicaltree

    Did you look at the code snippets in the SDK?  There are a bunch of samples to work with PDSEdit and structure/marking.

  • Error to fix permissions if I use the backup library

    I have the library on an external hard drive and I starts the backup on a second external hard drive. When I opened the backup of my library in second external hard drive with a photo, it is reported an error to fix permissions. What can I do to use the backup from my library on the first hard drive failure?

    Is what kind of backup?  A Time Machine backup?  A copy of the library? Photos cannot open the library if it is on a volume of TimeMachine.

    And what type of backup drive?  If you want to open a copy of the photo library on an external drive, it's safer, if the file system is Mac OS extended (journaled) and the drive is mounted locally.

    Turn on the indicator "Ignore ownership on this volume" for the external drive the errors of authorization.

    When you select the drive in the Finder and open the Info Panel to the reader by entering ⌘I it should look like this in the "Général" section and in the section "permissions & ownership «:»»

  • Qosmio G30-163: bad reception TV using the media library

    Very fuzzy TV reception gives my Qosmio G30-163. I use the Saudi Arabia country setting in the media library. I tried to connect to another air outlet that I know my TV works with the classic but that was still fuzzy, so is not the antenna for sure Jack. Any help appreciated.
    Thank you and best regards.

    Have you chosen the right settings to PAL/NTSC?
    Please check this box.

    For the most part these incorrect settings are responsible for bad reception of the TV signal.

    One question;
    Have you tried to update the TV tuner driver? Should do!

  • Compilation error when you use the NDK library

    Hello

    I am developing an application of cascades that uses a static library NDK to communicate with a bluetooth device. The NDK library compiles without problems, but when I then compile the application stunts I get errors with all bluetooth NDK functions:

    myBB10Lib.a(BluetoothDevice.o): In function `MyBB10Lib::BluetoothDevice::getAddress()':
    \src\Driver/BluetoothDevice.cpp:33: undefined reference to `bt_rdev_get_address'
    
    myBB10Lib.a(BluetoothDevice.o): In function `MyBB10Lib::BluetoothDevice::getName()':
    \src\Driver/BluetoothDevice.cpp:53: undefined reference to `bt_rdev_get_friendly_name'
    
    make[2]: *** [o.le-v7-g/MyCascadesProject] Error 1
    make[1]: *** [debug] Error 2
    make: *** [Device-Debug] Error 2
    

    (I create a static library as it will act as a driver for the bluetooth device in other applications of stunts in the future).

    I have good include (#include ) in the BluetoothDevice .cpp file, but the application of Cascades always gives me this error. It is one of the functions in question:

    /*!
     * Returns the MAC address of the remote device, terminated by a null character (\0).
     */
    char* BluetoothDevice::getAddress() {
    
        // Holder for results
        char address[18];
    
        // Perform the check
        int res = bt_rdev_get_address(mDevice, address);
        if(res != 0) {
    
            //TODO  Query failed, pass up error
        }
    
        return address;
    }
    

    Any suggestions?

    Hello!
    I suspect that the NDK functions can be linked only dynamically. Only the .so files are available.

    Try adding
    LIBS +=-lbtapi
    the file .pro of application using the library.

  • Submitting a form Via the REST API using the PHP library request

    Can someone send please how to use the library to query PHP found at fredsakr/eloqua-php-request · GitHub to publish form to Eloqua data?

    So far, I have following:

    // include the Eloqua REST client 
    require_once('eloquaRequest.php');  
    
    
    // define the Contact class  
    class ContactForm  
    {
      public $FirstName;  
      public $LastName;  
      public $PhoneNumber;
      public $Institution;  
      public $ContactComment;  
      public $EmailAddress; 
    } 
    
    $client = new EloquaRequest('SITE', 'USERNAME', 'PASSWORD', 'https://secure.eloqua.com/API/REST/1.0');
    
    // instantiate a new instance of the ContactForm class 
    $contact = new ContactForm();  
    $contact->FirstName = 'Sample';  
    $contact->LastName = 'Import'.date("Y-m-d-H-i-s");  
    $contact->PhoneNumber = '111-111-1111';
    $contact->Institution = 'Company Name';
    $contact->ContactComment = 'This is a test of the API';
    $contact->EmailAddress = '[email protected]'; 
    
    // invoke a POST request to create the contact 
    $response = $client->post('/data/form/45', $contact);
    
    


    However, it returns the following:


    array(1) { [0]=> object(stdClass)#318 (4) { ["type"]=> string(21) "ObjectValidationError" ["property"]=> string(11) "fieldValues" ["requirement"]=> object(stdClass)#316 (1) { ["type"]=> string(23) "NoDuplicatesRequirement" } ["value"]=> string(6) "" } }


    Can someone give me a guide step by step on how to do it properly please?

    Hello world

    We have added a 'sample' in the repository of PHP library folder request on Github. The first example shows how to submit form using the API data:

    Please note that you can describe the form fields and other metadata using the following endpoint:

    Hope this helps and please let me know if you need more information.

    Thank you

    Fred

  • Deploy and use the shared library in VeriStand for several VCD

    Hello world

    I'm using LabVIEW 2011 SP1 and VeriStand 2011 SP1.

    We have developed many custom features that use a shared code (C++ and LabVIEW code).

    For now, there is a copy of the C++ shared in each custom device dll.

    The problem is when we change the C++ dll and we forget to copy a new one to each custom devices, the oldest one that can be used by each custom devices.

    We would like to do is not to have only a single dll shared in a specific folder.

    My questions are how we can deploy this dll to a specific shared folder in VeriStand?

    Is there a specific folder that we can use to do this?

    Is it possible to deploy using the measurement and Automation Explorer?

    If someone has an idea, you are welcome!

    Best regards

    CFOE

    You can display this question in another forum that I don't think there's anything directly to do with NI VeriStand.

  • Acquisition of vibration with the NI USB-9234 using the NIDaqMxBase library

    I have a NI USB-9162 linked to a NOR-9234 properly configured and installed under OpenSUSE 11.3. It's the output of ldaq:

    >lsdaq
    --------------------------------
    Detecting National Instruments DAQ Devices
    Found the following DAQ Devices:
    NI USB-9234: "Dev1"    (USB0::0x3923::0x72B5::0164852A::RAW)
    --------------------------------
    

    I'm developing a simple application to acquire the values of vibration of a project connected with an accelerometer.
    We start from the example of acquireNScans - AnlgStart.c of NIDaqMxBase 3.4.5 documentation.

    Unfortunately, the program fails and generates the following error:

    "DAQmxBase Error -200428: Value passed to the Task/Channels In control is invalid."
    

    Then I realize that the NI9234 doesn't support analog and digital triggers so I have decided to try with the acquire1Scan.c (a scan without triggering):

    int main(int argc, char *argv[])
    {
        // Task parameters
        int32       error = 0;
        TaskHandle  taskHandle = 0;
        char        errBuff[2048]={'\0'};
    
        // Channel parameters
        char        chan[] = "Dev1/ai0";
        float64     min = -10.0;
        float64     max = 10.0;
    
        // Timing parameters
        uInt64      samplesPerChan = 1;
    
        // Data read parameters
        float64     data;
        int32       pointsToRead = 1;
        int32       pointsRead;
        float64     timeout = 10.0;
    
        DAQmxErrChk (DAQmxBaseCreateTask("",&taskHandle));
        DAQmxErrChk (DAQmxBaseCreateAIVoltageChan(taskHandle,chan,"",DAQmx_Val_Cfg_Default,min,max,DAQmx_Val_Volts,NULL));
        DAQmxErrChk (DAQmxBaseStartTask(taskHandle));
        DAQmxErrChk (DAQmxBaseReadAnalogF64(taskHandle,pointsToRead,timeout,DAQmx_Val_GroupByChannel,&data,samplesPerChan,&pointsRead,NULL));
    
    printf ("Acquired reading: %f\n", data);
    

    Also this program fails and gives this error:

    DAQmxBase Error -200077: Requested value is not a supported value for this property. (Timing Mode)
    

    How can I get at least a single data value of the accelerometer of the device using the NIDaqMxBase API?

    Hi giaulo,

    The examples that you have tried to run are not compatible with your device.

    The 9234 does not support analog triggering, so examples of "acquireNScans" - AnlgStart.c do not work.

    He is also unable to make an acquisition of single point because is based on the architecture of delta-sigma ADC. Here is a knowledge base article explaining the limitation:

    KB 4SU94SH7: DSA Hardware Support a Point Acquisition?

    This is the reason why the "acquire1Scan.c" does not work.

    You will need run one example making an acquisition in the buffer. "acquireNScans.c" would be a good to watch. Be aware of all these examples, the default is +/-10V input range. The 9234 can only input +/-5V, so it will take a few changes. Also as you try to read an accelerometer, IEPE excitement is probably necessary. I've attached an example which is based on the example of "contAcquireNChan.c" that defines the range and allows the excitement for the device correctly.

  • I just posted a long question about recording on an Iomega Screenplay Director using the media library and the content is not visible when I try to watch on my TV. The question seems to have disappeared.

    The idea was to load an Iomega 2 TB disk with lots of movies to the computer by using the Media Center tuner. and then connect the Iomega to the TV and watch the movies at my ease. Unfortunately it does everything just

    Hello

    I suggest you to contact IOMega to improve assistance in this regard.

Maybe you are looking for