feat: Enhance equipment components with pin functionality and constraint management

- Added pin support to MechanicalButton, enabling pin-click events and componentId handling.
- Updated Pin component to manage constraint states and colors dynamically.
- Integrated SMT_LED with pin functionality, allowing LED state to respond to constraints.
- Enhanced Wire component to reflect constraint colors and manage wire states based on pin connections.
- Introduced wireManager for managing wire states and constraints.
- Implemented a constraints store for managing and notifying constraint state changes across components.
- Updated component configuration to remove appearance options and clarify constraint descriptions.
- Improved ProjectView to handle optional chaining for props and ensure robust data handling.
- Initialized constraint communication in main application entry point.
This commit is contained in:
alivender
2025-04-29 11:05:30 +08:00
parent 10db7c67bf
commit 1c75aa621a
12 changed files with 590 additions and 420 deletions

View File

@@ -154,18 +154,6 @@ const componentConfigs: Record<string, ComponentConfig> = {
{ value: 'analog', label: 'analog' }
],
description: '引脚的模数特性,数字或模拟'
},
{
name: 'appearance',
type: 'select',
label: '引脚样式',
default: 'Dip',
options: [
{ value: 'None', label: 'None' },
{ value: 'Dip', label: 'Dip' },
{ value: 'SMT', label: 'SMT' }
],
description: '引脚的外观样式,不影响功能'
}
]
},
@@ -313,9 +301,9 @@ const componentConfigs: Record<string, ComponentConfig> = {
{
name: 'constraint',
type: 'string',
label: '连接约束',
label: '引脚约束',
default: '',
description: '相同约束字符串的组件将被视为有电气连接'
description: '相同约束字符串的引脚将被视为有电气连接'
}
]
},
@@ -341,7 +329,7 @@ const componentConfigs: Record<string, ComponentConfig> = {
default: '#4a5568',
description: '线条颜色使用CSS颜色值'
},
{
{
name: 'strokeWidth',
type: 'number',
label: '线条宽度',