关于PlantSimulation数据库操作的API接口记录

关于PlantSimulation数据库操作的API接口记录

InsertSigleValueToDb //向数据库中插入单个值
GetUUID //获取唯一ID
UpdataValueByIndex //更新某一个值
DeleteAllDataOfDatabase //清空数据库
ExistsTable //确认是否存在指定表名
SetSQLConnect //发起数据库连接
CreateSQLTableByObject //通过表对象创建数据库
DeleteTable//删除表
WriteNwDataToTable //数据库指定位置按行批量插入数据
AppendNwDataToTable//向数据库末端 从左向右增加数据
FillDataToSqlLiteByObject//根据数据表直接填充数据库

代码示例

	if  callLibrary(libraryID,"ExistsTable",VCT_M_Db.NAME)
		callLibrary(libraryID,"DeleteTable",VCT_M_Db.NAME)//删除目标表
	end
	if not callLibrary(libraryID,"CreateSQLTableByObject",VCT_M_Db)//"UID_Index_Data"
		freeLibrary(libraryID)
	end
	//断开数据库链接
	if not callLibrary(libraryID,"SetSQLClose")//"UID_Index_Data"
		freeLibrary(libraryID)
	end

关于设备的接口记录【未整理】

#pragma once
#include 
#include 
class ObjectPrimaryInterface
{
public:
	ObjectPrimaryInterface();
	~ObjectPrimaryInterface();
	/// 
	/// //获取表指定列的数据类型
	/// 
	/// 
	/// 
	/// 
	static UF_DataType getDataType(SimpleObjID TargetTable, int ColumnIndex);
	/// 
	/// //将对象的String类型转换为仿真内部使用的 UF_DataType 类型 
	/// 
	/// 
	/// 
	static UF_DataType TranslateStringToDataType(const char* StringDataType);
	/// 
	/// 确认对象是否存在指定属性
	/// 
	/// 目标对象
	/// 属性名称
	/// 
	static bool hasAttribute(SimpleObjID TargetObject, char* AttributeName);
	/// 
	/// 获取对象的类名--该接口仅支持到16.0
	/// 
	/// 目标对象
	/// 返回类名
	static char* GetInternalClassName(SimpleObjID TargetObject);
	/// 
	/// 获取对象名称
	/// 
	/// 对象实例
	/// 
	static char* GetName(SimpleObjID TargetObject);
	/// 
	/// 获取对象的类名--该接口从16.1开始支持
	/// 
	/// 目标对象
	/// /// 返回类名
	static char* GetInternalClassType(SimpleObjID TargetObject);
	/// ///获取指定属性的值/// 
	/// 目标对象
	///属性名称
	///UF_Value
	static void ObjectPrimaryInterface::GetAttribute(SimpleObjID TargetObject, char* AttributeName, UF_Value* RValue);
	/// 
	/// 对对象的执行属性进行赋值操作
	/// 
	/// 对象实例
	/// 新值
	/// 是否操作成功
	static bool SetValueToAttribute(SimpleObjID TargetObject, const char* AttributeName, char* nValue);
	/// 
	/// 对对象的执行属性进行赋值操作
	/// 
	/// 对象实例
	/// 新值
	/// 是否操作成功
	static bool SetValueToAttribute(SimpleObjID TargetObject, const char* AttributeName, int nValue);
	/// 
	/// 对对象的执行属性进行赋值操作
	/// 
	/// 对象实例
	/// 新值
	/// 是否操作成功
	static bool SetValueToAttribute(SimpleObjID TargetObject, const char* AttributeName, double nValue);
	/// 
	/// 对对象的执行属性进行赋值操作
	/// 
	/// 对象实例
	/// 新值
	/// 是否操作成功
	static bool SetValueToAttribute(SimpleObjID TargetObject, const char* AttributeName, bool nValue);
	/// 
	/// 对对象的执行属性进行赋值操作
	/// 
	/// 对象实例
	/// 新值
	/// 是否操作成功
	static bool SetValueToAttribute(SimpleObjID TargetObject, const char* AttributeName, SimpleObjID nValue);
	/// 
	/// 获取对象的绝对地址
	/// 
	/// 对象实例
	/// 返回值
	static char* ObjectPrimaryInterface::GetAbsPathByObject(SimpleObjID TargetObject);
};
/// 
/// 表操作API集合
/// 
class TableOpration
{
public:
	TableOpration();
	~TableOpration();
	/// 
	/// 获取详细的表基础信息
	/// 
	/// 
	/// 
	static mDataTable  GetDetailDataWithTable(SimpleObjID TargetObject);
	static bool WriteDataByIndex(SimpleObjID TableObject, int ColumnIndex, int RowIndex, int DataValue);
	static bool WriteDataByIndex(SimpleObjID TableObject, int ColumnIndex, int RowIndex, double DataValue);
	static bool WriteDataByIndex(SimpleObjID TableObject, int ColumnIndex, int RowIndex, char* DataValue);
	static bool WriteDataByIndex(SimpleObjID TableObject, int ColumnIndex, int RowIndex, bool DataValue);
	static void TableOpration::ReadDataByIndex(SimpleObjID TableObject, int ColumnIndex, int RowIndex, UF_Value mDataValue);
	static void TableOpration::ReadUuidInDataTableByIndex(SimpleObjID TableObject, int ColumnIndex, int RowIndex, char* UuidValue);
private:

};
/// 
/// 路径API操作集合
/// 
class PathOpration
{
public:
	PathOpration();
	~PathOpration();
private:

};


你可能感兴趣的:(数据库,c++,sql,PlantSimulation,TPS)