Mango Automation 时间相关功能

问题描述 投票:0回答:1

我刚刚开始使用 Mango Automation。尝试为这个 Modbus 串行事物构建一个控制页面。我使用的是Mango Automation V5.0.3,使用Win10和Chrome版本120.0.6099.217。

大部分都是有道理的,但我坚持处理时间数据。我不知道如何设置一个带有简单的开/关开关(开始/停止)的页面,以及用于显示开始时间、停止时间和正常运行时间的三个字段,即使在这些开始/停止开关期间也是如此。而且,哦,我还想以时间格式和以秒为单位的普通旧整数显示持续时间。

我需要哪些虚拟数据点?我应该如何格式化它们?有人可以帮助这个新手编码员吗?

javascript html dashboard
1个回答
0
投票

我终于解决了我的问题。 该页面正在运行,已获得所有所需的结果。但是,我无法在显示持续时间时删除天数中多余的 1。如何才能做到这一点? 我非常想了解我所应用的方法有多正确和优化。 要开始一个页面,请将下一个文本粘贴到芒果页面编辑器中的空白新页面中

<div class="ma-designer-root" id="11c26dc1-8e3d-475e-ba22-1b6d9c37eb0c" style="width: 1366px; height: 768px; position: relative; background-color: rgb(204, 204, 255);">
<ma-get-point-value point-xid="startTime" point="_startTime"></ma-get-point-value>
<ma-get-point-value point-xid="stopTime" point="_stopTime"></ma-get-point-value>
<ma-get-point-value point-xid="Start" point="_Start"></ma-get-point-value>
<ma-switch id="0022dde1-a203-4176-a0eb-9b120feb36a3" style="position: absolute; left: 220px; top: 60px; font-weight: bold; font-family: fantasy; text-align: center; width: 100px; height: 70px; background-color: rgb(153, 153, 255); color: rgb(0, 0, 0);" display-type="switch" point="Start" label="NAME" point-xid="Start" ng-click="_Start.value ? (_stopTime.setValue(_stopTime.time)) :  (_startTime.setValue(_startTime.time))">Start</ma-switch>
    <ma-now update-interval="1 SECONDS" output="time" browser-timezone="browserTz"></ma-now>
<div id="7ebdece1-8366-4df8-b660-62c0c19da235" style="position: absolute; left: 10px; top: 10px; width: 170px; height: 30px; font-weight: normal; line-height: 13px; font-size: 20px; font-family: fantasy;">{{time|maMoment:'format':' DD.MM.YY HH:mm:ss  '}}</div>
<div id="b554c70c-e4ab-49f8-89be-0b1348180c96" style="position: absolute; left: 370px; top: 70px; width: 210px; height: 30px;">Start time:  {{_startTime.value|maMoment:'format':' DD.MM.YY HH:mm:ss '}}</div>
<div id="55e794bb-b763-4d59-b2c7-b03bfac43d87" style="position: absolute; left: 370px; top: 100px; width: 210px; height: 30px;" ng-show="_Start.value === false">Stop time :{{_stopTime.value|maMoment:'format':' DD.MM.YY HH:mm:ss '}}</div>
<div id="36cc40c9-66d1-4369-9b29-b18edf4cb066" style="position: absolute; left: 670px; top: 90px; width: 210px; height: 30px;" ng-show="_Start.value === false">{{(_stopTime.value-_startTime.value)/1000}}{{"sec = "}} {{((_stopTime.value-_startTime.value))|maMoment:'tz':'UTC'|maMoment:'format':'DDDD[day] HH:mm:ss '}}</div>
<ma-indicator id="af49567e-6576-49f5-9bdd-8d8808324cbc" style="position: absolute; width: 30px; height: 30px; left: 330px; top: 80px;" color-false="#ff0000" color-true="#00f500" toggle-on-click="true" point="_Start"></ma-indicator>
<div id="fe605657-ed93-4361-9755-7d4ff023ed1f" style="position: absolute; left: 670px; top: 90px; width: 140px; height: 30px;" ng-show="_Start.value">{{(_stopTime.time-_startTime.value)/1000}}sec</div>
<div id="fffc771a-27b3-463b-b464-fdaf9db2841d" style="position: absolute; left: 590px; top: 90px; width: 150px; height: 30px;">Duration:</div></div>

并将文件export_Time_Demo.json导入到数据集成->配置导入/导出中。 期待您的评论。谢谢你。

© www.soinside.com 2019 - 2024. All rights reserved.