-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1701 from xodio/feat-add-ui-for-tweak-pulses
`tweak-pulse` nodes
- Loading branch information
Showing
16 changed files
with
180 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
packages/xod-client/src/editor/components/inspectorWidgets/PulseTweakWidget.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import React from 'react'; | ||
import PT from 'prop-types'; | ||
import * as XP from 'xod-project'; | ||
|
||
import PinWidget from './pinWidgets/PinWidget'; | ||
|
||
class PulseTweakWidget extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
|
||
this.handleClick = this.handleClick.bind(this); | ||
} | ||
|
||
handleClick() { | ||
this.props.onSendTweakPulse(this.props.nodeId); | ||
} | ||
|
||
render() { | ||
return ( | ||
<li> | ||
<PinWidget | ||
elementId="pulse-tweak" | ||
label="OUT" | ||
dataType={XP.PIN_TYPE.PULSE} | ||
direction={XP.PIN_DIRECTION.OUTPUT} | ||
isBindable | ||
isConnected | ||
> | ||
<button className="Button inspectorButton" onClick={this.handleClick}> | ||
Pulse | ||
</button> | ||
</PinWidget> | ||
</li> | ||
); | ||
} | ||
} | ||
|
||
PulseTweakWidget.propTypes = { | ||
nodeId: PT.string.isRequired, | ||
onSendTweakPulse: PT.func.isRequired, | ||
}; | ||
|
||
export default PulseTweakWidget; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
struct State { | ||
}; | ||
|
||
{{ GENERATED_CODE }} | ||
|
||
void evaluate(Context ctx) { | ||
// The actual code that makes tweak-nodes work | ||
// is injected in detail::handleTweaks | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"description": "Outputs a pulse whenever you trigger it manually in real-time during a debug or simulation session", | ||
"nodes": [ | ||
{ | ||
"id": "Bkf4BDsmV", | ||
"position": { | ||
"x": 34, | ||
"y": 204 | ||
}, | ||
"type": "xod/patch-nodes/output-pulse" | ||
}, | ||
{ | ||
"id": "H157HwsX4", | ||
"position": { | ||
"x": 34, | ||
"y": 102 | ||
}, | ||
"type": "xod/patch-nodes/not-implemented-in-xod" | ||
} | ||
] | ||
} |