Esempio n. 1
0
    bool CameraGigeAravis::listCameras(){

        ArvInterface *interface;
        //arv_update_device_list();

        int ni = arv_get_n_interfaces ();

        cout << endl << "------------ GIGE CAMERAS WITH ARAVIS ----------" << endl << endl;

        for (int j = 0; j< ni; j++){

            interface = arv_gv_interface_get_instance();
            arv_interface_update_device_list(interface);
            //int nb = arv_get_n_devices();

            int nb = arv_interface_get_n_devices(interface);
            for(int i = 0; i < nb; i++){

                cout << "-> [" << i << "] " << arv_interface_get_device_id(interface,i)<< endl;
                //cout << "-> [" << i << "] " << arv_get_device_id(i)<< endl;

            }

            if(nb == 0) {
                cout << "-> No cameras detected..." << endl;
                return false;
            }
        }
        cout << endl << "------------------------------------------------" << endl << endl;

        return true;

    }
Esempio n. 2
0
const char *
arv_get_device_id (unsigned int index)
{
	unsigned int offset = 0;
	unsigned int i;

	for (i = 0; i < G_N_ELEMENTS (interfaces); i++) {
		ArvInterface *interface;
		unsigned int n_devices;

		interface = interfaces[i].get_interface_instance ();
		n_devices = arv_interface_get_n_devices (interface);

		if (index - offset < n_devices)
			return arv_interface_get_device_id (interface, index - offset);

		offset += n_devices;
	}

	return NULL;
}
Esempio n. 3
0
    vector<pair<int,string>> CameraGigeAravis::getCamerasList() {

        vector<pair<int,string>> camerasList;

        ArvInterface *interface;

        //arv_update_device_list();

        int ni = arv_get_n_interfaces();


        for (int j = 0; j< ni; j++){

            const char* name = arv_get_interface_id (j);
            if (strcmp(name,"GigEVision") == 0) {
                interface = arv_gv_interface_get_instance();
                arv_interface_update_device_list(interface);
                //int nb = arv_get_n_devices();

                int nb = arv_interface_get_n_devices(interface);

                for(int i = 0; i < nb; i++){

                    pair<int,string> c;
                    c.first = i;
                    //const char* str = arv_get_device_id(i);
                    const char* str = arv_interface_get_device_id(interface,i);
                    const char* addr = arv_interface_get_device_address(interface,i);
                    std::string s = str;
                    c.second = "NAME[" + s + "] SDK[ARAVIS] IP: " + addr;
                    camerasList.push_back(c);
                }
            }
        }

       return camerasList;

    }