Conversation
| } | ||
|
|
||
| override fun getFBValue(d: String) { | ||
| setValue(d.equals("TRUE")); |
There was a problem hiding this comment.
Maybe use enum here, with value from line 8-9
qradimir
left a comment
There was a problem hiding this comment.
Thanks for the PR.
Things that we need to consider:
- Make a
cat_visuala gradle subproject of a root gradle project. Currenty it is an independent build - Extract samples from
cat_visual - Extract other functionality that are written in different modules into a separate
catmodule. - Package all functionality into a plugin
- Write documentation how to run
catinstances. Put it on our website (/docsfolder)
| ) : ZoomableBoxScope | ||
|
|
||
|
|
||
| abstract interface CustomItem { |
There was a problem hiding this comment.
Why do we need a special interface here? It seems to me we can just pass lambda to CanvasContext that will call directly all required composables, instead of wrapping them into CustomItem instances.
| fun RadioItem(items: List<String>) { | ||
| var color by remember { mutableStateOf(c) } | ||
| var selectedValue by remember { mutableStateOf("") } | ||
| val isSelectedItem: (String) -> Boolean = { selectedValue == it } |
There was a problem hiding this comment.
One-liners are not worth of extracting into variable.
| } | ||
| } | ||
|
|
||
| enum class TYPE_ID(val code: Int) { |
There was a problem hiding this comment.
Do not use upper case for type names
| import androidx.compose.runtime.mutableStateOf | ||
| import java.nio.ByteBuffer | ||
|
|
||
| data class SIntField(var defaultValue:Byte, override var content:Byte = 0, override val contentState: MutableState<Byte> = mutableStateOf(defaultValue)): ConnectionField<Byte>(content, contentState) { |
There was a problem hiding this comment.
All these classes have lots of common code -- I would suggest extract it in a common superclass.
|
|
||
| var ind = 0 | ||
|
|
||
| override fun response(fieldGetter: (ByteArray) -> Pair<Pair<ConnectionField<out Any>, ByteArray>, String>, ping:Long, callbacks: Map<String, () -> Unit>) { |
There was a problem hiding this comment.
Probably we need to think of utilising kotlin coroutines instead of spawning new threads each time.
| import androidx.compose.ui.zIndex | ||
|
|
||
| @Composable | ||
| fun PositionedBox(children: @Composable () -> Unit, x: Int = 0, y:Int = 0, zIndex: Float = 1f) { |
There was a problem hiding this comment.
If children will be last parameter here, it will allow to use trailing lambda syntax in usages and produce nicer code.
| val TANK_VOLUME = 100 | ||
| val MAX_TEMP = 100 | ||
|
|
||
| var isInlet: FieldWithCallback<Boolean> = FieldWithCallback(client.getField("stateInlet") as ConnectionField<Boolean>, |
There was a problem hiding this comment.
I would consider to design code in the way that here will be no casts required
| if (adapter == null) { | ||
| elements.remove(node) | ||
| } | ||
| return requiredClass.cast(adapter)!! |
There was a problem hiding this comment.
Consider to merge with master - this code has been changed some time ago.
| @@ -0,0 +1,5 @@ | |||
| package org.fbme.lib.iec61499.declarations | |||
|
|
|||
| interface SymbolDefinition { | |||
There was a problem hiding this comment.
No usages at the moment.
| ) { | ||
| fun convertFBType(): FBTypeDeclaration { | ||
| val root = myDocument.rootElement | ||
| if (root.getAttribute("UsedInCAT") != null && root.getAttribute("UsedInCAT").value == "True") { |
There was a problem hiding this comment.
Any particular difference between HMIInterfaceTypeDeclaration and ServiceInterfaceFBTypeDeclaration?
No description provided.