tunning scales

This commit is contained in:
Luis Fernando Molina committed 2020-01-20 09:30:14 +01:00
1 parent edc288e344
commit 8d1d887eff
5 files changed
+17 -17

No files matched your search

+2 -2
View File
@@ -184,7 +184,7 @@ function newTimeMachine () {
thisObject.timeScale.initialize(timeMachineCoordinateSystem, thisObject.container)
function timeScaleValueChanged (event) {
thisObject.container.frame.width = TIME_MACHINE_WIDTH * event.scale
thisObject.container.frame.width = TIME_MACHINE_WIDTH + TIME_MACHINE_WIDTH * event.scale
recalculateCoordinateSystem()
if (event.isUserAction === true) {
moveToUserPosition(thisObject.container, timeMachineCoordinateSystem, false, true, event.mousePosition, true)
@@ -206,7 +206,7 @@ function newTimeMachine () {
thisObject.rateScale.initialize(timeMachineCoordinateSystem, thisObject.container, thisObject.container)
function rateScaleValueChanged (event) {
thisObject.container.frame.height = TIME_MACHINE_HEIGHT * event.scale
thisObject.container.frame.height = TIME_MACHINE_HEIGHT + TIME_MACHINE_HEIGHT * event.scale
recalculateCoordinateSystem()
if (event.isUserAction === true) {
moveToUserPosition(thisObject.container, timeMachineCoordinateSystem, true, false, event.mousePosition, true)
+1 -1
View File
@@ -188,7 +188,7 @@ function newTimelineChart () {
}
function rateScaleValueChanged (event) {
thisObject.container.frame.height = TIME_MACHINE_HEIGHT * event.scale
thisObject.container.frame.height = TIME_MACHINE_HEIGHT + TIME_MACHINE_HEIGHT * event.scale
recalculateCoordinateSystem()
thisObject.container.eventHandler.raiseEvent('Dimmensions Changed', event)
}
+2 -2
View File
@@ -188,8 +188,8 @@ const PERIOD_01_MIN = "01-min";
We define here the size of the chartSpace. It has to bee enough big in order to accomodate all the charts we expect to display in this space.
*/
const TIME_MACHINE_WIDTH = 2000;
const TIME_MACHINE_HEIGHT = 200 / 25;
const TIME_MACHINE_WIDTH = 250;
const TIME_MACHINE_HEIGHT = 250 / 50;
function toRadians(angle) {
return angle * (Math.PI / 180);
+6 -6
View File
@@ -18,17 +18,17 @@ function newRateScale () {
finalize: finalize
}
const DEFAULT_SCALE = 25
const DEFAULT_SCALE = 50
const STEP_SCALE = 1
const MIN_SCALE = 1
const MIN_SCALE = 0
const MAX_SCALE = 100
const SNAP_THRESHOLD_SCALE = 2
const SNAP_THRESHOLD_SCALE = 1
const DEFAULT_OFFSET = 0
const STEP_OFFSET = 1
const MIN_OFFSET = -1000
const MAX_OFFSET = 1000
const SNAP_THRESHOLD_OFFSET = 4
const SNAP_THRESHOLD_OFFSET = 3
thisObject.container = newContainer()
thisObject.container.initialize(MODULE_NAME)
@@ -217,7 +217,7 @@ function newRateScale () {
try {
let code = JSON.parse(thisObject.payload.node.code)
code.scale = thisObject.scale / MAX_SCALE * 100
code.scale = code.scale.toFixed(2)
code.scale = code.scale.toFixed(0)
code.offset = thisObject.offset
thisObject.payload.node.code = JSON.stringify(code)
} catch (err) {
@@ -392,7 +392,7 @@ function newRateScale () {
}
if (scaleTimer > 0) {
label2 = thisObject.scale.toFixed(0)
label2 = (thisObject.scale / MAX_SCALE * 100).toFixed(0)
label3 = 'SCALE'
}
+6 -6
View File
@@ -16,10 +16,10 @@ function newTimeScale () {
finalize: finalize
}
const DEFAULT_SCALE = 1
const STEP_SCALE = 1
const MIN_SCALE = 1
const MAX_SCALE = 400
const DEFAULT_SCALE = 0
const STEP_SCALE = 2.5
const MIN_SCALE = 0
const MAX_SCALE = 250
const SNAP_THRESHOLD_SCALE = 0
thisObject.container = newContainer()
@@ -153,7 +153,7 @@ function newTimeScale () {
try {
let code = JSON.parse(thisObject.payload.node.code)
code.scale = thisObject.scale / MAX_SCALE * 100
code.scale = code.scale.toFixed(2)
code.scale = code.scale.toFixed(0)
thisObject.payload.node.code = JSON.stringify(code)
} catch (err) {
// we ignore errors here since most likely they will be parsing errors.
@@ -275,7 +275,7 @@ function newTimeScale () {
let backgroundColor = UI_COLOR.BLACK
if (scaleTimer > 0) {
label2 = thisObject.scale.toFixed(0)
label2 = (thisObject.scale / MAX_SCALE * 100).toFixed(0)
label3 = 'SCALE'
}