Repository navigation
JSON send mode; ImageDisplay rotation, mirroring and scale mode - #13
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The image widget gets scaleMode (适应, 拉伸, 原始大小), rotation (0-359, clockwise), mirrorH and mirrorV. The box never changes: the picture is mirrored in its own frame, turned about the box centre and scaled so all of it stays inside. It paints the original picture through a QTransform instead of using ImageLabel, so it stays sharp at 2x and when zoomed. ImageDisplay moves to app/core/image_runtime.py, shared by the designer, the preview and exported apps. tests/data/image_placement_vectors.json holds where the picture's corners land, the same file FluentHMI Studio is checked against. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
commandMode"JSON"on the six command widgets (文本 / HEX / JSON / Modbus).commandTemplateis a JSON template. Each{value}becomes the value as JSON: a value that is valid JSON (1,true,{"a":1}) is used as is, anything else is sent as an escaped string, input boxes included. For example,{"cmd":"setSpeed","value":{value}}with 75 sends{"cmd":"setSpeed","value":75}.{value}inside quotes is an error). A bad template is reported and nothing is sent.commandJsonNewlineis added (default 无).rotation(0–359°, clockwise about the centre; the box stays put and the picture shrinks to fit);mirrorH/mirrorV;scaleMode(适应 / 拉伸 / 原始大小).protocol.mdgains a JSON mode section.Checked:
tests/data/json_command_vectors.json(78 cases) andtests/data/image_placement_vectors.json.\nline ending. The bytes matched FluentHMI Studio's exactly, and a bad template was rejected without sending.🤖 Generated with Claude Code