12 lines
439 B
JavaScript
12 lines
439 B
JavaScript
export function PointSubscribe(baja, sub, ordPath, pointName) {
|
|
// ord 為要訂閱的點位
|
|
baja.Ord.make(`local:|foxs:|station:|slot:/${ordPath}`)
|
|
.get()
|
|
.then(folder => {
|
|
folder.getSlots().is("control:NumericWritable").eachValue((point) => {
|
|
if (point.getDisplayName() === pointName) {
|
|
baja.Ord.make(`local:|foxs:|station:|slot:/${ordPath}/${pointName}`).get({ subscriber: sub })
|
|
}
|
|
})
|
|
})
|
|
} |