Fix muon monitor demo.

Light intensity moved to constants
This commit is contained in:
2025-03-21 10:08:39 +03:00
parent 5429674b28
commit e762b59499
22 changed files with 73 additions and 82 deletions

View File

@ -8,7 +8,7 @@
### Changed
- Simplified Vision and VisionGroup logic. Observation logic moved out.
- Use `Name` for child designation and `Path` for tree access
- Default intensity for AmbientLight is 2.0
- The default intensity for AmbientLight is 1.0. The intensity scale for Three-js is 3.0.
### Deprecated
@ -17,6 +17,7 @@
### Fixed
- Vision server now automatically switches to WSS protocol for updates if incoming protocol is HTTPS
- Issue with track removal in muon monitor demo.
### Security

View File

@ -70,7 +70,7 @@ To learn more about DataForge, please consult the following URLs:
>
> **Maturity**: EXPERIMENTAL
### [plotly](plotly)
### [plotly-kt](plotly-kt)
>
> **Maturity**: EXPERIMENTAL
@ -99,10 +99,6 @@ To learn more about DataForge, please consult the following URLs:
>
> **Maturity**: EXPERIMENTAL
### [visionforge-plotly](visionforge-plotly)
>
> **Maturity**: EXPERIMENTAL
### [visionforge-server](visionforge-server)
>
> **Maturity**: EXPERIMENTAL
@ -147,23 +143,15 @@ To learn more about DataForge, please consult the following URLs:
>
> **Maturity**: EXPERIMENTAL
### [plotly/examples](plotly/examples)
### [plotly-kt/examples](plotly-kt/examples)
>
> **Maturity**: EXPERIMENTAL
### [plotly/plotlykt-core](plotly/plotlykt-core)
### [plotly-kt/plotly-kt-core](plotly-kt/plotly-kt-core)
>
> **Maturity**: DEVELOPMENT
### [plotly/plotlykt-jupyter](plotly/plotlykt-jupyter)
>
> **Maturity**: EXPERIMENTAL
### [plotly/plotlykt-script](plotly/plotlykt-script)
>
> **Maturity**: EXPERIMENTAL
### [plotly/plotlykt-server](plotly/plotlykt-server)
### [plotly-kt/plotly-kt-server](plotly-kt/plotly-kt-server)
>
> **Maturity**: EXPERIMENTAL
@ -176,19 +164,15 @@ To learn more about DataForge, please consult the following URLs:
>
> **Maturity**: EXPERIMENTAL
### [plotly/examples/compose-demo](plotly/examples/compose-demo)
### [plotly-kt/examples/compose-demo](plotly-kt/examples/compose-demo)
>
> **Maturity**: EXPERIMENTAL
### [plotly/examples/fx-demo](plotly/examples/fx-demo)
### [plotly-kt/examples/js-demo](plotly-kt/examples/js-demo)
>
> **Maturity**: EXPERIMENTAL
### [plotly/examples/js-demo](plotly/examples/js-demo)
>
> **Maturity**: EXPERIMENTAL
### [plotly/examples/native-demo](plotly/examples/native-demo)
### [plotly-kt/examples/native-demo](plotly-kt/examples/native-demo)
>
> **Maturity**: EXPERIMENTAL

View File

@ -2,3 +2,20 @@
## Usage
## Artifact:
The Maven coordinates of this project are `space.kscience:cern-root-loader:0.5.0`.
**Gradle Kotlin DSL:**
```kotlin
repositories {
maven("https://repo.kotlin.link")
mavenCentral()
}
dependencies {
implementation("space.kscience:cern-root-loader:0.5.0")
}
```

View File

