Replacing gui by kotlin
This commit is contained in:
parent
797df76dba
commit
1d51ae6702
@ -5,7 +5,6 @@ import hep.dataforge.control.devices.Device
|
|||||||
import hep.dataforge.control.devices.DeviceListener
|
import hep.dataforge.control.devices.DeviceListener
|
||||||
import hep.dataforge.control.devices.PortSensor
|
import hep.dataforge.control.devices.PortSensor
|
||||||
import hep.dataforge.control.devices.Sensor
|
import hep.dataforge.control.devices.Sensor
|
||||||
import hep.dataforge.fx.FXObject
|
|
||||||
import hep.dataforge.fx.fragments.FXFragment
|
import hep.dataforge.fx.fragments.FXFragment
|
||||||
import hep.dataforge.fx.fragments.FragmentWindow
|
import hep.dataforge.fx.fragments.FragmentWindow
|
||||||
import hep.dataforge.values.Value
|
import hep.dataforge.values.Value
|
||||||
@ -24,7 +23,7 @@ import java.util.*
|
|||||||
/**
|
/**
|
||||||
* Created by darksnake on 14-May-17.
|
* Created by darksnake on 14-May-17.
|
||||||
*/
|
*/
|
||||||
abstract class DeviceViewConnection<D : Device> : Component(), Connection, DeviceListener, FXObject {
|
abstract class DeviceViewConnection<D : Device> : Component(), Connection, DeviceListener {
|
||||||
|
|
||||||
private val bindings = HashMap<String, ObjectBinding<Value>>()
|
private val bindings = HashMap<String, ObjectBinding<Value>>()
|
||||||
|
|
||||||
@ -141,7 +140,7 @@ abstract class DeviceViewConnection<D : Device> : Component(), Connection, Devic
|
|||||||
}
|
}
|
||||||
togglebutton("View") {
|
togglebutton("View") {
|
||||||
isSelected = false
|
isSelected = false
|
||||||
FragmentWindow.build(this){FXFragment.buildFromNode(device.name) { fxNode }}
|
FragmentWindow.build(this){FXFragment.buildFromNode(device.name) { getFxNode() }}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ abstract class NumassControlApplication<D : Device> : App() {
|
|||||||
device = setupDevice()
|
device = setupDevice()
|
||||||
val controller = buildView(device)
|
val controller = buildView(device)
|
||||||
device.connect(controller, Roles.VIEW_ROLE, Roles.DEVICE_LISTENER_ROLE)
|
device.connect(controller, Roles.VIEW_ROLE, Roles.DEVICE_LISTENER_ROLE)
|
||||||
val scene = Scene(controller.pane)
|
val scene = Scene(controller.getPane())
|
||||||
stage.scene = scene
|
stage.scene = scene
|
||||||
|
|
||||||
stage.show()
|
stage.show()
|
||||||
|
@ -108,7 +108,7 @@ class VacCollectorViewConnection : DeviceViewConnection<VacCollectorDevice>() {
|
|||||||
hbarPolicy = ScrollPane.ScrollBarPolicy.NEVER
|
hbarPolicy = ScrollPane.ScrollBarPolicy.NEVER
|
||||||
vbox {
|
vbox {
|
||||||
viewList.forEach {
|
viewList.forEach {
|
||||||
add(it.fxNode)
|
add(it.getFxNode())
|
||||||
separator(Orientation.HORIZONTAL)
|
separator(Orientation.HORIZONTAL)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -85,7 +85,7 @@ val storageInterceptor = InterceptorFactory { context, meta ->
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val controlInterceptor = InterceptorFactory { context, meta ->
|
val deviceInterceptor = InterceptorFactory { context, meta ->
|
||||||
val deviceManager = context.getFeature(DeviceManager::class.java);
|
val deviceManager = context.getFeature(DeviceManager::class.java);
|
||||||
ServerInterceptor("devices") {
|
ServerInterceptor("devices") {
|
||||||
get("listDevices") {
|
get("listDevices") {
|
@ -17,7 +17,7 @@ fun main(args: Array<String>) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
context.optFeature(DeviceManager::class.java).ifPresent{
|
context.optFeature(DeviceManager::class.java).ifPresent{
|
||||||
|
server.intercept(deviceInterceptor)
|
||||||
}
|
}
|
||||||
|
|
||||||
server.start()
|
server.start()
|
@ -13,7 +13,7 @@ include ":numass-core"
|
|||||||
include ":numass-client"
|
include ":numass-client"
|
||||||
include ":numass-server"
|
include ":numass-server"
|
||||||
include ":numass-server"
|
include ":numass-server"
|
||||||
include ":numass-kserver"
|
include ":numass-web"
|
||||||
include ":numass-test"
|
include ":numass-test"
|
||||||
//
|
//
|
||||||
include ":numass-viewer"
|
include ":numass-viewer"
|
||||||
|
Loading…
Reference in New Issue
Block a user