Пример #1
0
SimData::SimData(const std::tuple<size_t, size_t, size_t> domain_dimensions,
                 const size_t num_directions)
    : _domain_dimensions(domain_dimensions), _kdim(num_directions) {
    rho = nullptr;
    u = nullptr;
    n = nullptr;
    ntmp = nullptr;
    _bootstrap();
}
Пример #2
0
ArvDevice *
arv_uv_device_new (const char *vendor, const char *product, const char *serial_nbr)
{
	ArvUvDevice *uv_device;

	g_return_val_if_fail (vendor != NULL, NULL);
	g_return_val_if_fail (product != NULL, NULL);
	g_return_val_if_fail (serial_nbr != NULL, NULL);

	arv_debug_device ("[UvDevice::new] Vendor  = %s", vendor);
	arv_debug_device ("[UvDevice::new] Product = %s", product);
	arv_debug_device ("[UvDevice::new] S/N     = %s", serial_nbr);

	uv_device = g_object_new (ARV_TYPE_UV_DEVICE, NULL);

	libusb_init (&uv_device->priv->usb);
	uv_device->priv->vendor = g_strdup (vendor);
	uv_device->priv->product = g_strdup (product);
	uv_device->priv->serial_nbr = g_strdup (serial_nbr);
	uv_device->priv->packet_id = 65300; /* Start near the end of the circular counter */
	uv_device->priv->timeout_ms = 32;

	_open_usb_device (uv_device);

	arv_debug_device("[UvDevice::new] Using control endpoint %d, interface %d",
			 uv_device->priv->control_endpoint, uv_device->priv->control_interface);
	arv_debug_device("[UvDevice::new] Using data endpoint %d, interface %d",
			 uv_device->priv->data_endpoint, uv_device->priv->data_interface);

	if (uv_device->priv->usb_device == NULL ||
	    libusb_claim_interface (uv_device->priv->usb_device, uv_device->priv->control_interface) < 0 ||
	    libusb_claim_interface (uv_device->priv->usb_device, uv_device->priv->data_interface) < 0) {
		arv_warning_device ("[UvDevice::new] Failed to claim USB interface to '%s - #%s'", product, serial_nbr);
		g_object_unref (uv_device);
		return NULL;
	}

	_bootstrap (uv_device);

	if (!ARV_IS_GC (uv_device->priv->genicam)) {
		arv_warning_device ("[UvDevice::new] Failed to load genicam data");
		g_object_unref (uv_device);
		return NULL;
	}

	return ARV_DEVICE (uv_device);
}