Skip to content

Commit

Permalink
Fix the x axis title for the TOF data
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewSazonov committed Jul 4, 2024
1 parent 465c8a9 commit c176947
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,22 @@ Column {
EaCharts.QtCharts1dBase {
id: mainChart

property var experimentDataBlocksNoMeas: Globals.Proxies.main.experiment.dataBlocksNoMeas
onExperimentDataBlocksNoMeasChanged: {
if (Globals.Proxies.experimentMainParam('_diffrn_radiation', 'type').value === 'cwl') {
axisX.title = '2θ (degree)'
} else if (Globals.Proxies.experimentMainParam('_diffrn_radiation', 'type').value === 'tof') {
axisX.title = 'TOF (µs)'
} else {
axisX.title = ''
}
}

anchors.topMargin: EaStyle.Sizes.toolButtonHeight - EaStyle.Sizes.fontPixelSize - 1
anchors.bottomMargin: -12 - EaStyle.Sizes.fontPixelSize

useOpenGL: container.useOpenGL

axisX.title: "2θ (degree)"
axisX.titleVisible: false
axisX.labelsVisible: false
axisX.min: Globals.Proxies.rangeValue('xMin')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,21 @@ Rectangle {
EaCharts.QtCharts1dMeasVsCalc {
id: chartView

property var experimentDataBlocksNoMeas: Globals.Proxies.main.experiment.dataBlocksNoMeas
onExperimentDataBlocksNoMeasChanged: {
if (Globals.Proxies.experimentMainParam('_diffrn_radiation', 'type').value === 'cwl') {
axisX.title = '2θ (degree)'
} else if (Globals.Proxies.experimentMainParam('_diffrn_radiation', 'type').value === 'tof') {
axisX.title = 'TOF (µs)'
} else {
axisX.title = ''
}
}

anchors.topMargin: EaStyle.Sizes.toolButtonHeight - EaStyle.Sizes.fontPixelSize - 1

useOpenGL: EaGlobals.Vars.useOpenGL //Globals.Proxies.main.plotting.useWebGL1d

axisX.title: "2θ (degree)"
axisX.min: Globals.Proxies.rangeValue('xMin')
axisX.max: Globals.Proxies.rangeValue('xMax')
axisX.minAfterReset: Globals.Proxies.rangeValue('xMin')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ EaComponents.SideBarColumn {
if (Globals.Proxies.experimentMainParam('_diffrn_radiation', 'type').value === 'cwl') {
return Globals.Proxies.experimentLoopTitle(qsTr('Background'), '_pd_background')
} else if (Globals.Proxies.experimentMainParam('_diffrn_radiation', 'type').value === 'tof') {
return qsTr('Background')
return Globals.Proxies.experimentLoopTitle(qsTr('Background'), '_pd_background')
}
}
icon: 'wave-square'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,19 @@ import Gui.Globals as Globals
EaCharts.QtCharts1dMeasVsCalc {
id: chart

property var experimentDataBlocksNoMeas: Globals.Proxies.main.experiment.dataBlocksNoMeas
onExperimentDataBlocksNoMeasChanged: {
if (Globals.Proxies.experimentMainParam('_diffrn_radiation', 'type').value === 'cwl') {
axisX.title = '2θ (degree)'
} else if (Globals.Proxies.experimentMainParam('_diffrn_radiation', 'type').value === 'tof') {
axisX.title = 'TOF (µs)'
} else {
axisX.title = ''
}
}

useOpenGL: EaGlobals.Vars.useOpenGL //Globals.Proxies.main.plotting.useWebGL1d

axisX.title: "2θ (degree)"
axisX.min: parameterValue('xMin')
axisX.max: parameterValue('xMax')

Expand Down

0 comments on commit c176947

Please sign in to comment.