@ -10,7 +10,7 @@ group = "ru.mipt.npm"
kscience {
fullStack(
"muon-monitor.js",
development = false,
development = true,
jvmConfig = {
binaries {
executable {

View File

@ -72,7 +72,8 @@ class Model(val manager: VisionManager) {
map.values.forEach {
it.properties[SolidMaterial.MATERIAL_COLOR_KEY] = null
}
tracks.visions.keys.forEach {
val tracksToRemove = tracks.visions.keys.toList()
tracksToRemove.forEach {
tracks.setVision(it, null)
}
}

View File

@ -5,14 +5,14 @@
[![Slack](https://img.shields.io/badge/slack-channel-green?logo=slack)](https://kotlinlang.slack.com/archives/CEXV2QWNM)
# DataForge Visualization Platform
# VisionForge platform
## Table of Contents
* [Introduction](#introduction)
* [Requirements](#requirements)
* [Features](#features)
* [About DataForge](#about-dataforge)
* [About VisionForge](#about-VisionForge)
* [Modules contained in this repository](#modules-contained-in-this-repository)
* [Visualization for External Systems](#visualization-for-external-systems)
* [Demonstrations](#demonstrations)
@ -23,7 +23,7 @@
## Introduction
This repository contains a [DataForge](#about-dataforge)\-based framework
This repository contains a [VisionForge](#about-VisionForge) framework
used for visualization in various scientific applications.
The main framework's use case for now is 3D visualization for particle physics experiments.
@ -41,16 +41,16 @@ JVM backend requires JDK 11 or later
The main framework's features for now include:
- 3D visualization of complex experimental set-ups
- Event display such as particle tracks, etc.
- Scales up to few hundred thousands of elements
- Camera move, rotate, zoom-in and zoom-out
- Scales up to hundreds of thousands of elements
- The camera moves, rotates, zoom-in and zoom-out
- Scene graph as an object tree with property editor
- Settings export and import
- Multiple platform support
## About DataForge
## About VisionForge
DataForge is a software framework for automated scientific data processing. DataForge Visualization
Platform uses some of the concepts and modules of DataForge, including: `Meta`, `Configuration`, `Context`,
[DataForge](https://git.sciprog.center/kscience/dataforge-core) is a software framework for automated scientific data processing. VisionForge
Platform uses some concepts and modules of DataForge, including: `Meta`, `Configuration`, `Context`,
`Provider`, and some others.
To learn more about DataForge, please consult the following URLs:

View File

@ -1,4 +1,4 @@
# Module plotlykt-core
# Module plotly-kt-core
@ -6,7 +6,7 @@
## Artifact:
The Maven coordinates of this project are `space.kscience:plotlykt-core:0.7.2`.
The Maven coordinates of this project are `space.kscience:plotly-kt-core:0.5.0`.
**Gradle Kotlin DSL:**
```kotlin
@ -16,6 +16,6 @@ repositories {
}
dependencies {
implementation("space.kscience:plotlykt-core:0.7.2")
implementation("space.kscience:plotly-kt-core:0.5.0")
}
```

View File

@ -1,21 +1,4 @@
# Module plotlykt-server
# Module plotly-kt-server
## Usage
## Artifact:
The Maven coordinates of this project are `space.kscience:plotlykt-server:0.7.2`.
**Gradle Kotlin DSL:**
```kotlin
repositories {
maven("https://repo.kotlin.link")
mavenCentral()
}
dependencies {
implementation("space.kscience:plotlykt-server:0.7.2")
}
```

View File

@ -6,7 +6,7 @@
## Artifact:
The Maven coordinates of this project are `space.kscience:visionforge-compose-html:0.4.2`.
The Maven coordinates of this project are `space.kscience:visionforge-compose-html:0.5.0`.
**Gradle Kotlin DSL:**
```kotlin
@ -16,6 +16,6 @@ repositories {
}
dependencies {
implementation("space.kscience:visionforge-compose-html:0.4.2")
implementation("space.kscience:visionforge-compose-html:0.5.0")
}
```

View File

@ -6,7 +6,7 @@
## Artifact:
The Maven coordinates of this project are `space.kscience:visionforge-compose-multiplatform:0.4.2`.
The Maven coordinates of this project are `space.kscience:visionforge-compose-multiplatform:0.5.0`.
**Gradle Kotlin DSL:**
```kotlin
@ -16,6 +16,6 @@ repositories {
}
dependencies {
implementation("space.kscience:visionforge-compose-multiplatform:0.4.2")
implementation("space.kscience:visionforge-compose-multiplatform:0.5.0")
}
```

View File

@ -6,7 +6,7 @@
## Artifact:
The Maven coordinates of this project are `space.kscience:visionforge-core:0.4.2`.
The Maven coordinates of this project are `space.kscience:visionforge-core:0.5.0`.
**Gradle Kotlin DSL:**
```kotlin
@ -16,6 +16,6 @@ repositories {
}
dependencies {
implementation("space.kscience:visionforge-core:0.4.2")
implementation("space.kscience:visionforge-core:0.5.0")
}
```

View File

@ -6,7 +6,7 @@
## Artifact:
The Maven coordinates of this project are `space.kscience:visionforge-gdml:0.4.2`.
The Maven coordinates of this project are `space.kscience:visionforge-gdml:0.5.0`.
**Gradle Kotlin DSL:**
```kotlin
@ -16,6 +16,6 @@ repositories {
}
dependencies {
implementation("space.kscience:visionforge-gdml:0.4.2")
implementation("space.kscience:visionforge-gdml:0.5.0")
}
```

View File

@ -6,7 +6,7 @@ Common visionforge jupyter module
## Artifact:
The Maven coordinates of this project are `space.kscience:visionforge-jupyter:0.4.2`.
The Maven coordinates of this project are `space.kscience:visionforge-jupyter:0.5.0`.
**Gradle Kotlin DSL:**
```kotlin
@ -16,6 +16,6 @@ repositories {
}
dependencies {
implementation("space.kscience:visionforge-jupyter:0.4.2")
implementation("space.kscience:visionforge-jupyter:0.5.0")
}
```

View File

@ -6,7 +6,7 @@ Jupyter api artifact including all common modules
## Artifact:
The Maven coordinates of this project are `space.kscience:visionforge-jupyter-common:0.4.2`.
The Maven coordinates of this project are `space.kscience:visionforge-jupyter-common:0.5.0`.
**Gradle Kotlin DSL:**
```kotlin
@ -16,6 +16,6 @@ repositories {
}
dependencies {
implementation("space.kscience:visionforge-jupyter-common:0.4.2")
implementation("space.kscience:visionforge-jupyter-common:0.5.0")
}
```

View File

@ -6,7 +6,7 @@
## Artifact:
The Maven coordinates of this project are `space.kscience:visionforge-markdown:0.4.2`.
The Maven coordinates of this project are `space.kscience:visionforge-markdown:0.5.0`.
**Gradle Kotlin DSL:**
```kotlin
@ -16,6 +16,6 @@ repositories {
}
dependencies {
implementation("space.kscience:visionforge-markdown:0.4.2")
implementation("space.kscience:visionforge-markdown:0.5.0")
}
```

View File

@ -6,7 +6,7 @@
## Artifact:
The Maven coordinates of this project are `space.kscience:visionforge-server:0.4.2`.
The Maven coordinates of this project are `space.kscience:visionforge-server:0.5.0`.
**Gradle Kotlin DSL:**
```kotlin
@ -16,6 +16,6 @@ repositories {
}
dependencies {
implementation("space.kscience:visionforge-server:0.4.2")
implementation("space.kscience:visionforge-server:0.5.0")
}
```

View File

@ -6,7 +6,7 @@
## Artifact:
The Maven coordinates of this project are `space.kscience:visionforge-solid:0.4.2`.
The Maven coordinates of this project are `space.kscience:visionforge-solid:0.5.0`.
**Gradle Kotlin DSL:**
```kotlin
@ -16,6 +16,6 @@ repositories {
}
dependencies {
implementation("space.kscience:visionforge-solid:0.4.2")
implementation("space.kscience:visionforge-solid:0.5.0")
}
```

View File

@ -17,11 +17,13 @@ public abstract class LightSource : MiscSolid() {
override val descriptor: MetaDescriptor get() = LightSource.descriptor
public val color: ColorAccessor by colorProperty(SolidMaterial.COLOR_KEY)
public var intensity: Number by properties.number(INTENSITY_KEY) { 2.0 }
public var intensity: Number by properties.number(INTENSITY_KEY) { DEFAULT_INTENSITY }
public companion object {
public val INTENSITY_KEY: Name = "intensity".asName()
public const val DEFAULT_INTENSITY: Double = 1.0
public val descriptor: MetaDescriptor by lazy {
MetaDescriptor {
value(Vision.VISIBLE_KEY, ValueType.BOOLEAN) {

View File

@ -6,7 +6,7 @@
## Artifact:
The Maven coordinates of this project are `space.kscience:visionforge-tables:0.4.2`.
The Maven coordinates of this project are `space.kscience:visionforge-tables:0.5.0`.
**Gradle Kotlin DSL:**
```kotlin
@ -16,6 +16,6 @@ repositories {
}
dependencies {
implementation("space.kscience:visionforge-tables:0.4.2")
implementation("space.kscience:visionforge-tables:0.5.0")
}
```

View File

@ -6,7 +6,7 @@
## Artifact:
The Maven coordinates of this project are `space.kscience:visionforge-threejs:0.4.2`.
The Maven coordinates of this project are `space.kscience:visionforge-threejs:0.5.0`.
**Gradle Kotlin DSL:**
```kotlin
@ -16,6 +16,6 @@ repositories {
}
dependencies {
implementation("space.kscience:visionforge-threejs:0.4.2")
implementation("space.kscience:visionforge-threejs:0.5.0")
}
```

View File

@ -14,10 +14,12 @@ import kotlin.reflect.KClass
public object ThreeAmbientLightFactory : ThreeFactory<AmbientLightSource> {
override val type: KClass<in AmbientLightSource> get() = AmbientLightSource::class
private const val INTENSITY_SCALE = 3.0
override suspend fun build(three: ThreePlugin, vision: AmbientLightSource, observe: Boolean): AmbientLight {
val res = AmbientLight().apply {
color = vision.color.threeColor() ?: Color(0x404040)
intensity = vision.intensity.toDouble()
intensity = vision.intensity.toDouble()*INTENSITY_SCALE
}
if (observe) {
@ -25,11 +27,12 @@ public object ThreeAmbientLightFactory : ThreeFactory<AmbientLightSource> {
when (propertyName) {
Vision.VISIBLE_KEY -> res.visible = vision.visible ?: true
SolidMaterial.COLOR_KEY -> res.color = vision.color.threeColor() ?: Color(0x404040)
LightSource.INTENSITY_KEY -> res.intensity = vision.intensity.toDouble()
LightSource.INTENSITY_KEY -> res.intensity = vision.intensity.toDouble()*INTENSITY_SCALE
}
}
}
return res
}
}

View File

@ -6,7 +6,7 @@
## Artifact:
The Maven coordinates of this project are `space.kscience:visionforge-threejs-server:0.4.2`.
The Maven coordinates of this project are `space.kscience:visionforge-threejs-server:0.5.0`.
**Gradle Kotlin DSL:**
```kotlin
@ -16,6 +16,6 @@ repositories {
}
dependencies {
implementation("space.kscience:visionforge-threejs-server:0.4.2")
implementation("space.kscience:visionforge-threejs-server:0.5.0")
}
```