INNER CODE UNIT · Kotlin

valueConsumer

vogler75/automation-gateway · source/lib-plc4x/src/main/kotlin/Plc4xDriver.kt:223

    private fun valueConsumer(topic: Topic, data: PlcValue) {
        logger.finest { "Got value [${topic.topicName}] [$data]" }
        try {
            val value = toValue(data)
            eventBus.publishDataPoint(vertx, DataPoint(topic, value))
        } catch (e: java.lang.Exception) {
            e.printStackTrace()
        }
    }

    override fun unsubscribeTopics(topics: List<Topic>, items: List<MonitoredItem>): Future<Boolean> {
        val promise = Promise.promise<Boolean>()
        try {
            val xs = items.filterIsInstance<Plc4xMonitoredItem>()
            if (xs.isNotEmpty()) {
                val builder = plc!!.unsubscriptionRequestBuilder()
                items.filterIsInstance<Plc4xMonitoredItem>().forEach { item ->
                    builder.addHandles(item.item)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…