西門子PLC: | 西門子伺服電機(jī) |
西門子觸摸屏: | 西門子電纜 |
西門子變頻器: | 西門子模塊 |
單價: | 面議 |
發(fā)貨期限: | 自買家付款之日起 天內(nèi)發(fā)貨 |
所在地: | 廣東 惠州 |
有效期至: | 長期有效 |
發(fā)布時間: | 2024-07-18 10:17 |
最后更新: | 2024-07-18 10:17 |
瀏覽次數(shù): | 61 |
采購咨詢: |
請賣家聯(lián)系我
|
portant; overflow-wrap: break-word !important;">利用威綸觸摸屏ta:image/svg+xml,%3csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M7.60772 8.29444C7.02144 8.73734 6.29139 9 5.5 9C3.567 9 2 7.433 2 5.5C2 3.567 3.567 2 5.5 2C7.433 2 9 3.567 9 5.5C9 6.28241 8.74327 7.00486 8.30946 7.5877C8.3183 7.59444 8.3268 7.60186 8.33488 7.60994L10.4331 9.70816L9.726 10.4153L7.62777 8.31704C7.62055 8.30983 7.61387 8.30228 7.60772 8.29444ZM8 5.5C8 6.88071 6.88071 8 5.5 8C4.11929 8 3 6.88071 3 5.5C3 4.11929 4.11929 3 5.5 3C6.88071 3 8 4.11929 8 5.5Z' fill='%23576B95'/%3e%3c/svg%3e");">的JS元件與MQTT功能實(shí)現(xiàn)遠(yuǎn)程更新屏幕圖表。
JS元件
JS元件是指威綸觸摸屏系統(tǒng)中使用的Javascript(JS)元件。
這些元件是為了方便在觸摸屏界面上實(shí)現(xiàn)動態(tài)內(nèi)容展示和增強(qiáng)用戶體驗(yàn)等方面而設(shè)計的。
通過JS元件,觸摸屏可以實(shí)現(xiàn)動態(tài)內(nèi)容的更新和刷新,讓用戶能夠?qū)崟r獲取最新的信息和數(shù)據(jù)。
在組態(tài)開發(fā)過程中,開發(fā)人員可以利用這些JS元件來構(gòu)建用戶界面,響應(yīng)用戶操作,并與后臺系統(tǒng)進(jìn)行數(shù)據(jù)交換。
這樣就能夠?qū)崿F(xiàn)更加豐富、靈活和智能化的觸摸屏應(yīng)用程序,滿足不同場景下的需求。
比如,我們先簡單定義一個雷達(dá)圖ta:image/svg+xml,%3csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M7.60772 8.29444C7.02144 8.73734 6.29139 9 5.5 9C3.567 9 2 7.433 2 5.5C2 3.567 3.567 2 5.5 2C7.433 2 9 3.567 9 5.5C9 6.28241 8.74327 7.00486 8.30946 7.5877C8.3183 7.59444 8.3268 7.60186 8.33488 7.60994L10.4331 9.70816L9.726 10.4153L7.62777 8.31704C7.62055 8.30983 7.61387 8.30228 7.60772 8.29444ZM8 5.5C8 6.88071 6.88071 8 5.5 8C4.11929 8 3 6.88071 3 5.5C3 4.11929 4.11929 3 5.5 3C6.88071 3 8 4.11929 8 5.5Z' fill='%23576B95'/%3e%3c/svg%3e");">,并為它賦予初始數(shù)據(jù)和標(biāo)簽,如下:
portant; overflow-wrap: break-word !important;">var radarChart = new Chart(ctx, configuration)
portant; overflow-wrap: break-word !important;">var configuration = {
portant; overflow-wrap: break-word !important;"> type: 'radar',
portant; overflow-wrap: break-word !important;"> data: {
portant; overflow-wrap: break-word !important;"> labels: [ '員工1', '員工2', '員工3', '員工4', '員工5', '員工6', ],
portant; overflow-wrap: break-word !important;"> datasets: [{
portant; overflow-wrap: break-word !important;"> label: '去年生產(chǎn)量',
portant; overflow-wrap: break-word !important;"> data: [0, 1, 2, 3, 4, 5],
portant; overflow-wrap: break-word !important;"> fill: true,
portant; overflow-wrap: break-word !important;"> backgroundColor: 'rgba(255, 99, 132, 0.2)',
portant; overflow-wrap: break-word !important;"> borderColor: 'rgb(255, 99, 132)',
portant; overflow-wrap: break-word !important;"> pointBackgroundColor: 'rgb(255, 99, 132)',
portant; overflow-wrap: break-word !important;"> pointBorderColor: '#fff',
portant; overflow-wrap: break-word !important;"> },
portant; overflow-wrap: break-word !important;"> {
portant; overflow-wrap: break-word !important;"> label: '今年生產(chǎn)量',
portant; overflow-wrap: break-word !important;"> data: [5, 4, 3, 2, 1, 0],
portant; overflow-wrap: break-word !important;"> fill: true,
portant; overflow-wrap: break-word !important;"> backgroundColor: 'rgba(54, 162, 235, 0.2)',
portant; overflow-wrap: break-word !important;"> borderColor: 'rgb(54, 162, 235)',
portant; overflow-wrap: break-word !important;"> pointBackgroundColor: 'rgb(54, 162, 235)',
portant; overflow-wrap: break-word !important;"> pointBorderColor: '#fff',
portant; overflow-wrap: break-word !important;"> }]
portant; overflow-wrap: break-word !important;"> },
portant; overflow-wrap: break-word !important;"> options: {
portant; overflow-wrap: break-word !important;"> elements: {
portant; overflow-wrap: break-word !important;"> line: {
portant; overflow-wrap: break-word !important;"> borderWidth: 3
portant; overflow-wrap: break-word !important;"> }
portant; overflow-wrap: break-word !important;"> },
portant; overflow-wrap: break-word !important;"> scales: {
portant; overflow-wrap: break-word !important;"> r: {
portant; overflow-wrap: break-word !important;"> beginAtZero: true
portant; overflow-wrap: break-word !important;"> }
portant; overflow-wrap: break-word !important;"> }
portant; overflow-wrap: break-word !important;"> },
portant; overflow-wrap: break-word !important;">};
這是一段基礎(chǔ)的創(chuàng)建雷達(dá)圖的代碼,不加修改的話會有以下效果:
雷達(dá)圖(也稱為蜘蛛圖或星圖)是一種常用的數(shù)據(jù)可視化工具,它具有多維度展示、對比性、適用性廣泛等優(yōu)點(diǎn),是一種功能強(qiáng)大、直觀易懂的數(shù)據(jù)可視化工具。
但是,我們在通過JS元件創(chuàng)建雷達(dá)圖之后,它的數(shù)據(jù)將只能通過修改地址內(nèi)的數(shù)據(jù)來實(shí)現(xiàn)更改,這就限制了其使用的便捷性。
那么實(shí)現(xiàn)如何遠(yuǎn)程更改圖表呢?這就用到了另一個工具——MQTT。