Object: TransformDataContextXYY1
- Updated2024-09-12
- 2 minute(s) read
DIAdem REPORT > Objects > Context Objects > Object: TransformDataContextXYY1
Object: TransformDataContextXYY1
The TransformDataContextXYY1 object provides the input and output channels for the curve transformation of a curve as an object in a 2D axis system in DIAdem REPORT. Use the TransformDataContextXYY1 object for all 2D display types in which the data originates from an x-channel, a y-channel, and a y1 channel. The user command receives the TransformDataContextXYY1 object as a parameter. Use the curve transformation user command only to manipulate the values of temporary copies of the input channels. REPORT objects such as the worksheet, the axis system, and the curves can only be accessed in read-only mode.
![]() | Note To test the example script, you must first save the second script and register it as a user command in the dialog box that opens when you select Settings»Extensions»User Commands. |
The following example generates an axis system with two curves as filled area and assigns the MyOnCurveTransformation user command to the second curve:
Dim oMy2DAxisSystem, oMy2DCurveOrg, oMy2DCurveTrans, oMyPos Report.NewLayout Call Data.Root.Clear() Call DataFileLoad(DataReadPath & "Report_Data.tdm","TDM","") Set oMy2DAxisSystem = Report.ActiveSheet.Objects.Add(eReportObject2DAxisSystem, "My2DAxisSystem") Set oMyPos = oMy2DAxisSystem.Position.ByCoordinate oMyPos.X1 = 20 oMyPos.X2 = 80 oMyPos.Y1 = 20 oMyPos.Y2 = 80 Set oMy2DCurveOrg = oMy2DAxisSystem.Curves2D.Add(e2DShapeFilledArea, "MyOrgCurve") oMy2DCurveOrg.Shape.XChannel.Reference = "[2]/[1]" oMy2DCurveOrg.Shape.YChannel.Reference = "[2]/[2]" oMy2DCurveOrg.Shape.YChannelDifferential.Reference = "[2]/[3]" Call oMy2DCurveOrg.Shape.Settings.FillEffects.Color.SetPredefinedColor(eColorIndexBlue) oMy2DCurveOrg.Shape.Settings.FillEffects.Color.Transparency = 50 Set oMy2DCurveTrans = oMy2DAxisSystem.Curves2D.Add(e2DShapeFilledArea, "MyTransCurve") oMy2DCurveTrans.Shape.XChannel.Reference = "[2]/[1]" oMy2DCurveTrans.Shape.YChannel.Reference = "[2]/[2]" oMy2DCurveTrans.Shape.YChannelDifferential.Reference = "[2]/[3]" Call oMy2DCurveTrans.Shape.Settings.FillEffects.Color.SetPredefinedColor(eColorIndexRed) oMy2DCurveTrans.Shape.Settings.FillEffects.Color.Transparency = 50 oMy2DAxisSystem.Settings.UseCurveTransformation = TRUE oMy2DCurveTrans.OnCurveTransformation = "MyOnCurveTransformation" Call Report.Refresh()
The user command copies the x-values and smoothes the y-values:
Sub MyOnCurveTransformation(Context) Dim oMyDataContext Set oMyDataContext = Context.DataContext Select Case Context.DataType Case e2DCurveTransformDataTypeXY Call ChnCopy (oMyDataContext.XChannelNumberIn ,oMyDataContext.XChannelNumberOut) 'Copy the input channel into the output channel Call ChnSmooth(oMyDataContext.YChannelNumberIn, oMyDataContext.YChannelNumberOut, 100, "symmetric") 'Smooth the input channel and save the result as output channel Case e2DCurveTransformDataTypeXYY1 Call ChnCopy (oMyDataContext.XChannelNumberIn ,oMyDataContext.XChannelNumberOut) 'Copy the input channel into the output channel Call ChnSmooth(oMyDataContext.YChannelNumberIn, oMyDataContext.YChannelNumberOut, 2, "symmetric") 'Smooth the input channel and save the result as output channel Call ChnSmooth(oMyDataContext.Y1ChannelNumberIn, oMyDataContext.Y1ChannelNumberOut, 2, "symmetric") 'Smooth the input channel and save the result as output channel Case e2DCurveTransformDataTypeCXCY oMyDataContext.ConstXOut = oMyDataContext.ConstXIn + 2 oMyDataContext.ConstYOut = oMyDataContext.ConstYIn + 2 End Select End Sub
Properties
XChannelNumberIn | XChannelNumberOut | Y1ChannelNumberIn | Y1ChannelNumberOut | YChannelNumberIn | YChannelNumberOut
