예제 #1
0
ArvGcNode *
arv_gc_struct_entry_node_new (void)
{
    ArvGcStructEntryNode *gc_struct_entry_node;

    gc_struct_entry_node = g_object_new (ARV_TYPE_GC_STRUCT_ENTRY_NODE, NULL);

    return ARV_GC_NODE (gc_struct_entry_node);
}
예제 #2
0
ArvGcNode *
arv_gc_variable_node_new (void)
{
	ArvGcPropertyNode *node;

	node = g_object_new (ARV_TYPE_GC_VARIABLE_NODE, NULL);
	node->type = ARV_GC_PROPERTY_NODE_TYPE_P_VARIABLE;

	return ARV_GC_NODE (node);
}
예제 #3
0
ArvGcNode *
arv_gc_index_node_new (void)
{
	ArvGcPropertyNode *node;

	node = g_object_new (ARV_TYPE_GC_INDEX_NODE, NULL);
	node->type = ARV_GC_PROPERTY_NODE_TYPE_P_INDEX;

	return ARV_GC_NODE (node);
}
예제 #4
0
ArvGcNode *
arv_gc_invalidator_node_new (void)
{
	ArvGcPropertyNode *node;

	node = g_object_new (ARV_TYPE_GC_INVALIDATOR_NODE, NULL);
	node->type = ARV_GC_PROPERTY_NODE_TYPE_P_INVALIDATOR;

	return ARV_GC_NODE (node);
}
예제 #5
0
static ArvGcNode *
arv_gc_property_node_new (ArvGcPropertyNodeType type)
{
	ArvGcPropertyNode *node;

	node = g_object_new (ARV_TYPE_GC_PROPERTY_NODE, NULL);
	node->type = type;

	return ARV_GC_NODE (node);
}
예제 #6
0
ArvGcNode *
arv_gc_swiss_knife_new (void)
{
	ArvGcSwissKnife *swiss_knife;

	swiss_knife = g_object_new (ARV_TYPE_GC_SWISS_KNIFE, NULL);
	swiss_knife->value_type = G_TYPE_DOUBLE;

	return ARV_GC_NODE (swiss_knife);
}
예제 #7
0
ArvGcNode *
arv_gc_converter_new_integer (void)
{
	ArvGcConverter *converter;

	converter = g_object_new (ARV_TYPE_GC_CONVERTER, NULL);
	converter->value_type = G_TYPE_INT64;

	return ARV_GC_NODE (converter);
}
예제 #8
0
ArvGcNode *
arv_gc_register_node_new_struct_register (void)
{
	ArvGcRegisterNode *gc_register_node;

	gc_register_node = g_object_new (ARV_TYPE_GC_REGISTER_NODE, NULL);
	gc_register_node->type = ARV_GC_REGISTER_NODE_TYPE_STRUCT_REGISTER;
	gc_register_node->value_type = G_TYPE_INT64;

	return ARV_GC_NODE (gc_register_node);
}
예제 #9
0
ArvGcNode *
arv_gc_register_node_new_float (void)
{
	ArvGcRegisterNode *gc_register_node;

	gc_register_node = g_object_new (ARV_TYPE_GC_REGISTER_NODE, NULL);
	gc_register_node->type = ARV_GC_REGISTER_NODE_TYPE_FLOAT;
	gc_register_node->value_type = G_TYPE_DOUBLE;

	return ARV_GC_NODE (gc_register_node);
}
예제 #10
0
ArvGcNode *
arv_gc_register_node_new_masked_integer (void)
{
	ArvGcRegisterNode *gc_register_node;

	gc_register_node = g_object_new (ARV_TYPE_GC_REGISTER_NODE, NULL);
	gc_register_node->type = ARV_GC_REGISTER_NODE_TYPE_MASKED_INTEGER;
	gc_register_node->value_type = G_TYPE_INT64;

	return ARV_GC_NODE (gc_register_node);
}
예제 #11
0
ArvGcNode *
arv_gc_register_node_new (void)
{
	ArvGcRegisterNode *gc_register_node;

	gc_register_node = g_object_new (ARV_TYPE_GC_REGISTER_NODE, NULL);
	gc_register_node->type = ARV_GC_REGISTER_NODE_TYPE_REGISTER;
	gc_register_node->value_type = G_TYPE_BYTE_ARRAY;

	return ARV_GC_NODE (gc_register_node);
}
예제 #12
0
ArvGcNode *
arv_gc_property_node_get_linked_node (ArvGcPropertyNode *node)
{
	ArvGc *genicam;

	g_return_val_if_fail (ARV_IS_GC_PROPERTY_NODE (node), NULL);
	g_return_val_if_fail (node->type > ARV_GC_PROPERTY_NODE_TYPE_P_UNKNONW, NULL);

	genicam = arv_gc_node_get_genicam (ARV_GC_NODE (node));
	return arv_gc_get_node (genicam, _get_value_data (node));
}
예제 #13
0
static guint64
_get_address (ArvGcRegisterNode *gc_register_node, GError **error)
{
	ArvGc *genicam;
	GError *local_error = NULL;
	GSList *iter;
	guint64 value = 0;

	genicam = arv_gc_node_get_genicam (ARV_GC_NODE (gc_register_node));
	g_return_val_if_fail (ARV_IS_GC (genicam), 0);

	for (iter = gc_register_node->addresses; iter != NULL; iter = iter->next) {
		value += arv_gc_property_node_get_int64 (iter->data, &local_error);

		if (local_error != NULL) {
			g_propagate_error (error, local_error);
			return 0;
		}
	}

	for (iter = gc_register_node->swiss_knives; iter != NULL; iter = iter->next) {
		value += arv_gc_integer_get_value (iter->data, &local_error);

		if (local_error != NULL) {
			g_propagate_error (error, local_error);
			return 0;
		}
	}

	if (gc_register_node->index != NULL) {
		gint64 length;

		length = _get_length (gc_register_node, &local_error);

		if (local_error != NULL) {
			g_propagate_error (error, local_error);
			return 0;
		}

		value += arv_gc_index_node_get_index (ARV_GC_INDEX_NODE (gc_register_node->index), length, &local_error);

		if (local_error != NULL) {
			g_propagate_error (error, local_error);
			return 0;
		}
	}

	return value;
}
예제 #14
0
static ArvDomNode *
_get_pvalue_node (ArvGcPropertyNode *property_node)
{
	ArvDomNode *pvalue_node;
	const char *node_name;
	ArvGc *genicam;

	if (property_node->type < ARV_GC_PROPERTY_NODE_TYPE_P_UNKNONW)
		return NULL;

	node_name = _get_value_data (property_node);
	genicam = arv_gc_node_get_genicam (ARV_GC_NODE (property_node));
	pvalue_node = ARV_DOM_NODE (arv_gc_get_node (genicam, node_name));

	return pvalue_node;
}
예제 #15
0
gint64
arv_gc_index_node_get_index (ArvGcIndexNode *index_node, gint64 default_offset, GError **error)
{
	gint64 offset;
	gint64 node_value;
	GError *local_error = NULL;

	g_return_val_if_fail (ARV_IS_GC_INDEX_NODE (index_node), 0);
	g_return_val_if_fail (error == NULL || *error == NULL, 0);

	if (index_node->offset == NULL)
		offset = default_offset;
	else {
		if (index_node->is_p_offset) {
			ArvGcNode *node;
			ArvGc *genicam;

			genicam = arv_gc_node_get_genicam (ARV_GC_NODE (index_node));
			node = arv_gc_get_node (genicam, index_node->offset);
			offset = arv_gc_integer_get_value (ARV_GC_INTEGER (node), &local_error);

			if (local_error != NULL) {
				g_propagate_error (error, local_error);

				return 0;
			}
		} else
			offset = g_ascii_strtoll (index_node->offset, NULL, 0);
	}

	node_value = arv_gc_property_node_get_int64 (ARV_GC_PROPERTY_NODE (index_node), &local_error);

	if (local_error != NULL) {
		g_propagate_error (error, local_error);
		return 0;
	}

	return offset * node_value;
}
예제 #16
0
static void
arv_gc_feature_node_set_attribute (ArvDomElement *self, const char *name, const char *value)
{
	ArvGcFeatureNode *node = ARV_GC_FEATURE_NODE (self);

	if (strcmp (name, "Name") == 0) {
		ArvGc *genicam;

		g_free (node->priv->name);
		node->priv->name = g_strdup (value);

		genicam = arv_gc_node_get_genicam (ARV_GC_NODE (self));
		/* Kludge around ugly Genicam specification (Really, pre-parsing for EnumEntry Name substitution ?) */
		if (strcmp (arv_dom_node_get_node_name (ARV_DOM_NODE (node)), "EnumEntry") != 0)
			arv_gc_register_feature_node (genicam, node);
	} else if (strcmp (name, "NameSpace") == 0) {
		if (g_strcmp0 (value, "Standard") == 0)
			node->priv->name_space = ARV_GC_NAME_SPACE_STANDARD;
		else
			node->priv->name_space = ARV_GC_NAME_SPACE_CUSTOM;
	} else
		arv_debug_dom ("[GcFeature::set_attribute] Unknown attribute '%s'", name);
}