所属产品: Mingcedar Studio DESIGNER
Rotate 旋转 | Mingcedar Studio
按角度值绕指定支点旋转组件,适用于指针、阀板和风扇。
<div class="manual-doc-article manual-doc-article-section"><h2 id="geometry-rotate">几何: Rotate 旋转</h2>
按角度值绕指定支点旋转组件,适用于指针、阀板和风扇。
<div class="doc-card-list">
<article class="doc-card">
<h3 id="geometry-rotate-item-1">功能说明</h3>
<p>在 Behavior Browser → Geometry 中将 Rotate 拖到组件。它直接应用输入角度,不按区间换算百分比。</p>
</article>
<article class="doc-card">
<h3 id="geometry-rotate-item-2">使用方法:编辑器控件逐项说明</h3>
<p>Rotation input 直接返回角度(度)。Maximum angle 定义对称的允许范围,PIVOT POINT 指定旋转支点。Rotate 不按源范围计算百分比。</p>
<ul>
<li>Behavior name 可编辑,Component name 只读。</li>
<li>Override border by quality:按数据质量配置 Good / Bad 边框。</li>
<li>JS functions...:向聚焦的表达式字段插入方法。</li>
<li>Rotation input:角度表达式,例如 ReadTagDouble("PLC_LINE01.VALVE01.ANGLE", 0)。</li>
<li>Condition:布尔表达式;false 跳过旋转,不隐藏组件。</li>
<li>Maximum angle:默认 360。90 表示允许 -90° 到 +90°;预设按钮可填入 45、90、180、270 或 360。</li>
<li>PIVOT POINT:Center、Top、Bottom、Left、Right,按机械转轴选择。</li>
<li>Hide outside angle range:超出允许范围时隐藏;未启用时角度限制在边界。</li>
<li>Save / Ctrl+S 校验并保存,Cancel / Esc 放弃修改。</li>
</ul>
<div class="manual-code" data-code-language="text"><div class="manual-code-toolbar"><span>Text</span><span class="manual-code-tools"><small>Text</small><button type="button" data-copy-code data-copied="已复制" data-failed="请选中代码后复制" aria-label="复制代码: Text">复制代码</button><span class="manual-code-status" role="status"></span></span></div><pre tabindex="0" class="docs-code-block shiki github-light" style="background-color:#fff;color:#24292e" tabindex="0"><code><span class="line"><span>// Rotation input</span></span>
<span class="line"><span>ReadTagDouble("PLC_LINE01.VALVE01.ANGLE", 0)</span></span>
<span class="line"><span></span></span>
<span class="line"><span>// Maximum angle: 90</span></span>
<span class="line"><span>// PIVOT POINT: Center</span></span></code></pre></div>
</article>
<article class="doc-card">
<h3 id="geometry-rotate-item-3">适用场景</h3>
<p>用于按当前角度转动图形,例如:</p>
<ul>
<li>仪表指针:把压力/温度对应的角度读出来,驱动指针绕中心转动</li>
<li>阀门开度:阀门图标按开度角度转动,支点选在阀杆的真实机械中心</li>
<li>风扇 / 搅拌叶片:按运行角度旋转叶片,表现转动状态</li>
</ul>
</article>
<article class="doc-card">
<h3 id="geometry-rotate-item-4">限制与常见问题</h3>
<ul>
<li>Rotation input 的单位是度;若 Tag 提供开度百分比,应显式换算为角度。</li>
<li>支点应与机械转轴重合。底端固定的指针选择 Bottom;以图形中心转动的对象选择 Center。</li>
<li>角度预设按钮只修改 Maximum angle,不修改 Rotation input。</li>
<li>Condition 为 false 仅跳过当前旋转;可见性应通过隐藏选项或独立显隐行为控制。</li>
</ul>
</article>
</div>
<div class="docs-note-grid manual-doc-image-grid">
<figure class="docs-note-card manual-doc-image-card" id="geometry-rotate-image-1">
<img src="/WEB_img/HQPPT/current/geometry/rotate.png" alt="Rotate 旋转行为编辑器" loading="lazy" decoding="async" />
<figcaption>
<strong>图示 1: Rotate 编辑器</strong>
<p>把角度值应用到组件,按选定支点旋转,可设最大旋转和支点位置。</p>
</figcaption>
</figure>
</div>
</div>