-- 机床，机器人等对应的时序数据库配置表，即TDengine配置表
CREATE CLASS IF NOT EXISTS ts_db_config: Biz2 (
	id 			varchar 	'MachineTool/Robot ID',
	conf_type 	varchar		'TDengine',
	version 	varchar		'1.0',
	host 		varchar		'grapetec',
	port 		int			'6030',
	user 		varchar		'root',
	password 	varchar		'taosdata',
	db_name		varchar		'kuka_kr6_sn51465',
	tables 		varchar		'表结构 - 这里直接存为String，等确有结构化需求了，再打散存储'
)with key=manu, alias='TsDbConfig', nickname='TsDbConfig', version=true;

-- 任务相关
CREATE CLASS IF NOT EXISTS task_info : Biz2 (
	id			varchar		'TaskID',
	creator_id	varchar		'创建者ID',
	receiver_id	varchar		'接收者ID',
	description	text		'描述信息',
	file_name	varchar		'Task对应的zip文件名称',
	file_stamp	varchar		'zip文件对应MD5',
	create_time	timestamp	'创建时间'
)with key=manu, alias='TaskInfo', nickname='TaskInfo', version=true;

--- 存储刀具映射，根据刀具ID来获取刀具类型
CREATE CLASS IF NOT EXISTS machining_tool_catalog: Biz2 (
	id									varchar		'刀具ID',
	tool_type 							text		'刀具大类型，例：MillingCuttingTool'
)with alias='MachiningToolCatalog', nickname='MachiningToolCatalog', version=true;

--- 存储刀具状态（可扩展）
CREATE CLASS IF NOT EXISTS machining_tool_state: Biz2 (
	id								varchar 	'刀具ID',
	machine_tool_id					varchar		'绑定到哪个机床了',
	slot_id			 				int			'绑定到哪个槽位'
)with alias='MachiningToolState', nickname='MachiningToolState', version=true;

--- 机床绑定的刀具信息
CREATE CLASS IF NOT EXISTS magazine_slot: Biz2 (
	id							varchar		'机床ID_slotID',
	slot_id			 			int			'刀具槽位ID',
	machining_tool_id 			varchar		'刀具ID',
	machining_tool_sub_type		varchar		'刀具子类型，例如Endmill',
	machining_tool_brief		varchar		'刀具的概要信息'
)with alias='MagazineSlot', nickname='MagazineSlot', version=true;

--- 机床刀库信息
CREATE CLASS IF NOT EXISTS machine_tool_magazine: Biz2 (
	id							varchar		'机床ID',
	slots						MagazineSlot[?]
)with alias='MachineToolMagazine', nickname='MachineToolMagazine', version=true;

