Home

QCRTGraph for WPF User Manual - Quinn

image

Contents

1. Q hartAttribute attribl new ChartAttribute Colors Yellow 2 DashStyles Solid OHLCPlot ohlcplotl new OHLCPlot pTransforml null ChartCalendar GetCalendarWidthValue ChartObj SECOND 1 25 attribl ohloplotl SetFastClipMode ChartObj FASTCLIP X RTProcessVar stockvars stockOpenl stockHighl stockLowl stockClosel rtPlotl new RTGroupMultiValuePlot pTransforml ohlcplotl stockvars chartVu AddChartObject rtPlotl ChartAttribute attrib2 new ChartAttribute Colors Green 3 DashStyles Solid SimpleLinePlot lineplot2 new SimpleLinePlot pTransform2 null attrib2 lineplot2 SetFastClipMode ChartObj FASTCLIP X rtPlot2 new RTSimpleSingleValuePlot pTransform2 lineplot2 NASDAQChannel chartVu AddChartObject rtPlot2 C hartAttribute attrib3 new ChartAttribute Colors Blue 3 DashStyles Solid SimpleLinePlot lineplot3 new SimpleLinePlot pTransform2 null attrib3 lineplot3 SetFastClipMode ChartObj FASTCLIP X rtPlot3 new RTSimpleSingleValuePlot pTransforml lineplot3 movingAverageStock chartVu AddChartObject rtPlot3 VB ScrollFramel New RTScrollFrame Me stockOpenl pTransforml ChartObj RT FIXEDEXTENT MOVINGSTART AUTOSCROLL scrollFramel ScrollScaleModeY ChartObj RT AUTOSCALE Y MINMAX Need to add this ProcessVar s to have auto scale work for all values of OHLC plot scrollFramel AddProcessVar stockHighl scrollFramel AddProcessVar stockLowl scrollFramel AddPro
2. 68 70 95 AntennaCoordinateS i 59 60 94 AntennaGrid AntennaLineMarkerPlot 80 81 95 AntennaLinePlot 80 81 95 AntennaPlot AntennaScatterblot 80 81 95 ArroWPIOt eene 72 73 95 Arrows ASP NET E E 10 Auto scaling classes 61 62 94 287 AutoScale AutoScale cocta rtr bre ai AutosScale ono ue ne aat d rade 1 Axis label classes ee heo eer 177 AxisLabelss ia rame una eee 2 AxisLabels 68 69 95 172 177 KEE EE 2 EE TEE 87 88 95 Backgrounds 2 3 62 96 143 145 156 158 160 163 210 211 215 216 221 222 290 BosWhuskerblort 72 73 95 BubblePlot 72 73 95 239 BubblePlotLegend e BubblePlotLegendItem BufferedImage CandlestickPlot i CartesianCoordinates 136 137 143 145 156 158 160 162 214 215 218 219 221 222 247 250 256 261 266 287 292 293 294 CellPlot 43 2 pipi ra die actis Chart object attributes ChartAttribute 60 61 62 94 98 102 105 106 109 110 118 120 121 122 123 124 125 126 128 129 130 131 132 133 134 135 136 137 139 140 141 143 144 145 147 148 149 150 151 152 153 154 157 158 159 160 163 172 174 175 177 178 179 182 183 185 187 194 197 198 199 204 206 207 208 209 210 211 212 213 215 216 217 218 219 220 221 222
3. InitializeScrollGraph timerl Interval TimeSpan FromMilliseconds 50 100 msecs AddHandler timerl Tick New EventHandler AddressOf timerl Tick timer2 Interval TimeSpan FromMilliseconds 200 100 msecs AddHandler timer2 Tick New EventHandler AddressOf timer2 Tick timerl Start 370 Using OCRTGraph for WPF to Create Web Applications timer2 Start End Sub Private Sub TemperatureAlarmEventProc ByVal sender As Object ByVal e As RTAlarmEventArgs Dim alarm As RTAlarm e EventAlarm Dim alarmlimitvalue As Double alarm AlarmLimitValue Dim pv As RTProcessVar e ProcessVar Dim tagname As String pv TagName Dim timestamp As Double pv TimeStamp Dim timestampstring As String timestamp ToString If alarm AlarmState Then Console Out WriteLine timestampstring amp amp tagname amp Warning Alarm Level amp alarmlimitvalue ToString amp Exceeded Else Console Out WriteLine timestampstring amp amp tagname amp Process Value transitioned back to normal range End If End Sub Update data using 100 msec timer Private Sub timerl Tick ByVal sender As Object ByVal e As System EventArgs Random data currentTemperatureValuel 5 0 5 ChartSupport GetRandomDouble currentTemperatureValue2 8 0 5 ChartSupport GetRandomDouble These two methods of setting the current value are equivalent If True Then This method uses the default
4. 57 58 61 94 98 287 358 SimpleDatasetiy 4 odis base ete ae ll 2 SimpleLineMarkerPlot 10 83 84 95 SimpleLinePlot 10 83 85 95 233 234 235 236 237 238 243 244 SimplePlot 13 15 23 28 70 83 84 85 89 90 95 97 232 239 SmpleSceatterblot esses 10 83 85 95 SimpleVersaPlot sese 85 95 360 StackedBarPlot 72 76 95 239 StackedLinePlot 72 79 95 239 StandardLegend 85 86 95 String axis Jabel 182 String Panel Meters 17 20 22 28 112 125 126 127 128 129 131 132 143 144 146 156 215 216 219 220 221 223 Appendix 379 StringAxisLabels 18 33 68 69 95 181 182 22 87 88 95 114 123 126 T 88 89 96 47 49 87 95 177 178 EA 91 92 95 Time Panel Meters 17 20 22 28 112 129 130 131 132 133 TimeAutoScale sse 61 62 94 TimeAxis 63 66 70 87 95 Tme A visl abels n rnanan reniir 69 70 95 TimeCoordinates 59 60 94 285 TimeGroupDataset 17 19 20 57 58 62 94 97 100 101 102 103 104 105 106 107 108 109 110 313 314 325 326 334 343 349 350 358 359 360 TimeLabel eee eres 22 87 88 95 129 130 TimeScale 58 59 94 TimeSimpleDataset 57 58 62 94 204 Tool Tips eed RO eR 89 90 94 Use
5. InitializeGraph private void InitializeScrollGraph double xl 0 1 double yl 0 1 double x2 0 90 double y2 0 9 ChartFont axisFont font12 ChartCalendar startTime new ChartCalendar ChartCalendar endTime new ChartCalendar endTime Add ChartCalendar SECOND 20 TimeCoordinates pTransforml new TimeCoordinates startTime currentTemperaturel DefaultMinimumDisplayValue Colors White Colors Black ChartObj GRID MAJOR endTime currentTemperaturel DefaultMaximumDisplayValue pTransforml SetGraphBorderDiagonal x1 yl x2 y2 Background graphbackground new Background pTransforml ChartObj GRAPH BACKGROUND chartVu AddChartObject graphbackground Background plotbackground new Background pTransforml ChartObj PLOT BACKGROUND chartVu AddChartObject plotbackground TimeAxis xaxis new TimeAxis pTransforml ChartObj X AXIS xaxis LineColor Colors Black chartVu AddChartObject xaxis LinearAxis yaxis new LinearAxis pTransforml ChartObj Y AXIS yaxis LineColor Colors Black chartVu AddChartObject yaxis ChartGrid yAxisGrid new ChartGrid xaxis yaxis ChartObj Y AXIS yAxisGrid SetColor Colors White yAxisGrid SetLineWidth 1 yAxisGrid SetLineStyle DashStyles Solid ChartObj GRID MAJOR chartVu AddChartObject yAxisGrid ChartGrid xAxisGrid new ChartGrid xaxis yaxis ChartObj X AXIS xAxisGrid SetColor Colors White xAxisGrid S
6. The polar line charts use true polar not linear interpolation between data points PolarLinePlot This class is a concrete implementation of the PolarPlot class and displays data in a simple line plot format The lines drawn between adjacent data points use polar coordinate interpolation PolarScatterPlot This class is a concrete implementation of the PolarPlot class and displays data in a simple scatter plot format Antenna Plot Classes AntennaPlot AntennaLinePlot AntennaScatterPlot AntennaLineMarkerPlot GraphObj AntennaAnnotation Antenna plots that use data organized as arrays of x and y values where an x value represents the radial value of a point in antenna coordinates and the y value represents the angle in degrees of a point in antenna coordinates Antenna plot types include line plots scatter plots line marker plots and an annotation class AntennaPlot This class is an abstract base class for the polar plot classes 270 AntennaLinePlot AntennaScatterPlot AntennaLineMarkerPlot AntennaAnnotation QCChart2D Class Summary 79 180 AntennaLineMarkerPlot This class is a concrete implementation of the AntennaPlot class and displays data in a simple line plot format The lines drawn between adjacent data points use antenna coordinate interpolation This class is a concrete implementation of the AntennaPlot class and displays data in a simple scatter plot format This class is a concrete impleme
7. Code File dB Component Class Reporting Cursor File A Custom Control Workflow e Custom Control WPF gu DataSet Fea Debugger Visualizer Ift Dynamic Data Field TE Flow Document WPF el HTML Page i Icon File d Installer Class seg Interface JScript File A LINQ to SQL Classes J Local Database Local Database Cache MDI Parent Form An empty dass definition Name ScrollGraph1 cs using using using using using using using using using using 336 Using Real Time Graphics Tools for WPF to Create Windows Applications The resulting ScrollGraph1 cs file will contain using System using System Collections Generic using System Linq using System Text namespace WpfApplicationl class SorollGraphl e Modify the ScrollGraphl file to create the desired chart Most all of our examples are structured the same way The constructor is changed to pass in a ChartView object Then a chart initialization routine is called which customizes the chart See the ScrollGraph1 cs file of the WpfRTApplicationl example System System Windows System Collections Generic System Ling System Text System Windows Media System Windows Controls System Windows Input com quinncurtis chart2dwpf com quinncurtis rtgraphwpf namespace WpfRTApplicationl lt summary gt Summary description for ScrollApplicationUserControll lt summary gt public class
8. 1 12 09 i 2 02 09 rl 1 26 09 T 1 19 09 This class is a concrete implementation of the GroupPlot class and displays free floating stacked bars The bars are free floating because each bar does not reference a fixed base value as do simple bar plots stacked bar plots and group bar plots 74 QCChart2D Class Summary GroupBarPlot StackedBarPlot GroupVersaPlot S Er amp Drug Sales The Group bar graph and the Stacked bar graph represent two different ways of displaying the same data This class is a concrete implementation of the GroupPlot class and displays group data in a group bar format Individual bars the height of which corresponds to the group y values of the dataset display side by side as a group justified with respect to the x position value for each group The group bars share a common base value This class is a concrete implementation of the GroupPlot class and displays data as stacked bars In a stacked bar plot each group is stacked on top of one another each group bar a cumulative sum of the related group items before it The GroupVersaPlot is a plot type that can be any of the eight group plot types GROUPBAR STACKEDBAR CANDLESTICK OHLC MULTILINE STACKEDLINE FLOATINGBAR and FLOATING STACKED BAR Use it when you want to be able to change from one plot type to another without deleting the instance of the old plot object and creating an instance of the new QCChart2D Class S
9. indicato riz Auto Indicator Classes 303 rtAutoMeterIndicatorl HighAlarm AlarmLimitValue 233 rtAutoMeterIndicatorl MinIndicatorValue 0 rtAutoMeterIndicatorl MaxIndicatorValue 300 Dial Indicator Class RTAutoDialIndicator System Windows Controls UserControl ChartView RTAutoIndicator RTAutoDialIndicator The RTAutoDialIndicator combines a RTMeterIndicator object with other objects needed to create a self contained meter display These other objects include a RTComboProcessVar variable meter coordinates system a meter axis and axis labels title string units string alarm indicators and panel meters used in the display of the meters numeric value tag name and alarm status Since it contains a RTComboProcessVar object it can divide a single input value into multiple values to drive multiple needles in the display RTAutoDialIndicator constructors Since the RTAutoDialIndicator is designed to be dropped on a form only a default constructor is used The indicator is customized using public properties Visual Basic Overloads Public Sub New C public RTAutoDialIndicator The InitStrings method is used to initialize the dials tag and units strings Method InitStrings VB Public Sub InitStrings _ title As String _ units As String C public void InitsStrings string title string units Parameters 304 Auto Indicator Classes title The title or tag string units The units str
10. Inherited from RTAutoIndicator Get a reference to the tag panel meter object Inherited from RTAutoIndicator Get Set the tag string Inherited from RTAutoIndicator Get a reference to the units string panel meter object Inherited from RTAutoIndicator Get Set the units string Inherited from RTAutoIndicator Gets or sets a value indicating whether the control is displayed Inherited from Control Gets or sets the width of the control Inherited from Control Get the x axis object Get the second x axis object Get the x axis labels object Get the x axis title object Get the x axis grid object Get the y axis object Get the second y axis object Get the y axis labels object Accessible only after BuildGrap Get the y axis title object Auto Indicator Classes 289 YGrid Get the y axis grid object A complete listing of RTAutoBarIndicator properties is found in the QCRTGraphWPFCompiledHelpFile chm documentation file located in the doc subdirectory There are two different bar graph formats horizontal and vertical Below you will find a brief description of the differences between the formats Flow 493 CH03 100 80 60 a 40 20 290 Auto Indicator Classes Flow 493 Panel meters above and below the bar for the tag name numeric value and alarm status The scale units displayed vertically on the left Turn the BarEndBulb property on and the bar indicator area will resca
11. controlgrid CellRowMargin 0 0 controlgrid CellColumnMargin 0 0 controlgrid FormControlTemplate Frame3DEnable True chartVu AddChartObject controlgrid End Sub Example for momentary and radio buttons The example below extracted from the FetalMonitor example creates four RTControlButton buttons two are momentary buttons and two are radio buttons The buttons are added to an RTFormControlGrid in order to position them as a logical group C RTControlButton StartButton new RTControlButton ChartObj RT CONTROL RADIOBUTTON SUBTYPE RTControlButton StopButton new RTControlButton ChartObj RT CONTROL RADIOBUTTON SUBTYPE RTControlButton ResetButton new RTControlButton ChartObj RT CONTROL MOMENTARYBUTTON SUBTYPE Buttons Track Bars and Other Form Control Classes 223 RTControlButton ClearButton new RTControlButton ChartObj RT CONTROL MOMENTARYBUTTON SUBTYPE public void InitializeStartStopButtons ChartFont buttonfont font12Bold CartesianCoordinates pTransforml w CartesianCoordinates 0 0 0 pTransforml SetGraphBorderDiagonal ChartAttribute attribl new ChartAttribute Colors Black 5 DashStyles Solid Colors LightBlue ArrayList buttonlistl new ArrayList Op Day 14006 Ds Wels 2995 Day De 3 StartButton ButtonUncheckedText Start StartButton ButtonChecked true StartButton Click new System Windows RoutedEventHandler this selector Button Click StartButton
12. meteraxis SetChartObjAttributes attrib1 meteraxis SetAxisTickDir ChartObj AXIS MIN meteraxis LineWidth 5 meteraxis LineColor Colors White meteraxis SetAxisTickSpace 1 meteraxis SetAxisMinorTicksPerMajor 1 meteraxis ShowAlarms true meterneedle MeterAxis meteraxis chartVu AddChartObject meteraxis RTMeterAxis meteraxis2 new RTMeterAxis meterframe meterneedle meteraxis2 SetChartObjAttributes attribl meteraxis2 SetAxisTickDir ChartObj AXIS MIN Meters Coordinates Meter Axes and Meter Axis Labels 161 meteraxis2 LineWidth 1 meteraxis2 LineColor Colors White meteraxis2 SetAxisTickSpace 0 1 meteraxis2 AxisMinorTickLength 10 meteraxis2 AxisMajorTickLength 10 meteraxis2 SetAxisMinorTicksPerMajor 10 meteraxis2 ShowAlarms false chartVu AddChartObject meteraxis2 VB Dim attribl As New ChartAttribute Colors Black 1 DashStyles Solid Colors Blue Dim startarcangle As Double 135 Dim arcextent As Double 230 Dim startarcscale As Double 0 0 Dim endarcscale As Double 8 0 Dim arcdirection As Boolean False Dim arcradius As Double 0 75 Dim centerx As Double 0 0 Dim centery As Double 0 0 Dim meterframe As New RTMeterCoordinates startarcangle arcextent startarcscale endarcscale arcdirection centerx centery arcradius meterframe SetGraphBorderDiagonal 0 45 0 2 0 75 0 9 Dim meterneedle As New RTMeterNeedleIndicator meterframe tach meterneedle S
13. v 100 this BarWidth return width private void InitializeBar3 RTProcessVar processVarArray processVarl processVar2 processVar3 processVar4 CartesianCoordinates pTransforml new CartesianCoordinates 0 0 0 0 1 0 100 0 pTransforml SetGraphBorderDiagonal 0 05 475 0 5 0 65 Background background new Background pTransforml ChartObj PLOT BACKGROUND Colors White chartVu AddChartObject background ChartAttribute attribl new ChartAttribute Colors Green 1 DashStyles Solid Colors BlanchedAlmond ChartAttribute attrib2 new ChartAttribute Colors Green 1 DashStyles Solid Colors Aquamarine ChartAttribute attrib3 new ChartAttribute Colors Green 1 DashStyles Solid Colors DarkSalmon ChartAttribute attrib4 new ChartAttribute Colors Green 1 DashStyles Solid Colors Moccasin ChartAttribute attribArray attribl attrib2 attrib3 attrib4 double barwidth 0 20 barbase 0 0 barspace 0 25 int barjust ChartObj JUSTIFY MIN int barorient ChartObj VERT DIR LinearAxis baraxis new LinearAxis pTransforml ChartObj Y AXIS baraxis CalcAutoAxis chartVu AddChartObject baraxis LinearAxis baraxis2 new LinearAxis pTransforml ChartObj Y AXIS baraxis2 CalcAutoAxis baraxis2 SetAxisIntercept pTransforml GetStopX baraxis2 SetAxisTickDir ChartObj AXIS MAX chartVu AddChartObject baraxis2 NumericAxisLabels barAxis
14. End Sub InitializeAnnunciator Example for a simple multi channel annunciator 198 Single and Multiple Channel Annunciators The example below extracted from the RTGraphNetDemo example file AnnunciatorUserControll method InitializeAnnunciator2 creates a multi channel annunciator that shows the tag name current value and alarm state of the associated RTProcessVar object C private void InitializeAnnunciator2 RTProcessVar processVarArray processVarl processVar2 processVar3 processVar4 CartesianCoordinates pTransforml new CartesianCoordinates 0 0 0 0 1 0 L 0 pTransforml SetGraphBorderDiagonal 0 175 005 0 45 0 475 Background background new Background pTransforml ChartObj PLOT BACKGROUND Colors Gray chartVu AddChartObject background ChartAttribute attribl new ChartAttribute ChartAttribute attrib2 new ChartAttribute ChartAttribute attrib3 new ChartAttribute ChartAttribute attrib4 new ChartAttribute Colors Bisque 5 DashStyles Solid Colors Bisque ChartAttribute attribArray attribl attrib2 attrib3 attrib4 int numrows 2 int numcols 2 RTMultiValueAnnunciator annunciator new RTMultiValueAnnunciator pTransforml processVarArray numcols numrows attribArray ChartAttribute panelmeterattrib new ChartAttribute Colors SteelBlue 3 DashStyles Solid Colors Black RTNumericPanelMeter panelmeter new RTNumericPanelMeter pTransforml processVar2 panelmeterattrib
15. Example for initializing RTAutoDialIndicator objects The example below extracted from the AutoGraphDemos AutoDialsAndClockIndicatorsUserControll example draws each of the 3 different dial formats See the AutoDialsAndClockIndicatorsUserControll asml file to see how the dials are positioned in the parent window C public void InitializeGraph this this this this this this bis tAutoDialIndicatorl GraphFormat 0 tAutoDialIndicatorl InvertColors tAutoDialIndicatorl InitStrings Altimeter Feet E rtAutoDiallndicatorl GraphBackground FillColor Colors White r rtAutoDialIndicator2 GraphFormat 1 rtAutoDialIndicator2 GraphBackground FillColor Colors White rtAutoDialIndicator2 InitStrings Odometer Miles rtAutoDialIndicator3 GraphFormat 2 308 Auto Indicator Classes this rtAutoDialIndicato r3 InitStrings Electric Meter KW Hr VB Public Sub InitializeGraph Me rtAutoClockIndicatorl GraphFormat 0 Me rtAutoClockIndicatorl GraphBackground FillColor Colors White Me rtAutoClockIndicatorl InvertColors Me rtAutoClockIndicatorl InitStrings Boston EST Me rtAutoClockIndicator2 GraphFormat 1 Me rtAutoClockIndicator2 GraphBackground FillColor Colors White Me rtAutoClockIndicator2 PlotAttrib FillColor Colors Blue Me rtAutoClockIndicatorZ InitStrings Pittsburgh TESTY Me rtAutoClockIndicator3 GraphFormat 2 Me r
16. Inherited from RTAutoIndicator Get Set the tag string Inherited from RTAutoIndicator The maximum value for the indicator Inherited from RTAutoIndicator Gets or sets the size that is the lower limit that GetPreferredSize Size can specify Inherited from Control The minimum value for the indicator Inherited from RTAutoIndicator 288 Auto Indicator Classes MultiAlarmIndicator MultiBarPlot NumericPanelMeter PlotAttrib PlotAttribArray PlotBackground PreferredSize Process Variable RenderingMode ResetOnDraw ResizeMode SetpointAlarm TagPanelMeter TagString UnitsPanelMeter UnitsString Visible Width XAxis XAxis2 XAxisLab XAxisTitle XGrid YAxis YAxis2 YAxisLab YAxisTitle Get a reference to the RTMultiAlarmIndicator object Get a reference to the RTMultiBarIndicator object Get a reference to the RTNumericPanelMeter object Inherited from RTAutoIndicator Get an ChartAttribute object in the Inherited from RTAutoIndicator Get an array of ther attributes object for the bars of the bar graph Get the plot background object Inherited from RTAutoIndicator Inherited from ChartView Get most recently created RTProcessVar Inherited from RTAutoIndicator Inherited from ChartView Set Get True the ChartView object list is cleared with each redraw Inherited from RTAutoIndicator Inherited from ChartView Get the most recent setpoint RTAlarm object
17. NeedleBaseWi SetChartObjA NeedleLength hartObject me eIndicator meterframe Colors Black eIndicator meterframe All values must be converted to this range clock12Hour SetDivisorItem 0 5 seconds 5 give seconds position on 0 12 scale clock12Hour SetDivisorItem 1 5 60 seconds 300 give minutes on 0 12 scale clock12Hour SetDivisorItem 2 60 60 seconds 3600 give hours on 0 12 scale clock12Hour SetModuloItem 0 12 apply modulo 12 base clockl2Hour SetModuloItem 1 12 apply modulo 12 base clock12Hour SetModuloItem 2 12 apply modulo 12 base private void InitlallzeClock double startarcangle 90 double arcextent 360 double startarcscale 0 0 double endarcscale 12 0 bool arcdirection false double arcradius 0 50 double centerx 0 0 centery 0 0 ChartFont meterFont font12 RTMeterCoordinates meterframe new RTMeterCoordinates startarcangle arcextent startarcscale endarcscale arcdirection centerx centery arcradius meterframe SetGraphBorderDiagonal 0 8 0 0 99 0 3 ChartAttribute frameattrib new ChartAttribute Colors Black 3 DashStyles Solid Colors Blue Seconds ChartAttribute needleattribl new ChartAttribute Colors Black 1 DashStyles Solid Colors Blue RTMeterNeedleIndicator meterneedlel new RTMeterNeedleIndicator meterframe clockdata 0 meterneedlel NeedleBaseWidth 1 meterneedlel SetChartObjAttributes needleattribl meterneedlel N
18. buttonlistl Add ClearButton Dim numColumns As Integer Dim numRows As Integer 4 startStopControlGrid New RTFormControlGrid pTransforml Nothing buttonlistl numColumns numRows attribl startStopControlGrid CellRowMargin 0 1 startStopControlGrid CellColumnMargin 0 0 startStopControlGrid FormControlTemplate Frame3DEnable flag3DBorder chartVu AddChartObject startStopControlGrid Dim buttonlist2 As New ArrayList Dim attrib2 As New ChartAttribute Colors Black 5 DashStyles Solid Colors LightGreen Dim pTransform2 As New CartesianCoordinates 0 0 0 0 1 0 1 0 pTransform2 SetGraphBorderDiagonal 0 21 0 65 0 4 0 98 PrimaryLineButton ButtonUncheckedText Primary Line PrimaryLineButton ButtonChecked False AddHandler PrimaryLineButton Click New System Windows RoutedEventHandler AddressOf Me selector Button Click PrimaryLineButton ButtonFont buttonfont buttonlist2 Add PrimaryLineButton SecondaryLineButton ButtonUncheckedText Secondary Line SecondaryLineButton ButtonChecked False AddHandler SecondaryLineButton Click New System Windows RoutedEventHandler AddressOf Me selector Button Click SecondaryLineButton ButtonFont buttonfont buttonlist2 Add SecondaryLineButton Buttons Track Bars and Other Form Control Classes 225 Concurrent ButtonUncheckedText Concurrent Concurrent ButtonChecked False AddHandler Concurrent Click New System Windows RoutedEventHandler Ad
19. referenced in the tutorial Visual Basic VB specific code Examples VB examples Same as the C examples above Critical Note Running the Example Programs The example programs for Real Time Graphics Tools for WPF software are supplied in complete source In order to save space they have not been pre compiled which means that many of the intermediate object files needed to view the main form are not present This means that ChartView derived control will not be visible on the main Form if you attempt to view the main form before the project has been compiled The default state for all of the example projects should be the Start Page Before you do view any other file or form do a build of the project This will cause the intermediate files to be built If you attempt to view the main Form before building the project Visual Studio decides that the ChartView control placed on the main form does not exist and delete it from the project There are two versions of the Real Time Graphics Tools for WPF class library the 30 day trial versions and the developer version Each version has different characteristics that are summarized below 30 Day Trial Version The trial version of Real Time Graphics Tools for WPF is downloaded in a file named Trial QCRTGraphWPFR20x The 30 day trial version stops working 30 days after the initial download The trial version includes a version message in the upper left corner of the graph window t
20. s web sites If you wish to redistribute the 30 day trial version of the SOFTWARE you should arrange to have it redistributed directly from our web site If you are using SOFTWARE on an evaluation basis you may make copies of the evaluation SOFTWARE as you wish give exact copies of the original evaluation SOFTWARE to anyone and distribute the evaluation SOFTWARE in its unmodified form via electronic means Internet BBS s Shareware distribution libraries CD ROMs etc You may not charge any fee for the copy or use of the evaluation SOFTWARE itself You must not represent in any way that you are selling the SOFTWARE itself You must distribute a copy of this EULA with any copy of the SOFTWARE and anyone to whom you distribute the SOFTWARE is subject to this EULA C Redistributable License The standard Developer License permits the programmer to deploy and or distribute applications that use the Quinn Curtis SOFTWARE royalty free We cannot allow developers to use this SOFTWARE to create a graphics toolkit a library or any type of graphics component that will be used in combination with a program development environment for resale to other developers If you utilize the SOFTWARE in an application program or in a web site deployment should we ask you must supply Quinn Curtis Inc with the name of the application program and or the URL where the SOFTWARE is installed and being used 3 RESTRICTIONS You may not reverse engineer de compi
21. tRate tRate tRate tRate tRate hear hear hear hear hear hear hear New RTProcessVar Heart Rate MinimumValue 0 MaximumValue 300 DefaultMinimumDisplayValue DefaultMaximumDisplayValue AddAlarm lowheartratealarm AddAlarm highheartratealarm 200 new RTAlarm ChartObj RT ALARM LOWERTHAN Emergency MessageBoxDefaultButton Buttonl tribute Colors Green 1 0 3034 Rate Colors Blue Colors Blue hartObj RT ALARM GREATERTHAN 160 High Heart Rate Colors Red Red defaultattrib F event handling Erue new RTAlarmEventDelegate this heartRate HighAlarm r te void heartRate HighAlarm object sender RTAlarmEventArgs e MessageBoxButtons YesNo buttons 1 0 D shstyles So011idg 30 Rate Colors Blue Colors Blue tObj RT ALARM GREATERTHAN 160 High Heart Rate Colors Red Red defaultattrib Process Variable and Alarm Classes 107 These two lines enable alarm transition event handling heartRate AlarmTransitionEventEnable True AddHandler heartRate AlarmTransitionEventHandler AddressOf Me heartRate HighAlarm heartRate SetCurrentValue heartRateValue heartRate SetCurrentValue heartRateValue Private Sub heartRate HighAlarm ByVal sender As Object ByVal e As RTAlarmEventArgs Dim buttons As MessageBoxButtons MessageBoxButtons YesNo Dim result As DialogResult Displays the MessageBox result MessageBox Show Me Emergency Heart
22. 18 32 33 35 166 171 173 174 175 176 177 179 180 181 183 184 186 203 RTMeterAxisLabels 18 33 35 166 172 176 178 179 181 203 RTMeterCoordinates 17 33 34 166 167 168 169 170 171 172 173 174 175 179 180 183 184 186 187 188 194 195 198 199 203 206 208 210 211 RTMeterIndicator 17 20 23 25 97 112 171 172 173 185 187 188 194 195 198 199 203 332 341 347 RTMeterNeedleIndicator 17 23 27 174 175 179 180 183 184 185 194 195 196 197 203 206 207 208 209 210 211 212 RTMeterStringAxisLabels 18 34 35 166 181 182 183 184 203 RTMeterSymbolIndicator 17 23 28 185 198 199 200 201 203 RTMultiAlarmIndicator 17 32 33 325 RTMultiBarIndicator 17 20 29 30 97 112 127 128 152 153 156 157 158 159 162 322 325 RTMultiValueAnnunciator 17 29 30 97 213 216 217 218 219 221 222 RTMultiValueIndicator 17 28 29 33 36 38 152 213 217 224 228 239 263 265 RTNumericPanelMeter 17 20 21 28 112 117 118 119 120 121 122 124 125 128 129 143 144 145 156 197 198 215 216 221 222 255 256 258 314 325 335 343 350 359 RTPanelMeter 15 17 20 23 26 28 36 47 49 97 112 113 114 117 118 119 122 126 129 132 135 152 166 185 214 259 260 290 RTPIDControl 17 46 48 272 274 275 277 RTPlot 17 20 23 29 38 113 11
23. 223 235 236 239 242 243 244 247 250 256 259 260 261 263 264 266 290 291 296 297 298 299 320 321 325 331 332 ChartCalendar 58 62 66 88 91 92 94 99 243 288 348 349 353 354 356 363 365 366 367 369 373 374 ChartBE vent iiec PER ie a ee ChartEvent ChartLabel 4i iain ean aedi t 87 88 95 260 ChartObj 17 18 36 46 94 98 102 105 106 107 109 110 117 118 120 121 122 124 125 128 129 131 132 134 135 137 143 144 145 146 148 149 150 151 156 157 158 159 160 161 163 164 174 175 176 179 180 181 183 184 197 198 201 210 211 215 216 219 220 221 222 223 231 233 234 235 236 237 238 241 242 243 244 247 248 249 250 251 256 262 266 280 283 284 285 286 287 288 292 293 294 296 297 299 311 320 321 322 323 331 332 362 363 364 365 372 373 374 ChartPlot 140 141 142 153 154 155 VE OK 177 178 ChaitTitl erraverit ntes 87 88 95 ChartView 8 13 16 18 19 20 39 40 41 42 43 44 45 46 57 62 89 91 94 105 112 121 141 142 154 156 173 178 186 224 225 226 228 229 233 234 280 281 284 295 298 300 301 303 304 310 314 322 326 332 335 341 343 347 350 353 358 359 360 365 366 375 ContourDaltaset sirio aida naso 57 58 94 91 92 94 Customer Support Data Tooltips data tool
24. 3 DashStyles Solid Dim lineplot2 As New SimpleScatterPlot pTransforml Nothing ChartObj SQUARE attrib2 lineplot2 SetFastClipMode ChartObj FASTCLIP X lineplot2 c End Dim sol Hr urrentu Temperature2 larPanelLinePlot2 As New chartVu AddChartObject solarPanelLinePlot2 If RTSimpleSingleValuePlot pTransforml Using QCRTGraph for WPF to Create Web Applications 369 Dim titlefont As ChartFont font14 Dim charttitle As New ChartTitle pTransforml titlefont Scroll Application 1 ChartObj CHART HEADER ChartObj CENTER PLOT chartVu AddChartObject charttitle End Sub Public Sub InitializeGraph timerl IsEnabled False templowalarml New RTAlarm ChartObj RT ALARM LOWERTHAN 80 templowalarml AlarmMessage Low Alarm templowalarml AlarmSymbolColor Colors Blue templowalarml AlarmTextColor Colors Blue temphighalarml New RTAlarm ChartObj RT ALARM GREATERTHAN 120 temphighalarml AlarmMessage High Alarm temphighalarml AlarmSymbolColor Colors Red temphighalarml AlarmTextColor Colors Red currentTemperaturel New RTProcessVar Temp 1 New ChartAttribute Colors Green 1 0 DashStyles Solid Colors Green currentTemperaturel MinimumValue 20 currentTemperaturel MaximumValue 200 currentTemperaturel DefaultMinimumDisplayValue 0 currentTemperaturel DefaultMaximumDisplayValue 150 currentTemperaturel SetCurrentValue currentTemperatureValuel cur
25. 600 Width 800 xmlns my clr namespace com quinncurtis chart2dwpf assembly QCChart2DWPF3 xmlns my2 clr namespace com quinncurtis rtgraphwpf assembly QCRTGraphWPF3 Grid my ChartView Margin 5 5 5 5 Name scrollApp1 gt lt Grid gt lt Page gt Display the Pagel asml cs behind code file It will look something like this using System using System Collections Generic using System Ling using System Text using System Windows using System Windows Controls using System Windows Data using System Windows Documents using System Windows Input 356 Using OCRTGraph for WPF to Create Web Applications using System using System using System using System namespace WpfBrowserApplicationl Windows Windows Windows Windows Media Shapes lt summary gt Interaction logic for Pagel xaml lt summary gt public partial class Pagel public Pagel i Media Imaging Navigation Page InitializeComponent e Adda reference to the QCChart2DWPF and QCRTGraphWPF namespaces com quinncurtis chart2dwpf and com quinncurtis rtgraphwpf in the using section of the program using com quinncurtis chart2dwpf using com quinncurtis rtgraphwpf Adda new simple class file named ScrollGraph1 to the project Alternatively select Add Existing Item and select the file ScrollGraph1 cs from our WpfRTBrowserApplication example folder If you do that make sure y
26. AxisTickOrigin inherited from Axis AxisTicksEnable inherited from Axis AxisTickSpace inherited from LinearAxis ChartObjAttributes inherited from GraphObj InnerAlarmArcNormalized MajorTickLine Width MeterAxisLabels MeterFrame MeterIndicator MinorTickLineWidth OuterAlarmArcNormalized ShowAlarms ZOrder inherited from GraphObj Get Set the number of minor tick marks per major tick mark Get Set the direction of a tick mark Use one of the tick direction constants AXIS MIN AXIS CENTER AXIS MAX Get Set the starting point for positioning tick marks in physical coordinates Set Get to true draws the axis tick marks Get Set the minor tick mark spacing Sets the attributes for a chart object using a ChartAttribute object Get Set the inner arc of the axis in normalized radius coordinates Get Set the major tick line width Get Set the RTMeterAxisLabels object if any associated with this object Get Set the RTMeterCoordinates coordinate system associated with this object Get Set the RTMeterIndicator object if any associated with this object Get Set the minor tick line width Get Set the outer arc of the axis in normalized radius coordinates Get Set true to show the alarm arcs Sets the z order of the object in the chart Every object has a z order value Each z order value does NOT have to be unique If z order sorting is turned on in the ChartView object objects are sorted by z order
27. Colors Red Channel 3 tAutoScrollGraphl SimplePlotObj SymbolAttributes SymbolSize 8 tAutoScrollGraphl GraphScrollFrame ScrollRescaleMargin 0 01 tAutoScrollGraphl GraphScrollFrame ScrollScaleModeY ChartObj RT AUTOSCALE Y MINMAX la fe tAutoScrollGraphl Footer ChartObjEnable ChartObj OBJECT ENABLE tAutoScrollGraphl YAxisLab2 ChartObjEnable ChartObj OBJECT ENABLE rtAutoScrollGraphl InitStrings RTAutoScrollGraph Time Ogarks rtAutoScrollGraphl GraphBackground FillColor Colors BlanchedAlmond rtAutoScrollGraphl SubHead TextString Subhead Text rtAutoScrollGraphl SubHead ChartObjEnable ChartObj OBJECT ENABLE rtAutoScrollGraphl Footer TextString Footer text ZE E BOTTOM HORIZONTAL GRAPH Elapsed Time scale TimeSpan startts TimeSpan FromSeconds 0 TimeSpan endts TimeSpan FromSeconds 30 rtAutoScrollGraph2 InitRTAutoScrollGraph startts 0 endts 15 rtAutoScrollGraph2 InitSimpleRTPlotObject ChartObj LINE PLOT Colors Blue Channel 1 rtAutoScrollGraph2 InitSimpleRTPlotObject ChartObj LINE PLOT Colors Green Channel 2 rtAutoScrollGraph2 InitSimpleRTPlotObject ChartObj SCATTER_PLOT Colors Red Channel 3 tAutoScrollGraph2 SimplePlotObj SymbolAttributes SymbolSize 8 tAutoScrollGraph2 GraphScrollFrame ScrollRescaleMargin 0 01 tAutoScrollGraph2 GraphScrollFrame ScrollScaleModeY ChartObj RT AUTOSCALE Y MINMAX BR H tAutoScr
28. It contains data common to all of the dataset classes such as the x value array the number of x values the dataset name and the dataset type 56 QCChart2D Class Summary SimpleDataset Represents simple xy data where for every x value there is one y value TimeSimpleDataset A subclass of SimpleDataset it is initialized using ChartCalendar dates a wrapper around the System DateTime value class in place of the x or y values ElapsedTimeSimpleDataset A subclass of SimpleDataset it is initialized with TimeSpan objects or milliseconds in place of the x or y values ContourDataset A subclass of SimpleDataset it adds a third dimension z values to the x and y values of the simple dataset GroupDataset Represents group data where every x value can have one or more y values TimeGroupDataset A subclass of GroupDataset it uses ChartCalendar dates a wrapper around the System DateTime value class as the x values and floating point numbers as the y values ElapsedTimeGroupDataset A subclass of GroupDataset it uses TimeSpan objects or milliseconds as the x values and floating point numbers as the y values Scale Classes ChartScale LinearScale LogScale TimeScale ElapsedTimeScale The ChartScale abstract base class defines coordinate transformation functions for a single dimension It is useful to be able to mix and match different scale transform functions for x and y dimensions of the PhysicalCoordinates clas
29. LogAxis TimeAxis Creating a PhysicalCoordinates coordinate system does not automatically create a pair of x and y axes Axes are separate charting objects drawn with respect to a specific PhysicalCoordinates object The coordinate system and the axes do not need to have the same limits In general the limits of the coordinate system should be greater than or equal to the limits of the axes The coordinate system may have limits of 0 to 15 while you may want the axes to extend from 0 to 10 Widget Tolerances by Worker 600 4500 130K Click on one of the buttons below to See the oa range eg 4 4 4 i LEN AM M M H H S N LAU CA NI e MAS V VA i vA 400 1000 12 0K YA T 4 4 A 1 j 4 6 4 4 4 4 d 200 500 11 0K 20 2 d i 0 0 10 0K 0 0 20 40 60 80 100 Event Partition Graphs can have an UNLIMITED number of x and y axes Axis This class is the abstract base class for the other axis classes It contains data and drawing routines common to all axis classes 62 QCChart2D Class Summary Linear Axes 100 0 00004 50 0 00002 0 0 00000 sog 001002 003 0 04 0 05 0 00002 0 00004 100 0 4 0 2 0 0 0 2 0 4 ii a2 T pa ed eren 0 10000 20000 30000 40000 10 LL 2800 15 de 2400 25 2000 0 5 10 15 The positioning of axes is very flexible Axes can have an inverted scale LinearAxis This class implements a linear axis with major and minor tick marks placed a
30. MaximumValue MinimumValue PrevCurrentValue Get Set the flag for the alarm state event enable Set to true to enable alarm checking Get Set the flag for the AlarmTransitionEventHandler delegate enable Set to true to enable the AlarmTransitionEventHandler delegate Get the process variable current value Get Set to true to enable historical data collection in the process variable dataset Get Set the default attributes for the process variable Get Set maximum allowable display value for the process variable Get Set minimum allowable display value for the process variable Get Set the process variable detailed description string Get Set set to false designates that the current value is a bad value Get Set maximum allowable value for the process variable Get Set minimum allowable value for the process variable Get the process variable previous current Process Variable and Alarm Classes 99 value PrevTimeStamp Get the process variable previous time stamp value Process VarDataset Get Set the process variable dataset ShortDescription Get Set the process variable short description string TagName Get Set the process variable tag string TimeStamp Get the process variable time stamp value Uniqueldentifier Get Set the process variable unique identifier string UnitsString Get Set the process variable units string Public Instance Events AlarmStateEventHandler Delegate for notification each time the check of a p
31. Simple plots use data organized as a simple array of xy points where there is one y for every x Simple plot types include line plots scatter plots bar graphs and line marker plots SimplePlot SimpleBarPlot g E This class is an abstract base class for all simple plot classes Production of Green Bars is Up Rael Ga arly LaLa ERU aL 77 UT psu 1999 2000 2001 2002 2003 2004 2005 2006 Bar plots can have the values of the bars displayed above or inside each bar This class is a concrete implementation of the SimplePlot class and displays data in a bar format Individual bars the 82 QCChart2D Class Summary maximum value of which corresponds to the y values of the dataset are justified with respect to the x values History Test Results Test Score 0 5 10 15 20 Student Individual data points can be automatically labeled SimpleLineMarkerPlot This class is a concrete implementation of the SimplePlot class and it displays simple datasets in a line plot format where scatter plot symbols highlight individual data points Sales Volume is Rising Faster than Forecast 400 100 1998 1999 2005 2006 2000 2001 2002 2003 2004 Presentation quality graphs with background gradients semi transparent colors legends and titles SimpleLinePlot Measurable work output QCChart2D Class Summary 83 This class is a concrete implementation of the SimplePlot class it displays simple datasets
32. This class labels the major tick marks of the associated AntennaAxes object The y axis is labeled from the radius minimum to the radius maximum The circular axis is labeled clockwise from 0 to 360 degrees starting at 12 00 Plot objects are objects that display data organized in a ChartDataset class There are six main categories simple group polar antenna contour and pie plots Simple plots graph data organized as a simple set of xy data points The most common examples of simple plots are line plots bar graphs scatter plots and line marker plots Group plots graph data organized as multiple y values for each x value The most common examples of group plots are stacked bar graphs open high low close plots candlestick plots floating stacked bar plots and box and whisker plots Polar charts plot data organized as a simple set of data points where each data point represents a polar magnitude and angle pair rather than xy Cartesian coordinate values The most common example of polar charts is the display of complex numbers a bi and it is used in many engineering QCChart2D Class Summary 69 disciplines Antenna charts plot data organized as a simple set of data points where each data point represents a radius value and angle pair rather than xy Cartesian coordinate values The most common example of antenna charts is the display of antenna performance and specification graphs The contour plot type displays the iso lines or c
33. Use the ChartZoom ArCorrectionMode property to specify the aspect ratio correction mode ZOOM NO AR CORRECTION Allow the x and y dimension of the zoom rectangle to change the overall charts physical aspect ratio This is the default mode and the only mode supported prior to Revision 2 0 Zooming 249 ZOOM X AR CORRECTION Track the x dimension of the zoom rectangle and calculate the y dimension in order to maintain a fixed aspect ratio ZOOM Y AR CORRECTION Track the y dimension of the zoom rectangle and calculate the x dimension in order to maintain a fixed aspect ratio The target aspect ratio is the aspect ratio of the coordinate system s at the time the ChartZoom object is intitialized zoomObj ArCorrectionMode ChartObj ZOOM X AR CORRECTION Simple zoom example Extracted from the FetalMonitor example In this example a new class derives from the ChartZoom class and the MousePressed event overridden The event invokes the PopZoomStack method Otherwise the default operation of the ChartZoom class controls everything else C ChartZoom zoomObj zoomObj new ZoomWithStack chartVu pTransforml true zoomObj SetButtonMask MouseButton Left zoomObj SetZoomYEnable true zoomObj SetZoomXEnable true zoomObj SetZoomXRoundMode ChartObj AUTOAXES FAR zoomObj SetZoomYRoundMode ChartObj AUTOAXES FAR zoomObj SetEnable false zoomObj InternalZoomStackProcesssing true chartVu SetCurrentMouseListene
34. Z LINQ to SQL Classes GEltocal Database Cache E MDI Parent Form s Page WPF Ei Report d ADO NET Entity Data Model Class Diagram x T3 COM Class F Custom Control g DataSet lay Dynamic Data Field 13 Flow Document WPF 3 JScript File g Local Database A Login Form Module Page Function WPF el Report Wizard An empty class definition Name ScroliGraph il vb The resulting ScrollGraph1 vb file will contain Public Class ScrollGraphl End Class e Modify the ScrollGraphl file to create the desired chart Most all of our examples are structured the same way The constructor is changed to pass in a ChartView object Then a chart initialization routine is called which customizes the chart See the ScrollGraph1 vb file of the WpfRTBrowserApplicationl example Imports com quinncurtis chart2dwpf Imports com quinncurtis rtgraphwpf Using QCRTGraph for WPF to Create Web Applications 367 II lt summary gt Summary description for ScrollApplicationUserControll U lt summary gt Public Class SorollGraphi Private timerl As New System Windows Threading DispatcherTimer Private timer2 As New System Windows Threading DispatcherTimer Private currentTemperatureValuel As Double 110 0 Private currentTemperaturel As RTProcessVar Private currentTemperatureValue2 As Double 100 0 Private currentTemperature2 As RTProcessVar Private scrollFrame As New RTScrollFrame Pr
35. barjust barorient barplot IndicatorSubType ChartObj RT BAR SOLID SUBTYPE For Pointer indicator ChartAttribute attribl new ChartAttribute Colors Black 1 DashStyles Solid Colors Green double barwidth 1 0 barbase 0 0 int barjust ChartObj JUSTIFY MIN int barorient ChartOb VERT DIR attribl SymbolSize 22 RTBarIndicator barplot new RTBarIndicator pTransforml processVarl barwidth barbase attribl barjust barorient barplot IndicatorSubType ChartObj RT POINTER SUBTYPE VB Dim attribl As New ChartAttribute Colors Black 1 DashStyles Solid Colors Green Dim barwidth As Double 1 0 Dim barbase As Double 0 0 Dim barjust As Integer ChartObj JUSTIFY MIN Dim barorient As Integer ChartObj VERT DIR Dim barplot As New RTBarIndicator pTransforml processVarl _ barwidth barbase attribl barjust barorient barplot IndicatorSubType ChartObj RT BAR SOLID SUBTYPE For Pointer indicator Dim attribl As New ChartAttribute Colors Black 1 DashStyles Solid Colors Green Dim barwidth As Double 1 0 Dim barbase As Double 0 0 Dim barjust As Integer ChartObj JUSTIFY MIN Dim barorient As Integer ChartObj VERT DIR Single Channel Bar Indicator 141 attribl SymbolSize 22 Dim barplot As New RTBarIndicator pTransforml processVarl _ barwidth barbase attribl barjust barorient barplot IndicatorSubType ChartObj RT POINTER SUBTYPE 7 Multiple Channel Bar Indicator RTMultiBarI
36. changes of the y scale for the first few samples lFrame MinSamplesForAutoScale lFrame ScrollRescaleMargin 100 Vets chartVu AddChartObject scrollFrame If scrollMode Dim attribl Dim lineplotl As New SimpleLinePl 0 Then As New ChartAttribute Colors Yellow lot pTransforml Su Nothing DashStyles Solid attribl linepl Dim s current otl SetFastClipMode ChartObj FASTCLIP X olarPanelLinePlotl As New RTSimpleSingleValuePlot pTransforml lineplotl lineplot2 c Else ChartObj CIR lineplotl c tTemperaturel chartVu AddChartObj Dim attrib2 As New Dim linepl Dim sol Hr urrentTemperature2 chartVu AddChartObj Dim attribl As New ChartAttribu lineplotl As New Simpl Dim CLE dttribl linepl Dim sol urrentTemperaturel ect sol ChartAttribu lineplot2 As New Simpl ot2 SetFastCl larPanelLinePlot2 As ipMode ect sol larPanelLinePl te Colors leLinePl New arPanelLinePl te Colors eScatterPlot p1 otl SetFastClipMode ChartObj FASTCLIP larPanelLinePlotl As New Green lot pTransforml ChartObj FASTCLIP X RTSimpleSingl GEZ tel RTSimpleSing otl 3 Llow 3 Transforml X chartVu AddChartObject solarPanelLinePlot1 Nothing leValuePlot pTransforml leValuePlot pTransforml DashStyles Solid attrib2 DashStyles Sol Nothing id Dim attrib2 As New ChartAttribute Colors Green
37. graph RTSimpleSingleValuePlot constructors Visual Basic Overloads Public Sub New _ ByVal transform As PhysicalCoordinates _ ByVal plottemplate As SimplePlot _ ByVal datasource As RIProcessVar _ Overloads Public Sub New _ ByVal plottemplate As SimplePlot _ ByVal datasource As RTProcessVar _ Single and Multiple Channel Annunciators 209 C public RTSimpleSingleValuePlot PhysicalCoordinates transform SimplePlot plottemplate RTProcessVar datasource public RTSimpleSingleValuePlot SimplePlot plottemplate RTProcessVar datasource Parameters transform The coordinate system for the new RTSimpleSingleValuePlot object plottemplate This SimplePlot object is used as a template for the scrolling plot object datasource The source process variable Selected Public Instance Properties EndOfPlotLineMarker Get Set The end of plot marker type Use one of the Marker marker type constants MARKER NULL MARKER VLINE MARKER HLINE MARKER HVLINE PlotTemplate Get Set the simple plot template A complete listing of RTSimpleSingleValuePlot properties is found in the QCRTGraphWPFCompiledHelpFile chm documentation file located in the doc subdirectory Example for a simple single channel scrolling line plot The example below extracted from the HomeAutomation example file SolarPanelUserControll method InitializeScrollGraph creates a single channel scrolling graph Note Both the RTScrollFrame
38. indicator graphical display Meter scaling meter axes meter axis labels and alarm objects and handle by the meter coordinate system meter axis and meter axis labels classes described in the preceding chapter Base Class for Meter Indicators Class RTMeterIndicator com quinncurtis chart2dwpf ChartPlot RTPlot RTSingleValueIndicator RTMeterIndicator The RTMeterIndicator class is the abstract base class for all meter indicators Since it is abstract it does not have a constructor that you can use It does have properties common to all meter indicator types and these are listed here Selected Public Instance Properties AlarmIndicatorColorMode Get Set whether the color of the indicator objects inherited from changes on an alarm Use one of the constants RTSingleValueIndicator RT_INDICATOR COLOR NO ALARM CHANGE RT INDICATOR COLOR CHANGE ON ALARM ChartObjAttributes inherited Sets the attributes for a chart object using a from GraphObj ChartAttribute object ChartObjEnable inherited Enables Disables the chart object A chart object is from GraphObj drawn only if it is enabled A chart object is enabled by default ChartObjScale inherited from Sets the reference to the PhysicalCoordinates object GraphObj that the chart object is placed in CurrentProcess Value Get the current process value of the primary channel inherited from RTSingleValueIndicator FillColor inherited from GraphObj IndicatorBackground Indicato
39. the middle of the bar indicator area A panel meter at the top for the tag name The scale units displays horizontally under the scale Turn the BarEndBulb property on and the bar indicator area shrinks horizontally in order to fit in the Horiz Horiz 3 Horiz Horiz 3 opge Simliar to GraphFormat 1 except for the treatment of the bar end bulb Panel meters to the left and right of the bar for the numeric value and and alarm status A panel meter at the top for the tag name The scale units displays horizontally under the scale Turn the BarEndBulb property on and the numeric value sits on top of the bulb Example for initializing RTAutoBarIndicator objects The example below extracted from the AutoGraphDemos AutoBarIndicators example draws four vertical and four horizontal bargraphs 282 Auto Indicator Classes Wi Window1 eee AutoBarIndicators AutoMeterIndicators AutoMultiBarIndicators AutoPanelMeterIndicators AutoDialsAndClocksIndicators 100 80 Usar end bulb Interior axs Numeric readout 020 60 100 l 3 ni 0 20 40 60 80 100 Alarm readout SMB v Units string Tag string Segmented 0 20 40 60 80 100 0 20 40 60 680 100 GMB GMB Below you will find the code used to initialize the first of the bargraphs above extracted from the AutoGraphDemos AutoBarIndicatorsUserControll example program The bars are placed in the underlying windows using the
40. using com quinncurtis chart2dwpf using com quinncurtis rtgraphwpf namespace WpfRTApplicationl summary Interaction logic for Windowl xaml lt summary gt public partial class Windowl Window SerollGraphl sg null public Windowl InitializeComponent sg new ScrollGraphl scrollAppl scrollAppl PreferredSize new Size 800 600 Using QCRTGraph for WPF to Create Windows Applications 341 The reference to PreferredSize tells the software that the font sizes specified in the graph are with respect to a chart window of size 900 600 If the chart is sized larger than this the fonts will be larger if it is sized smaller the fonts will be smaller Build the Solution Build Build Solution If the project fails to compile you need to go back and check the errors and the previous steps When it runs properly it the WpfRTApplicationl chart looks like Wi Window1 amp Scroll Application 1 15 55 25 15 55 30 15 55 35 15 55 40 There are other ways to incorporate charts into your application You can add a UserControl to your program Add UserControl and place the chart entirely in the UserControl The ChartView object is referenced in the Grid panel of the UserControl s xaml file and initialized in the UserControl s behind code file The UserControl derived class is then referenced in the main Window xaml file The QCChart2D UserControlChartExamplel demonstrates
41. 0 chartVu AddChartObject formControlTrackBarl 6 Single Channel Bar Indicator RTBarlIndicator An RTBarIndicator is used to display the current value of an RTProcessVar using the height or width of a bar One end of each bar is always fixed at the specified base value Bars can change their size either in vertical or horizontal direction Sub types within the RTBarlIndicator class support segmented bars custom segmented bars with variable width segments and pointer bar indicators Panel meters can be attached to the bar indicator where they provide text for numeric read outs alarm warnings descriptions and titles Bar Indicator Class RTBarIndicator com quinncurtis chart2dwpf ChartPlot RTPlot RTSingleValueIndicator RTBarIndicator The bar indicator is a relatively simple plot object that resides in the plot area of the specified coordinate system It is usually combined with axes and axis labels though this is not required Since the bar indicator does not include axes or axis labels as option it is up to the user to explicitly create axis and axis label objects for the bar indicator graph The QCChart2D axis and axis labels routines make this easy to do RTBarIndicator constructors Visual Basic Overloads Public Sub New _ ByVal transform As PhysicalCoordinates _ ByVal datasource As RTProcessVar ByVal barwidth As Double _ ByVal barbase As Double _ ByVal attrib As ChartAttribute ByVal barjust As Integer _
42. 1 DashStyles Dot Dim ygrid As New ChartGrid xAxis yAxis ChartObj Y AXIS ChartObj GRID MAJOR ygrid SetChartObjAttributes attrib3 chartVu AddChartObject ygrid Mouse Button Constants WPF events use different mouse button constants than Net Forms based programming The Net Forms mouse event constants are found in System Windows Forms MouseButtons while the WPF mouse constants are found in System Windows Input MouseButton Mouse Event Arguments In Net Forms programming the MouseDown MouseUp and MouseMove events use the System Windows Forms MouseEventArgs data type In WPF programming the MouseDown and MouseUp events use the System Windows Input MouseButtonEventArgs type and the MouseMove event uses the System Windows Input MouseEventArgs type Net Forms CH protected void OnMouseDown MouseEventArgs e protected void OnMouseUp MouseEventArgs e protected void OnMouseMove MouseEventArgs e VB protected void OnMouseDown ByVal e As MouseEventArgs protected void OnMouseUp ByVal e As MouseEventArgs protected void OnMouseMove ByVal e As MouseEventArgs WPF protected void OnMouseDown MouseButtonEventArgs e protected void OnMouseUp MouseButtonEventArgs e protected void OnMouseMove MouseEventArgs e 52 Class Architecture VB protected void OnMouseDown ByVal e As MouseButtonEventArgs protected void OnMouseUp ByVal e As MouseButtonEventArgs protected void OnMouseMove ByVal e As MouseEventArgs Ti
43. 135 136 139 141 147 148 152 153 154 159 161 162 185 213 217 225 228 229 232 240 259 260 263 264 280 281 284 290 294 297 301 BiG Shri X 70 82 95 Plot object classes13 17 20 23 28 38 70 71 95 113 118 122 126 129 132 135 139 140 141 142 152 153 154 155 185 187 194 198 213 217 224 228 231 239 POM egene retirees at tates 91 92 94 PolarAxes 63 67 70 87 95 PolarAxesl abels 68 70 95 PolarCoordinates 17 33 59 60 94 166 PolarGtid eee tete E ORE Ge 86 87 95 PolarLinePlot 2 1 tita tee 79 80 95 PolarPlot aitaa ea naene asns 70 79 80 95 PolarScatterPlot sese 79 80 95 Polysurface class 91 92 94 95 Printibg iste tete RUE ted 91 94 Rectangle2D 92 93 94 179 180 213 215 216 290 291 292 293 294 297 299 301 RineChatt Gage ne pre ane 83 RT XE 17 19 20 97 100 101 102 103 104 105 106 107 108 109 110 313 314 325 326 334 343 349 350 358 359 360 RT3DFrame 17 46 47 179 180 290 291 292 293 294 RTAlarmEventArgs 17 19 20 97 105 107 108 109 111 RTAlarmlIndicator 17 32 33 48 143 144 145 156 313 324 RTAlarmPanelMeter 17 20 21 22 28 112 122 123 124 125 143 144 146 156 215 216 221 223 313 324 334 343 349 358 RTAnnunciator 17 20 23 24 112 213 214 215 216 RTAuto
44. 256 Miscellaneous Shape Drawing Specifies the attributes line and fill color for the frame postype Specifies the positioning coordinate system Selected Public Instance Properties Returns the bounding box for the chart object Not all chart objects have bounding boxes Be sure and check for null ChartObjAttributes inherited from GraphObj ChartAttribute object GraphObj FrameRect Set Get the Rectangle2D object used to define the a M Set Get the apparent direction of fe light source used to highlight the 3D frame Use one of the direction constants LIGHT UPPER LEFT LIGHT UPPER RIGHT LIGHT LOWER LEFT LIGHT LOWER RIGHT LIGHT STRAIGHT ON LIGHT NONE OUTSET 3D LOOK INSET 3D LOOK GraphObj GraphObj GraphObj GraphObj A complete listing of RT3DFrame properties is found in the QCRTGraphWPFCompiledHelpFile chm documentation file located in the doc subdirectory Example for drawing RT3DFrame objects The example below extracted from the HomeAutomation example file ThermostatUserControll draws an RT3DFrame object the size of the entire control area Since each separate control in the example has a similar RT3DFrame background it provides a visual grouping of the objects in each control Miscellaneous Shape Drawing 257 C private void InitializeBackgroundPanel ChartFont theFont fontl0Bold Rectangle2D normrect new Rectangle2D 0 0 0 0 1 0 1 0 CartesianCoordinates pTransforml
45. 37 30 13 37 30 13 37 40 13 37 50 A display can have multiple scroll frames The frames can be in separate plots and update in a synchronized fashion or they can overlap the same plotting area RTScrollFrame The scrolling algorithm used in this software is different that in earlier Quinn Curtis real time graphics products 38 Class Architecture Scrolling plots are no longer updated incrementally whenever the underlying data is updated Instead the underlying RTProcessVar data objects are updated as fast as you want Scrolling graphs all graphs for that matter are only updated with the ChartView UpdateDraw method is called What makes scrolling graphs appear to scroll is the scroll frame RTScrollFrame When a scroll frame is updated as a result of the ChartView UpdateDraw event it analyzes the RTSimpleSingleValuePlot and RTGroupMultiValuePlot objects that have been attached to it and creates a coordinate system that matches the current and historical data associated with the plot objects The plot objects in the scroll frame are drawn into this coordinate system As data progresses forward in time the coordinate system is constantly being rescaled to include the most recent time values as part of the x coordinate system You can control whether or not the starting point of the scroll frame coordinate system remains fixed whether it advances in sync with the constantly changing end of the scroll frame Other options allow the
46. 6 dee 12 Real Time Graphics Tools for WPF Class Summary eene 14 Namespace c rguinnc rtis rteraphWwpi lirici li 17 Process Variable and Alarms Classes ili ieri 19 Panel Merr I n 20 Tia des eie c Rem 23 Mul ple Valje m Ip RR ARRE eer Ce meen rooney en nee 28 Par im A a 32 Keer EE 33 ER o NR 36 cer Frane I PR NATO TI n 38 OO CER RR aa a a 40 EEA I O O O 46 Source Code Differences between the Net Forms version of QCChart2D QCRTGraph and the WPF I ac dad RO RI TT DE LUI 49 CRIARI RTRT A TO O eee 56 REATI A eee 56 Chart Window RT ad JET 9Q SR Real Time ae ee ll 98 belli 102 M Netta cieca 112 esso Peres Indicator 1 Indica Real Time Graphics Tools for WPF 1 Introduction The QCRTGraph for WPF software represents an adaptation of the QCRTGraph library to the WPF user interface framework We have removed 100 of the GDI based graphics found in the Net System Drawing System Drawing Drawing2D and System Windows Forms names spaces and replaced them with DirectX based WPF equivalents We have redesigned the chart rendering scheme to work with the WPF retained graphics framework But we have maintained the simple to use flexible programming style found in our QCRTGraph for Net software In general you place one or more of our ChartView objects as visual elements in the XAML window of your application The chart itself is c
47. As RTMeterCoordinates ByVal graphplot As RIMeterIndicator Overloads Public Sub New ByVal frame As RIMeterCoordinates ByVal graphplot As RTMeterIndicator ByVal tickspace As Double ByVal tickspermajor As Integer _ ICH public RTMeterAxis RTMeterCoordinates frame RTMeterIndicator graphplot public RTMeterAxis RTMeterCoordinates frame RTMeterIndicator graphplot double tickspace int tickspermajor Parameters frame The RTMeterCoordinates object defining the meter properties for the meter axis graphplot The RTMeterIndicator object associated with the meter axis tickspace Specifies the spacing between minor tick marks in degrees tickspermajor Specifies the number of minor tick marks per major tick mark Selected Public Instance Properties AxisLabels inherited from Axis AxisLineEnable inherited from Axis AxisMajorTickLength inherited from Axis AxisMax inherited from Axis AxisMin inherited from Axis AxisMinorTickLength inherited from Axis Get Set the axis labels object associated with this axis Set Get to true draws the axis line connecting the tick marks Get Set length of a major tick mark Get Set the axis maximum value Get Set the axis minimum value Get Set length of a minor tick mark Meters Coordinates Meter Axes and Meter Axis Labels 159 AxisMinorTicksPerMajor inherited from Axis AxisTickDir inherited from Axis
48. AutoBarIndicatorsUserControl1 xaml file lt UserControl x Class AutoGraphDemo AutoBarIndicatorsUserControll xmlns http schemas microsoft com winfx 2006 xaml presentation xmlns x http schemas microsoft com winfx 2006 xaml Height 700 Width 900 xmlns my clr namespace com quinncurtis chart2dwpf assembly QCChart2DWPF3 xmlns my2 2 clr namespace com quinncurtis rtgraphwpf assembly QCRTGraphWPF3 Grid lt Grid RowDefinitions gt lt Row lt Row lt Row lt Row Definition Height 10 gt Definition Height 10 gt Definition Height 10 gt Definition Height 10 gt lt Grid RowDefinitions gt lt Grid ColumnDefinitions gt Col Cod Col Col Col umnDefinition Width 10 gt umnDefinition Width 10 gt umnDefinition Width 10 gt umnDefinition Width 10 gt umnDefinition Width 10 gt lt my2 Grid Row 0 lt my2 Grid Row 0 lt my2 Grid Row 0 lt my2 Grid Row 0 lt my2 Grid Row 2 lt my2 Grid Row 2 lt my2 Grid Row 4 lt my2 Grid Row 4 lt 5 lt Grid ColumnDefinitions gt RTAutoBarIndicator Margin 10 1 Grid RowSpan 2 Grid Column 0 RTAutoBarIndicator Margin 10 1 Grid RowSpan 2 Grid ColumnSpa RTAutoBarIndicator Margin 10 1 Grid RowSpan 2 Grid Column 3 RTAutoBarIndicator Margin 10 1 Grid RowSpan 2 Grid Column 4 RTAutoBarIndicator Margin 10 1 Grid ColumnSpan 2
49. ByVal barorient As Integer _ Ct public BTBarIndicator PhysicalCoordinates transform RTProcessVar datasource double barwidth double barbase 132 Single Channel Bar Indicator ChartAttribute attrib int barjust int barorient Parameters transform The coordinate system for the new RTBarIndicator object datasource The process variable associated with the bar indicator barwidth The width of the bar in physical units barbase The base of the bar in physical units attrib The color attributes of the bar indicator barjust The justification of bars Use one of the bar justification constants JUSTIFY MIN JUSTIFY CENTER JUSTIFY MAX barorient The orientation of the bar indicator HORIZ DIR or VERT DIR Selected Public Instance Properties AlarmIndicatorColorMode inherited from RTSingleValueIndicator BarDatapointLabelPosition inherited from ChartPlot BarJust inherited from ChartPlot BarOffset BarOrient inherited from ChartPlot BarSpacing inherited from RTPlot BarWidth inherited from ChartPlot Get Set whether the color of the indicator objects changes on an alarm Use one of the constants RT INDICATOR COLOR NO ALARM CHANGE RT INDICATOR COLOR CHANGE ON ALARM Bar plots that support the display of data point values have the option of displaying the data point s numeric values above the bar below the bar or centered in the bar Use one of
50. Colors Yellow 3 1 As New SimpleScatterPlot pTransforml tFastClipMode ChartObj FASTCLIP X elLinePlotl As New RTSimpleSingleValuePlot pTransforml aturel hartObject solarPanelLinePlotl DashStyles Solid Nothing As New ChartAttribute Colors Green 3 2 As New SimpleScatterPlot pTransforml tFastClipMode ChartObj FASTCLIP X elLinePlot2 As New RTSimpleSingleValuePlot pTransforml ature2 DashStyles Solid Nothing hartObject solarPanelLinePlot2 Using QCRTGraph for WPF to Create Windows Applications 349 End If Dim titlefont As ChartFont font14 Dim charttitle As New ChartTitle pTransforml titlefont Scroll Application 1 ChartObj CHART HEADER ChartObj CENTER PLOT chartVu AddChartObject charttitle End Sub Public Sub InitializeGraph timerl IsEnabled False templowalarml New RTAlarm ChartObj RT ALARM LOWERTHAN 80 templowalarml AlarmMessage Low Alarm templowalarml AlarmSymbolColor Colors Blue templowalarml AlarmTextColor Colors Blue temphighalarml New RTAlarm ChartObj RT ALARM GREATERTHAN 120 temphighalarml AlarmMessage High Alarm temphighalarml AlarmSymbolColor Colors Red temphighalarml AlarmTextColor Colors Red currentTemperaturel New RTProcessVar Temp 1 New ChartAttribute Colors Green 1 0 DashStyles Solid Colors Green currentTemperaturel MinimumValue 20 currentTemperaturel MaximumValue 200 currentTemperatur
51. Dim endarcscale As Double 100 0 Dim arcdirection As Boolean False Dim arcradius As Double 0 6 Dim centerx As Double 0 0 Dim centery As Double 0 2 Dim meterFont As ChartFont font12 Dim meterframel As New RTMeterCoordinates startarcangle arcextent _ Startarcscale endarcscale arcdirection centerx centery arcradius Dim normrect As New Rectangle2D 0 67 0 05 0 32 0 53 Dim frame3d As New RT3DFrame meterframel normrect facePlateAttrib ChartObj NORM GRAPH POS chartVu AddChartObject frame3d meterframel SetGraphBorderDiagonal 0 67 0 05 0 99 0 58 Dim meterneedle As New RTMeterNeedleIndicator meterframel humidity meterneedle SetChartObjAttributes attribl meterneedle NeedleLength 0 6 Add panel meters chartVu AddChartObject meterneedle Dim meteraxisl As New RTMeterAxis meterframel meterneedle meteraxisl SetChartObjAttributes attribl meteraxisl SetAxisTickDir ChartObj AXIS MIN meteraxisl LineWidth 3 meteraxisl LineColor Colors Black meteraxisl SetAxisTickSpace 20 meteraxisl SetAxisMinorTicksPerMajor 1 meteraxisl ShowAlarms False meterneedle MeterAxis meteraxisl chartVu AddChartObject meteraxis1 Dim meteraxislabelsl1 As New RTMeterAxisLabels meteraxis1 meteraxislabelsl SetTextFont meterFont meteraxislabelsl SetAxisLabelsDir meteraxisl GetAxisTickDir meteraxislabelsl OverlapLabelMode ChartObj OVERLAP LABEL DRAW chartVu AddChartObject meteraxislabels1 String
52. Double _ updatedraw As Boolean CH public void UpdateIndicator double value bool updatedraw Parameters value Update the indicator channel with this value updatedraw True and the indicator is immediately updated Selected Public Instance Properties Name Description AlarmList Get the ArrayList holding all of the RTAlarm objects AlarmPanelMeter Get a reference to the RTAlarmPanelMeter object DefaultAlarmFont Get Set the font used for the subhead title DefaultAxisLabelsFont Get Set the default font used for the axes labels and axes titles Get Set the default font used for the numeric values labeling the indicator i Set Get the default font used in the chart This is a string DefaultFontString ni specifiying the name of the font DefaultMainTitleFont Get Set the font used for the main title DefaultTagFont Get Set the font used for the main title DefaultUnitsFont Get Set the font used for the chart footer DefaultDataValueFont FaceplateBackground GraphBackground GraphBorder GraphFormat Height HighAlarm LowAlarm MainTitle MaximumSize MaxIndicatorValue MinimumSize MinIndicatorValue NumericPanelMeter PlotAttrib PlotBackground PreferredSize ProcessVariable RenderingMode ResizeMode TagPanelMeter UnitsPanelMeter UnitsString Visible Width Auto Indicator Classes 297 Set to true to show 3D faceplate Get the graph background object Get the default graph border for the chart Get S
53. GetRandomDouble These two methods of setting the current value are equivalent If True Then This method uses the default time stamp which is the current time of day currentTemperaturel SetCurrentValue currentTemperatureValuel currentTemperature2 SetCurrentValue currentTemperatureValue2 Else This method you pass in whatever time stamp you want in this case it is the current time of day Dim tod As New ChartCalendar get current time currentTemperaturel SetCurrentValue tod currentTemperatureValuel currentTemperaturel SetCurrentValue tod currentTemperatureValue2 End If End Sub Update screen on 500 msec timer Private Sub timer2 Tick ByVal sender As Object ByVal e As System EventArgs chartVu UpdateDraw End Sub End Class e Reference and initialize the newly created ScrollGraph1 class in the Windowl xaml vb behind code file Imports com quinncurtis chart2dwpf Imports com quinncurtis rtgraphwpf Class Windowl Dim sg As ScrollGraphl Nothing Using QCRTGraph for WPF to Create Windows Applications 351 Public Sub New InitializeComponent sg New ScrollGraphl scrollAppl scrollAppl PreferredSize New Size 800 600 End Sub End Class The reference to PreferredSize tells the software that the font sizes specified in the graph are with respect to a chart window of size 900 600 If the chart is sized larger than this the fonts will be larger if it is sized smaller the fonts will be s
54. Grid Column RTAutoBarIndicator Margin 10 1 Grid ColumnSpan 2 Grid Column RTAutoBarIndicator Margin 10 1 Grid ColumnSpan 2 Grid Column RTAutoBarIndicator Margin 10 1 Grid ColumnSpan 2 Grid Column tackPanel Margin 20 10 10 10 Auto Indicator Classes 283 1 10 6 Name rtAutoBarIn gt 1 10 6 Name rtAutoBarIn wo Grid Column 1 gt 1 10 6 Name rtAutoBarIn gt UI 1 10 6 Name rtAutoBarIn W gt 1 10 6 Name rtAutoBarIn elt DM i gt 1 10 6 Name rtAutoBarIn gs oM ys 1 10 6 Name rtAutoBarIn scil DIN JS 1 10 6 Name rtAutoBarIn M S CheckBox Click ProcessCh dicato dicato dicato dicato dicato dicato dicato dicato ckBox EL pa pa pa Co ro EIU po Grid Row 2 Grid RowSpan 2 Grid Column 4 gt lt CheckBox Name checkBox1 Margin 10 gt Bar end bulb lt CheckBox gt lt CheckBox Name checkBox2 Margin 10 gt Interior axs lt CheckBox gt lt CheckBox Name checkBox3 Margin 10 gt Numeric readout lt CheckBox gt lt CheckBox Name checkBox4 Margin 10 gt Alarm readout lt CheckBox gt lt CheckBox Name checkBox5 Margin 10 gt Units string lt CheckBox gt lt CheckBox Name checkBox6 Margin 10 gt Tag string lt CheckBox gt lt CheckBox Name checkBox7 Margin 10 gt Segmented lt CheckBox gt lt StackPanel gt lt Grid gt lt UserControl gt Colo
55. Indicators Alarm Indicators Panel Meter Classes Real time data is stored in RTProcessVar classes The RTProcessVar class is designed to represent a single process variable complete with limit values an unlimited number of high and low alarms historical data storage and descriptive strings for use in displays A single value indicator is a real time display object that is attached to a single RTProcessVar object This includes single channel bar indicators which includes solid segmented custom and pointer bar indicators meter indicators which includes meter needles meter arcs and meter symbol indicators single channel annunciator indicators panel meter indicators and scrolling graph plots based on a QCChart2D SimplePlot chart object A multiple value indicator is a real time display object that is attached to a group of RTProcessVar objects This includes multiple channel bar indicators which includes solid segmented custom and pointer bar indicators multiple channel annunciator indicators panel meter indicators organized in a grid and scrolling graph plots based on a QCChart2D GroupPlot chart object Alarm indicators are used to display alarm lines symbols and fill areas for the RTProcessVar objects associated with the single value and multiple value indicator classes The RTPanelMeter derived classes are special cases of the single value indicator classes that are used throughout the software to display real ti
56. Inherited from RTAutoIndicator Set Get to true and an interior axis is drawn Get the most recent low RTAlarm object Inherited from RTAutoIndicator Get Set the tag string Inherited from RTAutoIndicator The maximum value for the indicator Inherited from RTAutoIndicator Gets or sets the size that is the lower limit that GetPreferredSize Size can specify Inherited from Control The minimum value for the indicator Inherited from RTAutoIndicator Get a reference to the RTNumericPanelMeter object Inherited from RTAutoIndicator Get an RTProcessVar object in the Inherited from RTAutoIndicator Get the plot background object Inherited from RTAutoIndicator Inherited from ChartView Get most recently created RTProcessVar Inherited from RTAutoIndicator Inherited from ChartView Inherited from ChartView SetpointAlarm TagPanelMeter TagString UnitsPanelMeter UnitsString Visible Width XAxis XAxis2 XAxisLab XAxisTitle XGrid YAxis YAxis2 YAxisLab YAxisTitle YGrid Auto Indicator Classes 277 Get the most recent setpoint RTAlarm object Inherited from RTAutoIndicator Get a reference to the tag panel meter object Inherited from RTAutoIndicator Get Set the tag string Inherited from RTAutoIndicator Get a reference to the units string panel meter object Inherited from RTAutoIndicator Get Set the units string Inherited from RTAutoIndicator
57. LOK 10 SIR LOR i00 00u da lom m TT Ts RITO 100m m ode m u 10 1007 TO Mi me TILO 100 5o LIT NL Ke E a PIOS Dim rowStrings As String Frequency Ohms Capacitance DC AC Volts DO Amps AC Amps Dim colStrings As String e M Www ww Dim rtbutton As RTControlButton Dim buttonfont As ChartFont font12Bold Dim pTransforml As New CartesianCoordinates 0 0 0 0 pTransforml SetGraphBorderDiagonal 0 25 0 68 0 95 Dim attribl As New ChartAttribute Colors White 3 Colors SandyBrown For i As Integer 0 To selectorStrings Length 1 rtbutton New RTControlButton ChartObj RT CONTROL RADIOBUTTON SUBTYPE rtbutton ButtonUncheckedText selectorStrings i If i currentRangeSelectorIndex Then rtbutton ButtonChecked True Else rtbutton ButtonChecked False End If AddHandler rtbutton Click New System Windows RoutedEventHandler AddressOf Me selector_button_Click rangeSelectorButtons rtbutton ButtonFont buttonfont rangeSelectorButtons Add rtbutton Next Dim numColumns As Integer 4 Dim numRows As Integer 7 Dim controlgrid As New RTFormControlGrid pTransforml numColumns numRows colStrings rowStrings attribl controlgrid CellRowMargin 0 05 controlgrid CellColumnMargin 0 1 controlgrid FormControlTemplate Frame3DEnable True controlgrid HeadersTemplate LineColor Colors Black controlgrid HeadersTemplate TextFont fontl4Bol
58. Microsoft Net installation but it is included with our software It is a public domain font that has the family name Digital SF with a space between Digital and SF It resides in the Digital TTF file found in the Quinn Curtis lib subdirectory In order to use the font in Visual Studio Net programs you should copy this file to the Windows Fonts subdirectory AND reboot your computer The reboot forces Windows to re enumerate the fonts Once that is done it can be used like any other TrueType font All of our example programs assume that the font has been copied to the Windows Fonts subdirectory and the computer rebooted The example below creates an instance of the Digial SF font ChartFont fontl2Numeric new ChartFont Digital SF 12 FontStyles Normal The font can be downloaded from the link http www webfontlist com pages station asp ID 10643 amp x Fonts if you want to download your own copy Panel Meter Classes 109 If you create an application that uses this font you have to plan on how to install it on the target computer You can install a copy of the Digital TTF file in the target computers Windows Fonts subdirectory While it may be possible to register a font some other way we aren t aware of a WPF equivalent to the Net PrivateFontCollection class Panel Meters Class RTPanelMeter com quinncurtis chart2dwpf ChartPlot RTPlot RTSingleValueIndicator RTPanelMeter The RTPanelMeter is an abstract class
59. OverlapLabelMode inherited from AxisLabels TextBgColor inherited from ChartText TextBgMode inherited from ChartText TextBoxColor inherited from ChartText TextBoxMode inherited from ChartText TextFont inherited from ChartText TextNudge inherited from ChartText TextRotation inherited from ChartText ZOrder inherited from GraphObj coordinates of the label offset from the endpoint of the associated tick mark Set Get the y offset in window device coordinates of the label offset from the endpoint of the associated tick mark Sets the attributes for a chart object using a ChartAttribute object Get Set the RTMeterAxis associated with this object It is possible that axis labels overlap if the window that the axes are placed in is to small the major tick marks are to close together or in the case of time axis labels to large for the current tick mark spacing A test can be performed in the software to not display labels to overlap Set Get the color of the background rectangle under the text if the textBgMode is true Set Get the text background color mode Set Get if the text bounding box is drawn in the text box color Set Get the text bounding box color Set Get the font of the text Set Get the xy values of the textNudge property It moves the relative position using window device coordinates of the text relative to the specified location of the text Set Get the rotation of the text in the no
60. PLOT BACKGROUND Colors Black chartVu AddChartObject plotbackground Dim xaxis As New TimeAxis pTransforml ChartObj X AXIS xaxis LineColor Colors Black chartVu AddChartObject xaxis Dim yaxis As New LinearAxis pTransforml ChartObj Y AXIS yaxis LineColor Colors Black chartVu AddChartObject yaxis 348 Using Real Time Graphics Tools for WPF to Create Windows Applications Dim yAxisGrid As ChartObj GRID_ MAJOR ChartObj GRID_MAJOR yAxisGrid SetCol New ChartGrid xaxis yaxis ChartObj Y AXIS or Colors White yAxisGrid SetLineWidth 1 yAxisGrid SetLineStyle DashStyles Dot chartVu AddChartObject yAxisGrid Dim xAxisGrid As xAxisGrid SetCol New ChartGrid xaxis yaxis ChartObj X AXIS or Colors White xAxisGrid SetLineWidth 1 xAxisGrid SetLineStyle DashStyles Dot chartVu AddChartObject xAxisGrid Dim yaxis2 As New LinearAxis pTransforml ChartObj Y AXIS yaxis2 LineColor yaxis2 AxisTickDir yaxis2 AxisIntercept Colors Black ChartObj AXIS MAX xaxis AxisMax chartVu AddChartObject yaxis2 Dim xAxisLab As xAxisLab TextFont axisFont chartVu AddChartObject Dim yAxisLab As yAxisLab TextFont New TimeAxisLabels xaxis xAxisLab New NumericAxisLabels yaxis axisFont chartVu AddChartObject yAxisLab scrollFrame New RTScrollFrame chartVu currentTemperaturel pTransforml ChartObj RT FIXEDEX
61. RIProcessVar processvar PhysicalCoordinates initialscale int scrollymode int autoscalexmode public RTVerticalScrollFrame ChartView component RTProcessVar processvar PhysicalCoordinates initialscale int scrollmode public RTVerticalScrollFrame ChartView component PhysicalCoordinates initialscale int scrollymode int autoscalexmode 206 Single and Multiple Channel Annunciators Parameters component This ChartView component the scroll frame is placed in processvar The source process variable initialscale A coordinate system that serves as the initial scale for the scroll frame scrollymode Specifies y axis auto scale mode of the scroll frame Use one of the x axis scroll frame constants RT NO AUTOSCALE X no auto scale for the x axis use in non scrolling graphs RT AUTOSCALE Y CURRENT SCALE auto scale based on current scale use in non scrolling graphs RT AUTOSCALE Y MIN autoscale x axis minimum only use in non scrolling graphs RT AUTOSCALE Y MAX autoscale x axis maximum only use in non scrolling graphs RT AUTOSCALE Y MINMAX autoscale x axis minimum and maximum use in non scrolling graphs RT FIXEDEXTENT MOVINGSTART AUTOSCROLL autoscale the x axis for a fixed range with moving maximum and minimum values use in scrolling graphs RT MAXEXTENT FIXEDSTART AUTOSCROLL autoscale the x axis with the start of the x axis fixed and the end of the x axis moving use in scrolling gra
62. RTPlot RTSingleValueIndicator RTAnnunciator RTBarIndicator RTMeterIndicator RTMeterArcIndicator RTMeterNeedleIndicator RTMeterSymbolIndicator RTPanelMeter RTSimpleSingleValuePlot Display objects derived from the RTSingleValueIndicator class are attached to a single RTProcessVar object This includes single channel bar indicators which includes solid segmented custom and pointer bar indicators meter indicators which includes meter needles meter arcs and meter symbol indicators single channel annunciator indicators panel meter indicators and scrolling graph plots based on a QCChart2D SimplePlot chart object These objects can be positioned in a chart using one of the many chart coordinate systems available for positioning including physical coordinates PHYS_POS device coordinates DEV POS plot normalized coordinates NORM PLOT POS and graph normalized coordinates NORM GRAPH POS Class Architecture 23 An annunciator can contain any combination string numeric and alarm panel meters The background color of the annunciator can change in response to an alarm event RTAnnunciator An RTAnnunciator is used to display the current values and alarm states of a single channel real time data It consists of a rectangular cell that can contain the tag name units current value and alarm status message Any of these items may be excluded If a channel is in alarm the background of the corresponding cell changes its color giv
63. RTProcessVar RTProcessVar RTProcessVar RTProcessVar for int i 0 Cie le ebe PEE a PEE Vra p EE EP EE EE E E EUG IEEE E EE EU E 15 56 45 15 57 00 15 57 15 15 57 30 PIDControlLoops new RTPIDControl 16 ProportionalControl new RTProcessVar 16 IntegralControl new RTProcessVar 16 DerivativeControl new RTProcessVar 16 ControlSetpoints new RTProcessVar 16 ControlTrackBarOutputs new RTProcessVar 16 ControlOutputs new RTProcessVar 16 i 16 i44 Note derivative value is saled down by 100x PIDControlLoops i new RTPIDControl ControlSetpoints i CurrentValue pidSteadyState ProportionalControl i CurrentValue IntegralControl i CurrentValue DerivativeControl i CurrentValue 100 0 sampleper 60 0 filterConstant void CalculatePIDValues double rMeas 0 0 double rSetpoint 0 0 double rOutput 0 0 for int i 0 i l6 i r simulate measurement rOutput ControlOutputs i CurrentValue rMeas ProcessModel i rOutput PIDProcessItems i SetCurrentValue rMeas if autoModeEnable i rSetpoint ControlSetpoints i CurrentValue rOutput PIDControlLoops i RTCalcPID rMeas rSetpoint ControlOutputs i SetCurrentValue rOutput outputControlTrackBar RTValue ControlOutputs currentTuningChannel CurrentValue VB Private PIDProcessItems 15 As RTProcessVar Private ProportionalControl 15 As RTProcessVar Private Integr
64. Scroll Week 7 29 02 8 05 02 8 12 02 8 19 02 Press and hold left mouse button over a stock value to get details for that date This class is a concrete implementation of the GroupPlot class and displays stock market data in an open high low close format common in financial technical analysis Every item of the plot is a vertical line representing High and Low values with two small horizontal flags one left and one right extending from the vertical High Low line and representing the Open and Close values QCChart2D Class Summary 77 Cumulative Plot of Noise vs Time from 7 Sources 10 15 20 Time The Stacked Line Plot will plot the cumulative sum of multiple y vectors vs a single x vector StackedLinePlot This class is a concrete implementation of the GroupPlot class and displays data in a stacked line format In a stacked line plot each group is stacked on top of one another each group line a cumulative sum of the related group items before it Polar Plot Classes PolarPlot PolarLinePlot PolarScatterPlot Polar plots that use data organized as arrays of x and y values where an x value represents the magnitude of a point in polar coordinates and the y value represents the angle in radians of a point in polar coordinates Polar plot types include line plots and scatter plots PolarPlot This class is an abstract base class for the polar plot classes 78 QCChart2D Class Summary Polar Line and Scatter Plots
65. ScrollGraphl System Windows Threading DispatcherTimer timerl new System Windows Threading DispatcherTimer System Windows Threading DispatcherTimer timer2 new System Windows Threading DispatcherTimer double currentTemperatureValuel 110 0 RTProcessVar currentTemperaturel double currentTemperatureValue2 100 0 RTProcessVar currentTemperature2 RTScrollFrame scrollFrame new RTScrollFrame RTAlarm templowalarml RTAlarm temphighalarml RTAlarm templowalarm2 RTAlarm temphighalarm2 ChartFont font12 new ChartFont Microsoft Sans Serif 12 FontStyles Normal ChartFont font14 new ChartFont Microsoft Sans Serif 14 FontStyles Normal ChartFont fontl4Numeric new ChartFont Digital SF 14 FontStyles Normal ChartView chartVu int scrollMode 0 public ScrollGraphl ChartView chartvu Using QCRTGraph for WPF to Create Windows Applications 337 chartVu chartvu InitializeGraph private void InitializeScrollGraph double x1 0 1 double yl 0 1 double x2 0 90 double y2 0 9 ChartFont axisFont font12 ChartCalendar startTime new ChartCalendar ChartCalendar endTime new ChartCalendar endTime Add ChartCalendar SECOND 20 TimeCoordinates pTransforml new TimeCoordinates startTime currentTemperaturel DefaultMinimumDisplayValue Colors White Colors Black ChartObj GRID MAJOR endTime currentTemperaturel DefaultMax
66. Since ChartView is derived from UserControl you can place as many auto indicator classes on a form as you want You can instantiate the auto indicator classes in your program or you can add them to the Visual Studio component tool box where they will be accessible to drop onto a Windows Form object Add the auto indicator classes to the toolbox by displaying a form in design mode right clicking in the Toolbox window and selecting Choose Items from the drop down menu Select Browse the browse to the Quinn Curtis DotNet lib folder and select the QCRTGraphNet DLL file Once the DLL is selected you should see all of the auto indicator components listed in the Toolbox Single Channel Bar Indicator Class RTAutoBarIndicator System Windows Controls UserControl ChartView RTAutoIndicator RTAutoBarIndicator 274 Auto Indicator Classes The RTAutoBarIndicator combines a RTBarIndicator object with other objects needed to create a self contained bargraph display These other objects include a RTProcessVar variable axes axis labels title string units string alarm indicators and panel meters used in the display of the bar graphs numeric value tag name and alarm status Since it contains a single RTProcessVar object it displays a single channel of data RTAutoBarIndicator constructors Since the RTAutoBarIndicator is designed to be dropped on a form only a default constructor is used The indicator is customized using public properties Vis
67. Templates Web RI DocProject amp DocProject A DocSite Web Application Reporting Ed Search Online Templates WCF Workflow JI Vial C Windows Presentation Foundation dient application NET Framework 3 5 v Name WpfApplication 1 Location E Quinn Curtis WPF Development DotNet QCRTGraph Visual CSharplexamples wpf Solution Create new Solution vj A create directory for solution Solution Name WpfApplication1 The window does not yet have any content First define a default size for the window and add references to the QCChart2D and QCRTGraph namespaces In this case the namespaces are com quinncurtis chart2dwpf and com quinncurtis rtgraphwpf and are located in the assemblies DLL with the names QCChart2DWPF3 and QCRTGraphWPF3 So replace the Title line the following lines under the other xmlns namespace tags Title Windowl Height 631 Width 878 n xmlns my clr namespace com quinncurtis chart2dwpf assembly QCChart2DWPF3 xmlns my2 clr namespace com quinncurtis rtgraphwpf assembly QCRTGraphWPF3 gt These lines need to be resolved by adding a references to the QCChart2DWPF3 and QCRTGraphWPF3 libraries to the project Right click on Reference in the Solution Explorer window and select Add Reference Browse to the Quinn Curtis DotNet lib subdirectory and select QCChart2DWPF3 DLL and QCRTGraphWPF3 DLL files If you also want printing in the program you need to add a reference to the Ne
68. The following classes have been added to the software in support of event based charting ChartEvent A ChartEvent object stores the position value the time stamp y values and custom strings associated with the event EventArray A utility array class used to store ChartEvent objects EventAutoScale An auto scale class used by the EventCoordinates class 2 Introduction e EventAxis Displays an axis based on an EventCoordinates scale EventAxisLabels Displays the string labels labeling the tick marks of an EventAxis EventCoordinates Event coordinates define a coordinate system based on the the attached Event datasets EventGroupDataset A group dataset which uses ChartEvent objects as the source of the data It is used to feed data into the group plotting routines EventScale An event scale class used to convert between event coordinates and device coordinates EventSimpleDataset A simple dataset which uses ChartEvent objects as the source of the data It is used to feed data into the simple plotting routines Tutorials Tutorials that describe how to get started with the Real Time Graphics Tools for WPF charting software are found in Chapter 18 Using Real Time Graphics Tools for WPF to Create Windows Applications and Chapter 19 Using Real Time Graphics Tools for WPF to Create Web Applications Customer Support Use our forums at http www quinn curtis com ForumFrame htm for customer supp
69. UnitsPanelMeter UnitsString Visible Width Auto Indicator Classes 305 Set to true to show 3D faceplate Get the graph background object Get the default graph border for the chart Get Set any an indicator format is supported Gets or sets the height of the control Inherited from Control Get the most recent high RTAlarm object Get the most recent low RTAlarm object Get Set the tag string Gets or sets the size that is the upper limit that GetPreferredSize Size can specify Inherited from Control The maximum value for the indicator Gets or sets the size that is the lower limit that GetPreferredSize Size can specify Inherited from Control The minimum value for the indicator Get a reference to the RTNumericPanelMeter object Get an RTProcessVar object in the Get the plot background object Inherited from ChartView Get most recently created RTProcessVar Inherited from ChartView Inherited from ChartView Get a reference to the tag panel meter object Get a reference to the units string panel meter object Get Set the units string Gets or sets a value indicating whether the control is displayed Inherited from Control Gets or sets the width of the control Inherited from Control A complete listing of RTAutoDialIndicator properties is found in the QCRTGraphWPFCompiledHelpFile chm documentation file located in the doc subdirectory There are three different dial formats Use
70. Use one of the coordinate system constants DEV POS PHYS POS NORM GRAPH POS NORM PLOT POS Selected Public Instance Properties CornerRadius Get Set the corner radius of the rounded rectangle FillColor inherited from GraphObj LineColor inherited from GraphObj LineStyle inherited from GraphObj LineWidth inherited from GraphObj LW ZOrder inherited from GraphObj Sets the z order of the object in the chart Every object has a z order value Each z order value does NOT have to be unique If z order sorting is turned on in the ChartView object objects are sorted by z order before they are drawn 260 Miscellaneous Shape Drawing A complete listing of RTRoundedRectangle2D properties is found in the QCRTGraphWPFCompiledHelpFile chm documentation file located in the doc subdirectory Example for drawing RTRoundedRectangle2D objects The example below extracted from the RTGraphNetDemo example file NeedleMeterUserControll method InitializeMeter2 draws a large rectangle with rounded corners as the frame of the meter and a smaller filled rectangle at the bottom C RTRoundedRectangle2D rr new RTRoundedRectangle2D meterframel 0 25 0 01 0 45 0 43 0 01 ChartObj NORM GRAPH POS ChartAttribute backattrib new ChartAttribute Colors Black 2 DashStyles Solid Colors White rr SetChartObjAttributes backattrib rr SetChartObjClipping ChartObj NO CLIPPING chartVu Ad
71. _ value As Double _ updatedraw As Boolean _ CH public void UpdateIndicator double values bool updatedraw public void UpdateIndicator double value bool updatedraw Parameters values Auto Indicator Classes 317 An array of new values one for each channel of the indicator value A single value if the scroll graphs only has one channel updatedraw True and the indicator is immediately updated Selected Public Instance Properties Name AlarmList AlarmPanelMeter BarDataValue BarFillColor BarLineColor BarLineWidth BarWidth ChartLegend ChartObjType ChartSimpleDataset CoordinateSystem Description Get the ArrayList holding all of the RTAlarm objects Inherited from RTAutoIndicator Get a reference to the RTAlarmPanelMeter object Inherited from RTAutoIndicator Get the numeric label template object used to place numeric values on the bars Sets the fill color for the chart object Sets the line color for the chart object Sets the line width for the chart object Set Get the bar width Get Set the charts Legend object Get Set the chart object type Inherited from RTAutoIndicator Get the SimpleDataset object that holds the data used to plot the scroll graph Get the coordinate system object for the indicator 318 Auto Indicator Classes DatasetList Datatoolti DefaultChartFontString DefaultLegendFont DefaultSubHeadFont DefaultToolTipFont DrawEnable Face
72. and TimeAxis classes PolarGrid This class defines the grid lines associated with a polar axis A polar chart grid consists of two sets of lines The first set is a group of concentric circles centered on the origin and passing through the major and or minor tick marks of the polar magnitude horizontal and vertical axes The second set is a group of radial lines starting at the origin and extending to the outermost edge of the polar plot circle passing through the major and minor tick marks of the polar angle circular axis This class works in conjunction with the PolarAxes class AntennaGrid Analogous to the PolarGrid this class draws radial and circular grid lines for an Antenna chart Chart Text Classes ChartText ChartTitle AxisTitle ChartLabel NumericLabel TimeLabel StringLabel ElapsedTimeLabel The chart text classes draw one or more strings in the chart window Different classes support different numeric formats including floating point numbers date time values and multi line text strings International formats for floating point numbers and date time values are also supported ChartText This class draws a string in the current chart window It is the base class for the ChartTitle AxisTitle and ChartLabel classes The ChartText class also creates independent text objects Other classes that display text also use it internally 86 QCChart2D Class Summary ChartTitle AxisTitle ChartLabel NumericLabel T
73. and the RTSimpleSingleValuePlot objects are added to the ChartView When the ChartView UpdateDraw method is called the RTScrollFrame object in the ChartView object list causes the scroll graph coordinate system to be re scaled to reflect the current data values The RTSimpleSingleValue object in the ChartView list redraws the line plot in the new re scaled coordinate system 210 Single and Multiple Channel Annunciators Solar Panel Ges see ie SES 120 100 80 i B 18 45 00 18 46 00 C scrollFrame new RTScrollFrame this currentTemperaturel pTransforml ChartObj RT FIXEDEXTENT MOVINGSTART AUTOSCROLL scrollFrame ScrollScaleModeY ChartObj RT NO AUTOSCALE Y scrollFrame ScrollRescaleMargin 0 05 E i chartVu AddChartObject scrollFrame SimpleLinePlot lineplot new SimpleLinePlot pTransforml null attribl lineplot SetFastClipMode ChartObj FASTCLIP X RTSimpleSingleValuePlot solarPanelLinePlot new RTSimpleSingleValuePlot pTransforml lineplot currentTemperaturel chartVu AddChartObject solarPanelLinePlot VB scrollFrame New RTScrollFrame Me currentTemperaturel pTransforml _ ChartObj RT FIXEDEXTENT MOVINGSTART AUTOSCROLL scrollFrame ScrollScaleModeY ChartObj RT NO AUTOSCALE Y scrollFrame ScrollRescaleMargin 0 05 e chartVu AddChartObject scrollFrame Dim lineplot As New SimpleLinePlot pTransforml Nothing attribl lineplot SetFastClipMode ChartObj
74. barwidth barbase attribl barjust barorient barplot IndicatorBackground new ChartAttribute Colors Black 1 DashStyles Solid Colors Black barplot SegmentSpacing 1 barplot SegmentWidth 1 barplot IndicatorSubType ChartObj RT BAR SEGMENTED SUBTYPE chartVu AddChartObject barplot VB Public Class CustomBRTBarIndicator Inherits RTBarIndicator Private temperatureSetpointD As Double 70 Public Sub New ByVal transform As PhysicalCoordinates ByVal datasource As RTProcessVar _ ByVal barwidth As Double ByVal barbase As Double _ ByVal attrib As CHARTATTRIBUTE ByVal barjust As Integer ByVal barorient As Integer Single Channel Bar Indicator 139 MyBase New transform datasource barwidth _ barbase attrib barjust barorient End Sub New Public Overrides Function GetCustomBarOffset ByVal v As Double As Double Dim offset As Double 0 0 Return offset End Function GetCustomBarOffset Public Overrides Function GetCustomBarWidth ByVal v As Double As Double Calculate width as fraction of initial bar width Dim width As Double 1 0 Bar widest at setpoint narrowest at endpoints Clamp width to 0 05 to 1 0 range width Math Max 0 05 _ Me BarWidth Math Abs 0 04 width Math Min 1 0 width Return width End Function GetCustomBarWidth v TemperatureSetpoint lt summary gt Set Get local setpoint lt summary gt Public Property TemperatureSetpoint As Double Get Retu
75. before they are drawn A complete listing of RTMeterAxis properties is found in the QCRTGraphWPFCompiledHelpFile chm documentation file located in the doc subdirectory Example for meter axis The example below extracted from the AutoInstrumentPanel example method InitializeTach creates a meter coordinate system that starts at the arc angle of 135 degrees and has an arc extent of 230 degrees The meter scale extends from 0 0 to 8 0 in the counterclockwise direction Two axes are created The first is created so that it draws 160 Meters Coordinates Meter Axes and Meter Axis Labels just the major tick marks using a thicker line width The second uses thin tick marks for the minor tick marks of the meter axis C ChartAttribute attribl new ChartAttribute Colors Black 1 DashStyles Solid Colors Blue double startarcangle 135 double arcextent 230 double startarcscale 0 0 double endarcscale 8 0 bool arcdirection false double arcradius 0 75 double centerx 0 0 centery 0 0 RTMeterCoordinates meterframe new RTMeterCoordinates startarcangle arcextent startarcscale endarcscale arcdirection centerx centery arcradius meterframe SetGraphBorderDiagonal 0 45 0 2 0 75 0 9 RTMeterNeedleIndicator meterneedle new RTMeterNeedleIndicator meterframe tach Add panel meters chartVu AddChartObject meterneedle RTMeterAxis meteraxis new RTMeterAxis meterframe meterneedle
76. define the attributes of the multi channel plot It is not the only technique since the previous chapter had an example that plotted multiple line plots using the RTSimpleSingleValue plot class If you need to plot multiple channel data and each channel is a different plot type i e one channel is a line plot the next channel is a bar plot and the third channel is a scatter plot you must use the technique that uses RTSimpleSingleValue objects There are two basic types of QCChart2D GroupPlot objects The first type is a multi channel plot Plot objects of this type include QCChart2D MultiLinePlot QCChart2D StackedLinePlot QCChart2D GroupBarPlot QCChart2D StackedBarPlot These objects are characterized as having unique ChartAttribute objects defining the colors and fill characteristic of each channel The second type is the multi variable plot These are objects that require two or more y values to characterize the plot at a given instance in time These include the QCChart2D HistogramPlot QCChart2D BubblePlot QCChart2D FloatingBarPlot QCChart2D CellPlot and QCChart2D OHLCPlot classes Usually one instance of one of these multi variable objects is characterized by a single ChartAttribute similar to the QChart2D SimplePlot objects Both types of QCChart2D GroupPlot objects can be used in scrolling graphs Multi Channel Scrolling Graphs Class RTGroupMultiValuePlot com quinncurtis chart2dwpf ChartPlot RTPlot RTMultiValueIndicator RTGro
77. error at previous sampling interval m i controller output deviation K proportional gain K integral action time Ka derivative action time The proportional term is the same between the Eqn 1 and Eqn 2 The integral term of the first equation is replaced by a summation term and the derivative term is replaced by the a first order difference approximation In actual practice the first order difference term e eii is very susceptible to noise problems In most practical systems this term is replaced by the more stable higher order equation Ae eli 3 e i 1 3 e i 2 e i 3 6 A common problem in discrete control systems arises from the summation of the error term for the integral action of the control equation If a process maintains an error for a long period of time it is possible that this summation can build to a very large numerical value Even though the error term returns to zero or moves in the opposite direction it will take a very long time to reduce the sum below the D A saturation levels Practical systems stop the summation of error terms if the current PID output level is outside a user specified range of high and low output values This limiting of the summation term is commonly referred to as anti reset windup Implementation Real Time Graphics Tools for Windows can maintain an unlimited number of control loops simultaneously the only limit being memory and CPU power A PID control object the
78. for WPF to Create Windows Applications if true else Random data currentTemperatureValuel 5 0 5 ChartSupport GetRandomDouble currentTemperatureValue2 8 0 5 ChartSupport GetRandomDouble fF 2 ff T hese two methods of setting the current value are equivalent his method uses the default time stamp which is the current time of day currentTemperaturel SetCurrentValue currentTemperatureValuel currentTemperature2 SetCurrentValue currentTemperatureValue2 JC current time of day fendif Char his method you pass in whatever time stamp you want in this case it is the tCalendar tod new ChartCalendar get current time currentTemperaturel SetCurrentValue tod currentTemperatureValuel currentTemperaturel SetCurrentValue tod currentTemperatureValue2 Update screen on 500 msec timer private void timer2 Tick object sender System EventArgs e chartVu UpdateDraw e Reference and initialize the newly created ScrollGraph1 class in the Window1 xaml cs behind code file using Sys using Sys using Sys using Sys using Sys using Sys using Sys using Sys using Sys using Sys using Sys using Sys using Sys cem tem Collections Generic tem Ling tem Text tem Windows tem Windows Controls tem Windows Data tem Windows Documents tem Windows Input tem Windows Media tem Windows Media Imaging tem Windows Navigation tem Windows Shapes
79. for game programmers DirectX which programmers found a better fit for the complex graphics required in game programming One of the strong selling points of DirectX is that the Windows operating system can offload time intensive graphics calculations to specialized GPU Graphics Processing Unit chips found in high and medium end computers Starting early in the last decade Microsoft wrote an alternative graphics rendering and user interface framework around DirectX This framework is known as the Windows Presentation Foundation framework or WPF for short DirectX features used in the QCRTGraph for WPF library include the following Resolution independence DirectX s emphasis on vector graphics means that programs can be more easily designed to be independent of the resolution of the output device Arbitrary line thickness and line styles for all lines Gradients fill patterns and color transparency for solid objects Generalized geometry support used to create arbitrary shapes Printer and image output support Improved font support for a large number of fonts using a variety of font styles size and rotation attributes Imaging support for a large number of image formats Advanced matrix support for handling 2D transformations 00000 00 In addition to the DirectX rendering for the display WPF utilizes a new declarative user interface definition framework known as XAML for Extensible Application Markup Language This f
80. labels the major tick marks of the RTMeterAxis class The class supports many predefined and user definable formats including numeric exponent percentage business and currency formats RTMeterAxisLabels constructor Visual Basic Overloads Public Sub New _ ByVal baseaxis As RTMeterAxis _ C public RTMeterAxisLabels RTMeterAxis baseaxis Parameters baseaxis The RTMeterAxis object associated with the labels Selected Public Instance Properties AxisLabelsDecimalPos inherited from Set Get the number of digits to the right of NumericA xisLabels the decimal point for numeric axis labels AxisLabelsDir inherited from Set Get the justification of the axis labels AxisLabels with respect to the axis tick marks Use one of the tick direction constants AXIS MIN AXIS MAX AxisLabelsEnds inherited from Set Get whether there should be labels for the AxisLabels axis minimum LABEL MIN maximum LABEL MAX or tick mark starting point LABEL ORIGIN The value of these constants can be OR d together The value of LABEL MIN LABEL MAX LABEL ORIGIN is LABEL ALL AxisLabelsFormat inherited from Set Get the numeric format for the axis AxisLabels labels AxisLabelsTickOffsetX inherited from Set Get the x offset in window device Meters Coordinates Meter Axes and Meter Axis Labels 163 AxisLabels AxisLabelsTickOffsetY inherited from AxisLabels ChartObjAttributes inherited from GraphObj MeterAxis
81. new CartesianCoordinates RT3DFrame frame3d new RT3DFrame pTransforml normrect facePlateAttrib ChartObj NORM GRAPH POS chartVu AddChartObject frame3d VB Private Dim Dim Dim Dim Sub InitializeBackgroundPanel theFont As ChartFont font10Bold normrect As New Rectangle2D 0 0 0 0 1 0 1 0 pTransforml As New CartesianCoordinates frame3d As New RT3DFrame pTransforml normrect facePlateAttrib _ ChartObj NORM GRAPH POS chartVu AddChartObject frame3d End Sub InitializeBackgroundPanel The example below extracted from the PIDControlTuner example file PIDControlTunerUserControll1 method InitializeTopBargraphs draws an RT3DFrame object as a backdrop for each of the barographs 258 Miscellaneous Shape Drawing C for int i 0 i lt PIDProcessItems Length i row aya col i 8 xl xoffset col faceplatewidthspacing yl yoffset row faceplateheightspacing x2 xl faceplatewidth y2 yl faceplateheight double mindisplayvalue PIDProcessItems i DefaultMinimumDisplayValue double maxdisplayvalue PIDProcessItems i DefaultMaximumDisplayValue pTransforml new CartesianCoordinates 0 0 mindisplayvalue 1 0 maxdisplayvalue Rectangle2D normrect new Rectangle2D x1 yl faceplatewidth faceplateheight RT3DFrame frame3d new RT3DFrame pTransforml normrect rectattrib ChartObj NORM GRAPH POS chartVu AddChartObject frame3d VB Dim i As
82. object Get a reference to the RTAlarmPanelMeter object AlarmPanelMeter Inherited from RTAutoIndicator BarAttributes Sets the line color for the chart object lei Get the numeric label template object used to place numeric values on the bars BarEndBulb Set Get to true for a bar end bulb BarFillColor Sets the fill color for the chart object BarLineWidth Sets the line width for the chart object 276 Auto Indicator Classes BarOrientation BarPlot BarWidth BarWidthPixels CoordinateSystem FaceplateBackground GraphBackground GraphBorder GraphFormat Height HighAlarm InteriorAxis LowAlarm MainTitle MaxIndicatorValue MinimumSize MinIndicatorValue NumericPanelMeter PlotAttrib PlotBackground PreferredSize Process Variable RenderingMode ResizeMode Get Set the orientation of the chart Get a reference to the RTBarIndicator object Set Get the bar width Set Get to the pixel width of the bar in the bar plot Get the coordinate system object for the indicator Inherited from RTAutoIndicator Set to true to show 3D faceplate Inherited from RTAutoIndicator Get the graph background object Inherited from RTAutoIndicator Get the default graph border for the chart Inherited from RTAutoIndicator Get Set any an indicator format is supported Inherited from RTAutoIndicator Gets or sets the height of the control Inherited from Control Get the most recent high RTAlarm object
83. objects public void InitRTAutoScrollGraph double minx ChartCalendar miny double maxx ChartCalendar maxy Initialize the x scale to a linear scale and the y scale to a Date Time scale using DateTime objects public void InitRTAutoScrollGraph double minx DateTime miny double maxx DateTime maxy Initialize the x scale to a linear scale and the y scale to a linear scale public void InitRTAutoScrollGraph double minx double miny 326 Auto Indicator Classes double maxx double maxy Initialize the x scale to a linear scale and the y scale to an elapsed time using TimeSpan objects public void InitRTAutoScrollGraph double minx TimeSpan miny double maxx TimeSpan maxy Initialize x scale to a linear scale and the y scale to the scale type specified by the parameter Use millisecond values for miny and maxy public void InitRTAutoScrollGraph double minx double miny double maxx double maxy int scaletype Parameters minx The starting x value miny The starting y value as a DateTime ChartCalendar double or TimeSpan value depending on which of the overloads is used maxx The ending x value maxy The ending y value as a DateTime ChartCalendar double or TimeSpan value depending on which of the overloads is used The InitStrings method initialized the title and units strings Method InitStrings VB public void InltStrings string title string units C public void Iniisi
84. own ChartView derived window along with all other objects typically associated the indicator axes labels process variables alarms titles etc Since ChartView is derived from UserControl you can place as many auto indicator classes on a form as you want RTAutoIndicator Abstract base class for the other auto indicator classes RTAutoBarIndicator Bar indicator class displaying a single bar RTAutoMultiBarIndicator Multi bar indicator class displaying a multiple bars RTAutoMeterIndicator Meter indicator class displaying a single needle RTAutoClockIndicator Clock indicator displaying hours minute seconds RTAutoDialIndicator Dial indicator displaying up to three needles as part of the dial RTAutoScrollGraph Scrolling graph can display an unlimited number of scroll graph traces RTAutoPanelMeterIndicator A simple panel meter indicator Process Variable and Alarms Classes RTProcessVar RTAlarm RTAlarmEventArgs Real time data is stored in RTProcessVar classes The RTProcessVar class is designed to represent a single process variable complete with limit values an unlimited number of high and low alarms historical data storage and descriptive strings for use in displays RTProcessVar Real time data is stored in RTProcessVar classes The RTProcessVar class is designed to represent a single Class Architecture 19 process variable complete with limit values an unlimited number of high and low alarms historical data storag
85. panelmeter PanelMeterPosition ChartObj CENTERED BAR panelmeter NumericTemplate TextFont FontArchive fontl4Numeric panelmeter NumericTemplate PostfixString char 176 E annunciator AddPanelMeter panelmeter RTAlarmPanelMeter panelmeter2 new RTAlarmPanelMeter pTransforml processVarl panelmeterattrib panelmeter2 PanelMeterPosition ChartObj BELOW REFERENCED TEXT panelmeter2 AlarmTemplate TextFont FontArchive font10 panelmeter2 SetPositionReference panelmeter annunciator AddPanelMeter panelmeter2 ChartAttribute panelmetertagattrib new a I o lors Bisque 5 DashStyles Solid Colors Bisque a o lors Bisque 5 DashStyles Solid Colors Bisque a o lors Bisque 5 DashStyles Solid Colors Bisque Single and Multiple Channel Annunciators 199 ChartAttribute Colors SteelBlue 3 DashStyles Solid Colors White RTStringPanelMeter panelmeter3 new RTStringPanelMeter pTransforml processVarl panelmetertagattrib ChartObj RT TAG STRING panelmeter3 SetPositionReference panelmeter panelmeter3 StringTemplate TextFont panelmeter3 PanelMeterPosition panelmeter3 TextColor Colors Black annunciator AddPanelMeter panelmeter3 chartVu AddChartObject annunciator VB Private Sub InitializeAnnunciator2 Dim processVarArray As RTProcessVar FontArchive font10 ChartObj ABOVE REFERENCED TEXT 1 0 1 9 0 475 PLOT BACKGRO
86. phObj RTPlot RTSingleValu oleValueIndicator for the indicator A complete listing of RTFormControlPanelMeter properties is found in the QCRTGraphWPFCompiledHelpFile chm documentation file located in the doc subdirectory Example for RTControlPanelMeter encapsulation an RTControlTrackBar The example below extracted from the Polygraph example creates an RTControlPanelMeter using an RTControlTrackBar C RTControlTrackBar timeAxisControlTrackbar public void InitializeTimeAxisTrackbar ChartAttribute attribl new ChartAttribute Colors White 3 DashStyles Solid Colors Coral CartesianCoordinates pTransform2 new CartesianCoordinates 0 0 0 0 1 0 1 0 pTransform2 SetGraphBorderDiagonal 0 7 0 93 0 98 0 99 ChartAttribute tbattrib new ChartAttribute Colors LightBlue 7 DashStyles Solid Colors LightBlue double starttime origStartTime GetCalendarMsecs double endtime origEndTime GetCalendarMsecs 232 Buttons Track Bars and Other Form Control Classes double range endtime starttime timeAxisControlTrackbar new RTControlTrackBar 0 100 10 1 10 timeAxisControlTrackbar Orientation Orientation Horizontal timeAxisControlTrackbar Click new System Windows RoutedEventHandler this timeAxisControlTrackbar Click timeAxisControlTrackbar RTValue 100 RTFormControlPanelMeter timeAxisControlPanelTrackBar RTFormControlPanelMeter pTransform2 timeAxisControlTrackbar tbatt
87. previous steps When it runs properly it the WpfBrowserApplicationl chart looks like WpfRTBrowserApplication1 xbap application x ms xbap Object Mozilla Firefox File Edit View History Bookmarks Tools Help e file E Quinn Curtis WPF Development DotNet QCRTGraph Visual CSharp examples a a Lei Most Visited Getting Started ES Latest Headlines _ WpfRTBrowserApplication1 xbap ap la m Scroll Application 1 372 Using OCRTGraph for WPF to Create Web Applications More complicated example using tabs is found in the WpfBrowserExample2 folder 22 Frequently Asked Questions FAQs First read the FAQ s section of the QCChart2D manual All of the FAQs for that software will apply to the QCRTGraph software 1 Is the Real Time Graphics Tools for WPF software backward compatible with the Charting Tools for Windows and the Graphics Class Libraries for MFC No the Real Time Graphics Tools for WPF software is not backward compatible with earlier Quinn Curtis products It was developed explicitly for the new Net programming object oriented programming framework You should have no problems recreating any charts that you created using our older Windows software in most cases it will take far fewer lines of code One of the few chart types that are not supported is the sweep graph INDEX AntennaAnpotatton 80 81 95 AntennaAxes 63 68 70 95 AntennaAxesLabels
88. public RTAlarm RIProcessVar processvar int alarmtype double alarmlimitvalue string normalmessage string alarmmessage public RTAlarm RTProcessVar processvar int alarmtype double alarmlimitvalue String normalmessage string alarmmessage double hysteresisvalue Parameters processvar ByVal alarmlimitvalue As Double _ ByVal processvar As RTProcessVar _ ByVal alarmlimitvalue As Double _ ByVal hysteresisvalue As Double Process Variable and Alarm Classes 101 Specifies the process variable that the alarm is for When you add an RTAlarm object to an RTProcessVar object this field will be overwritten with a reference to the RTProcessVar object that was added to alarmtype Specifies the alarm type RT ALARM NONE RT ALARM LOWERTHAN or RT ALARM GREATERTHAN alarmlimitvalue Specifies the alarm limit value normalmessage Specifies the message displayed when there is no alarm alarmmessage 102 Process Variable and Alarm Classes Specifies the alarm message hysteresisvalue Specifies the hysteresis value of the alarm This is used to prevent alarms from toggling between states due to noise in the system when the process variable is very close to an alarm threshold After an alarm has been triggered the process variable must cross the alarm threshold in the opposite direction by the hysteresis value before it falls out of alarm For example if an RT ALARM GREATERTHAN alarm threshold is 70 th
89. right of the bar indicator The image below also includes an RTStringPanelMeter for the Cyl tag an RTNumericPanelMeter for the numeric readout below each bar indicator and an RTAlarmPanelMeter below that See the Dynamometer example program for the complete program listing that creates all of these objects cd fica Mica Tene 600 400 200 C private void InitializeEnginelTempIndicator CartesianCoordinates pTransforml new CartesianCoordinates 0 0 0 0 1 0 800 0 pTransforml SetGraphBorderDiagonal 0 15 175 0 48 0 35 Background background new Background pTransforml ChartObj PLOT BACKGROUND Colors Gray chartVu AddChartObject background ChartAttribute attribl new ChartAttribute Colors DarkMagenta 1 DashStyles Solid Colors DarkMagenta ChartAttribute attrib2 new ChartAttribute Colors Aquamarine 1 DashStyles Solid Colors Aquamarine ChartAttribute attrib3 new ChartAttribute Colors DarkSalmon 1 DashStyles Solid Colors DarkSalmon ChartAttribute attrib4 new ChartAttribute Colors Yellow 1 DashStyles Solid Colors Yellow Multiple Channel Bar Indicator 147 ChartAttribute attribArray attribl attrib2 attrib3 attrib4 double barwidth 0 1 barbase 0 0 barspace 0 25 int barjust ChartObj JUSTIFY MIN int barorient ChartObj VERT DIR LinearAxis baraxis new LinearAxis pTransforml ChartObj Y AXIS chartVu AddChartObject baraxis LinearAxis b
90. terms PID controller and PID object are used interchangeably in this documentation is created and configured using the RTPID class The RTCalcPID function calculates the PID algorithm s output It should be called at equal time intervals PID algorithm constants can be tuned by adjusting corresponding property values 240 PID Control A typical problem occurs when a PID object is switched from manual to automatic mode or when a PID constant is changed the output value can change very quickly possibly damaging the control equipment The Quinn Curtis implementation of the PID algorithm uses the bumpless transfer technique to prevent this problem The algorithm also uses anti reset windup technique PID Control Class RTPIDControl RTPIDControl constructors Visual Basic Overloads Public Sub New _ ByVal ptype As Integer _ ByVal setpnt As Double _ ByVal steadstat As Double _ ByVal prop As Double _ ByVal integ As Double _ ByVal deriv As Double _ ByVal lowclmp As Double _ ByVal highclmp As Double ByVal rateclmp As Double _ ByVal sampleper As Double _ ByVal filterconst As Double Overloads Public Sub New _ ByVal setpnt As Double _ ByVal steadstat As Double _ ByVal prop As Double _ ByVal integ As Double _ ByVal deriv As Double _ ByVal sampleper As Double _ ByVal filterconst As Double C public RTPIDControl int ptype double setpnt double steadstat dou
91. the center allowing for the placement of a numeric panel meter as a digital readout in the center of the meter RTMeterArcIndicator constructor Visual Basic Overloads Public Sub New _ ByVal frame As RTMeterCoordinates ByVal datasource As RTProcessVar _ ByVal innerarc As Double _ ByVal outerarc As Double _ ByVal attrib As ChartAttribute Overloads Public Sub New _ ByVal frame As RTMeterCoordinates _ ByVal datasource As RTProcessVar C public RTMeterArcIndicator RTMeterCoordinates frame RTProcessVar datasource double innerarc double outerarc ChartAttribute attrib Meter Indicators Needle Arc and Symbol 172 public RTMeterArcIndicator RTMeterCoordinates frame RTProcessVar datasource VE Parameters frame The RTMeterCoordinates object defining the meter properties for the indicator datasource The process variable associated with the indicator innerarc The inner radius value in radius normalized units 0 0 1 0 outerarc The inner radius value in radius normalized units 0 0 1 0 attrib The color attributes of the indicator Selected Public Instance Properties IndicatorSubtype Set Get the meter indicator subtype Use one of the arc inherited from meter indicator subtype constants RTMeterIndicator RT METER ARC BAND SUBTYPE RT METER SEGMENTED ARC SUBTYPE RT METER SINGLE SEGMENT ARC SUBTYPE InnerArcCapStyle Set Get the inner arc cap style Use one of th
92. the data point label position constants INSIDE BAR OUTSIDE BAR or CENTERED BAR Set Get the justification of bars in bar graph plot objects Use one of the bar justification constants JUSTIFY MIN JUSTIFY CENTER or JUSTIFY MAX Set Get the bar offset from its fixed x or y value in physical units Set Get the orientation HORIZ DIR or VERT DIR for bar plots Set Get the spacing between adjacent items in multi channel plots Set Get the width of bars in physical coordinates for bar plots ChartObjAttributes inherited from GraphObj ChartObjClipping inherited from GraphObj ChartObjComponent inherited from GraphObj ChartObjEnable inherited from GraphObj ChartObjScale inherited from GraphObj CurrentProcess Value inherited from RTSingleValueIndicator FillBaseValue inherited from ChartPlot FillColor inherited from GraphObj IndicatorBackground IndicatorBackgroundEnable IndicatorSubType LabelTemplateDecimalPos inherited from ChartPlot LabelTemplateNumericForma t inherited from ChartPlot LineColor inherited from GraphObj LineStyle inherited from GraphObj LineWidth inherited from GraphObj NumChannels inherited from RTPlot PlotLabelTemplate inherited from ChartPlot PointerSymbolNum Single Channel Bar Indicator 133 Sets the attributes for a chart object using a ChartAttribute object Sets the object clipping mode Use one of the object clipping constants NO_CL
93. the panel meter is attached to a meter indicator Places the panel meter at the top at the radius of the MeterCoordinates system You can set the text justification however you want Used when the panel meter is attached to a meter indicator Places the panel meter on the left at the radius of the MeterCoordinates system You can set the text justification however you want Used when the panel meter is attached to a meter indicator Places the panel meter on the right at the radius of the MeterCoordinates system You can set the text justification however you want Used when the panel meter is attached to a meter indicator Places the panel meter at the center of the radius of the Panel Meter Classes 113 MeterCoordinates system You can set the text justification however you want OUTSIDE RADIUS BOTTOM Used when the panel meter is attached to a meter indicator Places the panel meter at the bottom centered on the outside edge of the radius of the MeterCoordinates system Text justification is JUSTIFY CENTER JUSTIFY MAX INSIDE RADIUS BOTTOM Used when the panel meter is attached to a meter indicator Places the panel meter at the bottom centered on the inside edge of the radius of the MeterCoordinates system Text justification is JUSTIFY CENTER JUSTIFY MIN CENTER RADIUS BOTTOM Used when the panel meter is attached to a meter indicator Places the panel meter at the bottom centered on the inside edge of the radius of the
94. the plot background object Inherited from ChartView Get most recently created RTProcessVar Inherited from ChartView Inherited from ChartView Get a reference to the tag panel meter object Get a reference to the units string panel meter object Get Set the units string Gets or sets a value indicating whether the control is displayed Inherited from Control Gets or sets the width of the control Inherited from Control A complete listing of RTAutoClockIndicator properties is found in the QCRTGraphWPFCompiledHelpFile chm documentation file located in the doc subdirectory There are two different clock formats Use the GraphFormat property 0 1 to set the format Below you will find a brief description of the differences between the formats eee Eas a AN aA P N Format 0 displays a three hand hours minutes seconds clock A tag name is displayed above the clock face 312 Auto Indicator Classes Format 1 displays a three hand hours minutes seconds clock The date is displayed above the center of the clock and a digial readout of the time below the center of the clock A tag name is displayed above the clock face Example for initializing RTAutoClockIndicator objects The example below extracted from the AutoGraphDemos AutoDialsAndClockIndicatorsUserControll example shows the different clock formats See the AutoDialsAndClockIndicatorsUserControll asml file to see how the clocks are
95. the scale being zoomed brescale True designates that the scale should be re scaled once the final zoom rectangle is ascertained Enable the zoom object after creation using the ChartZoom SetEnable true method Retrieve the physical coordinates of the zoom rectangle using the ChartZoom GetZoomMin and GetZoomMax methods Restrict zooming in the x or y direction using the SetZoomXEnable and SetZoomY Enable methods Set the rounding mode associated with rescale operations using the SetZoomXRoundMode and SetZoomYRoundMode methods Call the ChartZoom PopZoomStack method at any time and the chart scale reverts to the minimum and maximum values of the previous zoom operation Repeated calls to the PopZoomStack method return the chart scale is to its original condition after which the PopZoomStack method has no effect Integrated zoom stack processing Starting with Revision 2 0 zoom stack processing is internal to ChartZoom class There is no need to subclass the ChartZoom class in order to implement a zoom stack Just set the ChartZoom InternalZoomStackProcessing property true zoomObj InternalZoomStackProcesssing true Return to a previous zoom level by right clicking the mouse Change the zoom stack button using the ZoomStackButtonMask property Setting it to MouseButton Left MouseButton Right or MouseButton Middle Aspect Ratio Correction Starting with Revision 2 0 you can force the zoom rectangle to maintain a fixed aspect ratio
96. there it can be plotted in static or scrolling plots The RTProcessVar class contains a collection of RTAlarm objects Each alarm object represents a unique alarm condition either a greater than alarm or a less than alarm based on the specified limit value The RTAlarm class also specifies alarm text strings alarm colors and the alarm hysteresis value An RTProcessVar object can hold an unlimited number of RTAlarm objects Every time an RTProcessVar object is updated with new values every alarm is checked and an alarm event is generated if the alarm conditions are met The programmer can hook into the alarm events using alarm event delegates 96 Process Variable and Alarm Classes Real Time Process Variable Class RTProcessVar ChartObj RTProcessVar Real time data is stored in RTProcessVar classes The RTProcessVar class is designed to represent a single process variable complete with limit values an unlimited number of high and low alarms historical data storage and descriptive strings for use in displays It has two main constructors RTProcessVar constructors Visual Basic Overloads Public Sub New _ ByVal tagname As String _ ByVal defaultattribute As ChartAttribute _ Overloads Public Sub New _ ByVal dataset As SimpleDataset ByVal defaultattribute As ChartAttribute _ C public RTProcessVar string tagname ChartAttribute defaultattribute public RTProcessVar SimpleDataset data
97. this method Or You can add a UserControl to your program but change the inheritance from UserControl to ChartView Since ChartView is a subclass of UserControl this is valid In this case you want to remove the Grid section from the xaml file of the ChartView derived class The Grid panel is opaque and the chart will not show 342 Using Real Time Graphics Tools for WPF to Create Windows Applications through The ChartView derived class is then referenced in the main Window xaml file See the QCChart2D UserControlChartExample2 program for an example of this technique Or You can just reference the ChartView class in the main Windows xaml file Define the chart in the behind code file Windows xaml cs or Windows xaml vb See the QCChart2D UserControlChartExample3 program for an example of this technique Visual Basic for WPF If you do not already have an application program project create one using the Visual Studio project wizard File New Project Visual Basic Projects WPF Application On the left select a project type of Visual Basic Windows Give the project a unique name In our examples wpf folder this example is the WpfRT Application so give your example a different name such as WPFApplicationl You will end with a basic WPF based application For purposes of this example the chart will placed in the initial default window Default Namespace Issues There is an annoying difference in the default files
98. time stamp which is the current time of day currentTemperaturel SetCurrentValue currentTemperatureValuel currentTemperature2 SetCurrentValue currentTemperatureValue2 Else This method you pass in whatever time stamp you want in this case it is the current time of day Dim tod As New ChartCalendar get current time currentTemperaturel SetCurrentValue tod currentTemperatureValuel currentTemperaturel SetCurrentValue tod currentTemperatureValue2 End If End Sub Update screen on 500 msec timer Private Sub timer2 Tick ByVal sender As Object ByVal e As System EventArgs chartVu UpdateDraw End Sub End Class e Reference and initialize the newly created ScrollGraph1 class in the Pagel xaml vb behind code file Imports com quinncurtis chart2dwpf Imports com quinncurtis rtgraphwpf Class Pagel Dim sg As ScrollGraphl Nothing Public Sub New InitializeComponent Using OCRTGraph for WPF to Create Web Applications 371 sg New ScrollGraphl scrollApp1 scrollAppl PreferredSize New Size 800 600 End Sub End Class The reference to PreferredSize tells the software that the font sizes specified in the graph are with respect to a chart window of size 800 600 If the chart is sized larger than this the fonts will be larger if it is sized smaller the fonts will be smaller Build the Solution Build Build Solution If the project fails to compile you need to go back and check the errors and the
99. value is rounded up in calculating how many segments to display in RT BAR SEGMENTED SUBTYPE and RT BAR SINGLE SEGMENT SUBTYPE modes Use one of the constants RT FLOOR VALUE RT CEILING VALUE Get Set the thickness of segments for the RT BAR SEGMENTED SUBTYPE and RT BAR SINGLE SEGMENT SUBTYPE bar indicator sub types If the plot supports it this method will turn on off the display of data values next to the associated data point Set Get the plot objects step mode Use one of the line plot step constants NO STEP STEP START STEP END or STEP NO RISE LINE Sets the z order of the object in the chart Every object has a z order value Each z order value does NOT have to be unique If z order sorting is turned on in the 146 Multiple Channel Bar Indicator ChartView object objects are sorted by z order before they are drawn A complete listing of RTMultiBarIndicator properties is found in the QCRTGraphWPFCompiledHelpFile chm documentation file located in the doc subdirectory Example for an RTMultiBarIndicator Segmented Bar Indicator The multi bar indicator example below extracted from the Dynamometer example method InitializeEnginel TempIndicator creates the 4 bar segmented bar temperature indicator in the left upper section of the graph It demonstrates how the plot area is defined for the multi bar indicator how to create axes and axis labels An RTAlarmIndicator is also created to display the alarm limit symbols to the
100. width of the bar is calculated using a function based on the deviation of the current temperature from the temperatureSetpoint value Calculating the bar width as a function of the bar height only works with the segmented bar subtypes If you want a solid bar make the RTBarIndicator SegmentWidth and RTBarIndicator SegmetSpacing values small and the same as in the example below pe gt 70 50 138 Single Channel Bar Indicator C public class CustomRTBarIndicator RTBarIndicator double temperatureSetpoint 70 public CustomRTBarIndicator PhysicalCoordinates transform RTProcessVar datasource double barwidth double barbase ChartAttribute attrib int barjust int barorient base transform datasource barwidth barbase attrib barjust barorient public override double GetCustomBarOffset double v double offset 0 0 return offset public override double GetCustomBarWidth double v Calculate width as fraction of initial bar width double width 1 0 Bar widest at setpoint narrowest at endpoints Clamp width to 0 05 to 1 0 range width Math Max 0 05 this BarWidth Math Abs 0 04 v temperatureSetpoint width Math Min 1 0 width return width public double TemperatureSetpoint get return temperatureSetpoint set temperatureSetpoint value public void InitializeCustomBarIndicator barplot new CustomRTBarIndicator pTransforml currentTemperaturel
101. y scale to be constantly rescaled to reflect the current dynamic range of the y values in the scroll frame The RTScrollFrame horizontally scrolls data with a numeric time date or elapsed time time stamp Class Architecture 39 Scroll Application 1 0 00 30 0 00 20 0 00 10 0 00 00 100 110 120 130 An example of a vertical elapsed time scroll frame RTVerticalScrollFrame The RTScrollFrame has the limitation that it can only manage horizontal scrolling The RTVerticalScrollFrame is much the same as RTScrollFrame only it manages scrolling in the vertical direction The RTVerticalScrollFrame vertically scrolls data with a numeric time date or elapsed time time stamp Auto Indicator Classes com quinncurtis chart2dwpf ChartView RTAutoIndicator RTAutoBarIndicator RTAutoMultiBarIndicator 40 Class Architecture RTAutoMeterIndicator RTAutoDialIndicator RTAutoClockIndicator RTAutoPanelMeterInicator The ChartView class is the base class for the self contained auto indicator classes Each real time indicator is placed in its own ChartView derived window along with all other objects typically associated the indicator axes labels process variables alarms titles etc Since ChartView is derived from UserControl you can place as many auto indicator classes on a form as you want Class Architecture 41 Il A EI Horiz 1 O m The RTAutoBarIndicator has many different format opti
102. 0 60 Formats 0 and 1 use 270 degree arcs 235 to 45 clockwise with a tag string above and numeric panel meter and alarm status panel meter below the needle The difference between the two formats is the meter ticks point inward in format 0 and outward in format 1 0 40 60 2 80 F hr 0 100 Sy Formats 2 and 3 use 180 degree arcs 180 to 0 clockwise with a tag string above and numeric panel meter and alarm status panel meter below the needle The difference between the two formats is the meter ticks point inward in format 2 and outward in format 3 100 Auto Indicator Classes 299 Formats 4 and 5 use 180 degree arcs 180 to 0 counter clockwise with a tag string above and numeric panel meter and alarm status panel meter below the needle The difference between the two formats is the meter ticks point inward in format 4 and outward in format 5 Formats 6 and 6 use 180 degree arcs 90 to 90 clockwise with a tag string above numeric panel meter to to the left and alarm status panel meter below the needle The difference between the two formats is the meter ticks point inward in format 6 and outward in format 7 Formats 8 and 9 use 180 degree arcs 90 to 90 clockwise with a tag string above numeric panel meter to to the right and alarm status panel meter below the needle The difference between the two formats is the meter ticks point inward in format 8 and outward in form
103. 1 Margin 10 10 10 10 Grid Row 0 Grid Column 0 gt lt my2 RTProcessVarViewer x Name rtProcessVarAppl Margin 10 10 10 10 Grid Row 1 Grid Column 0 gt lt Grid gt lt Window gt RTProcessVarViewer constructor Public Sub New _ chartvu As ChartView _ transform As PhysicalCoordinates posrect As Rectangle2D _ pv As RTProcessVar rows As Integer _ cols As Integer start As Integer C public RTProcessVarViewer ChartView chartvu PhysicalCoordinates transform Rectangle2D posrect RIProcessVar pv int rows int cola ant start chartvu The ChartView object the DatasetViewer is placed in transform The coordinate system the DatasetViewer is placed in posrect A positioning rectangle using normalized chart coordinates for the dataset viewer use null if not used pv The initial process variable rows Number of rows to display cols Number of columns to display start Starting column of the dataset viewer Set unique fonts for the column headers row headers and grid cells using the ColumnHeaderFont RowHearderFont and GridCellFont properties 266 Process Variable Viewer Turn on the edit feature of the grid cells using the EnableEdit property Turn on the striped background color of the grid cells using the UseStripedGridBackground property Foreground and background attributes of the column headers row headers and grid cells can be set using the ColumnHeaderAttribute RowHeaderAttri
104. 2 AlarmMessage High Alarm temphighalarm2 AlarmSymbolColor Colors Red temphighalarm2 AlarmTextColor Colors Red Hr currentTemperature2 new RTProcessVar Temp 2 new ChartAttribute Colors DashStyles Solid Colors Green currentTemperature2 MinimumValue 20 currentTemperature2 MaximumValue 200 currentTemperature2 DefaultMinimumDisplayValue 0 currentTemperature2 DefaultMaximumDisplayValue 150 currentTemperature2 SetCurrentValue currentTemperatureValue2 currentTemperature2 AddAlarm templowalarm2 currentTemperature2 AddAlarm temphighalarm2 Important enables historical data collection for scroll graphs currentTemperature2 DatasetEnableUpdate true currentTemperature2 AlarmTransitionEventHandler new RTAlarmEventDelegate TemperatureAlarmEventProc InitializeScrollGraph timerl Interval TimeSpan FromMilliseconds 200 200 msecs timerl Tick new EventHandler timerl Tick timer2 Interval TimeSpan FromMilliseconds 500 500 msecs timer2 Tick new EventHandler timer2 Tick timerl Starti i timer2 Start private void TemperatureAlarmEventProc object sender RTAlarmEventArgs e RTAlarm alarm e EventAlarm double alarmlimitvalue alarm AlarmLimitValue RTProcessVar pv e ProcessVar String tagname pv TagName double timestamp pv TimeStamp String timestampstring timestamp ToString if alarm AlarmState Console Out WriteLine time
105. 4 118 122 126 129 132 135 139 140 141 142 152 154 155 185 186 187 194 198 213 217 224 228 231 239 261 264 RTProcessVar 10 13 15 17 19 20 21 22 23 25 26 27 28 29 30 31 35 39 97 98 99 100 101 102 103 104 105 106 107 108 109 110 112 114 118 119 121 122 123 126 127 129 130 132 133 135 139 142 147 148 152 153 155 159 160 161 162 171 185 186 187 188 194 198 199 203 204 205 206 207 213 214 217 218 220 222 223 224 225 228 229 232 239 240 243 259 261 263 265 275 277 279 300 301 302 305 311 314 322 326 332 335 343 350 353 359 366 RTRoundedRectangle2D RTScrollFrame RTSimpleSingleValuePlot 10 13 16 17 23 28 32 39 97 224 228 231 232 233 234 235 236 237 238 240 243 244 360 RTSingleValueIndicator 17 20 23 28 33 113 114 118 122 126 129 132 135 139 140 141 142 153 154 155 185 186 187 194 198 231 261 R ETextErame aeta ones 17 47 49 Scale classes eee eerte ett eed cote 58 59 60 94 Scrolling Graph 10 16 17 18 19 40 46 224 228 229 231 235 236 310 352 353 361 362 363 364 366 371 373 374 Scrolling Graphs 10 16 17 29 32 38 40 224 225 227 228 233 234 237 241 242 243 279 359 17 290 294 295 296 Sliapes i oe ae otee o ta 88 89 96 MESES ato 2 10 83 95 SimpleDataset
106. BarlIndicator 10 18 19 40 42 310 311 315 318 322 326 353 365 RTAutoClockIndicator 10 18 19 41 45 310 347 350 351 RTAutoDialIndicator 10 18 19 41 44 310 341 344 346 RTAutoMeterIndicator 10 18 19 41 44 310 332 333 335 338 348 RTAutoMultiBarIndicator 10 18 19 40 43 310 322 329 RTAutoPanelMeterIndicator 10 18 19 310 RTBarIndicator 17 20 23 25 97 112 121 122 123 124 125 129 139 140 143 144 145 146 147 148 149 150 151 159 161 311 313 325 RTComboProcessVar 17 203 204 205 206 207 209 211 341 344 345 347 RTControlButton 16 18 36 37 38 245 246 247 248 249 250 251 253 259 262 265 266 283 286 RTControlTrackBar 18 36 37 137 245 253 254 255 256 258 259 261 RTDatasetTruncateArgs eee 17 RTElapsedTimePanelMeter 17 20 23 132 133 134 135 RTFormControl 18 23 31 36 37 135 245 RTFormControlGrid 17 29 31 36 37 97 245 246 248 249 251 258 262 263 264 265 266 RTFormControlPanelMeter 17 20 23 36 37 112 135 136 137 245 256 259 260 261 262 RTGenShape 17 46 48 290 297 299 343 349 RTGroupDatasetTruncateAr rgs esses 17 RTGroupMultiValuePlot 10 13 16 17 29 31 32 39 977 224 228 236 239 240 241 243 353 366 RTMeterArcIndicator 17 23 27 185 187 188 189 203 RTMeterAxis
107. Button ChartObj RT CONTROL MOMENTARYBUTTON SUBTYPE Public Sub InitializeStartStopButtons Dim buttonfont As ChartFont font12Bold Dim pTransforml As New CartesianCoordinates 0 0 0 0 1 0 1 0 224 Buttons Track Bars and Other Form Control Classes pTransforml SetGraphBorderDiagonal 0 01 0 65 0 2 0 98 Dim attribl As New ChartAttribute Colors Black 5 DashStyles Solid Colors LightBlue Dim buttonlistl As New ArrayList StartButton ButtonUncheckedText Start StartButton ButtonChecked True AddHandler StartButton Click New System Windows RoutedEventHandler AddressOf Me selector Button Click e StartButton ButtonFont buttonfont buttonlistl Add StartButton topButton ButtonUncheckedText Stop 2 StopButton ButtonChecked False AddHandler StopButton Click New System Windows RoutedEventHandler AddressOf Me selector Button Click e StopButton ButtonFont buttonfont buttonlistl Add StopButton ResetButton ButtonUncheckedText Reset ResetButton ButtonChecked False AddHandler ResetButton Click New System Windows RoutedEventHandler AddressOf Me selector Button Click ResetButton ButtonFont buttonfont buttonlistl Add ResetButton ClearButton ButtonUncheckedText Clear ClearButton ButtonChecked False AddHandler ClearButton Click New System Windows RoutedEventHandler AddressOf Me selector Button Click ClearButton ButtonFont buttonfont
108. ButtonFont buttonfont buttonlistl Add StartButton StopButton ButtonUncheckedText Stop StopButton ButtonChecked false StopButton Click new System Windows RoutedEventHandler this selector Button Click S b topButton ButtonFont buttonfont uttonlistl Add StopButton ResetButton ButtonUncheckedText Reset ResetButton ButtonChecked false ResetButton Click new System Windows RoutedEventHandler this selector Button Click ResetButton ButtonFont buttonfont buttonlistl Add ResetButton ClearButton ButtonUncheckedText Clear ClearButton ButtonChecked false ClearButton Click new System Windows RoutedEventHandler this selector Button Click ClearButton ButtonFont buttonfont buttonlistl Add ClearButton Fret cb vt int numColumns 1 int numRows 4 StartStopControlGrid new RTFormControlGrid pTransforml null buttonlistl1 numColumns numRows attribl startStopControlGrid CellRowMargin 0 1 StartStopControlGrid CellColumnMargin 0 0 startStopControlGrid FormControlTemplate Frame3DEnable flag3DBorder chartVu AddChartObject startStopControlGrid VB Private StartButton As New RTControlButton ChartObj RT CONTROL RADIOBUTTON SUBTYPE Private StopButton As New RTControlButton ChartObj RT CONTROL RADIOBUTTON SUBTYPE Private ResetButton As New RTControlButton ChartObj RT CONTROL MOMENTARYBUTTON SUBTYPE Private ClearButton As New RTControl
109. C Panel Meter Classes 125 CartesianCoordinates pTransforml new CartesianCoordinates 0 0 0 0 1 0 1 0 pTransforml SetGraphBorderDiagonal 0 3 85 0 55 0 96 ChartAttribute panelmeterattrib new ChartAttribute Colors SteelBlue 3 DashStyles Solid Colors Black RTTimePanelMeter panelmeter new RTTimePanelMeter pTransforml timeOfDay panelmeterattrib panelmeter PanelMeterPosition ChartObj INSIDE INDICATOR panelmeter TimeTemplate TextFont new ChartFont Digital SF 36 FontStyles Normal panelmeter TimeTemplate TimeFormat ChartObj TIMEDATEFORMAT 24HMS panelmeter AlarmIndicatorColorMode ChartObj RT INDICATOR COLOR NO ALARM CHANGE chartVu AddChartObject panelmeter ChartAttribute panelmetertagattrib new ChartAttribute Colors Beige 0 DashStyles Solid Colors Beige RTStringPanelMeter panelmeter3 new RTStringPanelMeter pTransforml timeOfDay panelmetertagattrib ChartObj RT TAG STRING panelmeter3 StringTemplate TextFont new ChartFont Microsoft Sans Serif 10 FontStyles Normal panelmeter3 PanelMeterPosition ChartObj ABOVE REFERENCED TEXT panelmeter3 SetPositionReference panelmeter panelmeter3 TextColor Colors Black chartVu AddChartObject panelmeter3 VB Dim pTransforml As New CartesianCoordinates 0 0 0 0 1 0 1 0 prTransforml SetGraphBorderDiagonal 0 3 0 85 0 55 0 96 Dim panelmeterattrib As New ChartAttribute Colors SteelBlue 3 DashStyles Solid Colors Bla
110. CATTER PLOT Colors Red Channel 3 rtAutoScrollGraph2 SimplePlotObj SymbolAttributes SymbolSize 8 rtAutoScrollGraph2 GraphScrollFrame ScrollRescaleMargin 0 01 rtAutoScrollGraph2 GraphScrollFrame ScrollScaleModeY ChartObj RT AUTOSCALE Y MINMAX rtAutoScrollGraph2 InitStrings RTAutoScrollGraph Time Quarks rtAutoScrollGraph2 GraphBackground FillColor Colors BlanchedAlmond rtAutoScrollGraph2 SubHead TextString Elapsed Time Scrolling rtAutoScrollGraph2 SubHead ChartObjEnable ChartObj OBJECT ENABLE rtAutoScrollGraph2 Footer TextString Footer text rtAutoScrollGraph2 Footer ChartObjEnable ChartObj OBJECT ENABLE rtAutoScrollGraph2 YAxisLab2 ChartObjEnable ChartObj OBJECT ENABLE rtAutoScrollGraph2 LowAlarm AlarmLimitValue 4 rtAutoScrollGraph2 HighAlarm AlarmLimitValue 12 rtAutoScrollGraph2 SetpointAlarm AlarmLimitValue 8 End Sub The update of scroll graphs takes place in the timer event handler Private Sub timerl Tick ByVal sender As Object ByVal e As EventArgs Handles timerl Tick Dim timestamp As New ChartCalendar For i As Integer 0 To currentValues Length 1 currentValues i 0 5 ChartSupport GetRandomDouble Next rtAutoScrollGraphl UpdateScrollGraph timestamp currentValues True get elapsed time in milliseconds Dim etimemsecs As Double timestamp GetCalendarMsecs startCalendar GetCalendarMsecs Dim etimespan As TimeSpan TimeSpan FromMilliseconds etimemsecs rtAutoScrollGraph2 Upda
111. CartesianCoordinates 0 0 0 0 1 0 1 0 pTransforml SetGraphBorderDiagonal 0 01 0 05 0 15 0 35 Dim background As New Background pTransforml ChartObj PLOT BACKGROUND Colors Gray chartVu AddChartObject background Dim annunrect As New Rectangle2D 0 05 0 05 0 9 0 9 Dim attribl As New ChartAttribute Colors DarkGray 5 DashStyles Solid _ Colors DarkGray Dim annunciator As New RTAnnunciator pTransforml processVarl annunrect sttribpl Dim panelmeterattrib As New ChartAttribute Colors SteelBlue 3 DashStyles Solid Colors Black Dim panelmeter As New RTNumericPanelMeter pTransforml processVar2 panelmeterattrib panelmeter PanelMeterPosition ChartObj PLOTAREA CENTER panelmeter NumericTemplate TextFont FontArchive fontl6Numeric panelmeter NumericTemplate PostfixString ChrW 176 E annunciator AddPanelMeter panelmeter Dim panelmeter2 As New RTAlarmPanelMeter pTransforml processVarl panelmeterattrib panelmeter2 PanelMeterPosition ChartObj INSIDE BARBASE panelmeter2 AlarmTemplate TextFont FontArchive font10 panelmeter2 SetPositionReference panelmeter annunciator AddPanelMeter panelmeter2 Dim panelmetertagattrib As New ChartAttribute Colors SteelBlue 3 DashStyles Solid Colors White Dim panelmeter3 As New RTStringPanelMeter pTransforml processVarl panelmetertagattrib ChartObj RT_TAG STRING panelmeter3 SetPositionReference panelmeter Single and Multiple Channel Annunciators 195
112. ChartAttribute Overloads Public Sub New _ ByVal frame As RTMeterCoordinates ByVal datasource As RTProcessVar C public RTMeterSymbolIndicator RTMeterCoordinates frame RTProcessVar datasource int symbolnum double symbolsize ChartAttribute attrib public RTMeterSymbolIndicator RTMeterCoordinates frame RTProcessVar datasource Parameters frame The RTMeterCoordinates object defining the meter properties for the indicator datasource The process variable associated with the indicator symbolnum Specifies what symbol to use in the indicator Use one of the scatter plot symbol constants NOSYMBOL SQUARE TRIANGLE DIAMOND CROSS PLUS STAR LINE HBAR VBAR BAR3D CIRCLE symbolsize The size of the symbol in points attrib The color attributes of the indicator Selected Public Instance Properties Meter Indicators Needle Arc and Symbol 182 IndicatorSubtype inherited from Set Get the meter indicator subtype Use one of the RTMeterIndicator meter symbol indicator subtype constants RT METER SYMBOL ARC SUBTYPE RT METER SINGLE SYMBOL SUBTYPE SegmentValueRoundMode Get Set that the current process value is rounded up in calculating how many symbols to display in RT METER SYMBOL ARC SUBTYPE RT METER SINGLE SYMBOL SUBTYPE modes Use one of the constants RT FLOOR VALUE RT CEILING VALUE SymbolNum Set Get the symbol used as the indicator symbol Use one o
113. Enable True zoomObj InternalZoomStackProcesssing True chartVu SetCurrentMouseListener zoomObj Limiting the Zoom Range A zoom window needs to have zoom limits placed on the minimum allowable zoom range for the x and y coordinates Unrestricted or infinite zooming can result in numeric under and overflows The default minimum allowable range resulting from a zoom operation is 1 1000 of the original coordinate range Change this value using the ChartZoom SetZoomRangeLimitsRatio method The minimum allowable range for this value is approximately 1 0e 9 Another way to set the minimum allowable range is to specify explicit values for the x and y range using the 254 Zooming ChartZoom SetZoomRangeLimits method Specify the minimum allowable zoom range for a time axis in milliseconds for example ChartZoom SetZoomRangeLimits new Dimension 1000 0 01 sets the minimum zoom range for the time axis to 1 second and for the y axis to 0 01 The utility method ChartCalendar GetCalendarWidthValue is useful for calculating the milliseconds for any time base and any number of units The code below sets a minimum zoom range of 45 minutes C double minZoomTimeRange ChartCalendar GetCalendarWidthValue ChartObj MINUTE 45 double minZoomYRange 0 01 Dimension zoomLimits new Dimension minZzoomTimeRange minZoomYRange zoomObj SetZoomRangeLimits zoomLimits Visual Basic Dim minZoomTimeRange As double _ ChartObj GetCalendarWidth
114. FASTCLIP X Dim solarPanelLinePlot As New RTSimpleSingleValuePlot pTransforml _ lineplot currentTemperaturel chartVu AddChartObject solarPanelLinePlot Example for a simple two channel vertical scrolling line plot The example below extracted from the VerticalScrolling ElapsedTimeVerticalScrolling method InitializeVerticalScrollGraph creates a vertical elapsed time based two channel scrolling graph Note Both the RTVertcialScrollFrame and the RTSimpleSingleValuePlot objects are added to the ChartView When the ChartView UpdateDraw method is called the RTScrollFrame object in the ChartView object list causes the scroll graph coordinate system to be re scaled to reflect the current data values The RTSimpleSingleValue object in the ChartView list redraws the line plot in the new re scaled coordinate system Single and Multiple Channel Annunciators 211 0 00 42 0 00 32 0 00 22 0 00 12 0 50 100 150 C scrollFrame new RTVerticalScrollFrame this currentTemperaturel pTransforml ChartObj RT FIXEDEXTENT MOVINGSTART AUTOSCROLL ScrollFrame AddProcessVar currentTemperature2 ScrollFrame ScrollScaleModeX ChartObj RT AUTOSCALE X MINMAX Allow 100 samples to accumlate before autoscaling y axis This prevents rapid changes of the y scale for the first few samples scrollFrame MinSamplesForAutoScale 100 scrollFrame ScrollRescaleMargin 0 05 chartVu AddChartObject scrollFrame ChartAttribute att
115. Format 0 except that if the BarEndBulb property is turned on the numeric and alarm status panel meters do not sit on top of the bar GMB Panel meters above and below the bar for the tag name numeric value and alarm status The scale units are displayed under the tag name Turn the BarEndBulb property on and the numeric and alarm status panel meters will sit on top of the bar end bulb The default width of this format is wider than GraphFormat 0 229 NODO er sasa 20 40 60 80 100 GMB 280 Auto Indicator Classes Qi a 0 20 40 60 80 100 GMB Panel meters to the left and right of the bar for the tag name numeric value and alarm status The scale units displays horizontally under the scale Turn the BarEndBulb property on and the bar indicator area shrinks horizontally in order to fit in the bulb without overlap Horiz 1 Horiz 1 az OTTO 100 Horiz 1 Horiz 1 ae i 20 OMe 100 Panel meters to the left and right of the bar for the numeric value and and alarm status A panel meter at the top for the tag name The scale units displays horizontally under the scale Turn the BarEndBulb property on and the bar indicator area shrinks horizontally in order to fit in the bulb without overlap Horiz 2 Horiz 2 MEI Auto Indicator Classes 281 Horiz 2 Horiz 2 eum Panel meter right of the bar for the alarm status with the numeric panel meter placed in
116. Gets or sets a value indicating whether the control is displayed Inherited from Control Gets or sets the width of the control Inherited from Control Get the x axis object Get the second x axis object Get the x axis labels object Get the x axis title object Get the x axis grid object Get the y axis object Get the second y axis object Get the y axis labels object Accessible only after BuildGrap Get the y axis title object Get the y axis grid object A complete listing of RTAutoBarIndicator properties is found in the QCRTGraphWPFCompiledHelpFile chm documentation file located in the doc subdirectory There are 8 different bar graph formats four horizontal and four vertical Use the GraphFormat property 0 3 to set the format Below you will find a brief description of the differences between the formats 278 Auto Indicator Classes Panel meters above and below the bar for the tag name numeric value and alarm status The scale units displayed vertically on the left Turn the BarEndBulb property on and the numeric and alarm status panel meters will sit on top of the bar end bulb The tag panel meter on top with the numeric value and alarm status panel meters to the right The scale units displayed vertically on the left Turn on the BarEndBulb property and the bar indicator will shrink vertically in order fit the bulb in the indicator window Auto Indicator Classes 279 Similar to Graph
117. IPPING GRAPH AREA CLIPPING PLOT AREA CLIPPING or INHERIT CLIPPING Sets the reference to the ChartView component that the chart object is placed in Enables Disables the chart object A chart object is drawn only if it is enabled A chart object is enabled by default Sets the reference to the PhysicalCoordinates object that the chart object is placed in Get the current process value of the primary channel Set Get the base value in physical coordinates of solid bars and filled areas plot objects Sets the fill color for the chart object Get Set the background attribute of the bar indicator Set to true to enable the display of the bar indicator background Get Set the bar indicator sub type RT BAR SOLID SUBTYPE RT BAR SEGMENTED SUBTYPE RT BAR SINGLE SEGMENT SUBTYPE RT POINTER SUBTYPE Set Get number of digits to the right of the decimal point in the PlotLabelTemplate property Set Get the numeric format of the PlotLabelTemplate property Sets the line color for the chart object Sets the line style for the chart object Sets the line width for the chart object Get the number of channels in the indicator Set Get the plot objects data point template If the plot supports it this NumericLabel object is used as a template to size color and format the data point numeric values Set Get the symbol used for the pointer symbol indicator subtype RT POINTER SUBTYPE Use one of the 134 Single Channel Bar Indi
118. Integer For i 0 To PIDProcessItems Length 1 row i 8 col i Mod 8 x1 xoffset col faceplatewidthspacing yl yoffset row faceplateheightspacing x2 xl faceplatewidth y2 yl faceplateheight Dim mindisplayvalue As Double PIDProcessItems i DefaultMinimumDisplayValue Dim maxdisplayvalue As Double PIDProcessItems i DefaultMaximumDisplayValue pTransforml New CartesianCoordinates 0 0 mindisplayvalue 1 0 maxdisplayvalue Dim normrect As New Rectangle2D x1 yl faceplatewidth faceplateheight Dim frame3d As New RT3DFrame pTransforml normrect rectattrib ChartObj NORM GRAPH POS chartVu AddChartObject frame3d Next i Rounded Rectangles Class RTRoundedRectangle2D com quinncurtis chart2dwpf GraphObj RTRoundedRectangle2D Rounded rectangles are just that rectangles that have rounded corners Miscellaneous Shape Drawing 259 RTRoundedRectangle2D constructors Visual Basic Overloads Public Sub New _ ByVal transform As PhysicalCoordinates _ ByVal r As Rectangle2D ByVal corner As Double _ ByVal postype As Integer _ Cf public RTRoundedRectangle2D PhysicalCoordinates transform Rectangle2D r double corner int postype Parameters transform Places the RTRoundedRectangle2D object in the coordinate system defined by transform The size and position of the rectangle corner The radius of the rectangle corners postype The coordinate system the rectangle is defined in
119. Lab new NumericAxisLabels baraxis chartVu AddChartObject barAxisLab CustomRTMultiBarIndicator barplot new CustomRTMultiBarIndicator pTransforml processVarArray barwidth barspace barbase attribArray barjust barorient barplot SegmentSpacing 20 barplot SegmentWidth 15 chartVu AddChartObject barplot Add panel meters VB 150 Multiple Channel Bar Indicator Public Class CustomRTBarIndicator Inherits RTBarIndicator Public Sub New ByVal transform As PhysicalCoordinates _ ByVal datasource As RTProcessVar ByVal barwidth As Double ByVal barbase As Double ByVal attrib As CHARTATTRIBUTE ByVal barjust As Integer ByVal barorient As Integer MyBase New transform datasource barwidth barbase attrib barjust barorient End Sub New Public Overrides Function GetCustomBarOffset ByVal v As Double As Double Dim offset As Double 0 0 Return offset End Function GetCustomBarOffset Public Overrides Function GetCustomBarWidth ByVal v As Double As Double Calculate width as fraction of initial bar width Dim width As Double 0 5 width 0 01 v 100 v 100 Me BarWidth Return width End Function GetCustomBarWidth End Class CustomRTBarIndicator Public Class CustomRIMultiBarIndicator Inherits RIMultiBarIndicator Public Sub New ByVal transform As PhysicalCoordinates _ ByVal datasource As RTProcessVar ByVal barwidth As Double ByVal barspacing As Double ByVal barbase As Double _ ByV
120. List buttonlist new ArrayList StartControl ButtonUncheckedText Start StartControl ButtonCheckedText Stop 5 tartControl Click new System Windows RoutedEventHandler this controlOn Button Click StartControl ButtonFont buttonfont StartControl ButtonChecked false buttonlist Add StartControl 3 ResetErrorTerm ButtonUncheckedText Reset Error ResetErrorTerm Click new System Windows RoutedEventHandler this resetErrorTerm Button Click ResetErrorTerm ButtonFont buttonfont ResetErrorTerm ButtonChecked false buttonlist Add ResetErrorTerm ResetAll ButtonUncheckedText Reset All ResetAll Click new System Windows RoutedEventHandler resetAll Button Click ResetAll ButtonFont buttonfont ResetAll ButtonChecked false buttonlist Add ResetAll int numColumns 3 int numRows 1 CartesianCoordinates pTransforml new CartesianCoordinates 0 0 0 0 1 0 1 0 pTransforml SetGraphBorderDiagonal 0 73 94 0 99 0 99 RTFormControlGrid controlgrid ew RTFormControlGrid pTransforml null buttonlist numColumns numRows attribl controlgrid CellRowMargin 0 0 controlgrid CellColumnMargin 0 00 controlgrid FormControlTemplate Frame3DEnable true chartVu AddChartObject controlgrid VB Private ResetErrorTerm As New RTControlButton ChartObj RT CONTROL MOMENTARYBUTTON SUBTYPE Private ResetAll As New RTControlButton ChartObj RT CONTROL MOMENTARYBUT
121. Meter Axis Labels Class RTMeterStringAxisLabels com quinncurtis chart2dwpf StringA xisLabels RTMeterStringAxisLabels 166 Meters Coordinates Meter Axes and Meter Axis Labels This class labels the major tick marks of the RTMeterAxis class using user defined strings RTMeterStringAxisLabels constructor Visual Basic Overloads Public Sub New _ ByVal baseaxis As RTMeterAxis _ C public RTMeterStringAxisLabels RIMeterAxis baseaxis Parameters baseaxis The RTMeterAxis object associated with the labels Parameters baseaxis The RTMeterAxis object associated with the labels Selected Public Instance Properties The properties of the RTMeterStringA xisLabels class are pretty much the same as the RTMeterAxisLabels class with these exceptions Get Set if the text is horizontal METER LABEL HORIZONTAL at right angles to the tick mark METER LABEL PERPENDICULAR or radial to the tick mark parallel METER LABEL RADIAL 1 METER LABEL RADIAL 2 The axis label strings are set using the SetAxisLabelString method ings inherited from Sets the string array used to hold user defined StringAxisLabels axis label strings Setting the string array does not automatically turn on the use of string labels Use enableAxisLabelsStrings to enable axis strings Meters Coordinates Meter Axes and Meter Axis Labels 167 A complete listing of RTMeterStringAxisLabels properties is found in the QCRTGraphWPFComp
122. MeterCoordinates system Text justification is JUSTIFY CENTER JUSTIFY CENTER OUTSIDE RADIUS TOP Used when the panel meter is attached to a meter indicator Places the panel meter at the top centered on the outside edge of the radius of the MeterCoordinates system Text justification is JUSTIFY CENTER JUSTIFY MIN INSIDE RADIUS TOP Used when the panel meter is attached to a meter indicator Places the panel meter at the top centered on the inside edge of the radius of the MeterCoordinates system Text justification is JUSTIFY CENTER JUSTIFY MAX CENTER RADIUS TOP Used when the panel meter is attached to a meter indicator Places the panel meter at the top centered on the inside edge of the radius of the MeterCoordinates system Text justification is JUSTIFY CENTER JUSTIFY CENTER A particularly useful property is RTPanelMeter PanelMeterNudge After you get the panel meter positioned approximately where you want you may find that it just a couple of pixels too close to some other object whether it be an indicator axis or text object You can nudge the panel meter in any direction with respect to its calculated position The PanelMeterNudge property uses device or pixel coordinates C RTNumericPanelMeter panelmeter new RTNumericPanelMeter pTransforml panelmeterattrib panelmeter PanelMeterPosition ChartObj OUTSIDE PLOTAREA MIN panelmeter PanelMeterNudge new Point2D 0 4 VB 114 Panel Meter Class
123. MultiLinePlot pTransforml Nothing attribarray multilineplot SetFastClipMode ChartObj FASTCLIP X rtMultiLinePlot New RTGroupMultiValuePlot pTransforml multilineplot _ EngineCylinderTemp2 chartVu AddChartObject rtMultiLinePlot chartVu AddChartObject scrollFrame2 Example for multi scale multi axis scrolling graph combining stock open high low close plots with line plots The example below extracted from the RTStockDisplay example method InitializeScrollGraph creates a multi channel scrolling graph the combines an open high low close plots with line plots using two different scales Real Time Stock Display 28 0 27 5 27 0 26 5 11 52 15 11 52 30 11 52 45 11 53 00 C scrollFramel new RTScrollFrame this stockOpenl pTransforml ChartObj RT FIXEDEXTENT MOVINGSTART AUTOSCROLL scrollFramel ScrollScaleModeY ChartObj RT AUTOSCALE Y MINMAX Need to add this ProcessVar s to have auto scale work for all values of OHLC plot ScrollFramel AddProcessVar stockHighl scrollFramel AddProcessVar stockLowl scrollFramei AddProcessVar stockClosel scrollFramel ScrollRescaleMargin 0 05 chartVu AddChartObject scrollFramel ScrollFrame2 new RTScrollFrame this NASDAQChannel pTransform2 ChartObj RT FIXEDEXTENT MOVINGSTART AUTOSCROLL scrollFrame2 ScrollScaleModeY ChartObj RT AUTOSCALE Y MINMAX scrollFrame2 ScrollRescaleMargin 0 05 chartVu AddChartObject scrollFrame2
124. ND ARISING OUT OF THE DELIVERY PERFORMANCE OR USE OF THE SUCH DAMAGES IN ANY EVENT QUINN CURTIS S LIABILITY FOR ANY CLAIM WHETHER IN CONTRACT TORT OR ANY OTHER THEORY OF LIABILITY WILL NOT EXCEED THE GREATER OF U S 1 00 OR LICENSE FEE PAID BY YOU 10 U S GOVERNMENT RESTRICTED RIGHTS The SOFTWARE is provided with RESTRICTED RIGHTS Use duplication or disclosure by the Government is subject to restrictions as set forth in subparagraph c 1 11 of The Rights in Technical Data and Computer SOFTWARE clause of DFARS 252 227 7013 or subparagraphs c 1 and 2 of the Commercial Computer SOFTWARE Restricted Rights at 48 CFR 52 227 19 as applicable Manufacturer is Quinn Curtis Inc 18 Hearthstone Dr Medfield MA 02052 USA 11 MISCELLANEOUS If you acquired the SOFTWARE in the United States this EULA is governed by the laws of the state of Massachusetts If you acquired the SOFTWARE outside of the United States then local laws may apply Should you have any questions concerning this EULA or if you desire to contact Quinn Curtis Inc for any reason please contact Quinn Curtis Inc by mail at Quinn Curtis Inc 18 Hearthstone Dr Medfield MA 02052 USA or by telephone at 508 359 6639 or by electronic mail at support Quinn Curtis com iv Table of Contents Real Time Graphics Tools for WPF Dependencies cccsccesaccsvesacotetvasnueisvesisnsecvsacasivess 3 Directory Structure of OCR Graph for A BER ili i ira
125. Obj DataCursor MoveData DataToolTip ChartZoom MagniView shapes and images Use the MoveData class to move objects derived from SimplePlot This class extends the MouseListener class providing additional methods that selectively determine what graphical objects intersect the mouse cursor This class combines the MouseListener class and Marker class Press a mouse button and the selected data cursor horizontal and or vertical line cross hairs or a small box appears at the point of the mouse cursor The data cursor tracks the mouse motion as long as the mouse button is pressed Release the button and the data cursor disappears This makes it easier to line up the mouse position with the tick marks of an axis This class selects and moves individual data points of an object derived from the SimplePlot class A data tooltip is a popup box that displays the value ofa data point in a chart The data value can consist of the x value the y value x and y values group values and open high low close values for a given point in a chart This class implements mouse controlled zooming for one or more simultaneous axes The user starts zooming by holding down a mouse button with the mouse cursor in the plot area of a graph The mouse is dragged and then released The rectangle established by mouse start and stop points defines the new zoomed scale of the associated axes Zooming has many different modes Some of the combinat
126. Obj RT AUTOSCALE Y MINMAX scrollFramel Single and Multiple Channel Annunciators 213 ScrollRescaleMargin 0 05 chartVu AddChartObject scrollFramel for int i20 i lt 4 i SimpleLinePlot lineplot new SimpleLinePlot pTransforml null attribarray i lineplot SetFastClipMode ChartObj FASTCLIP X rtLinePlotArrayl i i new RTSimpleSingleValuePlot pTransforml lineplot EngineCylinderTempl i chartVu AddChartObject rtLinePlotArrayl i VB scrollFramel New RTScrollFrame Me EngineCylinderTempl1 0 pTransforml ChartObj RT FIXEDEXTENT MOVINGSTART AUTOSCROLL scrollFramel scrollFramel scrollFramel scrollFramel scrollFramel AddProcessVar EngineCylinderTempl 1 AddProcessVar EngineCylinderTempl 2 AddProcessVar EngineCylinderTempl 3 ScrollScaleModeY ChartObj RT AUTOSCALE Y MINMAX ScrollRescaleMargin 0 05 chartVu AddChartObject scrollFramel Dim i As Integer For i 0 To 3 Dim lineplot As New SimpleLinePlot pTransforml Nothing attribarray i lineplot SetFastClipMode ChartObj FASTCLIP X rtLinePlotArrayl i New RTSimpleSingleValuePlot pTransforml lineplot EngineCylinderTempl i chartVu AddChartObject rtLinePlotArrayl i Next i 13 Multi Channel Scrolling Plots RTGroupMultiValuePlot The RTGroupMultiValuePlot class can be used to plot multi channel scrolling plot data It uses the QCChart2D GroupPlot class as a template to
127. Object meterneedle Dim meteraxis As New RTMeterAxis meterframe meterneedle meteraxis SetChartObjAttributes attribl meteraxis SetAxisTickDir ChartObj AXIS MIN meteraxis LineWidth 2 meteraxis LineColor Colors White meteraxis SetAxisTickSpace 4 meteraxis SetAxisMinorTicksPerMajor 4 meteraxis ShowAlarms True meterneedle MeterAxis meteraxis chartVu AddChartObject meteraxis Dim meterFont As ChartFont font10Bold Dim meteraxislabels As New RTMeterStringAxisLabels meteraxis meteraxislabels SetTextFont meterFont meteraxislabels SetAxisLabelsDir meteraxis GetAxisTickDir Dim labelstrings As String E 1 2 F meteraxislabels OverlapLabelMode ChartObj OVERLAP LABEL DRAW meteraxislabels AxisLabelsEnds ChartObj LABEL MAX meteraxislabels SetAxisLabelsStrings labelstrings 3 meteraxislabels LineColor Colors White chartVu AddChartObject meteraxislabels 9 Meter Indicators Needle Arc and Symbol RTMeterIndicator RTMeterArcIndicator RTMeterNeedleIndicator RTMeterSymbolIndicator Familiar examples of analog meter indicators are voltmeters car speedometers pressure gauges compasses and analog clock faces Three meter indicator types are supported arc symbol and needle meters An unlimited number of meter indicators can be added to a given meter object RTPanelMeter objects can be attached to an RTMeterIndicator object for the display of RTProcessVar numeric alarm and string data in addition to the
128. Object timeAxisControlPanelTrackBar End Sub Form Control Grid The RTFormControlGrid organizes a collection of Form Control objects functionally and visually in a grid format An RTControlButton must be added to an RTFormControlGrid before the radio button processes of the RTControlButton will work Class RTFormControlGrid RTMultiValueIndicator RTFormControlGrid RTFormControlGrid constructors Buttons Track Bars and Other Form Control Classes 233 Visual Basic Overloads Public Sub New _ ByVal transform As PhysicalCoordinates _ ByVal datasource As RTProcessVar ByVal formcontrolarray As ArrayList _ ByVal numcols As Integer _ ByVal numrows As Integer _ ByVal colheads As String _ ByVal rowheads As Strinq _ ByVal attrib As ChartAttribute _ Overloads Public Sub New _ ByVal transform As PhysicalCoordinates ByVal datasource As RTProcessVar ByVal formcontrolarray As ArrayList _ ByVal numcols As Integer _ ByVal numrows As Integer _ ByVal attrib As ChartAttribute Overloads Public Sub New _ ByVal transform As PhysicalCoordinates ByVal datasource As RTProcessVar ByVal formcontrolarray As ArrayList _ ByVal attrib As ChartAttribute _ C public RTFormControlGrid PhysicalCoordinates transform RTProcessVar datasource ArrayList formcontrolarray int numcols int numrows string colheads string rowheads ChartAttribute attrib publ
129. QCRTGraph Real Time Graphics Tools for WPF Wi Window1 Real Time Graphics Tools for WPF 0 5 NI 10 1 10 5 0 Bopyright Quinn Curtis Inc 2008 Contact Information Company Web Site http www quinn curtis com Electronic mail General Information info quinn curtis com Sales sales quinn curtis com Technical Support Forum http www quinn curtis com ForumFrame htm Revision Date 12 29 2013 Rev 2 3 QCRTGraph WPF Documentation and Software Copyright Quinn Curtis Inc 2014 Quinn Curtis Inc Tools for Net END USER LICENSE AGREEMENT IMPORTANT READ CAREFULLY This Software End User License Agreement EULA is a legal agreement between you either an individual or a single entity and Quinn Curtis Inc for the Quinn Curtis Inc SOFTWARE identified above which includes all Quinn Curtis Inc Net software on any media and related documentation on any media By installing copying or otherwise using the SOFTWARE you agree to be bound by the terms of this EULA If you do not agree to the terms of this EULA do not install or use the SOFTWARE If the SOFTWARE was mailed to you return the media envelope UNOPENED along with the rest of the package to the location where you obtained it within 30 days from purchase 1 The SOFTWARE is licensed not sold 2 GRANT OF LICENSE A Developer License After you have purchased the license for SOFTWARE and have received the file containing the licen
130. S STAR LINE HBAR VBAR BAR3D CIRCLE RTPanelMeter The abstract base class for the panel meter types Panel meters based objects can be added to RTSingleValueIndicator and RTMultiValueIndicator objects to enhance the graphics display with numeric alarm and string information The RTNumericPanelMeter RTAlarmPanelMeter RTStringPanelMeter and RTTimePanelMeter classes are described in the preceding section Solar Panel n 140 z SCHNEIDEN nee 100 ER Eu 80 i RA E E L STORIA n 18 45 00 18 46 00 Any number of RTSimpleSingleValuePlot objects can be added to a scrolling graph RTSimpleSingleValuePlot The RTSimpleSingleValuePlot plot class uses a template based on the QCChart2D SimplePlot class to create a real time plot that displays RTProcessVar current and historical real time data in a scrolling line scrolling bar or scrolling scatter plot format Multiple Value Indicators com quinncurtis chart2dwpf ChartPlot 28 Class Architecture RTPlot RTMultiValueIndicator RTMultiValueAnnunciator RTMultiBarIndicator RTGroupMultiValuePlot RTFormControlGrid RTScrollFrame RTVerticalScrollFrame Display objects derived from the RTMultiValueIndicator class are attached to a collection of RTProcessVar objects This includes multi channel bar indicators which includes solid segmented custom and pointer bar indicators multi channel annunciator indicators and scrolling graph plots based on a QCChart2D GroupPlot chart object T
131. ScrollFrame this currentTemperaturel pTransforml ChartObj RT FIXEDEXTENT MOVINGSTART AUTOSCROLL scrollFrame AddProcessVar currentTemperature2 ScrollFrame ScrollScaleModeX ChartObj RT AUTOSCALE X MINMAX Allow 400 samples to accumlate before autoscaling y axis This prevents rapid changes of the y scale for the first few samples scrollFrame MinSamplesForAutoScale 400 scrollFrame ScrollRescaleMargin 0 05 chartVu AddChartObject scrollFrame VB scrollFrame New RTVerticalScrollFrame Me currentTemperaturel pTransforml ChartObj RT FIXEDEXTENT MOVINGSTART AUTOSCROLL ScrollFrame AddProcessVar currentTemperature2 scrollFrame ScrollScaleModeX ChartObj RT AUTOSCALE X MINMAX Allow 400 samples to accumlate before autoscaling y axis This prevents rapid changes of the y scale for the first few samples ScrollFrame MinSamplesForAutoScale 400 ScrollFrame ScrollRescaleMargin 0 05 chartVu AddChartObject scrollFrame Single Channel Scrolling Graphs Class RTSimpleSingleValuePlot com quinncurtis chart2dwpf ChartPlot RTPlot RTSingleValueIndicator RTSimpleSingleValuePlot The RTSimpleSingleValuePlot plot class uses a template based on the QCChart2D SimplePlot class to create a real time plot that displays RTProcessVar current and historical real time data in a scrolling line scrolling bar or scrolling scatter plot format Any plot object derived from the QCChart2D SimplePlot can be plotted as a scrolling
132. ScrollScaleModeX ChartObj RT AUTOSCALE X MINMAX Look at updatecounter number of points which is all of them scrollFramel MaxDisplayHistory updatecounter Render graph based on new scale Change to display of all collected data scrollFrame2 ScrollScaleModeX ChartObj RT AUTOSCALE X MINMAX Look at updatecounter number of points which is all of them ScrollFrame2 MaxDisplayHistory updatecounter Render graph based on new scale Update first to display all historical information then disable to allow for zooming this UpdateDraw scrollFrame2 ChartObjEnable ChartObj OBJECT DISABLE scrollFramel ChartObjEnable ChartObj OBJECT DISABLE Turn on zooming zoomObj SetEnable true private void zoomRestore Button Click object sender System EventArgs e RTControlButton button RTControlButton sender Turn off zooming zoomObj SetEnable false Re establish scroll mode scrollFramel ScrollScaleModeX ChartobJ RT FIXEDEXTENT MOVINGSTART AUTOSCROLL scrollFramel ChartObjEnable ChartObj OBJECT ENABLE Re establish scroll mode ScrollFrame2 ScrollScaleModeX Chart 0b RT FIXEDEXTENT MOVINGSTART AUTOSCROLL Zooming 253 scrollFrame2 ChartObjEnable ChartObj OBJECT ENABLE Render graph this UpdateDraw Visual Basic Dim Datasetl As New SimpleDataset First xl yl Dim Dataset2 As New SimpleDataset Second xl y2 Dim Dataset3 As New SimpleDataset Third x1 y3 Dim Dat
133. SetAxisMinorTicksPerMajor 4 meteraxis ShowAlarms true meterneedle MeterAxis meteraxis chartVu AddChartObject meteraxis ChartFont meterFont font10Bold RTMeterStringAxisLabels meteraxislabels new RTMeterStringAxisLabels meteraxis meteraxislabels SetTextFont meterFont meteraxislabels SetAxisLabelsDir meteraxis GetAxisTickDir String labelstrings E 1 2 F meteraxislabels OverlapLabelMode ChartObj OVERLAP LABEL DRAW 168 Meters Coordinates Meter Axes and Meter Axis Labels meteraxislabels AxisLabelsEnds ChartObj LABEL MAX meteraxislabels SetAxisLabelsStrings labelstrings 3 meteraxislabels LineColor Colors White chartVu AddChartObject meteraxislabels VB Dim attribl As New ChartAttribute Colors Black 1 DashStyles Solid Colors Blue Dim startarcangle As Double 180 Dim arcextent As Double 90 Dim startarcscale As Double 0 0 Dim endarcscale As Double 32 0 8 Dim arcdirection As Boolean False Dim arcradius As Double 0 Dim centerx As Double 0 0 Dim centery As Double 0 0 Dim meterframe As New RTMeterCoordinates startarcangle arcextent _ startarcscale endarcscale arcdirection centerx centery arcradius meterframe SetGraphBorderDiagonal 0 025 0 25 0 175 0 6 Dim meterneedle As New RTMeterNeedleIndicator meterframe fuel meterneedle SetChartObjAttributes attribl meterneedle NeedleLength 0 8 Add panel meters chartVu AddChart
134. So replace the Title line the following lines under the other xmlns namespace tags Title Pagel Height 600 Width 900 xmlns my clr namespace com quinncurtis chart2dwpf assembly QCChart2DWPF3 xmlns my2 clr namespace com quinncurtis rtgraphwpf assembly QCRTGraphWPF3 gt These lines need to be resolved by adding a references to the QCChart2DWPF3 and QCRTGraphWPF3 libraries to the project Right click on Reference in the Solution Explorer window and select Add Reference Browse to the Quinn Curtis DotNet lib subdirectory and select QCChart2DWPF3 DLL and QCRTGraphWPF3 DLL files Using QCRTGraph for WPF to Create Web Applications 355 Add Reference NET COM Projects Browse Recent Look in ib vote Clesen 8 OcChart2DNet dll X QCSPCChartNet dil S QCsPCChartWPF3 dl 8 QCChart3DNet dll 8 QCChart3DVisionAux dll 5 QcMatPackNet dil 5 QcMatViewNet dil 8 QCRTGraphNet dll File name QCRTGraphWPF3 dll QCChart2DWPF3 dll L Files of type Component Files dil tib olb ocx exe manifest a J conce View the Pagel xaml code and add the reference to ChartView object scrollAppl in the Grid layout panel The Pagel xaml file now looks like lt Page x Class WpfRTBrowserApplicationl Pagel xmlns http schemas microsoft com winfx 2006 xaml presentation xmlns x http schemas microsoft com winfx 2006 xaml Title Pagel Height
135. Solid Colors LightBlue ChartAttribute panelmeterattrib new ChartAttribute Colors SteelBlue 3 DashStyles Solid Colors Black RTNumericPanelMeter panelmeterl new RTNumericPanelMeter pTransforml METSCumlative panelmeterattrib panelmeterl NumericTemplate TextFont numericfont v 14 Do Los XD 3 ge i 116 Panel Meter Classes panelmeterl NumericTemplate DecimalPos 0 panelmeterl PanelMeterPosition ChartObj CUSTOM POSITION panelmeterl SetLocation 0 81 0 30 ChartObj NORM GRAPH POS chartVu AddChartObject panelmeterl VB Public Sub InitializeRightPanelMeters Dim numericfont As ChartFont font64Numeric Dim trackbarTitlefont As ChartFont font12Bold Dim pTransforml As New CartesianCoordinates 0 0 0 0 1 0 1 0 pTransforml SetGraphBorderDiagonal 0 0 0 0 1 0 1 0 Dim attribl As New ChartAttribute Colors LightBlue 7 _ DashStyles Solid Colors LightBlue Dim panelmeterattrib As New ChartAttribute Colors SteelBlue 3 _ DashStyles Solid Colors Black Dim panelmeterl As New RTNumericPanelMeter pTransforml _ METSCumlative panelmeterattrib panelmeterl NumericTemplate TextFont numericfont panelmeterl NumericTemplate DecimalPos 0 panelmeterl PanelMeterPosition ChartObj CUSTOM POSITION panelmeterl SetLocation 0 81 0 3 ChartObj NORM GRAPH POS chartVu AddChartObject panelmeterl End Sub InitializeRightPanelMeters Example of RTNumericPanelMeter used with an RTBarIndicator The pane
136. StackEnable True zoomObj InternalZoomStackProcesssing True set range limits to 1000 ms 1 degree zoomObj SetZoomRangeLimitsRatio New Dimension 1 0 1 0 chartVu SetCurrentMouseListener zoomObj Super Zooming of multiple physical coordinate systems The ChartZoom class also supports the zooming of multiple physical coordinate systems super zooming During the mouse released event the zoom rectangle is converted from device units into the physical coordinates of each scale and this information is used to re scale each coordinate system and the axis objects associated with them Use the constructor below in order to super zoom a chart that has multiple coordinate systems and axes ChartZoom constructor Zooming 251 Visual Basic Overloads Public Sub New _ ByVal component As ChartView _ ByVal transforms As PhysicalCoordinates _ ByVal brescale As Boolean C public ChartZoom ChartView component PhysicalCoordinates transforms bool brescale component A reference to the ChartView object that the chart is placed in transforms An array size numtransforms of the PhysicalCoordinates objects associated with the zoom operation brescale True designates that the all of the scales should be re scaled once the final zoom rectangle is ascertained Call the ChartZoom SetEnable true method to enable the zoom object Restrict zooming in the x or y direction using the SetZoomXEnable and SetZ
137. TENT MOVINGSTART AUTOSCROLL rapid lineplotl lineplot2 ChartObj CIRCLE lineplotl ChartObj SQUARE lineplot2 ScrollFrame AddP scrollFrame Scro Allow 100 samp changes of the ScrollFrame MinS scrollFrame Scro chartVu AddChart If scrollMode Dim attribl Dim lineplotl Se Dim solarPan currentTemper chartVu AddC Dim attrib2 Dim lineplot lineplot2 Se Dim solarPan currentTemper chartVu AddC Else attribl lineplot attribl lineplotl Se Dim solarPan currentTemper chartVu AddC Dim Dim Dim attribz Dim lineplot attrib2 lineplot2 Se Dim solarPan currentTemper chartVu AddC lineplotl rocessVar currentTemperature2 11ScaleModeY ChartObj RT AUTOSCALE Y MINMAX les to accumlate before autoscaling y axis This prevents y scale for the first few samples amplesForAutoScale 100 llRescaleMargin 0 05 Object scrollFrame 0 Then As New ChartAttribute Colors Yellow 3 As New SimpleLinePlot pTransforml Nothing tFastClipMode ChartObj FASTCLIP X elLinePlotl As New RTSimpleSingleValuePlot pTransforml aturel hartObject solarPanelLinePlotl DashStyles Solid attribi As New ChartAttribute Colors Green 3 2 As New SimpleLinePlot pTransforml1 Nothing tFastClipMode ChartObj FASTCLIP X elLinePlot2 As New RTSimpleSingleValuePlot pTransforml ature2 hartObject solarPanelLinePlot2 DashStyles Solid attribz As New ChartAttribute
138. TMeterCoordinates _ ByVal datasource As RTProcessVar ByVal needlelength As Double _ ByVal needleoverhang As Double ByVal needlewidth As Double ByVal attrib As ChartAttribute Overloads Public Sub New _ ByVal frame As RTMeterCoordinates ByVal datasource As RTProcessVar _ C public RTMeterNeedleIndicator RTMeterCoordinates frame RIProcessVar datasource double needlelength double needleoverhang double needlewidth ChartAttribute attrib public RTMeterNeedleIndicator RTMeterCoordinates frame RTProcessVar datasource Parameters frame The RTMeterCoordinates object defining the meter coordinate system datasource The process variable associated with the meter indicator needlelength Specifies length of the needle in normalized plot coordinates needleoverhang Specifies the overhang of the back end of the needle indicator specified in needle radius normalized coordinates needlewidth Meter Indicators Needle Arc and Symbol 178 The color attributes of the meter indicator attrib The color attributes of the meter indicator Selected Public Instance Properties IndicatorSubtype inherited from RTMeterIndicator NeedleBaseWidth NeedleHeadLengthMultiplier NeedleHeadWidthMultiplier NeedleLength NeedleOverhang PieWedgeDegrees PivotColor PivotDrawFlag PivotRadius Set Get the meter indicator subtype Use one of the meter needle indicator subtype co
139. TON SUBTYPE Private StartControl As New RTControlButton ChartObj RT CONTROL TOGGLEBUTTON SUBTYPE Public Sub InitializeStartStopButtons Dim attribl As New ChartAttribute Colors Black 3 DashStyles Solid Colors Coral Dim buttonfont As ChartFont font9Bold Dim buttonlist As New ArrayList StartControl ButtonUncheckedText Start StartControl ButtonCheckedText Stop AddHandler StartControl Click New System Windows RoutedEventHandler AddressOf Me controlOn Button Click 222 Buttons Track Bars and Other Form Control Classes StartControl ButtonFont buttonfont StartControl ButtonChecked False buttonlist Add StartControl ResetErrorTerm ButtonUncheckedText Reset Error AddHandler ResetErrorTerm Click New System Windows RoutedEventHandler AddressOf Me resetErrorTerm Button Click ResetErrorTerm ButtonFont buttonfont ResetErrorTerm ButtonChecked False buttonlist Add ResetErrorTerm ResetAll ButtonUncheckedText Reset All AddHandler ResetAll Click New System Windows RoutedEventHandler AddressOf resetAll Button Click ResetAll ButtonFont buttonfont ResetAll ButtonChecked False buttonlist Add ResetAll Dim numColumns As Integer 3 Dim numRows As Integer 1 Dim pTransforml As New CartesianCoordinates 0 0 0 0 1 0 1 0 pTransforml SetGraphBorderDiagonal 0 73 0 94 0 99 0 99 Dim controlgrid As New RTFormControlGrid pTransforml Nothing buttonlist numColumns numRows attribl
140. UND shStyles Solid shStyles Solid shStyles Solid shStyles Solid 2 attrib attrib4l orml processVarArray processVarl processVar2 processVar3 processVar4 Dim pTransforml As New CartesianCoordinates 0 0 0 0 pTransforml SetGraphBorderDiagonal 0 175 0 005 0 45 Dim background As New Background pTransforml ChartObj Colors Gray chartVu AddChartObject background Dim attribl As New ChartAttribute Colors Bisque 5 Da Colors Bisque Dim attrib2 As New ChartAttribute Colors Bisque 5 Da Colors Bisque Dim attrib3 As New ChartAttribute Colors Bisque 5 Da lors Bisque Dim attrib4 As New ChartAttribute Colors Bisque 5 Da Colors Bisque Dim attribArray As ChartAttribute attribl attrib Dim numrows As Integer 2 Dim numcols As Integer 2 Dim annunciator As New RTMultiValueAnnunciator pTransf numcols numrows attribArray Dim panelmeterattrib As New ChartAttribute Colors Stee DashStyles Solid Colors Black Dim panelmeter As New RTNumericPanelMeter pTransforml panelmeterattrib panelmeter PanelMeterPosition ChartObj CENTERED BAR panelmeter NumericTemplate TextFont FontArchive font panelmeter NumericTemplate PostfixString ChrW 176 annunciator AddPanelMeter panelmeter Dim panelmeter2 As New RTAlarmPanelMeter pTransforml panelmeterattrib panelmeter2 PanelMeterPosition ChartObj BELOW REFERE panelmeter2 AlarmTemplate TextFont FontArchive fontl panelmeter2 SetPositionRefe
141. Value ChartObj MINUTE 45 Dim minZoomYRange As Double 0 01 Dim zoomLimits As Dimension New Dimension minZoomTimeRange minZoomYRange zoomObj SetZoomRangeLimits zoomLimits 17 Miscellaneous Shape Drawing RT3DFrame RTRoundedRectangle2D RTGenShape Often the look and feel of a real time display is greatly enhanced with the addition of a few simple circular and rectangular drawing shapes All of the example programs use these shapes either directly or indirectly as the 3D border element of the RTPanelMeter class The chapter discusses how to explicitly add these objects to your program 3D Borders and Background Frames Class RT3DFrame com quinncurtis chart2dwpf GraphObj RT3DFrame This class is used to draw 3D borders and provide the background for many of the other graph objects most noticeably the RTPanelMeter classes It can also be used directly in your program to provide 3D frames the visually group objects together in a faceplate format RT3DFrame constructors Visual Basic Overloads Public Sub New _ ByVal transform As PhysicalCoordinates ByVal rect As Rectangle2D _ ByVal attrib As ChartAttribute ByVal postype As Integer _ C public RT3DFrame PhysicalCoordinates transform Rectangle2D rect ChartAttribute attrib int postype ey Parameters transform Places the RT3DFrame object in the coordinate system defined by transform rect Specifies the position and size of the frame attrib
142. Varl SetModuloItem 1 100 Private Sub Ini tializeDiall Dim startarcangle As Double 90 Dim arcexten t As Double 360 Dim startarcscale As Double 0 0 Dim endarcscale As Double 100 0 Dim arcdirec tion As Boolean False Dim arcradius As Double 0 9 Dim centerx As Double 0 0 Dim centery As Double 0 0 Dim meterFon t As ChartFont FontArchive font12 Dim meterframe As New RTMeterCoordinates startarcangle arcextent startarcscale endarcscale arcdirection centerx centery arcradius meterframe SetGraphBorderDiagonal 0 0 0 0 0 25 0 45 Dim gbackground As New Background meterframe ChartObj GRAPH BACKGROUND Colors White chartVu AddChartObject gbackground Dim frameattrib As New ChartAttribute Colors Black 3 DashStyles Solid Colors Blue Dim needleattribl As New ChartAttribute Colors Black 1 DashStyles Solid Colors Blue Dim meterneedlel As New RTMeterNeedleIndicator meterframe bigProcessVarArray 0 meterneedlel NeedleBaseWidth 5 meterneedlel SetChartObjAttributes needleattribl meterneedlel NeedleLength 0 55 chartVu AddChartObject meterneedlel Dim needleattrib2 As New ChartAttribute Colors Black 1 DashStyles Solid Colors Blue Dim meterneedle2 As New RTMeterNeedleIndicator meterframe bigProcessVarArray 1 meterneedle2 NeedleBaseWidth 3 meterneedle2 SetChartObj Attributes needleattrib2 meterneedle2 NeedleLength 0 35 chartVu AddChartObj
143. Visual Basic Overloads Public Sub New _ ByVal transform As PhysicalCoordinates _ ByVal datasource As RTProcessVar ByVal barwidth As Double _ ByVal barspacing As Double _ ByVal barbase As Double _ ByVal attribs As ChartAttribute ByVal barjust As Integer ByVal barorient As Integer _ C public RTMultiBarIndicator PhysicalCoordinates transform RTProcessVar datasource double barwidth double barspacing double barbase ChartAttribute attribs int barjust int barorient Parameters transform Multiple Channel Bar Indicator 143 The coordinate system for the new RTMultiBarIndicator object datasource An array of the process variables associated with the bar indicator barwidth The width of each bar in physical units barspacing The space between adjacent bars in physical units barbase The base of the bar in physical units attribs An array of the color attributes of the bar indicator barjust The justification of bars Use one of the bar justification constants JUSTIFY MIN JUSTIFY CENTER JUSTIFY MAX barorient The orientation of the bar indicator HORIZ DIR or VERT DIR Selected Public Instance Properties AlarmIndicatorColorMode inherited from RTSingleValueIndicator BarDatapointLabelPosition inherited from ChartPlot BarJust inherited from ChartPlot BarOffset BarOrient inherited from ChartPlot Get Set whether the color of the indi
144. a ASP NET Web Application 2 ASP NET Web Service Application Reporting i WPF Application Pai WPF Browser Application WCF GM console Application Ea wer Service Application Workflow E Windows Forms Control Library gi Dynamic Data Entities Web Application E Other Languages 1 Dynamic Data Web Application E Visual Basic Windows My Templates Web poc o DocProject EDocproject e DocSite Web Application Reporting Ls sl Search Online Templates E WCF Workflow 1 Vierial C w Windows Presentation Foundation browser application NET Framework 3 5 Name WpfBrowserApplication1 Location E Quinn Curtis WPF Development DotNet QCRTGraph Visual CSharp examples wpf Solution Create new Solution v Create directory for solution Solution Name WpfBrowserApplicationi 354 Using OCRTGraph for WPF to Create Web Applications The XAML of Pagel looks like lt Page x Class WpfBrowserApplicationl Pagel xmlns http schemas microsoft com winfx 2006 xaml presentation xmlns x http schemas microsoft com winfx 2006 xaml Title Pagel gt lt Grid gt lt Grid gt lt Page gt The window does not yet have any content First define a default size for the window and add references to the QCChart2D and QCRTGraph namespaces In this case the namespaces are com quinncurtis chart2dwpf and com quinncurtis rtgraphwpf and are located in the assemblies DLL with the names QCChart2DWPF3 and QCRTGraphWPF3
145. a simple multi channel annunciator The example below extracted from the AutoInstrumentPanel example method InitializeAnnunciator creates a multi channel annunciator that shows only the tag name of the associated RTProcessVar object Battery Coolant E Brakes Engine Doors Electric C private void InitializeAnnunciator CartesianCoordinates pTransforml new CartesianCoordinates 0 0 0 0 1 0 1 0 pTransforml SetGraphBorderDiagonal 0 05 0 1 0 725 0 175 ChartAttribute attrib ChartAttribute attribArray new ChartAttribute annunciatorl Length for int i 0 i lt annunciatorl Length i attrib new ChartAttribute Colors DarkRed 3 Single and Multiple Channel Annunciators 197 DashStyles Solid Colors DarkRed attribArray i attrib int numrows 1 int numcols 8 RTMultiValueAnnunciator annunciator new RTMultiValueAnnunciator pTransforml annunciatorl numcols numrows attribArray annunciator CellColumnMargin 0 05 annunciator CellRowMargin 0 1 ChartAttribute panelmetertagattrib new ChartAttribute Colors SteelBlue 3 DashStyles Solid Colors White RTStringPanelMeter panelmeter new RTStringPanelMeter pTransforml annunciator1 0 panelmetertagattrib ChartObj RT TAG STRING panelmeter StringTemplate TextFont font10Bold panelmeter PanelMeterPosition ChartObj INSIDE BAR panelmeter Frame3DEnable false T S panelmeter TextColor Colors White panelmeter StringT
146. a values next to the associated data point Set Get the plot objects step mode Use one of the line plot step constants NO STEP STEP START STEP END or STEP NO RISE LINE Sets the z order of the object in the chart Every object has a z order value Each z order value does NOT have to be unique If z order sorting is turned on in the ChartView object objects are sorted by z order before they are drawn Single Channel Bar Indicator 135 A complete listing of RTBarIndicator properties is found in the QCRTGraphWPFCompiledHelpFile chm documentation file located in the doc subdirectory Example for an RTBarIndicator Segmented Bar Indicator The bar indicator example below extracted from the Dynamometer example method InitializeEngine1 RPMIndicator creates the segmented bar RPM indicator in the upper left corner of the graph It demonstrates how the plot area is defined for the bar indicator how to create axes and axis labels An RTAlarmIndicator is also created to display the alarm limit symbols to the right of the bar indicator The image below also includes an RTStringPanelMeter for the RPM tag an RTNumericPanelMeter for the numeric readout below the bar indicator and an RTAlarmPanelMeter below that See the Dynamometer example program for the complete program listing that creates all of these objects C CartesianCoordinates pTransforml new CartesianCoordinates 0 0 0 0 1 0 5000 0 plransforml SetGraphBorderDia
147. able true metersymbolindicator SymbolSize 12 metersymbolindicator SymbolPosPercent 0 9 Add panel meters chartVu AddChartObject metersymbolindicator VB Dim metersymbolindicator As New RTMeterSymbolIndicator meterframe processVar2 metersymbolindicator SetChartObjAttributes attribl metersymbolindicator IndicatorSubtype ChartObj RT METER SYMBOL ARC SUBTYPE metersymbolindicator SymbolSpacing 10 metersymbolindicator SymbolNum ChartObj SQUARE metersymbolindicator IndicatorBackgroundEnable True metersymbolindicator SymbolSize 12 metersymbolindicator SymbolPosPercent 0 9 Add panel meters charto Addchareibjeceimeters bol indicator The bottom meter indicator extracted from the example program RTGraphNetDemo file SymbolMeterUserControl1 cs method InitializeMeter3 C RTMeterSymbolIndicator metersymbolindicator new RTMeterSymbolIndicator meterframe processVar2 metersymbolindicator SetChartObjAttributes attrib1l Meter Indicators Needle Arc and Symbol 184 metersymbolindicator IndicatorSubtype ChartObj RT METER SYMBOL ARC SUBTYPE metersymbolindicator SymbolSpacing 10 metersymbolindicator SymbolNum ChartObj CIRCLE metersymbolindicator IndicatorBackgroundEnable true metersymbolindicator SymbolSize 12 metersymbolindicator SymbolPosPercent 0 9 Add panel meters chartVu AddChartObject metersymbolindicator VB Dim metersymbolindicat
148. ackbar new RTControlTrackBar 0 0 15 0 0 1 1 0 1 runnersPaceTrackbar Orientation Orientation Vertical runnersPaceTrackbar RTValue 3 MUST USE RTValue to set double value RTFormControlPanelMeter formControlTrackBarl new RTFormControlPanelMeter pTransforml runnersPaceTrackbar attribl formControlTrackBarl RTDataSource runnersPace formControlTrackBarl PanelMeterPosition ChartObj CUSTOM POSITION formControlTrackBarl SetLocation 0 0 0 ChartObj PHYS POS formControlTrackBarl FormControlSize new Dimension 1 0 1 0 130 Panel Meter Classes chartVu AddChartObject formControlTrackBarl VB Dim trackbarfont As ChartFont font64Numeric Dim trackbarTitlefont As ChartFont font12Bold Dim pTransforml As New CartesianCoordinates 0 0 0 0 1 0 1 0 pTransforml SetGraphBorderDiagonal 0 01 0 12 0 06 0 3 Dim attribl As New ChartAttribute Colors LightBlue 7 DashStyles Solid Colors LightBlue runnersPaceTrackbar New RTControlTrackBar 0 0 15 0 0 1 1 0 1 runnersPaceTrackbar Orientation Orientation Vertical runnersPaceTrackbar RTValue 3 MUST USE RTValue to set double value Dim formControlTrackBarl As New RTFormControlPanelMeter pTransforml runnersPaceTrackbar attribl formControlTrackBarl RTDataSource runnersPace formControlTrackBarl PanelMeterPosition ChartObj CUSTOM POSITION formControlTrackBarl SetLocation 0 0 0 ChartObj PHYS POS formControlTrackBarl FormControlSize New Dimension 1 0 1
149. acted from the example program RTGraphNetDemo file ArcMeterUserControll method InitializeMeter1 C RTMeterArcIndicator meterarcindicator new RTMeterArcIndicator meterframe processVarl meterarcindicator SetChartObjAttributes attribl meterarcindicator IndicatorSubtype ChartObj RT METER ARC BAND SUBTYPE meterarcindicator InnerValueArcNormalized 0 65 meterarcindicator OuterValueArcNormalized 0 85 meterarcindicator IndicatorBackgroundEnable true meterarcindicator IndicatorBackground new ChartAttribute Colors Black 2 DashStyles Solid Color FromRgb 60 60 60 Add panel meters chartVu AddChartObject meterarcindicator VB Dim meterarcindicator As New RTMeterArcIndicator meterframe processVarl Meter Indicators Needle Arc and Symbol 174 meterarcindicator SetChartObjAttributes attribl meterarcindicator IndicatorSubtype ChartObj RT METER ARC BAND SUBTYPE meterarcindicator InnerValueArcNormalized 0 65 meterarcindicator OuterValueArcNormalized 0 85 meterarcindicator IndicatorBackgroundEnable True meterarcindicator IndicatorBackground New ChartAttribute Colors Black 2 DashStyles Solid Color FromRgb 60 60 60 Add panel meters chartVu AddChartObject meterarcindicator Extracted from the example program RTGraphNetDemo file ArcMeterUserControll method InitializeMeter3 C RTMeterArcIndicator meterarcindicator new RTMeterArcIndicator meterframe p
150. age file Miscellaneous Utility Classes ChartCalendar CSV Dimension Point2D GroupPoint2D DoubleArray DoubleArray2D BoolArray Point3D NearestPointData TickMark Polysurface 90 QCChart2D Class Summary Rectangle2D ChartCalendar CSV Dimension Point2D GroupPoint2D DoubleArray DoubleArray2D BoolArray Point3D NearestPointData TickMark Polysurface This class contains utility routines used to process ChartCalendar date objects This is a utility class for reading and writing CSV Comma Separated Values files This is a utility class for handling dimension height and width information using doubles rather than the integers used by the Size class This class encapsulates an xy pair of values as doubles more useful in this software than the Net Point and PointF classes This class encapsulates an x value and an array of y values representing the x and y values of one column of a group data set This class is used as an alternative to the standard Net Array class adding routines for resizing of the array and the insertion and deletion of double based data elements This class is used as an alternative to the standard Net 2D Array class adding routines for resizing of the array and the insertion and deletion of double based data elements This class is used as an alternative to the standard Net Array class adding routines for resizing of the array and the insertion and deletio
151. al attribs As CHARTATTRIBUTE ByVal barjust As Integer ByVal barorient As Integer MyBase New transform datasource barwidth barspacing barbase attribs barjust barorient End Sub New Public Overrides Function GetCustomBarOffset ByVal v As Double As Double d This centers the bar segments Dim offset As Double Me BarWidth 2 GetCustomBarWidth v 2 Return offset End Function GetCustomBarOffset Public Overrides Function GetCustomBarWidth ByVal v As Double As Double Dim width As Double 0 5 width 0 01 v 100 v 100 Me BarWidth Return width End Function GetCustomBarWidth End Class CustomRTMultiBarIndicator Private Sub InitializeBar3 Dim processVarArray As RTProcessVar _ processVarl processVar2 processVar3 processVar4 Dim pTransforml As New CartesianCoordinates 0 0 0 0 1 0 100 0 pTransforml SetGraphBorderDiagonal 0 05 0 475 0 5 0 65 Dim background As New Background pTransforml ChartObj PLOT BACKGROUND Colors White chartVu AddChartObject background Dim attribl As New ChartAttribute Colors Green 1 DashStyles Solid Colors BlanchedAlmond Dim attrib2 As New ChartAttribute Colors Green 1 DashStyles Solid Colors Aquamarine Dim attrib3 As New ChartAttribute Colors Green 1 DashStyles Solid Colors DarkSalmon Dim attrib4 As New ChartAttribute Colors Green 1 Dash8tyles 8olid Colors Moccasin Dim attribArray As ChartAttribute attribl attrib2 attr
152. al datasource As RTProcessVar _ ByVal attrib As ChartAttribute Panel Meter Classes 121 C public RTStringPanelMeter PhysicalCoordinates transform RTProcessVar datasource ChartAttribute attrib int stringtype public RTStringPanelMeter PhysicalCoordinates transform ChartAttribute attrib int stringtype public RTStringPanelMeter PhysicalCoordinates transform RTProcessVar datasource ChartAttribute attrib Parameters transform The coordinate system for the new RTStringPanelMeter object datasource The process variable associated with the panel meter attrib The color attributes of the panel meter indicator stringtype Specifies what string to display whether it is one of the process variable strings or a custom string Use one of the Panel Meter string constants RT CUSTOM STRING RT TAG STRING RT UNITS STRING Specify a custom string and use the StringTemplate TextString property to set the string Selected Public Instance Properties Get Set the string template defining the panel meter string format The text properties associated with the panel meter are set using this property A complete listing of RTStringPanelMeter properties is found in the QCRTGraphWPFCompiledHelpFile chm documentation file located in the doc subdirectory Example for RTStringPanelMeter used with RTMultiBarIndicator The panel meter below extracted from the HybridCar example method InitializeMotorV
153. alControl 15 As RTProcessVar Private DerivativeControl 15 As RTProcessVar Private ControlSetpoints 15 As RTProcessVar Private ControlTrackBarOutputs 15 As RTProcessVar Private ControlOutputs 15 As RTProcessVar Private PIDControlLoops 15 As RTPIDControl OO Dim i As Integer For i 0 To numChannels 1 Note derivative value is saled down by 100x PIDControlLoops i New RTPIDControl ControlSetpoints i CurrentValue pidSteadyState ProportionalControl i CurrentValue IntegralControl i CurrentValue _ DerivativeControl i CurrentValue 100 0 sampleper 60 0 filterConstant Next i Sub CalculatePIDValues Dim rMeas As Double 0 0 Dim rSetpoint As Double 0 0 Dim rOutput As Double 0 0 Dim i As Integer For i 0 To 15 Not calculating the PID value will prevent integral errors from continuing _ to be added to error sum simulate measurement rOutput ControlOutputs i CurrentValue rMeas ProcessModel i rOutput PIDProcessItems i SetCurrentValue rMeas If autoModeEnable i Then rSetpoint ControlSetpoints i CurrentValue rOutput PIDControlLoops i RTCalcPID rMeas rSetpoint ControlOutputs i SetCurrentValue rOutput End If Next i Moving Objects and Data Points 245 outputControlTrackBar RTValue _ controlOutputs currentTuningChannel CurrentValue End Sub CalculatePIDValues 16 Zooming Real Time Data ChartZoom Zooming is the interactive re scaling of a charts physical co
154. alScroll VScroll is visible Inherited from ScrollableControl VScrollBarl Inherited from DataGridBase Gets or sets the width of the control Width Inherited from Control Simple RTProcessVarViewer example extracted from the example program ProcessVarDataTables ScrollApplicationUserControll cs Window x Class ProcessVarDataTables Window1 xmlns http schemas microsoft com winfx 2006 xaml presentation xmlns x http schemas microsoft com winfx 2006 xaml Title Window1 Height 600 Width 1000 xmlns my clr namespace com quinncurtis chart2dwpf assembly QCChart2DWPF3 xmlns my2 clr namespace com quinncurtis rtgraphwpf assembly QCRTGraphWPF3 Grid Name grid1 gt TabControl Margin 4 7 8 13 Name tabControl1 gt lt TabItem Header Vertical RTProcessVarDataTable Name tabItem1 gt lt Grid gt lt Grid ColumnDefinitions gt lt ColumnDefinition Width 40 gt lt ColumnDefinition Width 15 gt lt Grid ColumnDefinitions gt lt my ChartView Margin 18 11 16 6 Name elapsedTimeVerticalScrollingApp1 Grid Column 0 gt lt my2 RTProcessVarViewer Margin 18 11 16 6 Name rtProcessVarViewerApp1 Grid Column 1 gt lt Grid gt lt TabItem gt lt TabItem Header Horizontal RTProcessVarDataTable Name tabItem2 gt lt Grid gt lt Grid RowDefinitions gt lt RowDefinition Height 40 gt lt RowDefinition Height 15 gt lt Grid RowDefinitions gt Process Variable Viewer 269 lt
155. alScrollGraphl UpdateScrollGraph count currentValues True End Sub 20 Using Real Time Graphics Tools for WPF to Create Windows Applications Critical Note Running the Example Programs The example programs for QCRTGraph Tools for WPF software are supplied in complete source In order to save space they have not been pre compiled which means that many of the intermediate object files needed to view the main form are not present This means that the charts will not be visible on the main Window if you attempt to view the main form before the project has been compiled The default state for all of the example projects should be the Start Page Before you do view any other file or form do a build of the project This will cause the intermediate files to be built If you attempt to view the main Form before building the project Visual Studio sometimes decides that the control placed on the main form does not exist and deletes it from the project The primary view class of the QCRTGraph library is the ChartView class The ChartView class derives from the Net System Windows Controls UserControl class It has the properties and methods of the underlying UserControl class Follow the following steps in order to incorporate the QCRTGraph classes into your program This is not the only way to add charts to an application In general any technique that works with UserControl derived classes will work We found the technique described below t
156. ale This circular axis represents 360 degrees of the antenna scale and the tick marks that circle this axis are spaced at equal degree intervals Axis Label Classes AxisLabels NumericAxisLabels StringAxisLabels PolarAxesLabels AntennaAxesLabels QCChart2D Class Summary 67 TimeAxisLabels ElapsedTimeAxisLabels Axis labels inform the user of the x and y scales used in the chart The labels center on the major tick marks of the associated axis Axis labels are usually numbers times dates or arbitrary strings Axis Labels Possible date labels Possible time labels Possible numeric labels for todays date for the current time for the value 12340 July 19 2002 15 15 11 24 Hour Mode 12340 0 Decimal 2002 15 15 24 Hour Mode 1 2340E4 Scientific 7 2002 15 11 Minute Second 12 340K Business 7 19 2002 3 15 11 12 Hour Mode 1234000 Percent 19 07 2002 3 15 12 Hour Mode 1 23401 04 Exponent 02 o 12340 Currency 7102 Se Ce 719 02 19 07 02 ue Multi line and rotated 0 360 degrees July ge axis labels are supported Jul S J 4 Friday Western Eastern Southern Northern Sales Sales Sales Sales Region Region Region Region Fri F In addition to the predefined formats programmers can define custom time date and numeric formats AxisLabels This class is the abstract base class for all axis label objects It places numeric labels date time labels or arbitrary text labels at the major tick marks of the associa
157. ale operation is carried out This prevents the first datapoints from generating an arbitrarily small range Get Set the scroll rescale margin When the limits of the scale needs to be increased the ScrollRescaleMargin current range of the x axis is added to the upper and lower limits of the current scale Get Set the scrolling mode for the x coordinate Use one of the x axis scroll frame constants RT NO AUTOSCALE X RT AUTOSCALE X CURRENT SCALE RT AUTOSCALE X MIN RT AUTOSCALE X MAX RT AUTOSCALE X MINMAX RT FIXEDEXTENT MOVINGSTART AUTOSCROLL RT MAXEXTENT FIXEDSTART AUTOSCROLL RT FIXEDNUMPOINT AUTOSCROLL Get Set the scrolling mode for the y coordinate Use one of the y axis scroll frame constants RT NO AUTOSCALE Y RT AUTOSCALE Y MIN RT AUTOSCALE Y MAX RT AUTOSCALE Y MINMAX Get Set the time stamp mode for the time values in the process variables Use one of the time stamp mode constants RT NOT MONOTONIC X MODE not monotonic means that the x values do not have to increase with increasing time A real time xy plot that plots x values against y values might have this characteristic RT MONOTONIC X MODE The default value Monotonic means that the x values always increase with increasing time If the scroll frame routines know that the x values will never backtrack it speeds up the search algorithm for minimum and maximum x values to use in auto scaling the x axis A complete listing of RTScrollFrame prope
158. alue RateValue 60 0 runnersPaceValue 10 0 treadmillElevationValue 3 0 tRate SetCurrentValue heartRateValue efaultattrib As New ChartAttribute Colors Green 1 0 DashStyles Solid s Green owheartratealarm As New RTAlarm ChartObj RT ALARM LOWERTHAN 30 artratealarm AlarmMessage Low Heart Rate artratealarm AlarmSymbolColor Colors Blue artratealarm AlarmTextColor Colors Blue ighheartratealarm As New RTAlarm ChartObj RT ALARM GREATERTHAN 160 eartratealarm AlarmMessage High Heart Rate eartratealarm AlarmSymbolColor Colors Red eartratealarm AlarmTextColor Colors Red Rate New RTProcessVar Heart Rate defaultattrib Rate MinimumValue 0 Rate MaximumValue 300 Rate DefaultMinimumDisplayValue Rate DefaultMaximumDisplayValue Rate AddAlarm lowheartratealarm Rate AddAlarm highheartratealarm Rate AlarmTransitionEventEnable True ndler heartRate AlarmTransitionEventHandler AddressOf Me heartRate HighAlarm Rate SetCurrentValue heartRateValue I C 200 RateValue 60 0 runnersPaceValue 10 0 treadmillElevationValue 3 0 Rate SetCurrentValue heartRateValue 104 Process Variable and Alarm Classes Real Time Alarms Event Handling Class RTAlarmEventArgs ChartObj RTAlarmEventArgs The RTProcessVar class can throw an alarm event based on either the current alarm state or an alarm transition from one alarm state to another The RTAlarmEventArgs class i
159. aluePlot RTGroupMultiValuePlot RTAlarmSymbol alarm symbols legend title subhead footer and units strings The RTAutoScrollGraph support horizontal scrolling only Use the RTAutoVerticalScrollGraph for a vertical scrolling version There are three types of scrolling x scales you can use in a scrolling chart a date time scale an elapsed time scale or a numeric scale Use the appropriate InitRTAutoScroll overload to select which one is most applicable to your data RTAutoScrollGraph constructors Since the RTAutoScrollGraph is designed to be dropped on a form only a default constructor is used The indicator is customized using public properties Visual Basic Overloads Public Sub New C public RTAutoScrollGraph A couple of methods are used to initialize the scroll graph after instantiation InitRTAutoScrollGraph and InitStrings The InitRTAutoScrollGraph method initializes the the x and y scales of the scrolling graph 314 Auto Indicator Classes Method InitRTAutoScrollGraph VB Initialize x scale to a Date Time scale using ChartCalendar objects linear y scale Public Sub InitRTAutoScrollGraph _ minx As ChartCalendar _ miny As Double _ maxx As ChartCalendar _ maxy As Double Initialize x scale to a Date Time scale using DateTime objects linear y scale Public Sub InitRTAutoScrollGraph _ minx As DateTime _ miny As Double _ maxx As DateTime _ maxy As Double Initialize x scale to a linea
160. and scroll bar value changed events processed to update colors of buttons and numeric values of scroll bars NumberColumns Get the number of rows in the annunciator Get the number of rows in the annunciator NumChannels inherited from RTPlot Get the number of channels in the indicator RTPlot GraphObj RadioButtonChecked Get Set the extra space between columns of the grid specified in normalized NORM PLOT POS coordinates RowHeaders Leet the row headers RTDataSource inherited from Get Set the array list holding the RTProcessVar RTMultiValueIndicator variables for the indicator A complete listing of RTFormControlGrid properties is found in the QCRTGraphWPFCompiledHelpFile chm documentation file located in the doc subdirectory Buttons Track Bars and Other Form Control Classes 235 Example for RTFormControlGrid encapsulation RTControlButton objects The example below extracted from the MiniScope example creates an RTFormControlGrid using a collection of RTControlButtons C ArrayList rangeSelectorButtons new ArrayList public void InitializeRangeSelectorButtons String selectorStrings l9 100 IK LOK BAR 1007 IK LOK 10u IODu nim l0m MOST Ae TON 100 POI PL ID 100 ey MEM Ls TEUD 7 Oe NIV IDM TON s String rowStrings Frequency Ohms Capacitance DC Volts AC Volts DO Amps AC Amps String colStrings Ct SEN RTC
161. and third are RTSimpleSingleValuePlot and RTGroupMultiValuePlot classes that encapsulate the actual line plot bar plot scatter plot or group plot that is plotted in the scrolling graph The RTScrollFrame class and the RTSimpleSingleValuePlot classes are described in this chapter and the RTGroupMultiValuePlot class is described in the next The original RTScrollFrame manges scrolling of numeric time date and elapsed time coordinate systems in the horizontal direction Starting with Revision 2 0 a new scroll frame has been added RTVerticalScrollFrame which manages scrolling in the vertical direction Scroll Frame Class RTScrollFrame com quinncurtis chart2dwpf ChartPlot RTPlot RTMultiValueIndicator RTScrollFrame The scrolling algorithm used in this software is different that in earlier Quinn Curtis real time graphics products Scrolling plots are no longer updated incrementally whenever the underlying data is updated Instead the underlying RTProcessVar data objects are updated as fast as you want Scrolling graphs all graphs for that matter are only updated with the ChartView UpdateDraw method is called What makes scrolling graphs appear to scroll is the scroll frame RTScrollFrame When a scroll frame is updated as a result of the ChartView UpdateDraw event it analyzes the RTSimpleSingleValuePlot and RTGroupMultiValuePlot objects that have been attached to it and creates a coordinate system that matches the current and historica
162. annunciator resides in coordinate system scaled for physical coordinates of 0 0 0 0 1 0 1 0 The annunciator rectangle size and position is defined using the RTAnnunciator AnnunciatorRect property The default annunciator consists of a simple rectangle that changes color in response to the alarm state of the RTProcessVar object attached to the annunciator The annunciator can be customized with tag names numeric readouts and alarm messages by adding RTPanelMeter objects to the RTAnnunciator object See the examples below Public Instance Properties AnnunciatorRect Get Set the annunciator rectangle A complete listing of RTAnnuciator properties is found in the QCRTGraphWPFCompiledHelpFile chm documentation file located in the doc subdirectory Example for single channel annunciator The example below extracted from the RTGraphNetDemo example file AnnunciatorUserControll method InitializeAnnunciator1 creates a single channel annunciator with a tag name numeric readout and alarm C private void InitializeAnnunciatorl CartesianCoordinates pTransforml new CartesianCoordinates 0 0 0 0 1 0 1 0 pTransforml SetGraphBorderDiagonal 0 01 05 0 15 0 35 Background background new Background pTransforml ChartObj PLOT BACKGROUND Colors Gray chartVu AddChartObject background Rectangle2D annunrect new Rectangle2D 0 05 0 05 0 9 0 9 194 Single and Multiple Channel Annunciators ChartAttr
163. ansforml lineplotl currentTemperaturel chartVu AddChartObject solarPanelLinePlotl ChartAttribute attrib2 new ChartAttribute Colors Green 2 DashStyles Solid SimpleLinePlot lineplot2 new SimpleLinePlot pTransforml null attrib2 lineplot2 SetFastClipMode ChartObj FASTCLIP X RTSimpleSingleValuePlot solarPanelLinePlot2 new RTSimpleSingleValuePlot pTransforml lineplot2 currentTemperature2 chartVu AddChartObject solarPanelLinePlot2 else ChartAttribute attribl new ChartAttribute Colors Yellow 1 DashStyles Solid SimpleScatterPlot lineplotl new SimpleScatterPlot pTransforml null ChartObj CIRCLE attrib l lineplotl SetFastClipMode ChartObj FASTCLIP X RTSimpleSingleValuePlot solarPanelLinePlotl new RTSimpleSingleValuePlot pTransforml lineplotl currentTemperaturel chartVu AddChartObject solarPanelLinePlotl ChartAttribute attrib2 new ChartAttribute Colors Green 1 DashStyles Solid SimpleScatterPlot lineplot2 new SimpleScatterPlot pTransforml null ChartObj SQUARE attrib2 lineplot2 SetFastClipMode ChartObj FASTCLIP X RTSimpleSingleValuePlot solarPanelLinePlot2 new RTSimpleSingleValuePlot pTransforml lineplot2 currentTemperature2 chartVu AddChartObject solarPanelLinePlot2 ChartFont titlefont font14 ChartTitle charttitle new ChartTitle pTransforml titlefont Scroll Application 41 ChartObj CHART HEADER ChartObj CENTER PLOT chartVu AddCha
164. aphWPFCompiledHelpFile chm documentation file located in the doc subdirectory The RTAutoVerticalScrollGraph class supports a date time elapsed time and numeric time horizontal x axis scale The y axis scale is linear or logarithmic The title and subhead shows above above the chart the legend and footer below Example for initializing RTAutoVerticalScrollGraph objects The example below extracted from the AutoGraphDemos SimpleAutoScrollUserControll example draws horizontal and vertical scrolling graphs The rightmost scrolling graph is a vertical scrolling that uses a linear numeric scale See the SimpleAutoScrollUserControll xaml file for how the scroll graph is positioned in the underlying window Auto Indicator Classes 329 RTAutoScrollGraph Subhead Text Time Quarks Channel 1 Channel 2 Channel 3 Footer text Vertical scrolling graph numeric y scale public void InitializeGraph double startvalue 0 double stopvalue 30 rtAutoVerticalScrollGraphl InitRTAutoScrollGraph 0 startvalue 15 stopvalue rtAutoVerticalScrollGraphl InitSimpleRTPlotObject ChartObj LINE PLOT Colors Blue Channel 1 rtAutoVerticalScrollGraphl InitSimpleRTPlotObject ChartObj LINE PLOT Colors Green Channel 2 rtAutoVerticalScrollGraphl InitSimpleRTPlotObject ChartObj SCATTER PLOT Colors Red Channel 3 K tAutoVerticalScrollGraphl SimplePlotObj SymbolAttributes SymbolSize 10 tAutoVert
165. ar Minimum property maxvalue Specifies the floating point maximum value for the track bar Equivalent to the TrackBar Maximum property largechange Specifies the floating point large change value for the track bar Equivalent to the TrackBar LargeChange property smallchange Specifies the floating point small change value for the track bar Equivalent to the TrackBar SmallChange property tickfrequency Specifies the floating point tick frequency value for the track bar Equivalent to the TrackBar TickFrequency property Selected Public Instance Properties RTOrientation Gets or sets a value indicating the horizontal or vertical orientation Orientation Horizontal or Orientation Vertical of the track bar RTLargeChange Specifies the floating point large change value for the track bar Equivalent to the TrackBar LargeChange property except allows floating point numbers RTMaximum Specifies the floating point maximum value for the track bar Equivalent to the TrackBar Maximum property except allows floating point numbers RTMinimum Specifies the floating point minimum value for the track bar Equivalent to the TrackBar Minimum property except allows floating point numbers RTSmallChange Specifies the floating point small change value for the track bar Equivalent to the TrackBar SmallChange property except allows floating point numbers RTTickFrequency Specifies the floating point tick frequency value for the track bar Equ
166. arIndicatorl MainTitle ChartObjEnable IfTest title ChartObj OBJECT ENABLE ChartObj OBJECT DISABLE Meter Indicator Class RTAutoMeterIndicator System Windows Controls UserControl ChartView RTAutoIndicator RTAutoMeterIndicator The RTAutoMeterIndicator combines a RTMeterIndicator object with other objects needed to create a self contained meter display These other objects include a RTProcessVar variable meter coordinates system a meter axis and axis labels title string units string alarm indicators and panel meters used in the display of the meters numeric value tag name and alarm status Since it contains a single RTProcessVar object it displays a single channel of data RTAutoMeterIndicator constructors Since the RTAutoMeterIndicator is designed to be dropped on a form only a default constructor is used The indicator is customized using public properties Visual Basic Overloads Public Sub New C public RTAutoMeterIndicator The InitStrings method is used to initialize the meters tag and units strings Method InitStrings VB Publio Sub InitStrings _ title As String _ units As String C public void InitStringsi string title string units 296 Auto Indicator Classes Parameters title The title or tag string units The units string Use the UpdateIndicator method to update the meter indicator with new data Method UpdatelIndicator VB Public Sub UpdateIndicator _ value As
167. araxis2 new LinearAxis pTransforml ChartObj Y AXIS baraxis2 SetAxisIntercept pTransforml GetStopX baraxis2 SetAxisTickDir ChartObj AXIS MAX chartVu AddChartObject baraxis2 NumericAxisLabels barAxisLab new NumericAxisLabels baraxis chartVu AddChartObject barAxisLab RTMultiBarIndicator barplot new RTMultiBarIndicator pTransforml EngineCylinderTempl barwidth barspace barbase attribArray barjust barorient barplot SegmentSpacing 50 barplot SegmentWidth 30 barplot IndicatorBackground new ChartAttribute Colors Black 1 DashStyles Solid Colors Black barplot SegmentValueRoundMode ChartObj RT CEILING VALUE barplot SegmentCornerRadius 0 barplot IndicatorSubType ChartObj RT BAR SEGMENTED SUBTYPE Add panel meters to barplot chartVu AddChartObject barplot VB Private Sub InitializeEnginelTempIndicator Dim pTransforml As New CartesianCoordinates 0 0 0 0 1 0 800 0 pTransforml SetGraphBorderDiagonal 0 15 0 175 0 48 0 35 Dim background As New Background pTransforml ChartObj PLOT BACKGROUND Colors Gray chartVu AddChartObject background Dim attribl As New ChartAttribute Colors DarkMagenta 1 DashStyles Solid Colors DarkMagenta Dim attrib2 As New ChartAttribute Colors Aquamarine 1 DashStyles Solid Colors Aquamarine Dim attrib3 As New ChartAttribute Colors DarkSalmon 1 DashStyles Solid Colors DarkSalmon Dim attrib4 As New ChartAttribute Colors Yel
168. arge _ barwidth barbase attribl barjust barorient Dim paneltagmeterattrib As New ChartAttribute Colors SteelBlue _ 0 DashStyles Solid Colors White Dim panelmeter As New RTNumericPanelMeter pTransforml panelmeterattrib Panel Meter Classes 123 panelmeter PanelMeterPosition ChartObj OUTSIDE PLOTAREA MIN barplot AddPanelMeter panelmeter Dim panelmeter3 As New RTStringPanelMeter pTransforml _ paneltagmeterattrib ChartObj RT TAG STRING panelmeter3 PanelMeterPosition ChartObj OUTSIDE PLOTAREA MAX panelmeter3 TextColor Colors Black panelmeter3 StringTemplate TextFont font12 panelmeter3 PanelMeterNudge New Point2D 0 6 panelmeter3 AlarmIndicatorColorMode ChartObj RT INDICATOR COLOR NO ALARM CHANGE barplot AddPanelMeter panelmeter3 Time Date Panel Meter Class RTTimePanelMeter com quinncurtis chart2dwpf ChartPlot RTPlot RTSingleValueIndicator RTPanelMeter RTTimePanelMeter The RTTimePanelMeter class displays the time date value of the time stamp of the associated RTProcessVar object It contains a template based on the QCChart2D TimeLabel class that is used to specify the font and time date format information associated with the panel meter RTTimePanelMeter constructors Visual Basic Overloads Public Sub New _ ByVal transform As PhysicalCoordinates ByVal datasource As RTProcessVar ByVal attrib As ChartAttribute _ Overloads Public Sub New ByVal transform As PhysicalCoor
169. ariablesGraph adds an RTStringPanelMeter above the motor 122 Panel Meter Classes variables multi bar indicator It is used to display the process variable tag name as the title for each bar in the multi value indicator Note The RTStringPanelMeter only needs to be added once to the RTMultiBarIndicator It automatically picks up on the tag name for each RTProcessVar object referenced by the RTMultiBarIndicator RPM 80 80 80 40 40 40 A A Y RTMultiBarIndicator barplot new RTMultiBarIndicator pTransforml motorvars barwidth barspace barbase attribarray barjust barorient ChartAttribute panelmeterattrib new ChartAttribute Colors SteelBlue 3 DashStyles Solid Colors Black RTNumericPanelMeter panelmeter new RTNumericPanelMeter pTransforml panelmeterattrib panelmeter PanelMeterPosition ChartObj OUTSIDE PLOTAREA MIN barplot AddPanelMeter panelmeter ChartAttribute paneltagmeterattrib new ChartAttribute Colors SteelBlue 0 DashStyles Solid Colors White RTStringPanelMeter panelmeter3 new RTStringPanelMeter pTransforml1 paneltagmeterattrib ChartObj RT TAG STRING panelmeter3 PanelMeterPosition ChartObj OUTSIDE PLOTAREA MAX panelmeter3 TextColor Colors Black panelmeter3 StringTemplate TextFont font12 panelmeter3 AlarmIndicatorColorMode ChartObj RT INDICATOR COLOR NO ALARM CHANGE barplot AddPanelMeter panelmeter3 VB Dim barplot As New RTBarIndicator pTransforml batteryCh
170. ark RTMeterStringAxisLabels This class labels the major tick marks of the RTMeterAxis class using user defined strings Class Architecture 35 Form Control Classes System Windows Controls Button RTControlButton System Windows Controls Slider RTControlTrackBar com quinncurtis chart2dwpf ChartObj RTFormControl RTPanelMeter RTFormControlPanelMeter RTMultiValueIndicator RTFormControlGrid Real time displays often require user interface features such as buttons and track bars The Visual Studio WPF platform includes a large number of useful controls The Slider ScrollBar and Button controls are examples of what we refer collectively as Form Controls We created subclassed versions of the Slider control and the Button control Our version of the Slider control is RTControlTrackBar It is pretty much the same as the underlying Slider type since it supports floating point setup parameters Our version of the Button control is RTControlButton adds superior On Off button text and color control and supports momentary toggle and radio button styles No matter what Form Control is used either ours or the original WPF controls it can be used in conjunction with the RTFormControl RTFormControlPanelMeter and RTFormControlGrid classes OFF The RTControlButton type supports momentary toggle and radio button styles RTControlButton Derived from the WPFForm Control Button class it adds superior On Off button text and color control a
171. arl SetLocation 0 0 0 ChartObj PHYS POS formControlTrackBarl FormControlSize new Dimension 1 0 1 0 ChartAttribute panelmeterattrib new ChartAttribute Colors SteelBlue 3 DashStyles Solid Colors Black RTNumericPanelMeter panelmeterl new RTNumericPanelMeter pTransforml runnersPace panelmeterattrib panelmeterl NumericTemplate TextFont trackbarfont panelmeterl NumericTemplate DecimalPos 1 panelmeterl PanelMeterPosition ChartObj RIGHT REFERENCED TEXT panelmeterl SetPositionReference formControlTrackBarl formControlTrackBarl AddPanelMeter panelmeterl chartVu AddChartObject formControlTrackBarl 228 Buttons Track Bars and Other Form Control Classes VB Public Sub InitializeLeftPanelMeters Dim trackbarfont As ChartFont font64Numeric Dim trackbarTitlefont As ChartFont font12Bold Dim pTransforml As New CartesianCoordinates 0 0 0 0 1 0 1 0 pTransforml SetGraphBorderDiagonal 0 01 0 12 0 05 0 3 Dim attribl As New ChartAttribute Colors Black 2 DashStyles Solid Colors LightBlue runnersPaceTrackbar New RTControlTrackBar 0 0 15 0 1 0 0 1 1 runnersPaceTrackbar Orientation Orientation Vertical runnersPaceTrackbar RTValue 3 MUST USE RTValue to set double value Dim formControlTrackBarl As New RTFormControlPanelMeter pTransforml runnersPaceTrackbar attribl formControlTrackBarl RTDataSource runnersPace formControlTrackBarl PanelMeterPosition ChartObj CUSTOM POSITION formContro
172. artAttribute Colors Black 1 DashStyles Solid Colors Black barplot SegmentValueRoundMode ChartObj RT CEILING VALUE barplot SegmentCornerRadius 0 barplot IndicatorSubType ChartObj RT BAR SEGMENTED SUBTYPE Single Channel Bar Indicator 137 Dim baralarms As New RTAlarmIndicator baraxis barplot chartVu AddChartObject baralarms Dim panelmeterattrib As New ChartAttribute Colors SteelBlue 3 DashStyles Solid Colors Black Dim paneltagmeterattrib As New ChartAttribute Colors SteelBlue 3 _ DashStyles Solid Colors White Dim panelmeter As New RTNumericPanelMeter pTransforml panelmeterattrib barplot AddPanelMeter panelmeter Dim panelmeter2 As New RTAlarmPanelMeter pTransforml panelmeterattrib barplot AddPanelMeter panelmeter2 Dim panelmeter3 As New RTStringPanelMeter pTransforml _ paneltagmeterattrib ChartObj RT TAG STRING barplot AddPanelMeter panelmeter3 chartVu AddChartObject barplot Example for an RTBarIndicator Custom Segmented Bar Indicator The custom bar indicator example below extracted from the HomeAutomation example method InitializeCustomBarIndicator uses a segmented bar indicator to display the temperature It uses a special feature that allows the width of the each bar segment to be calculated as a function of the height This is done by subclassing the RTBarIndicator class and overriding the GetCustomBarWidth and GetCustomBarOffset methods In the CustomRTBarIndicator example below the
173. artObj RT BAR SOLID SUBTYPE ORO OR OR OR ROR RAE OR bb PS Multi Channel Bar Indicator Class RTAutoMultiBarIndicator System Windows Controls UserControl ChartView RTAutoIndicator RTAutoBarIndicator RTAutoMultiBarIndicator The RTAutoMultiBarIndicator combines a RTMultiBarIndicator object with other objects needed to create a self contained multi bargraph display These other objects include an array of RTProcessVar variables axes axis labels title string units string alarm indicators and panel meters used in the display of the bar graphs numeric value Auto Indicator Classes 285 tag name and alarm status Since it contains an array of RTProcessVar objects it can display one or more channels of data RTAutoMultiBarIndicator constructors Since the RTAutoMultiBarIndicator is designed to be dropped on a form only a default constructor is used The indicator is customized using public properties Visual Basic Overloads Public Sub New C public RTAutoMultiBarIndicator A couple of methods are used to initialize the multi bar graph after instantiation InitMultiBarIndicator and InitStrings The InitMultiBarIndicator method initialized the orientation of the bars the format of multi bar graph the princible bar color and the number of bars If you want each bar to have a different color call the InitColors Color clrs method passing in one color for ea
174. artObj Y AXIS yaxis LineColor Colors Black chartVu AddChartObject yaxis Dim yAxisGrid As New ChartGrid xaxis yaxis ChartObj Y AXIS ChartObj GRID MAJOR 368 Using OCRTGraph for WPF to Create Web Applications yAxisGrid SetCo lor Colors White yAxisGrid SetLineWidth 1 yAxisGrid SetLineStyle DashStyles Dot chartVu AddChar Dim xAxisGrid As New ChartGrid xaxis ChartObj GRID MAJOR ChartObj RT F rapid xAxisGrid SetCo tObject yAxisGrid yaxis ChartObj X AXIS lor Colors White xAxisGrid SetLineWidth 1 xAxisGrid SetLineStyle DashStyles Dot chartVu AddChar Dim yaxis2 As chartVu AddChar Dim xAxisLab As xAxis chartVu AddChar Dim yAxisLab As yAxis chartVu AddChar scrollFrame SCroL scrol All SCEO Scrol Lab TextFont Lab TextFont tObject xAxisGrid New LinearAxis pTransforml ChartObj Y AXIS yaxis2 LineColor yaxis2 AxisTickDir yaxis2 AxisIntercept Colors Black ChartObj AXIS_MAX xaxis AxisMax tObject yaxis2 New TimeAxisLabels xaxis axisFont tObject xAxisLab New NumericAxisLabels yaxis axisFont New RTScrollFrame chartVu XEDEXTENT MOVINGSTART AUTOSCROLL lFrame AddProcessVar currentTemperature2 lFrame ScrollScaleModeY ow 100 samples to accumlate before autoscaling y axis tObject yAxisLab currentTemperaturel pTransforml ChartObj RT AUTOSCALE Y MINMAX This prevents
175. artView Get the sub head object for the chart Gets or sets the object that contains data about the control Inherited from Control Get a reference to the tag panel meter object Inherited from RTAutoIndicator Get Set the tag string Inherited from RTAutoIndicator Inherited from UserControl Inherited from ChartView Get a reference to the units string panel meter object Inherited from RTAutoIndicator Get Set the units string Inherited from RTAutoIndicator Gets or sets a value indicating whether the control is displayed Inherited from Control Gets or sets the width of the control Inherited from Control 320 Auto Indicator Classes XAxis Get the x axis object XAxis2 Get the second x axis object XAxisLab Get the x axis labels object XAxisLab2 Get the second x axis labels object XAxisTitle Get the x axis title object XGrid Get the x axis grid object YAxis Get the y axis object YAxis2 Get the second y axis object vil Se labels object Accessible only after Y AxisLab2 n sa labels object Accessible only YAxisTitle Get the y axis title object YGrid Get the y axis grid object A complete listing of RTAutoScrollGraph properties is found in the QCRTGraphWPFCompiledHelpFile chm documentation file located in the doc subdirectory The RTAutoScrollGraph class supports a date time elapsed time and numeric time horizontal x axis scale The y axis scale is linear or logarithmic The ti
176. aset4 As New SimpleDataset Fourth x1 y4 Dim Dataset5 As New SimpleDataset Fifth xl y5 Dim pTransforml As New CartesianCoordinates ChartObj LINEAR SCALE _ ChartObj LINEAR SCALE pTransforml AutoScale Datasetl ChartObj AUTOAXES FAR ChartObj AUTOAXES FAR Dim pTransform2 As New CartesianCoordinates ChartObj LINEAR SCALE ChartObj LINEAR SCALE pTransform2 AutoScale Dataset2 ChartObj AUTOAXES FAR ChartObj AUTOAXES FAR Dim pTransform3 As New CartesianCoordinates ChartObj LINEAR SCALE ChartObj LINEAR SCALE pTransform3 AutoScale Dataset3 ChartObj AUTOAXES FAR ChartObj AUTOAXES FAR Dim pTransform4 As New CartesianCoordinates ChartObj LINEAR SCALE ChartObj LINEAR SCALE pTransform4 AutoScale Dataset4 ChartObj AUTOAXES FAR ChartObj AUTOAXES FAR Dim pTransform5 As New CartesianCoordinates ChartObj LINEAR SCALE ChartObj LINEAR SCALE pTransform5 AutoScale Dataset5 ChartObj AUTOAXES FAR ChartObj AUTOAXES FAR Dim transformArray As CartesianCoordinates pTransforml _ pTransform2 pTransform3 pTransform4 pTransform5 Dim zoomObj As New ChartZoom chartVu transformArray 5 True zoomObj SetButtonMask MouseButton Left zoomObj SetZoomYEnable True zoomObj SetZoomXEnable True zoomObj SetZoomXRoundMode ChartObj AUTOAXES FAR zoomObj SetZoomYRoundMode ChartObj AUTOAXES FAR zoomObj SetEnable True zoomObj SetZzoomStack
177. at 9 300 Auto Indicator Classes Formats 10 and 1 use 360 degree arcs 90 to 90 clockwise Format 10 places the tag string above and the numeric and alarm panel meters below the meter arc Format 11 places the tag string above and the numeric and alarm panel meters to the right of the meter arc Example for initializing RTAutoMeterIndicator objects The example below extracted from the AutoGraphDemos AutoMeterIndicatorsUserControll example draws each of the 12 different meter formats Auto Indicator Classes 301 Wil Window1 Mixed Chart AutoBarindicators AutoMeterindicators AutoMultiBarindicators AutoPanelMeterindicators AutoDialsAndClocksIndicators Format 11 Below you will find the code used to initialize the first of the meters above extracted from the AutoGraphDemos AutoMeterIndicatorsUserControll example program The meters are positioned using the AutoMeterIndicatorsUserControl asml file lt UserControl x Class AutoGraphDemo AutoNeedleMeterIndicatorsUserControll xmlns http schemas microsoft com winfx 2006 xaml presentation xmlns x http schemas microsoft com winfx 2006 xaml Height 700 Width 900 xmlns my clr namespace com quinncurtis chart2dwpf assembly QCChart2DWPF3 xmlns my2 2 clr namespace com quinncurtis rtgraphwpf assembly QCRTGraphWPF3 Grid Grid RowDefinitions RowDefinition Height 10 gt RowDefinition Height 10 gt lt Ro
178. atasetViewer ColumnHeads Inherited from DataGridBase DataArray Inherited from DatasetViewer Gets or sets which control borders are docked to its parent control and determines how a control is resized with its Dock parent Inherited from Control DoubleBufferEnable Inherited from ChartView DrawEnable Inherited from ChartView GridAttribute Inherited from DataGridBase GridCellFont Inherited from DatasetViewer Heieht Gets or sets the height of the control SE Inherited from Control HorizontalGroupPlot HorizontalScroll HScroll HScrollBarl Left Location NumCols NumericFormat NumRows ParentChartView ParentTransform PreferredSize ResizeMode Right RowHeaderAttribute RowHeaderFont RowHeads SmoothingMode SourceDataset StartCol StartRow SyncChart TableGreenBarFlag TableStartPosX TableStartPosY TableStopPosX TableStopPosY TextRenderingHint Title Top Process Variable Viewer 267 Inherited from DatasetViewer Gets the characteristics associated with the horizontal scroll bar Inherited from ScrollableControl Gets or sets a value indicating whether the horizontal scroll bar is visible Inherited from ScrollableControl Inherited from DataGridBase Gets or sets the distance in pixels between the left edge of the control and the left edge of its container s client area Inherited from Control Gets or sets the coordinates of the upper left corner of the control r
179. ated in the assemblies DLL with the names QCChart2DWPF3 and QCRTGraphWPF3 So replace the Title line the following lines under the other xmlns namespace tags Title Pagel Height 600 Width 900 xmlns my clr namespace com quinncurtis chart2dwpf assembly QCChart2DWPF3 xmlns my2 clr namespace com quinncurtis rtgraphwpf assembly QCRTGraphWPF3 gt These lines need to be resolved by adding a references to the QCChart2DWPF3 and QCRTGraphWPF3 libraries to the project Right click on Reference in the Solution Explorer window and select Add Reference Browse to the Quinn Curtis DotNet lib subdirectory and select QCChart2DWPF3 DLL and QCRTGraphWPF3 DLL files Using QCRTGraph for WPF to Create Web Applications 365 Add Reference NET COM Projects Browse Recent Look in ib os Fl gacutil exe QCRTGraphWPF3 dl 8 QCChart2DNet dli 5 QCSPCChartNet dll 8 QCSPCChartwPF3 dl 8 QCChart3DNet dl 8 QCChart3DVisionAux dll 8 QCMatPackNet dll 5 QcMatViewNet dil 8 QCRTGraphNet dll File name QCRTGraphW PF3 dil QCChartt2DWPF3 dll L Files of type Component Files dll tib olb ocx exe manifest View the Pagel xaml code and add the reference to ChartView object scrollAppl in the Grid layout panel The Pagel xaml file now looks like Page x Class Pagel xmlns http schemas microsoft com winfx 2006 xaml presentation xmlns x http sc
180. ates A meter coordinate system has more properties than a simple Cartesian coordinate system or even a polar coordinate system Because of the variation in meter styles a meter coordinate system sets the start and end angle of the meter arc within the 360 degree polar coordinate system It also maps a physical coordinate system representing the meter scale on top of the meter arc And the origin of the meter coordinate system can be offset in both x and y directions with respect to the containing plot area 60 80 100 0 3 RPMx1000 4 40 60 0 80 0 100 A meter axis can have any number of alarm arcs A meter can have multiple axes representing multiple scales 34 Class Architecture RTMeter Axis A meter axis extends for the extent of the meter arc and is centered on the origin Major and minor tick marks are placed at evenly spaced intervals perpendicular to the meter arc The meter axis also draws meter alarm arcs using the alarm information in the associated RTProcessVar object 100 150 A useful feature of multiple meter scales is the ability to display both Fahrenheit and Centigrade scales at the same time RTMeterAxisLabels This class labels the major tick marks of the RTMeterAxis class The class supports many predefined and user definable formats including numeric exponent percentage business and currency formats Meter tick mark strings can be horizontal parallel and perpendicular to the tick m
181. ator Gets or sets the size that is the lower limit that GetPreferredSize Size can specify Inherited from Control The minimum value for the indicator Inherited from RTAutoIndicator Get a reference to the RTNumericPanelMeter object Inherited from RTAutoIndicator Get an RTProcessVar object in the PlotBackground PlotObjectList PreferredSize Process Variable Process VariableArray ResetOnDraw ResizeMode SetpointAlarm SimplePlotObj Single ValuePlot Single ValuePlotList Size SmoothingMode SubHead Tag TagPanelMeter TagString Text TextRenderingHint UnitsPanelMeter UnitsString Visible Width Auto Indicator Classes 319 Inherited from RTAutoIndicator Get the plot background object Inherited from RTAutoIndicator Get plot object list Inherited from ChartView Get most recently created RTProcessVar Inherited from RTAutoIndicator Get the ArrayList holding all of the RTProcessVar objects Set Get True the ChartView object list is cleared with each redraw Inherited from RTAutoIndicator Inherited from ChartView Get the most recent setpoint RTAlarm object Inherited from RTAutoIndicator Get the SimpleVersaPlot plot object Get the most recent RTSingleValuePlot object Get the ArrayList holding all of the RTSimpleSingleValuePlot objects Gets or sets the height and width of the control Inherited from Control Inherited from Ch
182. attrib new ChartAttribute Colors SteelBlue 0 DashStyles Solid Colors White RTNumericPanelMeter panelmeter new RTNumericPanelMeter pTransforml panelmeterattrib panelmeter PanelMeterPosition ChartObj OUTSIDE PLOTAREA MIN barplot AddPanelMeter panelmeter RTAlarmPanelMeter panelmeter2 new RTAlarmPanelMeter pTransforml panelmeterattrib panelmeter2 PanelMeterPosition ChartObj BELOW REFERENCED TEXT panelmeter2 SetPositionReference panelmeter panelmeter2 TextColor Colors SpringGreen panelmeter2 AlarmTemplate TextFont font10 panelmeter2 AlarmIndicatorColorMode ChartObj RT TEXT BACKGROUND COLOR CHANGE ON ALARM barplot AddPanelMeter panelmeter2 VB Dim barplot As New RTBarIndicator pTransforml batteryCharge barwidth barbase attribl barjust barorient Dim panelmeterattrib As New ChartAttribute Colors SteelBlue 3 DashStyles Solid Colors Black Dim paneltagmeterattrib As New ChartAttribute Colors SteelBlue 0 DashStyles Solid Colors White Dim panelmeter As New RTNumericPanelMeter pTransforml panelmeterattrib panelmeter PanelMeterPosition ChartObj OUTSIDE PLOTAREA MIN panelmeter TextColor Colors SpringGreen 120 Panel Meter Classes panelmeter NumericTemplate TextFont fontl4Numeric panelmeter NumericTemplate DecimalPos 0 panelmeter AlarmIndicatorColorMode _ ChartObj RT TEXT BACKGROUND COLOR CHANGE ON ALARM panelmeter PanelMeterNudge New Point2D 0 4 barplot AddPan
183. auto meter formats Altimeter Electric Meter The RTAutoDialIndicator is able to take a single numeric value and divide it into multiple needle values RTAutoDialIndicator An RTAutoDialIndicator is a self contained control derived from the ChartView user control It is used to display the values of up to three channels of real time data 44 Class Architecture and includes as options a numeric readout alarm status readout title and units The RTAutoClockIndicator can display the time and date in numeric format RTAutoClockIndicator An RTAutoClockIndicator is a self contained control derived from the ChartView user control It is used to display the values of up to three channels of real time data and includes as options a numeric readout alarm status readout title and units Class Architecture 45 RTAutoScrollGraph g E e 5 5 0 i i i i i 0 14 37 38 14 37 40 14 37 42 14 37 44 14 37 46 Time Channel 1 Channel 2 Channel 43 RTAutoScrollGraph An RTAutoScrollGraph is a self contained control derived from the ChartView user control It is used to display real time data in a variety of plot formats line plots bar plots scatter plots and line marker plots Options include a horizontal or vertical display automatic legend a main title and axis titles Miscellaneous Classes Support classes are used to display special symbols used for alarm limits in the software special round and
184. b types within the RTMultiBarIndicator class support segmented bars custom segmented bars with variable width segments and pointer bar indicators 30 Class Architecture 100 TF LP va dd i KC 100 a NAS 16 45 50 16 45 52 16 45 54 16 45 56 16 45 58 The RTGroupMultiValuePlot class turns QCChart2D GroupPlot objects like the MultiLinePlot object above into scrolling plots RTGroupMultiValuePlot The RTGroupMultiValuePlot plot class uses a template based on the QCChart2D GroupPlot class to create a real time plot that displays a collection of RTProcessVar objects as a group plot in a scrolling graph The RTFormControlGrid class organizes RTFormControl objects functionally and visually RTFormControlGrid The RTFormControlGrid plot class organizes a group of RTFormControl objects buttons and track bars primarily though others will also work in a grid format Class Architecture 31 28 0 27 5 BER 26 5 11 82 15 11 52 30 11 52 45 11 53 00 This RTScrollFrame combines an RTGroupMultiValuePlot the open high low close plot with two RTSimpleSingleValuePlot plot RTScrollFrame The RTScrollFrame plot manages horizontal scrolling and auto scaling for the RTSimpleSingleValuePlot and RTGroupMultiValuePlot objects The RTScrollFrame class is discussed in more detail a couple of sections down RTVerticalScrollFrame The RTVerticalScrollFrame plot manages vertical scrolling and auto scaling for the RTSimpleSingleValuePlo
185. bItem gt Tabltem Header Horizontal RTProcessVarDataTable Name tabItem2 gt lt Grid gt lt Grid RowDefinitions gt lt RowDefinition Height 40 gt lt RowDefinition Height 15 gt lt Grid RowDefinitions gt lt my ChartView Margin 18 11 16 6 Name scrollingApp1 Grid Row 0 gt lt my2 RTProcessVarViewer Margin 18 11 16 6 Name rtProcessVarViewerApp2 Grid Row 1 gt lt Grid gt lt TabItem gt lt TabControl gt lt Grid gt lt Window gt Process Variable Viewer 271 Scroll Application 1 0 00 06 0 00 16 0 00 26 0 00 34 0 00 35 0 00 36 0 50 100 150 C public void InitProcessVarViewer RTProcessVarViewer rtProcessVarViewerl int rows 11 columns 3 startindex 0 rtProcessVarViewerl InitRTProcessVarViewer chartVu null currentTemperaturel rows columns startindex ChartObj VERT DIR rtProcessVarViewerl UseStripedGridBackground true rtProcessVarViewerl GridCellFont font14 rtProcessVarViewerl AddProcessVar currentTemperature2 Set custom decimal precision for each row rtProcessVarViewerl SetFormatDecimalPos 0 0 rtProcessVarViewerl SetFormatDecimalPos 1 1 rtProcessVarViewerl SetFormatDecimalPos 2 2 VB Public Sub InitProcessVarViewer rtProcessVarViewerl As RTProcessVarViewer Dim posrect As New Rectangle2D 0 05 0 67 0 87 0 26 Dim rows As Integer 11 columns As Integer 3 startindex As Integer 0 rtProcessVarView
186. ble prop double integ double deriv double lowclmp double highclmp double rateclmp double sampleper double filterconst public RTPIDCont rol double setpnt double steadstat double prop double integ double deriv double sampleper double filterconst PID Control 241 Parameters setpnt Specifies the desired value for the process variable steadstat Anticipated steady state value for the output also known as bias If you do not know the steady state value use 0 0 for this parameter Setting this value properly improves response because it does not have to rely on integral response starting with a zero initial error summation term to add enough to the control output to make up for system losses prop Specifies the proportional gain constant The proportional term adjust the output value proportional to the current error term integ Specifies the integral gain constant The integral term adjusts the output value by accumulating or integrated the error term over time deriv Specifies the derivative gain constant The derivative term looks at the rate of change of the input and adjusts the output based on the rate of change The derivative function uses the time derivative of the error term lowclmp Specifies the low clamping value for output If the output of the PID calculation results in a value less than owc mp the value will be clamped to lowclmp highcl
187. bute GridAttribute and AltGridAttribute properties You can add multiple RTProcessVar objects toa RTProcessVarViewer using the RTProcessVarViewer AddProcessVar method When adding additional process variables it only adds the y values of the dataset It is assumed the x values of the datasets are the same otherwise the columns would lose synchronization The row header string for the first grid row the x values is picked up from the first dataset s XString property If that is null X Values is displayed for numeric x values and Time for time based x values Subsequent row header strings for the y values are picked up from the main title string of each associated dataset In the case of group datasets with multiple y values for each x value row header strings are picked up from the datasets GroupStrings property which stores one string for each group in the dataset You can change the default orientation of the RTProcessVarViewer by calling a version of the RTProcessVarViewer constructor that has an orientation property as the last parameter See the ProcessVarTables VerticalScrollApplicationUserControll cs for an example Selected Public Instance Properties AltGridAttribute Inherited from DataGridBase Set to true and the table will redraw using the current data associated with the update of th RTProcessVar ColumnHeaderAttribute Inherited from DataGridBase AutoRedrawTable ColumnHeaderFont Inherited from D
188. bute _ C public RTAlarmPanelMeter PhysicalCoordinates transform RTProcessVar datasource ChartAttribute attrib public RTAlarmPanelMeter PhysicalCoordinates transform ChartAttribute attrib Parameters transform The coordinate system for the new RTAlarmPanelMeter object datasource The process variable associated with the panel meter attrib The color attributes of the panel meter indicator Selected Public Instance Properties Get Set the string template defining the panel meter alarm string format The text properties associated with the panel meter are set using this property A complete listing of RTAlarmPanelMeter properties is found in the QCRTGraphWPFCompiledHelpFile chm documentation file located in the doc subdirectory Example of RTAlarmPanelMeter used with RTBarIndicator The panel meter below extracted from the HybridCar example method InitializeBatteryChargeGraph adds an RTAlarmPanelMeter underneath the numeric panel meter Panel Meter Classes 119 Note The RTAlarmPanelMeter uses the BELOW REFERENCED TEXT positioning constant and sets the RTAlarmPanelMeter SetPositionReference to the numeric panel meter C RTBarIndicator barplot new RTBarIndicator pTransforml batteryCharge barwidth barbase attribl barjust barorient ChartAttribute panelmeterattrib new ChartAttribute Colors SteelBlue 3 DashStyles Solid Colors Black ChartAttribute paneltagmeter
189. cator PrimaryChannel inherited from RTPlot RTDataSource inherited from RTSingleValueIndicator SegmentCornerRadius SegmentSpacing SegmentValueRoundMode SegmentWidth ShowDatapointValue inherited from ChartPlot StepMode inherited from ChartPlot ZOrder inherited from GraphObj constants RT NO SYMBOL RT LEFT LOW ALARM SYMBOL RT LEFT SET POINT SYMBOL RT LEFT HIGH ALARM SYMBOL RT RIGHT LOW ALARM SYMBOL RT RIGHT SETPOINT SYMBOL RT RIGHT HIGH ALARM SYMBOL RT TOP LOW ALARM SYMBOL RT TOP SETPOINT SYMBOL RT TOP HIGH ALARM SYMBOL RT BOTTOM LOW ALARM SYMBOL RT BOTTOM SETPOINT SYMBOL RT BOTTOM HIGH ALARM SYMBOL Set Get the primary channel of the indicator Get Set the array list holding the RTProcessVar variables for the indicator Get Set the corner radius used to draw the segment rounded rectangles Get Set the segments spacing for the RT BAR SEGMENTED SUBTYPE and RT BAR SINGLE SEGMENT SUBTYPE bar indicator sub types Set Get the segment value round mode Specifies that the current process value is rounded up in calculating how many segments to display in RT BAR SEGMENTED SUBTYPE and RT BAR SINGLE SEGMENT SUBTYPE modes Use one of the constants RT FLOOR VALUE RT CEILING VALUE Get Set the thickness of segments for the RT BAR SEGMENTED SUBTYPE and RT BAR SINGLE SEGMENT SUBTYPE bar indicator sub types If the plot supports it this method will turn on off the display of dat
190. cator objects changes on an alarm Use one of the constants RT INDICATOR COLOR NO ALARM CHANGE RT INDICATOR COLOR CHANGE ON ALARM Bar plots that support the display of data point values have the option of displaying the data point s numeric values above the bar below the bar or centered in the bar Use one of the data point label position constants INSIDE BAR OUTSIDE BAR or CENTERED BAR Set Get the justification of bars in bar graph plot objects Use one of the bar justification constants JUSTIFY MIN JUSTIFY CENTER or JUSTIFY MAX Set Get the bar offset from its fixed x or y value in physical units Set Get the orientation HORIZ DIR or VERT DIR for bar plots 144 Multiple Channel Bar Indicator BarSpacing inherited from RTPlot BarWidth inherited from ChartPlot ChartObjAttributes inherited from GraphObj ChartObjClipping inherited from GraphObj ChartObjComponent inherited from GraphObj ChartObjEnable inherited from GraphObj ChartObjScale inherited from GraphObj CurrentProcess Value inherited from RTSingleValueIndicator FillBaseValue inherited from ChartPlot FillColor inherited from GraphObj IndicatorBackground IndicatorBackgroundEnable IndicatorSubType LabelTemplateDecimalPos inherited from ChartPlot LabelTemplateNumericForma t inherited from ChartPlot LineColor inherited from GraphObj LineStyle inherited from GraphObj LineWidth inherited from GraphObj NumC
191. catorColorMode ChartObj RT INDICATOR COLOR NO ALARM CHANGE chartVu AddChartObject panelmeter 128 Panel Meter Classes Form Control Panel Meter Class RTFormControlPanelMeter com quinncurtis chart2dwpf ChartPlot RTPlot RTSingleValueIndicator RTPanelMeter RTFormControlPanelMeter The RTFormControlPanelMeter encapsulates an RTFormControl object buttons and track bars primarily though others will also work in a panel meter format This allows it to use the RTPanelMeter positioning constants to position the form controls with respect to indicators plot areas text and other panel meters RTFormControlPanelMeter constructors Visual Basic Overloads Public Sub New _ ByVal transform As PhysicalCoordinates _ ByVal datasource As RTProcessVar ByVal formcontrol As Control ByVal attrib As ChartAttribute Overloads Public Sub New _ ByVal transform As PhysicalCoordinates _ ByVal formcontrol As Control _ ByVal attrib As ChartAttribute C public RTFormControlPanelMeter PhysicalCoordinates transform RTProcessVar datasource Control formcontrol ChartAttribute attrib public RTFormControlPanelMeter PhysicalCoordinates transform Control formcontrol ChartAttribute attrib Parameters transform The coordinate system for the new RTFormControlPanelMeter object formcontrol Panel Meter Classes 129 A reference to the Form Control assigned to this panel meter data
192. catorSubType segmented ChartObj RT BAR SEGMENTED SUBTYPE ChartObj RT BAR SOLID SUBTYPE VB rtAutoBarIndicatorl InitBargraph ChartObj VERT DIR 0 Colors OrangeRed rAutoBarIndicatorl InitStrings VERT 0 GMB rtAutoBarIndicatorl LowAlarm AlarmLimitValue 23 tAutoBarIndicatorl HighAlarm AlarmLimitValue 78 tAutoBarIndicatorl SetpointAlarm AlarmLimitValue 53 tAutoBarIndicatorl MinIndicatorValue 0 tAutoBarIndicatorl MaxIndicatorValue 100 tAutoBarIndicatorl GraphBackground ChartObjAttributes New hartAttribute Colors LightBlue 5 DashStyles Solid Colors LightBlue tAutoBarIndicatorl FaceplateBackground True tAutoBarIndicatorl BarEndBulb barbulb tAutoBarIndicatorl InteriorAxis interioraxis tAutoBarIndicatorl NumericPanelMeter ChartObjEnable IfTest numeric hartObj OBJECT ENABLE ChartObj OBJECT DISABLE tAutoBarIndicatorl NumericPanelMeter NumericTemplate DecimalPos 0 tAutoBarIndicatorl AlarmPanelMeter ChartObjEnable IfTest alarm hartObj OBJECT ENABLE ChartObj OBJECT DISABLE tAutoBarIndicatorl UnitsPanelMeter ChartObjEnable IfTest units hartObj OBJECT ENABLE ChartObj OBJECT DISABLE tAutoBarIndicatorl YAxisTitle ChartObjEnable IfTest units hartObj OBJECT ENABLE ChartObj OBJECT DISABLE tAutoBarIndicatorl TagPanelMeter ChartObjEnable IfTest title hartObj OBJECT ENABLE ChartObj OBJECT DISABLE tAutoBarIndicatorl BarPlot IndicatorSubType IfTest segmented hartObj RT BAR SEGMENTED SUBTYPE Ch
193. cessVar stockClosel scrollFramel ScrollRescaleMargin 0 05 chartVu AddChartObject scrollFramel DES eres Ze 00 LIP X Lato oats n attrib2 As New ChartAttribute Colors Green 3 x Bali DashStyles Solid j SECOND 1 25 attribl stockLowl stockClosel 1 stockvars DashStyles Solid attrib2 plot2 NASDAQChannel es pine lineplot3 movingAverageStock 14 Buttons Track Bars and Other Form Control Classes RTControlButton RTControlTrackBar RTFormControl RTFormControlPanelMeter RTFormControlGrid Real time displays often require user interface features such as buttons and track bars The Visual Studio WPF platform includes a large number of useful controls The WPF Slider ScrollBar and Button controls are examples of what we refer collectively as Form Controls We created subclassed versions of the Slider control and the Button control Our version of the Slider control is RTControlTrackBar and adds floating point scaling for the track bar endpoints increments current value and tick mark frequency Our version of the Button control is RTControlButton and adds superior On Off button text and color control and supports momentary toggle and radio button styles No matter what Form Control is used either ours or the original WPFForm controls it can be used in conjunction with the RTFormControl RTFormControlPanelMeter and RTFormControlGrid classes Contr
194. ch bar Method InitMultiBarIndicator VB Public Sub InitMultiBarIndicator _ orientation As Integer _ bargraphformat As Integer _ colr As Color num As Integer _ C public void InitMultiBarIndicator int orientation int bargraphformat Color colt int num Parameters orientation Specifies the orientation of the chart ChartObj VERT_DIR or ChartObj HORIZ_DIR bargraphformat Specifies the bar graph format colr The color of the bars num The number of bars in the mult bargraph The InitStrings method initialized the title tags and units strings 286 Auto Indicator Classes Method InitStrings VB Publio Sub InitStrings title As String units As String _ tags As String _ C public void InitStringsi string title string units string tags Parameters title The title or tag string units The units string tags An array of the tag strings Use the UpdateIndicator method to update the bar indicator with new data Method UpdatelIndicator VB Public Sub UpdateIndicator _ values As Double _ updatedraw As Boolean CH public void UpdateIndicator double values bool updatedraw Parameters value An array of new values one for each channel of the indicator updatedraw True and the indicator is immediately updated Auto Indicator Classes 287 Selected Public Instance Properties Name AlarmIndicator AlarmPanelMeter BarAttributes BarDataValue Ba
195. ciator cell numcols The number of columns in the annunciator display numrows The number of rows in the annunciator display attribs An array of the color attributes one for each annunciator cell 196 Single and Multiple Channel Annunciators Public Instance Properties CellColumnMargin Get Set the extra space between columns of the annunciator specified in normalized NORM PLOT POS coordinates CellRowMargin Get Set the extra space between rows of the annunciator specified in normalized NORM PLOT POS coordinates NumberColumns Get the number of rows in the annunciator NumberRows Get the number of rows in the annunciator A complete listing of RTMultiValueAnnunciator properties is found in the QCRTGraphWPFCompiledHelpFile chm documentation file located in the doc subdirectory The CellColumnMargin and the CellRowMargin values represent the total amount of spacing used for the cell column and cell row margins respectively A value of 0 2 implies that 20 of the row or column space will be used as margin and 80 will be used for the annunciator cells The 2096 margin value is divided up between the cells in the row or column If the multi channel annunciator has 4 annunciator cells in a row there are 5 border areas between the cells 3 at the interior of the annunciator cell grid and 2 on either end The total margin of 20 is therefore divided 5 times resulting in a 4 margin between the column of each grid cell Example for
196. cindicator SegmentValueRoundMode ChartObj RT CEILING VALUE meterarcindicator SegmentWidth 7 meterarcindicator SegmentSpacing 10 meterarcindicator IndicatorBackgroundEnable true Add panel meters to meter needle chartVu AddChartObject meterarcindicator VB Dim meterarcindicator As New RTMeterArcIndicator meterframe meterarcindicator SetChartObjAttributes attribl meterarcindicator InnerValueArcNormalized 0 8 meterarcindicator OuterValueArcNormalized 0 95 processVar2 terarcindica terarcindica terarcindica terarcindica terarcindica me me me me me COLT COLF COLF COLF COLF IndicatorSubtype SegmentValueRoundMode SegmentWidth 7 SegmentSpacing 10 IndicatorBackgroundEnabl ChartObj RT METER SEGMENTED ARC SUBTYPE ChartObj RT CEILING VALUE e True Add panel meters chartVu AddChartObject meterarcindicator 177 Meter Indicators Needle Arc and Symbol LineStyle Needle Meter Indicator RTMeterNeedleIndicator com quinncurtis chart2dwpf ChartPlot RTPlot RTSingleValueIndicator RTMeterIndicator RTMeterNeedleIndicator This RTMeterNeedleIndicator class displays the current RTProcessVar value as a needle Subtypes of the RTMeterNeedleIndicator are simple needles pie wedge shaped needles the fat end of the pie wedge is at the radius center and arrow needles RTMeterNeedleIndicator Constructor Visual Basic Overloads Public Sub New _ ByVal frame As R
197. ck Dim panelmeter As New RTTimePanelMeter pTransforml timeOfDay panelmeterattrib panelmeter PanelMeterPosition ChartObj INSIDE INDICATOR panelmeter TimeTemplate TextFont font36Numeric panelmeter TimeTemplate TimeFormat ChartObj TIMEDATEFORMAT 24HMS panelmeter AlarmIndicatorColorMode _ ChartObj RT INDICATOR COLOR NO ALARM CHANGE chartVu AddChartObject panelmeter Dim panelmetertagattrib As New ChartAttribute Colors Beige 0 DashStyles Solid Colors Beige Dim panelmeter3 As New RTStringPanelMeter pTransforml1 timeOfDay panelmetertagattrib ChartObj RT TAG STRING panelmeter3 StringTemplate TextFont font10 panelmeter3 PanelMeterPosition ChartObj ABOVE REFERENCED TEXT panelmeter3 SetPositionReference panelmeter panelmeter3 TextColor Colors Black chartVu AddChartObject panelmeter3 Class RTElapsedTimePanelMeter com quinncurtis chart2dwpf ChartPlot RTPlot RTSingleValueIndicator RTPanelMeter RTElapsedTimePanelMeter 126 Panel Meter Classes The RTElapsedTimePanelMeter class displays the elapsed time value of the time stamp of the associated RTProcessVar object interpreting the numeric value of the time stamp in milliseconds It contains a template based on the QCChart2D ElapsedTimeLabel class that is used to specify the font and time date format information associated with the panel meter RTTimePanelMeter constructors Visual Basic Overloads Public Sub New _ ByVal transform As PhysicalC
198. com quinncurtis chart2dwpf using com quinncurtis rtgraphwpf namespace WpfRTBrowserApplicationl lt summary gt Interaction logic for Pagel xaml lt summary gt public partial class Pagel Page ScrollGraphl sg null public Pagel InitializeComponent sg new ScrollGraphl scrollApp1 scrollAppl PreferredSize new Size 800 600 The reference to PreferredSize tells the software that the font sizes specified in the graph are with respect to a chart window of size 800 600 If the chart is sized larger than this the fonts will be larger if it is sized smaller the fonts will be smaller 362 Using OCRTGraph for WPF to Create Web Applications e Build the Solution Build Build Solution If the project fails to compile you need to go back and check the errors and the previous steps When it runs properly it the WpfBrowserApplicationl chart looks like 7 WpfRTBrowserApplication1 xbap application x ms xbap Object Mozilla Firefox File Edit View History Bookmarks Tools Help e A file E Quinn Curtis WPF Development DotNet QCRTGraph Visual CSharp examples L Most Visited Getting Started NI Latest Headlines WpfRTBrowserApplication1 xbap ap PEN P Scroll Application amp 1 More complicated example using tabs is found in the WpfBrowserExample2 folder Visual Basic for Net Ifyou do not already have an application program project create one using the Visual S
199. com winfx 2006 xaml Height 700 Width 980 xmlns my clr namespace com quinncurtis chart2dwpf assembly QCChart2DWPF3 xmlns my2 2 clr namespace com quinncurtis rtgraphwpf assembly QCRTGraphWPF3 Grid Grid ColumnDefinitions ColumnDefinition Width 10 gt lt ColumnDefinition Widthi 1D gt lt ColumnDefinition Width 5 gt lt Grid ColumnDefinitions gt lt Grid RowDefinitions gt lt RowDefinition Height 10 gt lt RowDefinition Height 5 gt lt Grid RowDefinitions gt my2 RTAutoMultiBarIndicator Margin 5 5 5 5 Name rtAutoMultiBarIndicatorl Grid Column 0 my2 RTAutoMultiBarIndicator Margin 5 5 5 5 Name rtAutoMultiBarIndicator2 Grid Column 1 gt lt StackPanel Margin 10 10 10 10 CheckBox Click ProcessCheckBoxes Grid Column 2 gt lt CheckBox Name checkBox1 Margin 10 gt Bar end bulb lt CheckBox gt lt CheckBox Name checkBox2 Margin 10 gt Interior axs lt CheckBox gt 294 Auto Indicator Classes lt CheckBox Name checkBox5 Margin 10 gt Units string lt CheckBox gt lt CheckBox Name checkBox6 Margin 10 gt Tag string lt CheckBox gt lt CheckBox Name checkBox7 Margin 10 gt Title string lt CheckBox gt lt StackPanel gt lt Grid gt lt UserControl gt C void InitializeBargraphs bool barbulb bool interioraxis bool numeric bool alarm bool units tags bool title rtAutoMultiBarIndicatorl InitMultiBarIndicato
200. ct datasource The process variable associated with the control formcontrol A reference to the Control assigned to this panel meter attrib The color attributes of the panel meter Selected Public Instance Properties ChartObjAttributes inherited from Sets the attributes for a chart object using a GraphObj ChartAttribute object ChartObjScale inherited from Sets the reference to the PhysicalCoordinates object that GraphObj the chart object is placed in ControlSizeMode Set Get to the size mode for the Control Use one of the Control size mode constants RT_ORIG CONTROL SIZE RT MIN CONTROL SIZE RT INDICATORRECT CONTROL SIZE FormControlSize Get the size of the form control in device units Frame3DEnable inherited from Set Get to true to enable a 3D frame for the panel meter RTPanelMeter Buttons Track Bars and Other Form Control Classes 231 IndicatorRect inherited from Get Set Indicator positioning rect RTPanelMeter PanelMeterNudge inherited from Set Get the xy values of the panelMeterNudge property It RTPanelMeter moves the relative position using window device coordinates of the text relative to the specified location of the text from RTPanelMet LR position table in the RTPanelMeter chapiet from RTPanelMeter RTPanelMeter PanelMeterTemplate inherited Get a ChartLabel object representing the panel meters from RTPanelMeter template RTPanelMeter reference for this RTPanelMeter object Gra
201. cted from the RTGraphNetDemo example file DynCustomBarsUserControll method InitializeBar3 It uses a special feature that allows the width of the each bar segment to be calculated as a function of the height This is done by subclassing the RTBarIndicator and RTMultiBarIndicator classes and overriding the GetCustomBarWidth and GetCustomBarOffset methods In the example below the width and offset of the bar is calculated using a function based on the height value Calculating the bar width as a function of the bar height only works with the segmented bar subtypes If you want a solid bar with custom widths make the RTBarIndicator SegmentWidth and RTBarIndicator SegmetSpacing values equal and small een Kee fd 40 3 D ES mu LJ ce O i e C public class CustomRTMultiBarIndicator RTMultiBarIndicator public CustomRTMultiBarIndicator PhysicalCoordinates transform RTProcessVar datasource double barwidth double barspacing double barbase ChartAttribute attribs int barjust int barorient base transform datasource barwidth barspacing barbase attribs barjust barorient public override double GetCustomBarOffset double v This centers the bar segments Multiple Channel Bar Indicator 149 double offset this BarWidth 2 GetCustomBarWidth v 2 return offset public override double GetCustomBarWidth double v double width 0 5 width 0 01 v 100
202. ction of time S t X t The variables K K and Kg are adjustable and are used to customize a controller for a given process control application The K constant term is listed in some textbooks as 1 K It is simply a matter of the units K is specified in In the K form the units are repeats per minute while in the 1 K form the units are minutes per repeat also called reciprocal time The K version presented here is preferred because increasing K will increase the integral gain action 238 PID Control just like increasing K and Ka will increase the proportional gain and derivative gain action If 1 K is used then decreasing values of K will increase the amount of integral gain The proportional term of the PID equation contributes an amount to the controller output directly proportional to the current process error For example if the setpoint of the process is 100 degrees and the current temperature of the process is 90 degrees then the current process error is 10 degrees The proportional term adds to the controller output an amount equal to K 10 The gain term K determines how much the control output should change in response to a given error level If the error is 10 a K gain of 0 5 will add 5 to the output of the controller while a gain of 3 will add 30 to the output of the controller The larger the value of K the harder the system reacts to differences between the setpoint and the actual temperature A PID contro
203. current scale Get Set the scrolling mode for the x coordinate Use one of the x axis scroll frame constants RT NO AUTOSCALE X RT AUTOSCALE X MIN RT AUTOSCALE X MAX RT AUTOSCALE X MINMAX Get Set the scrolling mode for the y coordinate Use one of the y axis scroll frame constants RT NO AUTOSCALE Y RT AUTOSCALE Y CURRENT SCALE RT AUTOSCALE Y MIN RT AUTOSCALE Y MAX RT AUTOSCALE Y MINMAX RT FIXEDEXTENT MOVINGSTART AUTOSCROLL RT MAXEXTENT FIXEDSTART AUTOSCROLL RT FIXEDNUMPOINT AUTOSCROLL Get Set the time stamp mode for the time values in the process variables Use one of the time stamp mode constants RT NOT MONOTONIC Y MODE not monotonic means that the x values do not have to increase with increasing time A real time xy plot that plots x values against y values might have this characteristic RT MONOTONIC Y MODE The default value Monotonic means that the x values always increase with increasing time If the scroll frame routines know that the x values will never backtrack it speeds up the search algorithm for minimum and maximum x values to use in auto scaling the x axis A complete listing of RTVerticalScrollFrame properties is found in the QCRTGraphWPFCompiledHelpFile chm documentation file located in the doc subdirectory 208 Single and Multiple Channel Annunciators See the example VerticalScrolling for example of the use of the RTVerticalScrollFrame class C scrollFrame new RTVertical
204. d chartVu AddChartObject controlgrid End Sub Lavy en U RT DashStyles Solid Nothing LO 15 PID Control Theory Proportional Integral Derivative PID control algorithm is used to drive the process variable measurement to the preset value setpoint Temperature control is the most common form of closed loop control For example in a simple temperature control system the temperature of a vat of material is to be maintained at a given setpoint s t The output of the controller sets the valve of the actuator to apply less heat to the vat if the current temperature of the vat is greater than the setpoint and more heat to the vat if the current temperature is less than the setpoint The PID algorithm calculates its output by summing three terms One term is proportional to the error error is defined as the setpoint minus the current measured value The second term is proportional to the integral of the error over time and the third term is proportional to the rate of change first derivative of the error The general form of the PID control equation in analog form is Eqn 1 de m t K e t K fe t dt Ka dt proportional integral derivative where m t controller output deviation K proportional gain K reset multiplier integral time constant Ka derivative time constant S t current process setpoint X t actual process measured variable temperature for example e t error as a fun
205. d to a bar indicator Centers the panel meter inside the bar indicator If the object is not a bar indicator the panel meter is centered inside the plotting area Text justification is set to JUSTIFY CENTER JUSTIFY CENTER OUTSIDE BAR Used when the panel meter is attached to a bar indicator Places the panel meter on the outside edge of the bar indicator If the object is not a bar indicator the panel meter is placed on the outside edge of the plotting area maximum Text justification depends on the bar orientation Vertical Bars JUSTIFY CENTER JUSTIFY MIN Horizontal Bars JUSTIFY MIN JUSTIFY CENTER INSIDE BAR Used when the panel meter is attached to a bar indicator Places the panel meter on the inside edge of the bar indicator If the INSIDE BARBASE OUTSIDE BARBASE INSIDE INDICATOR OUTSIDE INDICATOR BELOW REFERENCED TEXT ABOVE REFERENCED TEXT RIGHT REFERENCED TEXT LEFT REFERENCED TEXT Panel Meter Classes 111 object is not a bar indicator the panel meter is placed on the inside edge of the plotting area maximum Text justification depends on the bar orientation Vertical Bars JUSTIFY CENTER JUSTIFY MAX Horizontal Bars JUSTIFY MAX JUSTIFY CENTER Used when the panel meter is attached to a bar indicator Places the panel meter on the inside edge of the bar base of the indicator If the object is not a bar indicator the panel meter is placed on the inside edge of the plotting area minimum Text justificat
206. dChartObject rr RTRoundedRectangle2D rrr new RTRoundedRectangle2D meterframel 0 25 0 35 0 45 0 09 0 0 ChartObj NORM GRAPH POS ChartAttribute backattrib2 new ChartAttribute Colors Black 2 DashStyles Solid Colors Black rrr SetChartObjAttributes backattrib2 rrr ZOrder 60 make it be drawn after needle hiding needle pivot point rrr SetChartObjClipping ChartObj NO CLIPPING chartVu AddChartObject rrr VB Dim rr As New RTRoundedRectangle2D meterframel 0 25 0 01 0 45 0 43 0 01 ChartObj NORM GRAPH POS Dim backattrib As New ChartAttribute Colors Black 2 DashStyles Solid Colors White rr SetChartObjAttributes backattrib rr SetChartObjClipping ChartObj NO CLIPPING chartVu AddChartObject rr Dim rrr As New RTRoundedRectangle2D meterframel 0 25 0 35 0 45 0 09 0 0 Miscellaneous Shape Drawing 261 ChartObj NORM GRAPH POS Dim backattrib2 As New ChartAttribute Colors Black 2 DashStyles Solid _ Colors Black rrr SetChartObjAttributes backattrib2 rrr ZOrder 60 rrr SetChartObjClipping ChartObj NO CLIPPING chartVu AddChartObject rrr General Shapes Class RTGenShape com quinncurtis chart2dwpf GraphObj RTGenShape This class is used to draw filled and unfilled rectangles rectangles with rounded corners general ellipses and aspect ratio corrected circles These shapes can be used by the programmer to add visual enhancements to graphs RTGenShape constructors Vis
207. dicatorl MultiBarPlot BarWidth 0 1 rtAutoMultiBarIndicatorl Inittolors barcolors rtAutoMultiBarIndicatorl InitStrings Flow 493 GMB bartags rtAu tiBarIndicatorl LowAlarm AlarmLimitValue 23 rtAutoMultiBarIndicatorl HighAlarm AlarmLimitValue 78 rAutoMultiBarIndicatorl SetpointAlarm AlarmLimitValue 53 rtAutoMultiBarIndicatorl GraphBackground ChartObjAttributes New ChartAttribute Colors LightBlue DashStyles Solid Colors LightBlue rtAutoMultiBarIndicatorl FaceplateBackground True rtAutoMultiBarIndicatorl BarEndBulb barbulb tAutoMultiBarIndicatorl InteriorAxis interioraxis rtAutoMultiBarIndicatorl NumericPanelMeter ChartObjEnable IfTest numeric ChartObj OBJECT ENABLE ChartObj OBJECT DISABLE rtAutoMultiBarIndicatorl AlarmPanelMeter ChartObjEnable IfTest alarm ChartObj OBJECT ENABLE ChartObj OBJECT DISABLE CheckBox CheckBox Name checkBox3 Name checkBox4 Margin 10 gt Numeric readout lt CheckBox gt Margin 10 gt Alarm readout lt CheckBox gt Auto Indicator Classes 295 rtAutoMultiBarIndicatorl UnitsPanelMeter ChartObjEnable IfTest units ChartObj OBJECT ENABLE ChartObj OBJECT DISABLE rtAutoMultiBarIndicatorl YAxisTitle ChartObjEnable IfTest units ChartObj OBJECT ENABLE ChartObj OBJECT DISABLE E rtAutoMultiBarIndicatorl TagPanelMeter ChartObjEnable IfTest tags ChartObj OBJECT ENABLE ChartObj OBJECT DISABLE rtAutoMultiB
208. dinates _ ByVal attrib As ChartAttribute C public RTTimePanelMeter PhysicalCoordinates transform RTProcessVar datasource ChartAttribute attrib public RTTimePanelMeter PhysicalCoordinates transform ChartAttribute attrib 124 Panel Meter Classes Parameters transform The coordinate system for the new RTTimePanelMeter object datasource The process variable associated with the panel meter attrib The color attributes of the panel meter indicator Selected Public Instance Properties Set Get the TimeLabel template for the panel meter time date value The text properties associated with the panel meter are set using this property In addition the time or calendar format of the time date value is also set here A complete listing of RTTimePanelMeter properties is found in the QCRTGraphWPFCompiledHelpFile chm documentation file located in the doc subdirectory Example for RTTimePanelMeter The panel meter below extracted from the Treadmill example method InitializeElapsedTimePanelMeter adds an RTTimePanelMeter as an independent panel meter at the bottom of the display In this example the plot area of the coordinate system is set for the position of the RTTimePanelMeter using pTransform1 SetGraphBorderDiagonal It is positioned inside the plot area using the INSIDE_INDICATOR position constant A string panel meter places a title above the time panel meter Current Time
209. dressOf Me selector Button Click Concurrent ButtonFont buttonfont buttonlist2 Add Concurrent numColumns 1 numRows 4 Dim controlgrid2 As New RTFormControlGrid pTransform2 Nothing buttonlist2 numColumns numRows attrib2 controlgrid2 CellRowMargin 0 1 controlgrid2 CellColumnMargin 0 0 controlgrid2 FormControlTemplate Frame3DEnable flag3DBorder chartVu AddChartObject controlgrid2 End Sub Control TrackBars Class RTControlTrackBar System Windows Controls Slider RTControlTrackBar The RTControlTrackBar class is subclassed from the WPFSlider class Our version of the TrackBar control adds floating point scaling for the track bar endpoints increments current value and tick mark frequency RTControlButton constructor Visual Basic Overloads ByVal ByVal ByVal ByVal ByVal Public Sub New minvalue As maxvalue As largechange smallchange tickfrequency As Double _ Double _ Double _ As Double As Double Overloads Public Sub New _ Cf ByVal minvalue As Double ByVal maxvalue As Double public RTControlTrackBar double double double double double minvalue maxvalue largechange smallchange tickfrequency public RTControlTrackBar double minvalue 226 Buttons Track Bars and Other Form Control Classes double maxvalue Parameters minvalue Specifies the floating point minimum value for the track bar Equivalent to the TrackB
210. e Net Forms based version of QCChart2D is derived from the System Drawing DashStyle class The WPF version of the line style class derives from the System Windows Media DashStyle class Whereas the line style enumerated constants for System Drawing line styles are found in the DashStyle class in WPF they are found in the DashStyles class Example System Drawing WPF C DashStyle ls DashStyle Solid DashStyle c DashStyles Solid VB Dim 1s as DashStyle DashStyle Solid Dim ls as DashStyle DashStyles Solid Fonts It is strange but WPF does not encapsulate font properties into a single class like the System Drawing Font class Instead WPF text objects which require a font specification use separate properties for the font name font size font style and the font weight We found this to be inconvenient so we created a simple ChartFont class which superficially looks like old System Drawing Font class That way we could keep source codes consistent System Drawing CH Font theFont new Font Microsoft Sans Serif 10 FontStyle Regular VB Dim theFont As New Font Microsoft Sans Serif 10 FontStyle Regular WPF 50 Class Architecture References to Font are replaced with the QCChart2D class ChartFont Since the WPF FontStyle type does not include bold options an additional constructor is added which has a FontWeight parameter Specify the font weight using one of the FontWeights enumerated constants CH ChartFo
211. e and descriptive strings for use in displays RTAlarm The RTAlarm class stores alarm information for the RTProcessVar class The RTAlarm class specifies the type of the alarm the alarm color alarm text messages and alarm hysteresis value The RTProcessVar classes can hold an unlimited number of RTAlarm objects in a ArrayList RTAlarmEventArgs The RTProcessVar class can throw an alarm event based on either the current alarm state or an alarm transition from one alarm state to another The RTAlarmEventArgs class is used to pass alarm data to the event handler Panel Meter Classes com quinncurtis chart2dwpf ChartPlot RTPlot RTSingleValueIndicator RTPanelMeter RTNumericPanelMeter RTAlarmPanelMeter RTStringPanelMeter RTTimePanelMeter RTElapsedTimePanelMeter RTFormControlPanelMeter The RTPanelMeter derived classes are special cases of the single value indicator classes that are used throughout the software to display real time data in a text format Panel meters are available for numeric values string values time date values and alarm values All of the panel meter classes have a great many options for controlling the text font color size border and background of the panel meter rectangle RTPanelMeter objects are used in two ways First they can be standalone and once attached to an RTProcessVar object they can be added to a ChartView as any other QCChart2D GraphObj derived class Second they can be attached to most of the sing
212. e constants RT METER ARC RADIUS CAP RT METER ARC WEDGE WIDTH CAP RT METER ARC FLAT CAP InnerValueArcNormalized Set Get the value of the inner arc radius in normalized radius coordinates OuterArcCapStyle Set Get the outer arc cap style Use one of the constants RT METER ARC RADIUS CAP RT METER ARC WEDGE WIDTH CAP RT METER ARC FLAT CAP OuterValueArcNormalized Set Get the value of the outer arc radius in normalized radius coordinates SegmentSpacing Set Get the spacing of the arc segments in degrees SegmentValueRoundMode Set Get how the current process value is rounded up in calculating how many segments to display in RT METER SEGMENTED ARC SUBTYPE RT METER SINGLE SEGMENT ARC SUBTYPE modes Use one of the constants RT FLOOR VALUE RT CEILING VALUE SegmentWidth Set Get the value of the arc segment width in degrees 173 Meter Indicators Needle Arc and Symbol LineStyle A complete listing of RTMeterArcIndicator properties is found in the QCRTGraphWPFCompiledHelpFile chm documentation file located in the doc subdirectory In the single segment arc indicator subtype RTMeterArcIndicator IndicatorSubType METER SINGLE SEGMENT ARC SUBTYPE only the last segment is on The segments up to but not including the final segment are turned off Examples for arc meter indicators The examples below are program segments that give the important aspects of configuration an arc meter indicator for the image above it Extr
213. e a et 10608 am 12003 12793 10103 10208 10303 10403 There are more than 40 different time date axes types appropriate for scales ranging from 1 second to 100 years Date Axes QuarterMonth o a2 a3 04 at o2 os a4 at 2001 2002 2003 Month 5 Fa a Oa a JFMAMJJASOND JFMAMJJSASONDJFMAMJJASOND J 2000 2001 2002 2003 KEE E deb gk ol 2003 Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec Jan Feb Mar Apr May Jun Jul Aug Sep 2004 Day 5 Day Week I T T T T T T T w T F M 113108 T T T T T T T 1 wo T F M T w Day Day Week T T T T T T Wed Thu Fri Sat Sun Mon Tue 4 05 03 Wed Thu Fr T T T T T T T Sat Sun Mon Tue Wed Thu 12 03 There are more than 40 different time date axes types appropriate for scales ranging from 1 second to 100 years Date Axes Gau Hour 8 HourHour farete 10108 1102 08 110303 10403 oo 00 1690 000 6 00 10103 10203 4 HourHour Hout Minute krer reri reri errr fa a ooo 400 00 1200 1600 0 00 4 00 2 00 2100 400 10108 110108 Houf Minute 45 Minute Minute pepo Im SR ER 0 00 1 00 290 200 0 00 0 15 0 30 0 45 4 00 10108 10108 5 Minute Minute Minute 15 Seconds poo eo Pepa pet eta O00 005 040 oe 020 025 00000 00100 00200 00300 00400 10108 110108 Minute S Second 5 Second Second BASEE 0 00 00 02100 0 02 00 00300 00000 00005 00040 00045 0 020 m ARA There are more than 40 different time date axes types appropriate for scales ranging from 1 seco
214. e alarm events that notify user defined alarm handlers C Chart DashS RTAla lowhe lowhe lowhe RTAla highh highh highh doubl hear hear hear hear hear hear hear hear qt Eh cb Gt ct st et e neart near VB Dim d Color Dim 1 lowhe lowhe lowhe Dim h highh highh highh near near near near near near near near AddH near Gh get ee dg hear hear ct xt Process Variable and Alarm Classes 103 The example was extracted from the Treadmill example program method InitializeGraph See the example in the RTAlarmEventArgs section for one that generates alarm events Attribute defaultattrib new ChartAttribute Colors Green 1 0 tyles Solid Colors Green rm lowheartratealarm new RTAlarm ChartObj RT ALARM LOWERTHAN 30 artratealarm AlarmMessage Low Heart Rate artratealarm AlarmSymbolColor Colors Blue artratealarm AlarmTextColor Colors Blue rm highheartratealarm new RTAlarm ChartObj RT ALARM GREATERTHAN 160 eartratealarm AlarmMessage High Heart Rate eartratealarm AlarmSymbolColor Colors Red eartratealarm AlarmTextColor Colors Red e heartRateValue 0 0 Rate new RTProcessVar Heart Rate defaultattrib Rate MinimumValue 0 Rate MaximumValue 300 Rate DefaultMinimumDisplayValue 0 Rate DefaultMaximumDisplayValue 200 Rate AddAlarm lowheartratealarm Rate AddAlarm highheartratealarm Rate SetCurrentValue heartRateV
215. e intellectual property in the SOFTWARE is transferred to you You further acknowledge that title and full ownership rights to the SOFTWARE will remain the exclusive property of Quinn Curtis Inc and you will not acquire any rights to the SOFTWARE except as expressly set forth in this license You agree that any copies of the SOFTWARE will contain the same proprietary notices which appear on and in the SOFTWARE 7 EXPORT RESTRICTIONS You agree that you will not export or re export the SOFTWARE to any country person entity or end user subject to U S A export restrictions Restricted countries currently include but are not necessarily limited to Cuba Iran Iraq Libya North Korea Sudan and Syria You warrant and represent that neither the U S A Bureau of Export Administration nor any other federal agency has suspended revoked or denied your export privileges 8 NO WARRANTIES Quinn Curtis Inc expressly disclaims any warranty for the SOFTWARE THE SOFTWARE AND ANY RELATED DOCUMENTATION IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND EITHER EXPRESS OR IMPLIED INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OR MERCHANTABILITY FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT THE ENTIRE RISK ARISING OUT OF USE OR PERFORMANCE OF THE SOFTWARE REMAINS WITH YOU 9 LIMITATION OF LIABILITY IN NO EVENT SHALL QUINN CURTIS INC OR ITS SUPPLIERS BE LIABLE TO YOU FOR ANY CONSEQUENTIAL SPECIAL INCIDENTAL OR INDIRECT DAMAGES OF ANY KI
216. e of scroll graphs which use an elapsed time scale FetalMonitor A fetal monitor simulation HomeAutomation A simple home automation control panel HybridCar Simulation of the power control system for a hybrid car MeterApplicationl A simple meter example program MiniScope A simple mini scope multimeter simulation PIDControlTuner A PID example program Polygraph A polygraph simulation ProcessMonitoring A SCADA Supervisory Control and Data Acquistion simulation ProcessVarDataTables An example in the use of the RTProcessVarViewer class RTGraphNetDemo A miscellaneous assortment of scrolling graphs dynamic bar graphs meters annunciators dials and clocks RTStockDisplay A real time stock monitoring simulation RTXYDisplay A real time XY plot displaying Lissajous figures ScrollApplication1 A simple scrolling graph application Treadmill A treadmill display simulation VerticalScrolling Vertical scrolling examples WeatherStation A computerized weather station simulation WpfRTApplication1 A simple scrolling graph example referenced in the tutorial WpfRTApplication2 A more complicated scrolling graph example referenced in the tutorial 8 Introduction WpfRTBrowserApplicationl A simple browser based scrolling graph example referenced in the tutorial WpfRTBrowserApplication2 A more complicated browser based scrolling graph example
217. eButtonEventArgs Color The color class used in the Net Forms based version of QCChart2D is derived from the System Drawing Color class The WPF version of the Color class derives from the System Windows Media Color class Whereas the color enumerated constants for System Drawing colors are found in the Color class in WPF they are found in the Colors class Example System Drawing WPF C Color c Color Red Color c Colors Red VB Dim c as Color Color Red Dim c as Color Colors Red Color FromArgb and Color Rgb Custom RGB colors were defined in Net using the Color FromArgb static method It had a couple of overrides one with four arguments for a full ARGB color with alpha blending specification and one with just three for RGB The WPF Color class has two different static methods used to define RGB colors Color FromArgb for the full ARGB specification and Color FromRgb for just RGB Class Architecture 49 System Drawing CH Color e Color FromArgb 127 255 0 0 Color e Color FromArgb 255 0 0 VB Dim c as Color Color FromArgb 127 255 0 0 Dim c as Color Color FromArgb 255 0 0 WPF CH Color e Color FromArgb 127 255 0 0 Color c Color FromRgb 255 0 0 VB Dim c as Color Color FromArgb 127 255 0 0 Dim c as Color Color FromRgb 255 0 0 Linestyle Constants Line styles are used to specify whether a line is solid dashed dotted or some combination of dot and dash styles The line style class used in th
218. ecified index SetModuloltem Sets the modulo factor at the specified index A complete listing of RTComboProcessVar properties is found in the QCRTGraphWPFCompiledHelpFile chm documentation file located in the doc subdirectory Examples for using RTComboProcessVar in a clock application The example extracted from the example program AutoInstrumentPanel methods InitializeGraph and InitializeClock show the important aspects of using an RTComboProcessVar object to supply data for the three meter needle indicators used as the hands of a clock RTProcessVar clockdata new RTProcessVar 3 RTComboProcessVar clockl2Hour 12 hour clock clockdata 0 clockdata 1 clockdata 2 new RTProcessVar Seconds defaultattrib new RTProcessVar Minutes defaultattrib new RTProcessVar Hours defaultattrib clock12Hour new RTComboProcessVar 12 Hour Clock defaultattrib clockl2Hour AddProcessVar clockdata 0 seconds clockl2Hour AddProcessVar clockdata 1 minutes clockl2Hour AddProcessVar clockdata 2 hours Dials and Clocks 188 Clock Meter coordinates is going to be scaled from 0 12 new RTMe meterneedle2 meterneedle2 meterneedle2 chartVu AddC Hours ChartAttribu new Char RTMeterNeedl new RTMe meterneedle3 meterneedle3 meterneedle3 chartVu AddC terNeedl NeedleBaseWi SetChartObjA NeedleLength hartObject me te needleattr tAttribute eIndicator me terNeedl
219. ect meterneedle2 End Sub InitializeDiall 11 Single and Multiple Channel Annunciators RTAnnunciator RTMultiValueAnnunciator An annunciator is used to display the current values and alarm states of real time data Each channel of data corresponds to a rectangular cell where each cell can contain the tag name units current value and alarm status message Any of these items may be excluded If a channel is in alarm the background of the corresponding cell changes its color giving a strong visual indication that an alarm has occurred Single Channel Annunciator Class RTAnnunciator com quinncurtis chart2dwpf ChartPlot RTPlot RTMultiValueIndicator RTAnnunciator An RTAnnunciator is used to display the current values and alarm states of a single channel real time data RTAnnunciator constructor Visual Basic Overloads Public Sub New _ ByVal transform As PhysicalCoordinates ByVal datasource As RTProcessVar ByVal annunpos As Rectangle2D _ ByVal attrib As ChartAttribute C public RTAnnunciator PhysicalCoordinates transform RTProcessVar datasource Rectangle2D annunpos ChartAttribute attrib Parameters transform The coordinate system for the new RTAnnunciator object datasource The process variable associated with the annunciator annunpos Single and Multiple Channel Annunciators 193 The position and size of the annunciator attrib The color attributes of the annunciator The
220. ects Get a reference to the RTAlarmPanelMeter object Get Set the font used for the subhead title Get Set the default font used for the axes labels and axes titles Get Set the default font used for the numeric values labeling the indicator Set Get the default font used in the chart This is a string specifiying the name of the font Get Set the font used for the main title Get Set the font used for the main title Get Set the font used for the chart footer Get dialInterior RTGenShape object Set to true to show 3D faceplate Get the graph background object Get the default graph border for the chart Get Set any an indicator format is supported Gets or sets the height of the control Inherited from Control Get the most recent high RTAlarm object Get the most recent low RTAlarm object Get Set the tag string Gets or sets the size that is the upper limit that GetPreferredSize Size can specify Inherited from Control The maximum value for the indicator Gets or sets the size that is the lower limit that GetPreferredSize Size can specify MinIndicatorValue NumericPanelMeter PlotAttrib PlotBackground PreferredSize ProcessVariable RenderingMode ResizeMode TagPanelMeter UnitsPanelMeter UnitsString Visible Width Auto Indicator Classes 311 Inherited from Control The minimum value for the indicator Get a reference to the RTNumericPanelMeter object Get an RTProcessVar object in the Get
221. eedleLength 0 5 chartVu AddChartObject meterneedlel Minutes ChartAttribute needleattrib2 new ChartAttribute Colors Black 1 DashStyles Solid Colors Blue RTMeterNeedleIndicator meterneedle2 clockdata l dth 3 ttributes needleattrib2 0 45 terneedle2 ib3 l DashStyles Solid Colors Blue terneedle3 clockdata 21 4 dth 5 ttributes needleattrib3 0 3 terneedle3 VB Private clockdata 2 As RTProcessVar Private clockl2Hour As RTComboProcessVar 12 hour clock 189 Dials and clockdata 0 clockdata 1 clockdata 2 Clocks New RTProcessVar Seconds defaultattrib New RTProcessVar Minutes defaultattrib New RTProcessVar Hours defaultattrib clock12Hour New RTComboProcessVar 12 Hour Clock defaultattrib ckdata 0 seconds ckdata 1 minutes ckdata 2 hours Clock Meter coordinates is going to be scaled from 0 12 clockl2Hour AddProcessVar clo clockl2Hour AddProcessVar clo clockl12Hour AddProcessVar clo clock12Hour SetDivisorItem 0 clock12Hour SetDivisorItem 1 clock12Hour SetDivisorItem 2 clock12Hour SetModuloItem 0 clock12Hour SetModuloItem 1 clock12Hour SetModuloItem 2 Private Sub InitializeClock Dim startarcangle As Doub Dim arcextent As Double Dim startarcscale As Doub Dim endarcscale As Double Dim arcdirection As Boole Dim arcradius As Double Dim centerx As Double 0 Dim centery As Double Dim meterFont A
222. el DefaultMinimumDisplayValue 0 currentTemperaturel DefaultMaximumDisplayValue 150 currentTemperaturel SetCurrentValue currentTemperatureValuel currentTemperaturel AddAlarm templowalarml currentTemperaturel AddAlarm temphighalarml Important enables historical data collection for scroll graphs currentTemperaturel DatasetEnableUpdate True AddHandler currentTemperaturel AlarmTransitionEventHandler New RTAlarmEventDelegate AddressOf TemperatureAlarmEventProc templowalarm2 New RTAlarm ChartObj RT ALARM LOWERTHAN 80 templowalarm2 AlarmMessage Low Alarm templowalarm2 AlarmSymbolColor Colors Blue templowalarm2 AlarmTextColor Colors Blue temphighalarm2 New RTAlarm ChartObj RT ALARM GREATERTHAN 120 temphighalarm2 AlarmMessage High Alarm temphighalarm2 AlarmSymbolColor Colors Red temphighalarm2 AlarmTextColor Colors Red Hr currentTemperature2 New RTProcessVar Temp 2 New ChartAttribute Colors Green 1 0 DashStyles Solid Colors Green Hr currentTemperature2 MinimumValue 20 currentTemperature2 MaximumValue 200 currentTemperature2 DefaultMinimumDisplayValue 0 currentTemperature2 DefaultMaximumDisplayValue 150 currentTemperature2 SetCurrentValue currentTemperatureValue2 currentTemperature2 AddAlarm templowalarm2 currentTemperature2 AddAlarm temphighalarm2 Important enables historical data collection for scroll graphs currentTemperature2 DatasetEnableUpdate True AddHand
223. elMeter panelmeter Dim panelmeter2 As New RTAlarmPanelMeter pTransforml panelmeterattrib panelmeter2 PanelMeterPosition ChartObj BELOW REFERENCED TEXT panelmeter2 SetPositionReference panelmeter panelmeter2 TextColor Colors SpringGreen panelmeter2 AlarmTemplate TextFont font10 panelmeter2 AlarmIndicatorColorMode _ ChartObj RT TEXT BACKGROUND COLOR CHANGE ON ALARM barplot AddPanelMeter panelmeter2 String Panel Meter Class RTStringPanelMeter com quinncurtis chart2dwpf ChartPlot RTPlot RTSingleValueIndicator RTPanelMeter RTStringPanelMeter The RTStringPanelMeter class displays a string either an arbitrary string or a string based on string data in the associated RTProcessVar object It is usually used to display a channels tag string and units string but it can also be used to display longer descriptive strings It contains a template based on the QCChart2D StringLabel class that is used to specify the font and string format information associated with the panel RTStringPanelMeter constructors Visual Basic Overloads Public Sub New _ ByVal transform As PhysicalCoordinates ByVal datasource As RTProcessVar ByVal attrib As ChartAttribute ByVal stringtype As Integer Overloads Public Sub New _ ByVal transform As PhysicalCoordinates ByVal attrib As ChartAttribute _ ByVal stringtype As Integer Overloads Public Sub New _ ByVal transform As PhysicalCoordinates ByV
224. elative to the upper left corner of its container Inherited from Control Inherited from DataGridBase Inherited from DataGridBase Inherited from DataGridBase Inherited from DataGridBase Inherited from DataGridBase Inherited from ChartView Inherited from ChartView Gets the distance in pixels between the right edge of the control and the left edge of its container s client area Inherited from Control Inherited from DataGridBase Inherited from DatasetViewer Inherited from DataGridBase Inherited from ChartView Inherited from DatasetViewer Inherited from DataGridBase Inherited from DataGridBase Inherited from DatasetViewer Inherited from DataGridBase Inherited from DataGridBase Inherited from DataGridBase Inherited from DataGridBase Inherited from DataGridBase Inherited from ChartView Inherited from DataGridBase Gets or sets the distance in pixels between the top edge of 268 Process Variable Viewer the control and the top edge of its container s client area Inherited from Control TransformList Inherited from DataGridBase UseStripedGridBackground Inherited from DataGridBase Gets the characteristics associated with the vertical scroll bar Inherited from ScrollableControl Gets or sets a value indicating whether the control is Visible displayed Inherited from Control Gets or sets a value indicating whether the vertical scroll bar Vertic
225. emplate TextBgMode false panelmeter AlarmIndicatorColorMode ChartObj RT INDICATOR COLOR NO ALARM CHANGE annunciator AddPanelMeter panelmeter chartVu AddChartObject annunciator VB Private Sub InitializeAnnunciator Dim pTransforml As New CartesianCoordinates 0 0 0 0 1 0 1 0 pTransforml SetGraphBorderDiagonal 0 05 0 1 0 725 0 175 Dim attrib As ChartAttribute Dim attribArray annunciatorl Length As ChartAttribute Dim i As Integer For i 0 To annunciatorl Length 1 attrib New ChartAttribute Colors DarkRed 3 DashStyles Solid Colors DarkRed attribArray i attrib Next i Dim numrows As Integer 1 Dim numcols As Integer 8 Dim annunciator As New RTMultiValueAnnunciator pTransforml annunciatorl numcols numrows attribArray annunciator CellColumnMargin 0 05 annunciator CellRowMargin 0 1 Dim panelmetertagattrib As New ChartAttribute Colors SteelBlue 3 DashStyles Solid Colors White Dim panelmeter As New RTStringPanelMeter pTransforml annunciator1 0 panelmetertagattrib ChartObj RT TAG STRING panelmeter StringTemplate TextFont font10Bold panelmeter PanelMeterPosition ChartObj INSIDE BAR panelmeter Frame3DEnable False panelmeter TextColor Colors White panelmeter StringTemplate TextBgMode False panelmeter AlarmIndicatorColorMode ChartObj RT INDICATOR COLOR NO ALARM CHANGE annunciator AddPanelMeter panelmeter chartVu AddChartObject annunciator
226. en meter object RTPanelMeter objects can be attached to an RTMeterIndicator object for the display of RTProcessVar numeric alarm and string data in addition to the indicator graphical display Meter scaling meter axes meter axis labels and alarm objects and handle by other classes Only the blue meter arc is the arc indicator The other elements of the meter include meter axes meter axis labels and panel meters for the numeric tag and alarm displays 26 Class Architecture RTMeterArcIndicator This RTMeterArcIndicator class displays the current RTProcessVar value as an arc Segmented meter arcs are one of the RTMeterArcIndicator subtypes Only the blue meter needles are the meter needle indicators The other elements of the meter include meter axes meter axis labels and panel meters for the numeric tag and alarm displays RTMeterNeedleIndicator This RTMeterNeedleIndicator class displays the current RTProcessVar value as a needle Subtypes of the RTMeterNeedleIndicator are simple needles pie wedge shaped needles and arrow needles Meter symbols can be any of 10 different shapes the symbols can have any size and the spacing between the symbols can have any value Class Architecture 27 RTMeterSymbolIndicator This RTMeterSymbolIndicator class displays the current RTProcessVar value as a symbol moving around in the meter arc Symbols include all of the QCChart2D scatter plot symbols SQUARE TRIANGLE DIAMOND CROSS PLU
227. en the process value will always go into alarm once the threshold value of 70 is exceeded If the hysteresis value is 2 then the process variable will not fall out of alarm until the process value is less than alarmlimitvalue hysteresisvalue 70 2 68 If you don t want hysteresis set it equal to 0 0 The most commonly used RTAlarm properties are Selected Public Instance Properties AlarmLimitValue Get Set the alarm limit value AlarmMessage Get Set the current alarm message AlarmState Get Set the alarm state true if the last call to CheckAlarm show that the process variable currently in alarm AlarmSymbolColor Get Set the alarm symbol color AlarmTextColor Get Set the alarm text color AlarmType Get Set the alarm type RT ALARM NONE RT ALARM LOWERTHAN ot RT ALARM GREATERTHAN Hysteresis Value Get Set the alarm hysteresis value A complete listing of RTAlarm properties is found in the QCRTGraphWPFCompiledHelpFile chm documentation file located in the doc subdirectory Once an RTAlarm object is added to an RTProcessVar object alarm checking takes place every time the RTProcessVar SetCurrentValue method is called Any displays dependent on the alarm will not change until the ChartView UpdateDraw method is called forcing a repaint of the view Example of RTAlarm objects added to an RTProcessVar object The example below creates and updates an RTProcessVar object that uses alarms It does not however generat
228. erl InitRTProcessVarViewer chartVu Nothing currentTemperaturel rows columns startindex _ ChartObj VERT DIR rtProcessVarViewerl UseStripedGridBackground True rtProcessVarViewerl GridCellFont font14 rtProcessVarViewerl AddProcessVar currentTemperature2 Set custom decimal precision for each row rtProcessVarViewerl SetFormatDecimalPos 0 0 rtProcessVarViewerl SetFormatDecimalPos 1 1 rtProcessVarViewerl SetFormatDecimalPos 2 2 End Sub 19 Auto Indicator Classes RTAutoBarIndicator RTAutoMultiBarIndicator RTAutoMeterIndicator RTAutoClockIndicator RTAutoDialIndicator RTAutoScrollGraph RTAutoPanelMeterIndicator The auto indicator classes are designed to simplify the creation of real time displays Each class encapsulates a collection of objects need to build a complete real time indicator object bar indicators meters dials clocks and scrolling graphs Since each indicator class is considered a UserControl by Net it can be added to the Visual Studio Toolbox where it can be selected and dropped on a form There are seven self containted auto indicator classes single channel bar indicator multi channel bar indicator meters dials clocks panel meter and scrolling graphs The ChartView class is the base class for the auto indicator classes Each indicator is placed in its own ChartView derived window along with all other objects typically associated the indicator axes labels process variables alarms titles etc
229. es Dim panelmeter As New RTNumericPanelMeter pTransforml panelmeterattrib panelmeter PanelMeterPosition ChartObj OUTSIDE PLOTAREA MIN panelmeter PanelMeterNudge New Point2D 0 4 Numeric Panel Meter Class RTNumericPanelMeter com quinncurtis chart2dwpf ChartPlot RTPlot RTSingleValueIndicator RTPanelMeter RTNumericPanelMeter The RTNumericPanelMeter class displays the floating point numeric value of an RTProcessVar object It contains a template based on the QCChart2D NumericLabel class that is used to specify the font and numeric format information associated with the panel meter RTNumericPanelMeter constructors Visual Basic Overloads Public Sub New _ ByVal transform As PhysicalCoordinates ByVal datasource As RTProcessVar ByVal attrib As ChartAttribute _ Overloads Public Sub New _ ByVal transform As PhysicalCoordinates _ ByVal attrib As ChartAttribute C public RTNumericPanelMeter PhysicalCoordinates transform RTProcessVar datasource ChartAttribute attrib public RTNumericPanelMeter PhysicalCoordinates transform ChartAttribute attrib Parameters transform The coordinate system for the new RTNumericPanelMeter object datasource The process variable associated with the panel meter attrib The color attributes of the panel meter indicator Panel Meter Classes 115 Selected Public Instance Properties Set Get the NumericLabel template for the panel
230. et any an indicator format is supported Gets or sets the height of the control Inherited from Control Get the most recent high RTAlarm object Get the most recent low RTAlarm object Get Set the tag string Gets or sets the size that is the upper limit that GetPreferredSize Size can specify Inherited from Control The maximum value for the indicator Gets or sets the size that is the lower limit that GetPreferredSize Size can specify Inherited from Control The minimum value for the indicator Get a reference to the RTNumericPanelMeter object Get an RTProcessVar object in the Get the plot background object Inherited from ChartView Get most recently created RTProcessVar Inherited from ChartView Inherited from ChartView Get a reference to the tag panel meter object Get a reference to the units string panel meter object Get Set the units string Gets or sets a value indicating whether the control is displayed Inherited from Control Gets or sets the width of the control Inherited from Control A complete listing of RTAutoMeterIndicator properties is found in the QCRTGraphWPFCompiledHelpFile chm documentation file located in the doc subdirectory There are 12 different meter formats four horizontal and four vertical Use the GraphFormat property 0 11 to set the format Below you will find a brief description of the differences between the formats 298 Auto Indicator Classes 4
231. etChartObjAttributes attribl meterneedle NeedleLength 0 75 Add panel meters chartVu AddChartObject meterneedle Dim meteraxis As New RTMeterAxis meterframe meterneedle meteraxis SetChartObjAttributes attribl meteraxis SetAxisTickDir ChartObj AXIS MIN meteraxis LineWidth 5 meteraxis LineColor Colors White meteraxis SetAxisTickSpace 1 meteraxis SetAxisMinorTicksPerMajor 1 meteraxis ShowAlarms True meterneedle MeterAxis meteraxis chartVu AddChartObject meteraxis Dim meterFont As ChartFont fonti4Bold Dim meteraxislabels As New RTMeterAxisLabels meteraxis meteraxislabels SetTextFont meterFont meteraxislabels LineColor Colors White meteraxislabels SetAxisLabelsDir meteraxis GetAxisTickDir meteraxislabels OverlapLabelMode ChartObj OVERLAP LABEL DRAW chartVu AddChartObject meteraxislabels Dim meteraxis2 As New RTMeterAxis meterframe meterneedle meteraxis2 SetChartObjAttributes attribl meteraxis2 SetAxisTickDir ChartObj AXIS MIN meteraxis2 LineWidth 1 meteraxis2 LineColor Colors White meteraxis2 SetAxisTickSpace 0 1 meteraxis2 AxisMinorTickLength 10 meteraxis2 AxisMajorTickLength 10 meteraxis2 SetAxisMinorTicksPerMajor 10 meteraxis2 ShowAlarms False chartVu AddChartObject meteraxis2 162 Meters Coordinates Meter Axes and Meter Axis Labels Numeric Meter Axis Labels Class RTMeterAxisLabels com quinncurtis chart2dwpf NumericAxisLabels RTMeterAxisLabels This class
232. etLineWidth 1 xAxisGrid SetLineStyle DashStyles Solid chartVu AddChartObject xAxisGrid LinearAxis yaxis2 new LinearAxis pTransforml ChartObj Y AXIS yaxis2 LineColor Colors Black yaxis2 AxisTickDir ChartObj AXIS MAX yaxis2 AxisIntercept xaxis AxisMax chartVu AddChartObject yaxis2 TimeAxisLabels xAxisLab new TimeAxisLabels xaxis xAxisLab TextFont axisFont chartVu AddChartObject xAxisLab NumericAxisLabels yAxisLab new NumericAxisLabels yaxis yAxisLab TextFont axisFont chartVu AddChartObject yAxisLab scrollFrame new RTScrollFrame chartVu currentTemperaturel pTransforml ChartObj RT FIXEDEXTENT MOVINGSTART AUTOSCROLL Using QCRTGraph for WPF to Create Web Applications 359 scrollFrame AddProcessVar currentTemperature2 ScrollFrame ScrollScaleModeY ChartObj RT AUTOSCALE Y MINMAX Allow 100 samples to accumlate before autoscaling y axis This prevents rapid changes of the y scale for the first few samples ScrollFrame MinSamplesForAutoScale 100 ScrollFrame ScrollRescaleMargin 0 05 chartVu AddChartObject scrollFrame if scrollMode 0 ChartAttribute attribl new ChartAttribute Colors Yellow 2 DashStyles Solid SimpleLinePlot lineplotl new SimpleLinePlot pTransforml null attribl lineploti SetFastClipMode ChartObj FASTCLIP X RTSimpleSingleValuePlot solarPanelLinePlotl new RTSimpleSingleValuePlot pTr
233. even values and well rounded major and minor tick mark spacing is quite complicated The AutoScale classes provide tools that make automatic generation of charts easier AutoScale This class is the abstract base class for the auto scale classes LinearAutoScale This class is a concrete implementation of the AutoScale class It calculates scaling values based on the numeric values in SimpleDataset and GroupDataset objects Linear scales and axes use it for auto scale calculations LogAutoScale This class is a concrete implementation of the AutoScale class It calculates scaling values based on the numeric values in SimpleDataset and GroupDataset objects Logarithmic scales and axes use it for auto scale calculations 60 QCChart2D Class Summary TimeAutoScale This class is a concrete implementation of the AutoScale class It calculates scaling values based on the ChartCalendar values in TimeSimpleDataset and TimeGroupDataset objects Date time scales and axes use it for auto scale calculations ElapsedTimeAutoScale This class is a concrete implementation of the AutoScale class It calculates scaling values based on the numeric values in ElapsedTimeSimpleDataset and ElapsedTimeGroupDataset objects The elapsed time classes use it for auto scale calculations Chart Object Classes Chart objects are graph objects that can be rendered in the current graph window This is in comparison to other classes that are purely calculation classes s
234. f the scatter plot symbol constants NOSYMBOL SQUARE TRIANGLE DIAMOND CROSS PLUS STAR LINE HBAR VBAR BAR3D CIRCLE SymbolPosPercent Set Get the radial position of the symbol indicator SymbolSize Set Get the size of the symbol indicator in points SymbolSpacing Get Set the space in degrees between adjacent symbols A complete listing of RTMeterSymbolIndicator properties is found in the QCRTGraphWPFCompiledHelpFile chm documentation file located in the doc subdirectory In the single symbol indicator subtype RTMeterSymbollIndicator IndicatorSub Type RT METER SINGLE SYMBOL SUBTYPE only the last symbol is on The symbols up to but not including the final symbol are turned off Examples for symbol meter indicators The examples below are program segments that give the important aspects of configuration a needle meter indicator for the image above it The top meter indicator extracted from the example program RTGraphNetDemo file SymbolMeterUserControll method InitializeMeter2 183 Meter Indicators Needle Arc and Symbol LineStyle C RTMeterSymbolIndicator metersymbolindicator new RTMeterSymbolIndicator meterframe processVar2 metersymbolindicator SetChartObjAttributes attribl metersymbolindicator IndicatorSubtype ChartObj RT METER SYMBOL ARC SUBTYPE metersymbolindicator SymbolSpacing 10 metersymbolindicator SymbolNum ChartObj SQUARE metersymbolindicator IndicatorBackgroundEn
235. for the other panel meter classes While it cannot be instantiated it does contain properties and methods common to all panel meters A summary of these properties is listed below Selected Public Instance Properties AlarmIndicatorColorMode Get Set whether the color of the indicator objects inherited from changes on an alarm Use one of the constants RTSingleValueIndicator RT INDICATOR COLOR NO ALARM CHANGE RT INDICATOR COLOR CHANGE ON ALARM ContrastTextAlarmColor Set Get a contrast color to use for text when the object inherited from is in alarm and the background color of the panel meter RTPanelMeter changes CurrentProcessValue inherited Get the current process value of the primary channel from RTSingleValueIndicator Frame3DEnable inherited Set Get to true to enable a 3D frame for the panel from RTPanelMeter meter PanelMeterNudge inherited Set Get the xy values of the PanelMeterNudge from RTPanelMeter property The PanelMeterNudge property moves the relative position using window device coordinates of the text relative to the specified location of the text PanelMeterPosition inherited Set Get the panel meter position value Use one of the from RTPanelMeter panel meter position constants See table for positioning constants PositionReference inherited Set Get an RTPanelMeter object used as a positioning from RTPanelMeter reference for this RTPanelMeter object PrimaryChannel inherited Set Get the pri
236. generated by the VB project wizard versus the C project wizard The C wizard includes a namespace reference in the class definition found in the main Pagel xaml file as in WpfBrowserApplicationl Pagel In Visual Basic the default Pagel xaml file does not include the namespace reference as in the example below If you stick with the default VB class definition no namespace you must be consistent across all of your source files and not specify a project namespace Most all of our other examples use namespaces throughout the project largely because they were translated directly from the C examples and all of the C examples use namespaces The XAML portion of the project looks like Window x Class Window1 xmlns http schemas microsoft com winfx 2006 xaml presentation xmlns x http schemas microsoft com winfx 2006 xaml Title Window1 Height 300 Width 300 gt lt Grid gt lt Grid gt lt Window gt Using QCRTGraph for WPF to Create Windows Applications 343 New Project Project types Templates NET Framework 3 5 M E E Visual C Visual Studio installed templates Windows eae Web ix Windows Forms Application GE Class Library DocProject CR ASP NET Web Application RL ASP NET Web Service Application Reporting a5 WPF Application FRE WPF Browser Application WCF m Console Application PES WCF Service Application Workflow Gel Windows Forms Control Library i Dynamic Data Entities Web Application E Othe
237. gonal 0 05 0 175 0 08 0 35 z Background background new Background pTransforml ChartObj PLOT BACKGROUND Colors Gray chartVu AddChartObject background ChartAttribute attribl new ChartAttribute Colors Green 1 DashStyles Solid Colors Green double barwidth 1 0 barbase 0 0 int barjust ChartObj JUSTIFY MIN int barorient ChartObj VERT DIR LinearAxis baraxis new LinearAxis pTransforml ChartObj Y AXIS baraxis CalcAutoAxis chartVu AddChartObject baraxis NumericAxisLabels barAxisLab new NumericAxisLabels baraxis chartVu AddChartObject barAxisLab RTBarIndicator barplot new RTBarIndicator pTransforml EngineRPM1 barwidth barbase attribl barjust barorient 136 Single Channel Bar Indicator barplot SegmentSpacing 400 barplot SegmentWidth 250 barplot IndicatorBackground new ChartAttribute Colors Black 1 DashStyles Solid Colors Black barplot SegmentValueRoundMode ChartObj RT CEILING VALUE barplot SegmentCornerRadius 0 barplot IndicatorSubType ChartObj RT BAR SEGMENTED SUBTYPE RTAlarmIndicator baralarms new RTAlarmIndicator baraxis barplot chartVu AddChartObject baralarms ChartAttribute panelmeterattrib new ChartAttribute Colors SteelBlue 3 DashStyles Solid Colors Black ChartAttribute paneltagmeterattrib new ChartAttribute Colors SteelBlue 3 DashStyles Solid Colors White RTNumericPanelMeter panelmeter new RTNumericPanelMeter pTra
238. h and low alarms historical data storage and descriptive strings for use in displays Indicators that display the current value of a single process variable the RTBarIndicator the RTMeterIndicator and RTPanelMeter classes for example reference back to a single RTProcessVar object Indicators that display the current values of multiple process variables the RTMultiBarIndicator RTMultiValueAnnunciator and RTFormControlGrid classes reference back to a collection of RTProcessVar objects Even though an RTProcessVar object is in a multi value indicator collection with other RTProcessVar objects it maintains its own unique settings for limit values alarm limits and descriptive strings The RTSimpleSingleValuePlot and RTGroupMultiValuePlot classes provide a link between the RTProcessVar class and the charting routines in the QCChart2D charting package The RTSimpleSingleValuePlot class combines any of the QCChart2D SimplePlot classes with an RTProcessVar object and the RTGroupMultiValuePlot class combines any of the QCChart2D GroupPlot classes with a collection of RTProcessVar objects The RTProcessVar class manages a historical data buffer based on the QCChart2D ChartDataset class Each time the current value of the RTProcessVar object is updated it is time stamped and its value appended to the internal ChartDataset The time stamp can either be explicitly supplied in the update call or it can be automatically derived from the system clock From
239. hannels inherited from RTPlot PlotLabelTemplate inherited from ChartPlot Set Get the spacing between adjacent items in multi channel plots Set Get the width of bars in physical coordinates for bar plots Sets the attributes for a chart object using a ChartAttribute object Sets the object clipping mode Use one of the object clipping constants NO_CLIPPING GRAPH AREA CLIPPING PLOT AREA CLIPPING or INHERIT CLIPPING Sets the reference to the ChartView component that the chart object is placed in Enables Disables the chart object A chart object is drawn only if it is enabled A chart object is enabled by default Sets the reference to the PhysicalCoordinates object that the chart object is placed in Get the current process value of the primary channel Set Get the base value in physical coordinates of solid bars and filled areas plot objects Sets the fill color for the chart object Get Set the background attribute of the bar indicator Set to true to enable the display of the bar indicator background Get Set the bar indicator sub type RT BAR SOLID SUBTYPE RT BAR SEGMENTED SUBTYPE RT BAR SINGLE SEGMENT SUBTYPE RT POINTER SUBTYPE Set Get number of digits to the right of the decimal point in the PlotLabelTemplate property Set Get the numeric format of the PlotLabelTemplate property Sets the line color for the chart object Sets the line style for the chart object Sets the line width for t
240. hart ChartShape This class encapsulates a System Windows Media PathGeometry class placing the shape in a chart using a position defined in chart coordinates A chart can display any object that can be defined using PathGeometry class ChartSymbol This class defines symbols used by the SimplePlot scatter plot functions Pre defined symbols include square triangle diamond cross plus star line horizontal bar vertical bar 3D bar and circle Mouse Interaction Classes MouseListener MoveObj FindObj DataToolTip DataCursor MoveData MagniView MoveCoordinates MultiMouseListener ChartZoom Several classes implement delegates for mouse events The MouseListener class implements a generic interface for managing mouse events in a graph window The DataCursor MoveData MoveObj ChartZoom MagniView and MoveCoordinates classes also implement mouse event delegates that use the mouse to mark move and zoom chart objects and data MouseListener This class implements Net delegates that trap generic mouse events button events and mouse motion events that take place in a ChartView window A programmer can derive a class from MouseListener and override the methods for mouse events creating a custom version of the class MoveObj This class extends the MouseListener class and it can select chart objects and move them Moveable chart objects include axes axes labels titles legends arbitrary text 88 QCChart2D Class Summary Find
241. hart2dwpf PolarCoordinates RTMeterCoordinates Class Architecture 17 com quinncurtis chart2dwpf LinearAxis RTMeterAxis com quinncurtis chart2dwpf NumericAxisLabels RTMeterAxisLabels com quinncurtis chart2dwpf StringAxisLabels RTMeterStringAxisLabels System Windows Controls Button RTControlButton System Windows Controls Slider RTControlTrackBar com quinncurtis chart2dwpf ChartObj RTFormControl System Windows Controls UserControl ChartView RTAutoIndicator RTAutoBarIndicator RTAutoMultiBarIndicator RTAutoMeterIndicator RTAutoClockIndicator RTAutoDialIndicator RTAutoScrollGraph RTAutoPanelMeterIndicator QCRTGraph Classes System Windows Controls UserControl ChartView RTAutoIndicator RTAutoBarIndicator RTAutoMultiBarIndicator RTAutoMeterIndicator RTAutoClockIndicator RTAutoDialIndicator RTAutoScrollGraph RTAutoPanelMeterIndicator The starting point of a chart is the ChartView class The ChartView class derives from the WPFSystem Windows Controls UserControl class The ChartView class manages 18 Class Architecture a collection of chart objects in a chart and automatically updates the chart objects whenever the control needs to redraw itself Since the ChartView class is a subclass of the UserControl class it can act as a container for other WPF components such as buttons and checkboxes The ChartView class is the base class for the self contained auto indicator classes Each real time indicator is placed in its
242. hat cannot be removed Developer Version The developer version of Real Time Graphics Tools for WPF is downloaded in a file named something like WPFRTGDEVIUR2x0x561x1 zip The developer version does not time out and you can use it to create application programs that you can distribute Introduction 9 royalty free You can download free updates for a period of 2 years When you placed your order you were e mailed download link s that will download the software Those download links will remain active for at least 2 years and should be used to download current versions of the software After 2 years you may have to purchase an upgrade to continue to download current versions of the software Source Code The commented source code to the QCRTGraph charting software also available The source code is written entirely in C It can be compiled using Visual Studio 2008 and higher Net C compilers It can be ordered using the model WPF RTG SRC Purchasers of the QCRTGraph source code must also own a valid Developer License since all example programs user manuals and licenses are installed as part of the Developer Version of the software Some programmers seem to think they can make do with just the source code without the Developer Version Purchasing the source without a Developer License does not give a license to use the software so don t do it Chapter Summary The remaining chapters of this book discuss the Real Time Graphics Tools fo
243. he Windowl1 xaml code and add the reference to ChartView object scrollAppl in the Grid layout panel The Windowl xaml file now looks like Window x Class Window1 xmlns http schemas microsoft com winfx 2006 xaml presentation xmlns x http schemas microsoft com winfx 2006 xaml Title Window1 Height 800 Width 1000 xmlns my clr namespace com quinncurtis chart2dwpf assembly QCChart2DWPF3 xmins my2 clr namespace com quinncurtis rtgraphwpf assembly QCRTGraphWPF3 gt lt Grid gt my ChartView Margin 5 5 5 5 Name scrollApp1 gt lt Grid gt lt Window gt Display the Window1 asml vb behind code file It will look something like this Class Windowl End Class 346 Using Real Time Graphics Tools for WPF to Create Windows Applications e Adda reference to the QCChart2DWPF and QCRTGraphWPF namespaces com quinncurtis chart2dwpf and com quinncurtis rtgraphwpf in the using section of the program Imports com quinncurtis chart2dwpf Imports com quinncurtis rtgraphwpf e Add a new simple class file named ScrollGraph1 to the project Alternatively select Add Existing Item and select the file ScrollGraph1 vb from our WpfRTApplication example folder If you do that make sure you change the declared namespace at the top of the file namespace WpfRTApplicationl to the one your project uses probably namespace WpfApplicationl Add New Item WpfRTApplication1 Categories Templates KC E Common Ite
244. he chart object Get the number of channels in the indicator Set Get the plot objects data point template If the plot supports it this PlotLabelTemplate object is used as a PointerSymbolNum PrimaryChannel inherited from RTPlot RTDataSource inherited from RTSingleValueIndicator SegmentCornerRadius SegmentSpacing SegmentValueRoundMode SegmentWidth ShowDatapointValue inherited from ChartPlot StepMode inherited from ChartPlot ZOrder inherited from GraphObj Multiple Channel Bar Indicator 145 template to size color and format the data point numeric values Set Get the symbol used for the pointer symbol indicator subtype RT POINTER SUBTYPE Use one of the constants RT NO SYMBOL RT LEFT LOW ALARM SYMBOL RT LEFT SET POINT SYMBOL RT LEFT HIGH ALARM SYMBOL RT RIGHT LOW ALARM SYMBOL RT RIGHT SETPOINT SYMBOL RT RIGHT HIGH ALARM SYMBOL RT TOP LOW ALARM SYMBOL RT TOP SETPOINT SYMBOL RT TOP HIGH ALARM SYMBOL RT BOTTOM LOW ALARM SYMBOL RT BOTTOM SETPOINT SYMBOL RT BOTTOM HIGH ALARM SYMBOL Set Get the primary channel of the indicator Get Set the array list holding the RTProcessVar variables for the indicator Get Set the corner radius used to draw the segment rounded rectangles Get Set the segments spacing for the RT BAR SEGMENTED SUBTYPE and RT BAR SINGLE SEGMENT SUBTYPE bar indicator sub types Set Get the segment value round mode Specifies that the current process
245. hemas microsoft com winfx 2006 xaml Title Pagel Height 600 Width 800 xmlns my clr namespace com quinncurtis chart2dwpf assembly QCChart2DWPF3 xmlns my2 clr namespace com quinncurtis rtgraphwpf assembly QCRTGraphWPF3 lt Grid gt my ChartView Margin 5 5 5 5 Name scrollApp1 gt lt Grid gt lt Page gt Display the Pagel asml cs behind code file It will look something like this Class Pagel End Class e Adda reference to the QCChart2DWPF and QCRTGraphWPF namespaces com quinncurtis chart2dwpf and com quinncurtis rtgraphwpf in the using section of the program 366 Using OCRTGraph for WPF to Create Web Applications Imports com quinncurtis chart2dwpf Imports com quinncurtis rtgraphwpf e Add a new simple class file named ScrollGraph1 to the project Alternatively select Add Existing Item and select the file ScrollGraph1 vb from our WpfRTBrowserApplication example folder If you do that make sure you change the declared namespace at the top of the file namespace Wp fRTBrowserApplication1 to the one your project uses probably namespace WpfBrowserApplicationl Add New Item WpfRTBrowserApplication 1 Categories Templates E Common Items Code Data General Web Windows Forms Reporting Workflow WPF Visual Studio installed templates E About Box Ye Class Ye Code File di Component Class Custom Control WPF Dialog EE Explorer Form vg Interface
246. hese objects can be positioned in a chart using one of the many chart coordinate systems available for positioning including physical coordinates PHYS_POS device coordinates DEV_POS plot normalized coordinates NORM_PLOT_POS and graph normalized coordinates NORM GRAPH POS The only limit to the number of annunciator cells you can have in an RTMultiValueAnnunciator graph is the size of the display and the readability of the text RTMultiValueAnnunciator Class Architecture 29 An RTMultiValueAnnunciator is used to display the current values and alarm states of a collection of RTProcessVar objects It consists of a rectangular grid with individual channels represented by the rows and columns in of the grid Each grid cell can contain the tag name units current value and alarm status message for a single RTProcessVar object Any of these items may be excluded If a channel is in alarm the background of the corresponding cell changes its color giving a strong visual indication that an alarm has occurred USS 600 400 200 RTMultiBarIndicator i a k Each bar in the RTMultiBarIndicator can have individual colors and alarm limits An RTMultiBarIndicator is used to display the current value of a collection of RTProcessVar objects using a group of bars changing size The bars are always fixed at the specified base value Bars can change their size either in vertical or horizontal direction Su
247. hich customizes the chart See the ScrollGraph1 cs file of the WpfRTBrowserApplicationl example using System using System Windows using System Collections Generic using System Ling using System Text using System Windows Media using System Windows Controls using System Windows Input using com quinncurtis chart2dwpf using com quinncurtis rtgraphwpf namespace WpfRTApplicationl lt summary gt Summary description for ScrollApplicationUserControll lt summary gt public class ScrollGraphl System Windows Threading DispatcherTimer timer1 System Windows Threading DispatcherTimer System Windows Threading DispatcherTimer timer2 System Windows Threading DispatcherTimer double currentTemperatureValuel 110 0 RTProcessVar currentTemperaturel double currentTemperatureValue2 100 0 RTProcessVar currentTemperature2 RTAlarm templowalarml RTAlarm temphighalarml RTAlarm templowalarm2 RTAlarm temphighalarm2 ChartFon new new RTScrollFrame scrollFrame new RTScrollFrame font12 new ChartFont Microsoft Sans Serif ChartFont font14 new ChartFont Microsoft Sans Serif ChartFon ChartView chartVu int scrollMode 0 public ScrollGraphl ChartView chartvu fontl4Numeric new ChartFont Digital SF 14 12 FontStyles Normal 14 FontStyles Normal FontStyles Normal 358 Using OCRTGraph for WPF to Create Web Applications chartVu chartvu
248. hics Tools for WPF to Create Windows Applications Add Reference NET COM Projects Browse Recent Look in lb v Eigacutil exe ISTOCRTGraphWPF3 dil 8 occhart2DNet dil X ocsPCChartNet dil S QCSPCChartWWPF3 dil 8 QCChart3DNet dll 8 QCChart3DVisionAux dll 5 QcMatPackNet dil 5 QcMatViewNet dil 8 QCRTGraphNet dll GCRTGraphWPF3 dll QCChart2DWPF3 dll Component Files dll tlb olb ocx exe manifest L a J conce If you also want printing in the program you need to add a reference to the Net Printing assembly In this case in the Add Reference tab choose Net and scroll to the System Printing assembly Using QCRTGraph for WPF to Create Windows Applications 345 Add Reference NET COM Projects Browse Recent Component Name System EnterpriseServices D D v2 0 50727 System IdentityModel 0 0 v2 0 50727 System IdentityModel Selectors 0 0 v2 0 50727 System IO Log 0 0 v2 0 50727 System Management 0 0 v2 0 50727 System Management Instrumentation 5 0 v2 0 50727 System Messaging 0 0 v2 0 50727 System Net 5 0 v2 0 50727 v2 0 50727 System Runtime Remoting D D v2 0 50727 System Runtime Serialization 0 0 v2 0 50727 System Runtime Serialization Formatters Soap 0 0 v2 0 50727 v2 0 50727 System ServiceModel 0 0 v2 0 50727 System ServiceModel Web 5 0 v2 0 50727 View t
249. ib3 attrib4 Dim barwidth As Double 0 2 Dim barbase As Double 0 0 Dim barspace As Double 0 25 Dim barjust As Integer ChartObj JUSTIFY MIN Multiple Channel Bar Indicator 151 Dim barorient As Integer ChartObj VERT DIR Dim baraxis As New LinearAxis pTransforml ChartObj Y AXIS baraxis CalcAutoAxis chartVu AddChartObject baraxis Dim baraxis2 As New LinearAxis pTransforml ChartObj Y AXIS baraxis2 CalcAutoAxis baraxis2 SetAxisIntercept pTransforml GetStopX baraxis2 SetAxisTickDir ChartObj AXIS MAX chartVu AddChartObject baraxis2 Dim barAxisLab As New NumericAxisLabels baraxis chartVu AddChartObject barAxisLab Dim barplot As New CustomRTMultiBarIndicator pTransforml processVarArray barwidth barspace barbase attribArray barjust barorient barplot SegmentSpacing 20 barplot SegmentWidth 15 Add panel meters barplot IndicatorSubType ChartObj RT BAR SEGMENTED SUBTYPE barplot SegmentValueRoundMode ChartObj RT CEILING VALUE chartVu AddChartObject barplot End Sub InitializeBar3 8 Meters Coordinates Meter Axes and Meter Axis Labels RTMeterCoordinates RTMeterAxis RTMeterAxisLabels RTMeterStringAxisLabels Familiar examples of analog meter indicators are voltmeters car speedometers pressure gauges compasses and analog clock faces A meter usually consists of a meter coordinate system meter axes meter axis labels and a meter indicator the needle arc or symbol used t
250. ibute attribl new ChartAttribute Colors DarkGray 5 DashStyles Solid Colors DarkGray RTAnnunciator annunciator new RTAnnunciator pTransforml processVarl annunrect attribl ChartAttribute panelmeterattrib new ChartAttribute Colors SteelBlue 3 DashStyles Solid Colors Black RTNumericPanelMeter panelmeter new RTNumericPanelMeter pTransforml processVar2 panelmeterattrib panelmeter PanelMeterPosition ChartObj PLOTAREA CENTER panelmeter NumericTemplate TextFont FontArchive fontl6Numeric panelmeter NumericTemplate PostfixString char 176 F annunciator AddPanelMeter panelmeter RTAlarmPanelMeter panelmeter2 new RTAlarmPanelMeter pTransforml processVarl panelmeterattrib panelmeter2 PanelMeterPosition ChartObj INSIDE BARBASE panelmeter2 AlarmTemplate TextFont FontArchive font10 panelmeter2 SetPositionReference panelmeter annunciator AddPanelMeter panelmeter2 ChartAttribute panelmetertagattrib new ChartAttribute Colors SteelBlue 3 DashStyles Solid Colors White RTStringPanelMeter panelmeter3 new RTStringPanelMeter pTransforml processVarl panelmetertagattrib ChartObj RT TAG STRING panelmeter3 SetPositionReference panelmeter panelmeter3 PanelMeterPosition ChartObj INSIDE BAR panelmeter3 TextColor Colors Black annunciator AddPanelMeter panelmeter3 chartVu AddChartObject annunciator VB Private Sub InitializeAnnunciatorl Dim pTransforml As New
251. ic RTFormControlGrid PhysicalCoordinates transform RTProcessVar datasource ArrayList formcontrolarray int numcols int numrows ChartAttribute attrib public RTFormControlGrid PhysicalCoordinates transform RTProcessVar datasource ArrayList formcontrolarray ChartAttribute attrib Parameters transform The coordinate system for the new RTFormControlGrid object datasource An array of the process variables associated with the control grid objects formcontrolarray An array of the Controls assigned to the control grid numcols The number of columns in the control grid numrows 234 Buttons Track Bars and Other Form Control Classes The number of rows in the control grid colheads An atray of string that is used as the column heads for the control grid rowheads An array of string that is used as the row heads for the control grid attrib A single attribute object that applies to all control grid objects Selected Public Instance Properties CellColumnMargin Get Set the extra space between columns of the grid specified in normalized NORM PLOT POS coordinates CellRowMargin Get Set the extra space between rows of the grid specified in normalized NORM PLOT POS coordinates GraphObj ChartAttribute object GraphObj that the chart object is placed in FormControlTemplate Set Get the row headers HeadersTemplate Set Get the string template InternalAction Set Get to true if you want radio button click
252. icalScrollGraphl GraphScrollFrame ScrollRescaleMargin 0 01 rtAutoVerticalScrollGraphl GraphScrollFrame ScrollScaleModeX ChartObj RT AUTOSCALE Y MINMAX H 330 Auto Indicator Classes rtA utoVerticalScrollGraphl InitStrings RTAutoScrollGraph Quarks Time rtAutoVerticalScrollGraphl GraphBackground FillColor Colors BlanchedAlmond rtAutoVerticalScrollGraphl SubHead TextString Subhead Text rtAutoVerticalScrollGraphl SubHead ChartObjEnable ChartObj OBJECT ENABLE rtAutoVerticalScrollGraphl Footer TextString Footer text rtAutoVerticalScrollGraphl Footer ChartObjEnable ChartObj OBJECT ENABLE rtAutoVerticalScrollGraphl YAxisLab2 ChartObjEnable ChartObj OBJECT ENABLE The update of scroll graphs takes place in the timer event handler private void timerl Tick object sender EventArgs e ChartCalendar timestamp new ChartCalendar for int i 0 i lt currentValues Length i currentValues i 0 5 ChartSupport GetRandomDouble count rtAutoVerticalScrollGraphl UpdateScrollGraph count currentValues true VB Public Sub InitializeGraph Dim startvalue As Double 0 Dim stopvalue As Double 30 tAutoVerticalScrollGraphl Footer ChartObjEnable ChartObj OBJECT ENABLE tAutoVerticalScrollGraphl YAxisLab2 ChartObjEnable ChartObj OBJECT ENABLE tAutoVerticalScrollGraphl LowAlarm AlarmLimitValue 4 tAutoVerticalScrollGraphl HighAlarm AlarmLim
253. iderations This chapter presents an overview of the Real Time Graphics Tools for WPF class architecture Based on the QCChart2D charting architecture it has the same design considerations listed in that software These are It is based on the Net WPF DirectX Retained Graphics API model New charting objects can be added to the library without modifying the source of the base classes There are no limits regarding the number of data points in a plot the number of plots in graph the number of axes in a graph the number of coordinate systems in a graph There are no limits regarding the number of legends arbitrary text annotations bitmap images geometric shapes titles data markers cursors and grids in a graph Users can interact with charts using classes using WPF routed event handling Design consideration specific to Real Time Graphics Tools for WPF are Updates of data classes are asynchronous with rendering of graphics to the screen Real Time plot objects are derived from QCChart2D plot objects resulting in standardized methods for setting plot object properties Any standard plot type from the QCChart2D software package both simple and group plot types can be implemented as scrolling graphs There are no limits on the number of process variable channels no limits on the number of alarm limits associated with a process variable no limits on the number of real time plots in a graph The update of real t
254. iledHelpFile chm documentation file located in the doc subdirectory Example for string meter axis labels The example below extracted from the AutoInstrumentPanel example method InitializeFuel creates a meter coordinate system that starts at the arc angle of 180 degrees and has an arc extent of 90 degrees The meter scale extends from 0 0 to 32 0 in the counterclockwise direction The meter axis is labeled at the major tick marks with the strings E 1 2 F C ChartAttribute attribl new ChartAttribute Colors Black 1 DashStyles Solid Colors Blue double startarcangle 180 double arcextent 90 double startarcscale 0 0 double endarcscale 32 0 bool arcdirection false double arcradius 0 8 double centerx 0 0 centery 0 0 RTMeterCoordinates meterframe new RTMeterCoordinates startarcangle arcextent Startarcscale endarcscale arcdirection centerx centery arcradius meterframe SetGraphBorderDiagonal 0 025 0 25 0 175 0 6 RTMeterNeedleIndicator meterneedle new RTMeterNeedleIndicator meterframe fuel meterneedle SetChartObjAttributes attribl meterneedle NeedleLength 0 8 chartVu AddChartObject meterneedle RTMeterAxis meteraxis new RTMeterAxis meterframe meterneedle meteraxis SetChartObjAttributes attribl meteraxis SetAxisTickDir ChartObj AXIS MIN meteraxis LineWidth 2 meteraxis LineColor Colors White meteraxis SetAxisTickSpace 4 meteraxis
255. ime objects will not interfere or overwrite other objects and will follow the z order precedence established when the graph was created 12 Class Architecture The chapter also summarizes the classes in the Real Time Graphics Tools for WPF library There are five primary features of the overall architecture of the Real Time Graphics Tools for WPF classes These features address major shortcomings in existing charting software for use with both Net and other computer languages Real Time Graphics Tools for WPF uses the standard Net WPF window architecture Real Time graphs are placed in a ChartView window that derives from the System Windows Controls UserControl class Position one or more ChartView objects in WPF container windows using the standard container layout managers Mix static QCChart2D and real time charts with other components in the same container The Real Time Graphics Tools for WPF software uses a new real time update and rendering paradigm which represents a shift in the way Quinn Curtis has always done real time updates in past In the past graphs were always updated incrementally as new data arrived This is no longer the case Instead rendering is no longer incremental When a graph is rendered the entire graph is redrawn using the most current data A special process variable class RTProcessVar is used to store new data as it is acquired In the case of graphs that require a historical display of information such as sc
256. imeLabel ElapsedTimeLabel StringLabel This class displays a text string as the title or footer of the chart This class displays a text string as the title for an axis The axis title position is outside of the axis label area Axis titles for y axes are rotated 90 degrees This class is the abstract base class of labels that require special formatting This class is a concrete implementation of the ChartLabel class and it displays formatted numeric values This class is a concrete implementation of the ChartLabel class and it displays formatted ChartCalendar dates This class is a concrete implementation of the ChartLabel class and it displays numeric values formatted as elapsed time strings 12 32 21 This class is a concrete implementation of the ChartLabel class that formats string values for use as axis labels Miscellaneous Chart Classes Marker ChartImage ChartShape ChartSymbol Various classes are used to position and draw objects that can be used as standalone objects in a graph or as elements of other plot objects Marker ChartImage This class displays one of five marker types in a graph The marker is used to create data cursors or to mark data points This class encapsulates a System Windows Control Image class defining a rectangle in chart coordinates that the image is placed in QCChart2D Class Summary 87 JPEG and other image files can be imported using the Image class and displayed in a c
257. imumDisplayValue pTransforml SetGraphBorderDiagonal x1 yl x2 y2 Background graphbackground new Background pTransforml ChartObj GRAPH BACKGROUND chartVu AddChartObject graphbackground Background plotbackground new Background pTransforml ChartObj PLOT BACKGROUND chartVu AddChartObject plotbackground TimeAxis xaxis new TimeAxis pTransforml ChartObj X AXIS xaxis LineColor Colors Black chartVu AddChartObject xaxis LinearAxis yaxis new LinearAxis pTransforml ChartObj Y AXIS yaxis LineColor Colors Black chartVu AddChartObject yaxis ChartGrid yAxisGrid new ChartGrid xaxis yaxis ChartObj Y AXIS yAxisGrid SetColor Colors White yAxisGrid SetLineWidth 1 yAxisGrid SetLineStyle DashStyles Solid ChartObj GRID MAJOR chartVu AddChartObject yAxisGrid ChartGrid xAxisGrid new ChartGrid xaxis yaxis ChartObj X AXIS xAxisGrid SetColor Colors White xAxisGrid SetLineWidth 1 xAxisGrid SetLineStyle DashStyles Solid chartVu AddChartObject xAxisGrid LinearAxis yaxis2 new LinearAxis pTransforml ChartObj Y AXIS yaxis2 LineColor Colors Black yaxis2 AxisTickDir ChartObj AXIS MAX yaxis2 AxisIntercept xaxis AxisMax chartVu AddChartObject yaxis2 TimeAxisLabels xAxisLab new TimeAxisLabels xaxis xAxisLab TextFont axisFont chartVu AddChartObject xAxisLab NumericAxisLabels yAxisLab new NumericAxisLabels yaxis yAxisLab TextFont axi
258. in a line plot format Adjacent data points are connected using a straight or a step line Theoretical vs Experimental Data 20 40 60 80 100 MBAs 1000 employees Energy Companies Software Companies Predicted SimpleScatterPlot SimpleVersaPlot Legend Classes LegendItem BubblePlotLegendItem Legend StandardLegend BubblePlotLegend Scatter plots usually display some form of sampled data This class is a concrete implementation of the SimplePlot class and it displays simple datasets in a scatter plot format where each data point is represented using a symbol The SimpleVersaPlot is a plot type that can be any of the four simple plot types LINE MARKER PLOT LINE PLOT BAR PLOT SCATTER PLOT It is used when you want to be able to change from one plot type to another without deleting the instance of the old plot object and creating an instance of the new 84 QCChart2D Class Summary Legends provide a key for interpreting the various plot objects in a graph It organizes a collection of legend items one for each plot objects in the graph and displays them in a rectangular frame Legend LegendItem BubblePlotLegendItem StandardLegend BubblePlotLegend ChartGrid Classes ChartGrid PolarGrid AntennaGrid This class is the abstract base class for chart legends This class is the legend item class for all plot objects except for bubble plots Each legend item manages one symbol and descripti
259. indicator IndicatorBackgroundEnable true meterarcindicator IndicatorBackground new ChartAttribute Colors Black 2 DashStyles Solid Color FromRgb 60 60 60 Add panel meters to meter needle chartVu AddChartObject meterarcindicator VB Dim meterarcindicator As New RTMeterArcIndicator meterframe processVarl meterarcindicator SetChartObjAttributes attribl meterarcindicator IndicatorSubtype ChartObj RT METER SEGMENTED ARC SUBTYPE meterarcindicator SegmentValueRoundMode ChartObj RT CEILING VALUE meterarcindicator SegmentWidth 7 meterarcindicator SegmentSpacing 10 meterarcindicator InnerValueArcNormalized 0 35 meterarcindicator OuterValueArcNormalized 0 85 meterarcindicator IndicatorBackgroundEnable True meterarcindicator IndicatorBackground New ChartAttribute Colors Black 2 DashStyles Solid Color FromRgb 60 60 60 Add panel meters chartVu AddChartObject meterarcindicator Meter Indicators Needle Arc and Symbol 176 Extracted from the example program RTGraphNetDemo file SegmentedArcMeterUserControll cs method InitializeMeter3 C RTMeterArcIndicator meterarcindicator new RTMeterArcIndicator meterframe processVar2 meterarcindicator SetChartObjAttributes attribl meterarcindicator InnerValueArcNormalized 0 8 meterarcindicator OuterValueArcNormalized 0 95 meterarcindicator IndicatorSubtype ChartObj RT METER SEGMENTED ARC SUBTYPE meterar
260. ing Use the UpdateIndicator method to update the dial indicator with new data Method UpdatelIndicator VB Public Sub UpdateIndicator _ value As Double updatedraw As Boolean CH public void UpdateIndicator double value bool updatedraw Parameters value Update the indicator channel with this value updatedraw True and the indicator is immediately updated Selected Public Instance Properties Name Description AlarmList Get the ArrayList holding all of the RTAlarm objects AlarmPanelMeter Get a reference to the RTAlarmPanelMeter object DefaultAlarmFont Get Set the font used for the subhead title DefaultAxisLabelsFont Get Set the default font used for the axes labels and axes titles Get Set the default font used for the numeric values labeling the indicator DefaultFontStrin Set Get the default font used in the chart This is a string uM MEE specifying the name of the font DefaultMainTitleFont Get Set the font used for the main title DefaultDataValueFont DefaultTagFont Get Set the font used for the main title DefaultUnitsFont Get Set the font used for the chart footer DialInterior Get dialInterior RTGenShape object FaceplateBackground GraphBackground GraphBorder GraphFormat Height HighAlarm LowAlarm MainTitle MaximumSize MaxIndicatorValue MinimumSize MinIndicatorValue NumericPanelMeter PlotAttrib PlotBackground PreferredSize ProcessVariable RenderingMode ResizeMode TagPanelMeter
261. ing a strong visual indication that an alarm has occurred Pvo1 100 100 80 wem 60 4 Ose D 40 1 60 4 E 20 x 40 e 0 20 3 b 0 3i 100 ES 40 E 20 0 0 20 40 60 80 100 Clockwise from top Solid bar indicator segmented bar indicator custom segmented bar indicator horizontal solid bar indicator and pointer indicator Only the green bars represent the bars and pointer represent the bar indicators Other items also shown include axes axis labels panel meters and alarm indicators 24 Class Architecture RTBarIndicator An RTBarIndicator is used to display the current value of an RTProcessVar using a bar changing its size One end of each bar is always fixed at the specified base value Bars can change their size either in vertical or horizontal direction Sub types within the RTBarIndicator class support segmented bars custom segmented bars with variable width segments and pointer bar indicators There are an infinite number of meter designs possible using a variety of meter arc ranges meter scales meter axes and meter indicator types RTMeterIndicator The RTMeterIndicator class is the abstract base class for all meter indicators Familiar examples of analog meters are voltmeters car speedometers pressure gauges Class Architecture 25 compasses and analog clock faces Three meter types are supported arc symbol and needle meters An unlimited number of meter indicators can be added to a giv
262. inimumDisplayValue 0 currentTemperature2 DefaultMaximumDisplayValue 150 currentTemperature2 SetCurrentValue currentTemperatureValue2 currentTemperature2 AddAlarm templowalarm2 currentTemperature2 AddAlarm temphighalarm2 Important enables historical data collection for scroll graphs currentTemperature2 DatasetEnableUpdate true currentTemperature2 AlarmTransitionEventHandler new Delegate TemperatureAlarmEventProc InitializeScrollGraph timerl Interval TimeSpan FromMilliseconds 200 200 msecs timerl Tick new EventHandler timerl Tick timer2 Interval TimeSpan FromMilliseconds 500 500 msecs timer2 Tick new EventHandler timer2 Tick timerl Starti i timer2 S5tart private void TemperatureAlarmEventProc object sender RTAlarmEventArgs e RTAlarm alarm e EventAlarm double alarmlimitvalue alarm AlarmLimitValue RTProcessVar pv e ProcessVar String tagname pv TagName double timestamp pv TimeStamp String timestampstring timestamp ToString if alarm AlarmState Console Out WriteLine timestampstring tagname Warning Alarm Level alarmlimitvalue ToString Exceeded else Console Out WriteLine timestampstring transitioned back to normal range Update data using 100 msec timer tagname private void timerl Tick object sender System EventArgs e Process Value 340 Using Real Time Graphics Tools
263. integrating action of the integral term which adds the initial proportional response each integral time T Therefore the reset rate is defined as the repeats per minute of the initial proportional response For example if the reset rate is 1 0 then for every minute that the error signal is non zero the amount of corrective action added to the controller output by the integral term will be equal to the amount added by the proportional term alone The higher the reset rate the harder the system will react to non zero error terms The addition of the derivative term to the PI controller described above results in the classic three mode PID controller The derivative action of a PID controller adds to the controller output the value proportional to the slope rate of change of the process error The derivative term anticipates the error providing a harder control response when the error term is going in the wrong direction and a dampening response when the error term is going in the right direction It reduces overshoot for transient upsets Proper use of the derivative term can result in much faster process response Computer based versions of the PID algorithm are based on sampled data discrete time control theory The discrete time equivalent of the PID equation is PID Control 239 Eqn 2 m i K e i T K XY e k k4 T e i e i 1 k 0 where T sampling interval e i error at ith sampling interval S t X t e i 1
264. ion depends on the bar orientation Vertical Bars JUSTIFY CENTER JUSTIFY MIN Horizontal Bars JUSTIFY MIN JUSTIFY CENTER Used when the panel meter is attached to a bar indicator Places the panel meter on the outside edge of the bar base of the indicator If the object is not a bar indicator the panel meter is placed on the outside edge of the plotting area maximum Text justification depends on the bar orientation Vertical Bars JUSTIFY CENTER JUSTIFY MAX Horizontal Bars JUSTIFY MAX JUSTIFY CENTER Same as INSIDE BAR Same as OUTSIDE BAR Used when it is desired that the panel meter be positioned next to another object Places the panel meter below the reference object Specify the position reference object using the PanelMeter SetPositionReference method Text justification is set to JUSTIFY CENTER JUSTIFY MAX Used when it is desired that the panel meter be positioned next to another object Places the panel meter above the reference object Specify the position reference object using the PanelMeter SetPositionReference method Text justification is set to JUSTIFY CENTER JUSTIFY MIN Used when it is desired that the panel meter be positioned next to another object Places the panel meter to the right of the reference object Specify the position reference object using the PanelMeter SetPositionReference method Text justification is set to JUSTIFY MIN JUSTIFY CENTER Used when it is desired that the panel mete
265. ions are One X or one y axis One x and one y axes One x and multiple y axes One y and multiple x axes Multiple x and y axes el Lei oi el OC This class implements mouse controlled magnification for one or more simultaneous axes This class implements a chart magnify class based on the MouseListener class It uses two charts the source chart and the target chart The source chart displays the chart in its unmagnified state The target chart displays the chart in the magnified state The mouse positions a MagniView rectangle within the source chart and the target chart is re scaled and redrawn to MoveCoordinates MultiMouseListener QCChart2D Class Summary 89 match the extents of the MagniView rectangle from the source chart This class extends the MouseListener class and it can move the coordinate system of the underlying chart analogous to moving chaging the coordinates of an internet map by grabbing it with the mouse and dragging it This class is used by the ChartView class to support multiple mouse listeners at the same time File and Printer Rendering Classes ChartPrint BufferedImage ChartPrint BufferedImage This class implements printing using the WPF System Printing print related services It can select setup and output a chart to a printer This class will convert a ChartView object to a System Windows Control Image object Optionally the class saves the buffered image to an im
266. itValue 12 tAutoVerticalScrollGraphl SetpointAlarm AlarmLimitValue 8 rtAutoVerticalScrollGraphl InitRTAutoScrollGraph 0 startvalue 15 stopvalue rtAutoVerticalScrollGraphl InitSimpleRTPlotObject ChartObj LINE PLOT Colors Blue Channel 1 rtAutoVerticalScrollGraphl InitSimpleRTPlotObject ChartObj LINE PLOT Colors Green Channel 42 rtAutoVerticalScrollGraphl InitSimpleRTPlotObject ChartObj SCATTER PLOT Colors Red Channel 3 rtAutoVerticalScrollGraphl SimplePlotObj SymbolAttributes SymbolSize 10 rtAutoVerticalScrollGraphl GraphScrollFrame ScrollRescaleMargin 0 01 rtAutoVerticalScrollGraphl GraphScrollFrame ScrollScaleModeX ChartObj RT AUTOSCALE X MINMAX rtAutoVerticalScrollGraphl InitStrings RTAutoScrollGraph Quarks Time rtAutoVerticalScrollGraphl GraphBackground FillColor Colors BlanchedAlmond rtAutoVerticalScrollGraphl SubHead TextString Numeric Scrolling rtAutoVerticalScrollGraphl SubHead ChartObjEnable ChartObj OBJECT ENABLE rtAutoVerticalScrollGraphl Footer TextString Footer text e T e E E End Sub The update of scroll graphs takes place in the timer event handler Private Sub timerl Tick ByVal sender As Object ByVal e As EventArgs Handles timerl Tick Dim timestamp As New ChartCalendar For i As Integer 0 To currentValues Length 1 currentValues i 0 5 ChartSupport GetRandomDouble Auto Indicator Classes 331 Next count 1 rtAutoVertic
267. itializeHumidity creates a meter coordinate system that starts at the arc angle of 225 degrees and has an arc extent of 270 degrees The meter scale extends from 0 0 to 100 0 in the counterclockwise direction 156 Meters Coordinates Meter Axes and Meter Axis Labels C double startarcangle 225 double arcextent 270 double startarcscale 0 0 double endarcscale 100 0 bool arcdirection false double arcradius 0 6 double centerx 0 0 centery 0 2 ChartFont meterFont font12 RTMeterCoordinates meterframel new RTMeterCoordinates startarcangle arcextent startarcscale endarcscale arcdirection centerx centery arcradius VB Fahrenheight scale Dim startarcangle As Double 225 Dim arcextent As Double 270 Dim startarcscale As Double 0 0 Dim endarcscale As Double 100 0 Dim arcdirection As Boolean False Dim arcradius As Double 0 6 0 Dim centerx As Double 0 Dim centery As Double 0 2 Dim meterFont As ChartFont font12 Dim meterframel As New RTMeterCoordinates startarcangle _ arcextent startarcscale endarcscale arcdirection centerx centery arcradius The example below extracted from the RTGraphNetDemo example file ArrowMeterUserControll method InitializeMeter4 creates a meter coordinate system that starts at the arc angle of 90 degrees and has an arc extent of 180 degrees The meter scale extends from 0 0 to 100 0 in the counterclockwise direction Mete
268. ivalent to the Buttons Track Bars and Other Form Control Classes 227 TrackBar TickFrequency property except allows floating point numbers RTValue Specifies the double value of the RTControlTrackBar slider A complete listing of RTControlTrackBar properties is found in the QCRTGraphWPFCompiledHelpFile chm documentation file located in the doc subdirectory Example for single RTControlTrackBar combined with an RTNumericPanelMeter The example below extracted from the Treadmill example creates a single RTControlTrackBar and positions a large numeric readout of the trackbar value next to it Pace mph C public void InitializeLeftPanelMeters ChartFont trackbarfont font64Numeric ChartFont trackbarTitlefont font12Bold CartesianCoordinates pTransforml new CartesianCoordinates 0 0 0 0 1 0 1 0 pTransforml SetGraphBorderDiagonal 0 01 12 0 06 0 3 ChartAttribute attribl new ChartAttribute Colors LightBlue 7 DashStyles Solid Colors LightBlue runnersPaceTrackbar new RTControlTrackBar 0 0 15 0 0 1 1 0 1 runnersPaceTrackbar Orientation Orientation Vertical runnersPaceTrackbar RTValue 3 MUST USE RTValue to set double value RTFormControlPanelMeter formControlTrackBarl new RTFormControlPanelMeter pTransforml runnersPaceTrackbar attribl formControlTrackBarl RTDataSource runnersPace formControlTrackBarl PanelMeterPosition ChartObj CUSTOM POSITION formControlTrackB
269. ivate templowalarml As RTAlarm Private temphighalarml As RTAlarm Private templowalarm2 As RTAlarm Private temphighalarm2 As RTAlarm Private font12 As New ChartFont Microsoft Sans Serif 12 FontStyles Normal Private font14 As New ChartFont Microsoft Sans Serif 14 FontStyles Normal Private fontl4Numeric As New ChartFont Digital SF 14 FontStyles Normal Private chartVu As ChartView Private scrollMode As Integer 0 Public Sub New ByVal chartvu 1 As ChartView chartVu chartvu 1 InitializeGraph End Sub Private Sub InitializeScrollGraph Dim x1 As Double 0 1 Dim yl As Double Dal Dim x2 As Double 0 9 Dim y2 As Double 0 9 Dim axisFont As ChartFont font12 Dim startTime As New ChartCalendar Dim endTime As New ChartCalendar endTime Add ChartCalendar SECOND 60 Dim pTransforml As New TimeCoordinates startTime currentTemperaturel DefaultMinimumDisplayValue endTime currentTemperaturel DefaultMaximumDisplayValue pTransforml SetGraphBorderDiagonal x1 yl x2 yZ Dim graphbackground As New Background pTransforml ChartObj GRAPH BACKGROUND Colors White chartVu AddChartObject graphbackground Dim plotbackground As New Background pTransforml ChartObj PLOT BACKGROUND Colors Black chartVu AddChartObject plotbackground Dim xaxis As New TimeAxis pTransforml ChartObj X AXIS xaxis LineColor Colors Black chartVu AddChartObject xaxis Dim yaxis As New LinearAxis pTransforml Ch
270. jects internal to the RTComboProcessVar These items are updated automatically by the master RTComboProcessVar whenever an update is made to the master class Note that the divisor operation takes place first followed by the modulo operation RTComboProcessVar constructors Visual Basic Overloads Public Sub New _ ByVal dataset As TimeSimpleDataset ByVal defaultattribute As ChartAttribute _ Overloads Public Sub New _ ByVal tagname As String _ ByVal defaultattribute As ChartAttribute _ C public RTComboProcessVar TimeSimpleDataset dataset ChartAttribute defaultattribute Ct public RTComboProcessVar string tagname ChartAttribute defaultattribute Parameters dataset A dataset that will be used to store historical values defaultattribute Specifies the default attribute for this process variable tagname The string representing the tag name of the process variable 187 Dials and Clocks Selected Public Instance Properties Item Get the RTProcessVar item at the specified index in the process variable list Selected Public Instance Methods A ddProcess Var Adds a new process variable to the process variable list ResetProcessVarsList Clears the process variable list SetCurrentValue Overloaded Updates the current value and the dataset of the underlying RTProcessVar It also updates the process variable list with the calculated process values Sets the divisor factor at the sp
271. k bonds commodities options etc across several days months or years Elapsed TimeAxis T T T T T T T j T T T T T T T T T T T T T 8 00 00 16 00 00 1D 0 00 00 Time The elapsed time axis is very similar to the linear axis and is subclassed from that class The main difference is the major and minor tick mark spacing calculated by the CalcAutoAxis method takes into account the base 60 of seconds per minute and minutes per hour and the base 24 of hours per day It is a continuous linear scale QCChart2D Class Summary 65 Polar Axes 4 polar axis consists of the x and y axis for magnitude and the outer circle for the angle PolarAxes This class has three separate axes two linear and one circular The two linear axes scaled for the magnitude of the polar scale form a cross with the center of both axes at the origin 0 0 The third axis is a circle centered on the origin with a radius equal to the magnitude of the polar scale This circular axis represents 360 degrees or 2 Pi radians of the polar scale and the tick marks that circle this axis are spaced at equal degree intervals 66 QCChart2D Class Summary 270 180 AntennaAxes This class has two axes one linear y axis and one circular axis The linear axis is scaled for the desired range of radius values This can extend from minus values to plus values The second axis is a circle centered on the origin with a radius equal to the range of the radius sc
272. kBar controls in an RTFormControlGtrid they will all end up with the same number of digits to the right of the decimal since one template applies to all of the track bars If the dynamic range of the track bars different enough to require unique decimal precision settings separate them into different grids See the method InitializePIDParameterTrackbars in the RTPIDControlTuner examplefor the source to this example Form Control Panel Meter This panel meter class encapsulates Form Control objects including our own RTControlButton and RTControlTrackBar objects in a panel meter class so that controls can be added to indicator objects Class RTFormControlPanelMeter RTPanelMeter RTFormControlPanelMeter 230 Buttons Track Bars and Other Form Control Classes Visual Basic Overloads Public Sub New _ ByVal transform As PhysicalCoordinates _ ByVal datasource As RTProcessVar ByVal formcontrol As Control ByVal attrib As ChartAttribute _ Overloads Public Sub New _ ByVal transform As PhysicalCoordinates _ ByVal formcontrol As Control ByVal attrib As ChartAttribute Ct public RTFormControlPanelMeter PhysicalCoordinates transform RTProcessVar datasource Control formcontrol ChartAttribute attrib public RTFormControlPanelMeter PhysicalCoordinates transform Control formoontrol ChartAttribute attrib Parameters transform The coordinate system for the new RTFormControlPanelMeter obje
273. l data associated with the plot objects The 202 Single and Multiple Channel Annunciators plot objects in the scroll frame are drawn into this coordinate system As data progresses forward in time the coordinate system is constantly being rescaled to include the most recent time values as part of the x coordinate system You can control whether or not the starting point of the scroll frame coordinate system remains fixed whether it advances in sync with the constantly changing end of the scroll frame Other options allow the y scale to be constantly rescaled to reflect the current dynamic range of the y values in the scroll frame The long term goal is that as computers get faster and Net more efficient you will never need to update the display faster than 30 60 times a second since this will result smooth scrolling even if the underlying data is updated 10 000 times a second Computers are not there yet running Net at least other languages are much faster and the scrolling may appear slow but in the long run the algorithm should prove an efficient technique throughout the rest of the decade RTScrollFrame constructors Visual Basic Overloads Public Sub New _ ByVal component As ChartView _ ByVal processvar As RIProcessVar _ ByVal initialscale As PhysicalCoordinates ByVal scrollxmode As Integer _ ByVal autoscaleymode As Integer _ Overloads Public Sub New _ ByVal component As ChartView _ ByVal processvar As RTProcessVa
274. l meter below extracted from the HybridCar example method InitializeBatteryChargeGraph is an RTNumericPanelMeter attached to a RTBarIndicator bar plot object The position of the panel meter is OUTSIDE PLOTAREA MIN which places underneath the dynamic bar The size of the panel meter is determined by two things the font size which in this case is 14 and the number of digits used in the display Note Unlike the previous example the panel meter is not added to the ChartView chartVu above instead it is added to the RTBarIndicator barplot below The panel meter will assume the values of the RTProcessVar used by the bar plot Panel Meter Classes 117 C RTBarIndicator barplot new RTBarIndicator pTransforml batteryCharge barwidth barbase attribl barjust barorient ChartAttribute panelmeterattrib new ChartAttribute Colors SteelBlue 3 DashStyles Solid Colors Black RTNumericPanelMeter panelmeter new RTNumericPanelMeter pTransforml panelmeterattrib panelmeter PanelMeterPosition ChartObj OUTSIDE PLOTAREA MIN panelmeter TextColor Colors SpringGreen panelmeter NumericTemplate TextFont fontl4Numeric panelmeter NumericTemplate DecimalPos 0 panelmeter AlarmIndicatorColorMode ChartObj RT TEXT BACKGROUND COLOR CHANGE ON ALARM panelmeter PanelMeterNudge new Point2D 0 4 barplot AddPanelMeter panelmeter VB Dim barplot As New RTBarIndicator pTransforml batteryCharge barwidth barbase a
275. lGraphl HighAlarm AlarmLimitValue 12 tAutoScrollGraphl SetpointAlarm AlarmLimitValue 8 vd vd vd vd vd vd vd vd vd vd rtAutoScrollGraphl InitRTAutoScrollGraph starttime 0 endtime 15 rtAutoScrollGraphl InitSimpleRTPlotObject ChartObj LINE PLOT Colors Blue Channel 1 rtAutoScrollGraphl InitSimpleRTPlotObject ChartObj LINE PLOT Colors Green Channel 2 rtAutoScrollGraphl InitSimpleRTPlotObject ChartObj SCATTER PLOT Colors Red Channel 43 rtAutoScrollGraphl SimplePlotObj SymbolAttributes SymbolSize 8 rtAutoScrollGraphl GraphScrollFrame ScrollRescaleMargin 0 01 rtAutoScrollGraphl GraphScrollFrame ScrollScaleModeY ChartObj RT AUTOSCALE Y MINMAX rtAutoScrollGraphl InitStrings RTAutoScrollGraph Time Ouarks rtAutoScrollGraphl GraphBackground FillColor Colors BlanchedAlmond rtAutoScrollGraphl SubHead TextString Time Date Scrolling rtAutoScrollGraphl SubHead ChartObjEnable ChartObj OBJECT ENABLE rtAutoScrollGraphl Footer TextString Footer text E E E E d Dim startts As TimeSpan TimeSpan FromSeconds 0 Dim endts As TimeSpan TimeSpan FromSeconds 30 rtAutoScrollGraph2 InitRTAutoScrollGraph startts 0 endts 15 rtAutoScrollGraph2 InitSimpleRTPlotObject ChartObj LINE PLOT Colors Blue Channel 1 rtAutoScrollGraph2 InitSimpleRTPlotObject ChartObj LINE PLOT Colors Green Channel 2 rtAutoScrollGraph2 InitSimpleRTPlotObject ChartObj S
276. lTrackBarl SetLocation 0 0 0 ChartObj PHYS POS formControlTrackBarl FormControlSize New Dimension 1 0 1 0 Must be in same units as SetLocation Dim panelmeterattrib As New ChartAttribute Colors SteelBlue 3 DashStyles Solid Colors Black Dim panelmeterl As New RTNumericPanelMeter pTransforml runnersPace panelmeterattrib panelmeterl NumericTemplate TextFont trackbarfont panelmeterl NumericTemplate DecimalPos 1 panelmeterl PanelMeterPosition ChartObj RIGHT REFERENCED TEXT panelmeterl SetPositionReference formControlTrackBarl formControlTrackBarl AddPanelMeter panelmeter1 Dim panelmetertagattrib As New ChartAttribute Colors Beige 0 DashStyles Solid Colors Beige Dim panelmeter2 As New RTStringPanelMeter pTransforml runnersPace panelmetertagattrib ChartObj RT TAG STRING panelmeter2 SetPositionReference panelmeterl panelmeter2 StringTemplate TextFont trackbarTitlefont panelmeter2 PanelMeterPosition ChartObj BELOW REFERENCED TEXT panelmeter2 TextColor Colors Black formControlTrackBarl AddPanelMeter panelmeter2 chartVu AddChartObject formControlTrackBarl Dim pTransform2 As New CartesianCoordinates 0 0 0 0 1 0 1 0 pTransform2 SetGraphBorderDiagonal 0 01 0 41 0 05 0 59 treadmillElevationTrackbar New RTControlTrackBar 0 0 15 0 1 0 0 1 1 treadmillElevationTrackbar Orientation Orientation Vertical treadmillElevationTrackbar RTValue 0 MUST USE RTValue to set do
277. larm limits in the software special round and rectangular shapes that can be used as backdrops for groupings of chart objects and PID control Real Time Graphics Tools for WPF Classes The QCRTGraph classes are a super set of the QCChart2D charting software No attempt should be made to utilize the QCRTGraph classes without a good understanding of the QCChart2D classes See the QCChart2DWPFManual PDF file for detailed information about the QCChart2D classes The diagram below depicts the class hierarchy of the Real Time Graphics Tools for WPF library without the additional QCChart2D classes 16 Class Architecture Namespace com quinncurtis rtgraphwpf System EventArgs RTAlarmEventArgs RTGroupDatasetTruncateArgs RTDatasetTruncateArgs com quinncurtis chart2dwpf ChartObj RTAlarm RTAlarmIndicator RTMultiAlarmIndicator RTProcessVar RTComboProcess Var RTPIDControl RTRoundedRectangle2D RTSymbol RTTextFrame RTGenShape RT3DFrame com quinncurtis chart2dwpf ChartPlot RTPlot RTSingleValueIndicator RTPanelMeter RTNumericPanelMeter RTAlarmPanelMeter RTStringPanelMeter RTTimePanelMeter RTElapsedTimePanelMeter RTFormControlPanelMeter RTAnnunciator RTBarIndicator RTMeterIndicator RTMeterArcIndicator RTMeterNeedleIndicator RTMeterSymbolIndicator RTSimpleSingleValuePlot RTMultiValueIndicator RTMultiValueAnnunciator RTMultiBarIndicator RTGroupMultiValuePlot RTFormControlGrid RTScrollFrame RTVerticalScrollFrame com quinncurtis c
278. larmChannel Get Set the alarm channel object EventAlarm Get Set the RTAlarm object associated with the alarm ProcessVar Get Set the RTProcessVar object associated with the alarm A complete listing of RTAlarmEventArgs properties is found in the QCRTGraphWPFCompiledHelpFile chm documentation file located in the doc subdirectory Example C Setup and enable an alarm transition event handler in the following manner heartRate AlarmTransitionEventEnable true heartRate AlarmTransitionEventHandler new RTAlarmEventDelegate this heartRate HighAlarm where the handler method is this heartRate HighAlarm Setup and enable an alarm state event handler in an identical manner heartRate AlarmStateEventEnable true heartRate AlarmStateEventHandler new RTAlarmEventDelegate this heartRate HighAlarm where the handler method is this heartRate_HighAlarm private void heartRate HighAlarm object sender RTAlarmEventArgs e Example of RTProcessVar RTAlarm and Alarm Event Handlers The example below creates and updates an RTProcessVar object that uses alarms and a user defined alarm event handler The example was extracted from the Treadmill example program method InitializeGraph See the example in the RTAlarmEventArgs section for one that generates alarm events 106 Process Variable and Alarm Classes C ChartAttribute defaultattrib new ChartAt DashStyles Solid Colors Green RTAlarm lowheartratealar
279. layValue 0 METS DefaultMaximumDisplayValue 100 M ETS DatasetEnableUpdate True Make sure this is on for scrolling graphs METSValue Math Max 0 heartRateValue 60 60 0 METS SetCurrentValue METSValue Real Time Alarms Class RTAlarm ChartObj RTAlarm The RTAlarm class stores alarm information for the RTProcessVar class The RTAlarm class specifies the type of the alarm the alarm color alarm text messages and alarm hysteresis value The RTProcessVar classes can hold an unlimited number of RTAlarm objects in an internal ArrayList RTProcessVar constructors Visual Basic Overloads Public Sub New _ ByVal processvar As RTProcessVar ByVal alarmtype As Integer _ Overloads Public Sub New _ ByVal alarmtype As Integer _ ByVal alarmlimitvalue As Double Overloads Public Sub New _ ByVal processvar As RTProcessVar ByVal alarmtype As Integer _ ByVal alarmlimitvalue As Double Overloads Public Sub New _ ByVal processvar As RTProcessVar ByVal alarmtype As Integer _ ByVal normalmessage As String _ ByVal alarmmessage As String Visual Basic ByVal alarmtype As Integer ByVal normalmessage As String _ ByVal alarmmessage As String _ C public RTAlarm RIProcessVar processvar int alarmtype public RTAlarm int alarmtype double alarmlimitvalue public RTAlarm RTProcessVar processvar int alarmtype double alarmlimitvalue
280. ldCoordinates This class derives from the UserCoordinates class and maps a device independent world coordinate system on top of the Net device coordinate system WorkingCoordinates This class derives from the WorldCoordinates class and extends the physical coordinate system of the plot area the 58 QCChart2D Class Summary PhysicalCoordinates CartesianCoordinates TimeCoordinates ElapsedTimeCoordinates PolarCoordinates AntennaCoordinates Attribute Class ChartAttribute ChartGradient area typically bounded by the charts axes to include the complete graph area the area of the chart outside of the plot area This class is an abstract base class derived from WorkingCoordinates and defines the routines needed to map the physical coordinate system of a plot area into a working coordinate system Different scale objects ChartScale derived are installed for converting physical x and y coordinate values into working coordinate values This class is a concrete implementation of the PhysicalCoordinates class and implements a coordinate system used to plot linear logarithmic and semi logarithmic graphs This class is a concrete implementation of the PhysicalCoordinates class and implements a coordinate system used to plot GregorianCalenar time based data This class is a subclass of the CartesianCoordinates class and implements a coordinate system used to plot elapsed time data This class is a subclass of the Car
281. le or disassemble the SOFTWARE except and only to the extent that such activity is expressly permitted by applicable law notwithstanding this ii limitation You may not rent lease or lend the SOFTWARE You may not use the SOFTWARE to perform any illegal purpose 4 SUPPORT SERVICES Quinn Curtis Inc may provide you with support services related to the SOFTWARE Use of Support Services is governed by the Quinn Curtis Inc polices and programs described in the user manual in online documentation and or other Quinn Curtis Inc provided materials as they may be modified from time to time Any supplemental SOFTWARE code provided to you as part of the Support Services shall be considered part of the SOFTWARE and subject to the terms and conditions of this EULA With respect to technical information you provide to Quinn Curtis Inc as part of the Support Services Quinn Curtis Inc may use such information for its business purposes including for product support and development Quinn Curtis Inc will not utilize such technical information in a form that personally identifies you 5 TERMINATION Without prejudice to any other rights Quinn Curtis Inc may terminate this EULA if you fail to comply with the terms and conditions of this EULA In such event you must destroy all copies of the SOFTWARE 6 COPYRIGHT The SOFTWARE is protected by United States copyright law and international treaty provisions You acknowledge that no title to th
282. le channel and multiple channel indicators such as RTBarIndicator RTMultiBarIndicator RTMeterIndicator and RTAnnunciator objects where they provide text output in addition to the indicators graphical output RTPanelMeter The abstract base class for the panel meter types 20 Class Architecture Pace mph Numeric panel meters can be the primary display method for real time data or they can be used as adjuncts to other real time indicators such as bar indicators and meters RTNumericPanelMeter Displays the floating point numeric value of an RTProcessVar object It contains a template based on the QCChart2D NumericLabel class that is used to specify the font and numeric format information associated with the panel meter ES High Teme The lowest panel meter in these examples is the RTAlarmPanelMeter object Alarm properties include custom text for all alarm levels When an alarm occurs the foreground color of alarm text and the background color of the alarm text rectangle can be programmed to change state Class Architecture 21 RTAlarmPanelMeter Displays an alarm text message It contains a template based on the QCChart2D StringLabel class that is used to specify the font and string format information associated with the panel meter It bases the alarm text message on the alarm information in the associated RTProcessVar object Heart Rate Panel meter strings can be used to display an objects tag name units
283. le to fit in the bulb without overlapting the numeric and alarm status panel Auto Indicator Classes 29 oo NIIT a 292 Auto Indicator Classes Flow 493 E Grinin ou E euam Ea EM 0 20 40 60 80 100 GMB Panel meters to the left and right of the bar for the tag name numeric value and alarm status The scale units displays horizontally under the scale Turn the BarEndBulb property on and the bar indicator area shrinks horizontally in order to fit in the bulb without overlap Example for initializing RTAutoMultiBarIndicator objects The example below extracted from the AutoGraphDemos AutoMultiBarIndicators example draws four vertical and four horizontal bargraphs Below you will find the code used to initialize the first of the bargraphs above extracted from the AutoGraphDemo AutoMultiBarIndicatorsUserControll The controls are placed in the underlying window using the AutoMultiBarIndicatorsUserControll xaml file Auto Indicator Classes 293 Wi Window1 Mixed Chart AutoBarIndicators AutoMeterIndicators AutoMultiBarIndicators AutoPanelMeterIndicators AutoDialsAndClocksIndicators Flow 493 Flow 493 8arendbulb v Interior axs v Numeric readout v Alarm readout v Units string v Tag string v Title string lt UserControl x Class AutoGraphDemo AutoMultiBarIndicatorsUserControll xmlns http schemas microsoft com winfx 2006 xaml presentation xmlns x http schemas microsoft
284. le2D Point2D Point3D GroupPoint2D DoubleArray DoubleArray2D BoolArray Polysurface GraphObj AntennaAnnotation TickMark Axis LinearAxis PolarAxes AntennaAxes LogAxis TimeAxis ElapsedTimeAxis ChartText ChartTitle AxisTitle ChartLabel NumericLabel BarDatapointValue TimeLabel ElapsedTimeLabel StringLabel AxisLabels NumericAxisLabels TimeAxisLabels ElapsedTimeAxisLabels StringAxisLabels PolarAxesLabels AntennaA xesLabels ChartGrid PolarGrid AntennaGrid LegendItem BubblePlotLegendItem Legend StandardLegend BubblePlotLegend ChartPlot SimplePlot SimpleLinePlot SimpleBarPlot SimpleScatterPlot SimpleLineMarkerPlot Simple VersaPlot GroupPlot ArrowPlot BubblePlot CandlestickPlot CellPlot ErrorBarPlot FloatingBarPlot FloatingStackedBarPlot GroupBarPlot HistogramPlot LineGapPlot MultiLinePlot OHLCPlot StackedBarPlot StackedLinePlot Box WhiskerPlot GroupVersaPlot PieChart RingChart PolarPlot PolarLinePlot PolarScatterPlot AntennaPlot AntennaLinePlot AntennaScatterPlot AntennaLineMarkerPlot QCChart2D Class Summary 93 94 QCChart2D Class Summary Background ChartImage ChartShape ChartSymbol Marker ChartZoom 4 Process Variable and Alarm Classes RTProcessVar RTAlarm RTAlarmEventArgs The RTProcessVar class is the core data storage object for all of the real time indicator classes The RTProcessVar class represents a single process variable complete with limit values an unlimited number of hig
285. ler currentTemperature2 AlarmTransitionEventHandler New RTAlarmEventDelegate AddressOf TemperatureAlarmEventProc InitializeScrollGraph timerl Interval TimeSpan FromMilliseconds 50 100 msecs AddHandler timerl Tick New EventHandler AddressOf timerl Tick timer2 Interval TimeSpan FromMilliseconds 200 100 msecs AddHandler timer2 Tick New EventHandler AddressOf timer2 Tick 350 Using Real Time Graphics Tools for WPF to Create Windows Applications timerl Start timer2 Start End Sub Private Sub TemperatureAlarmEventProc ByVal sender As Object ByVal e As RTAlarmEventArgs Dim alarm As RTAlarm e EventAlarm Dim alarmlimitvalue As Double alarm AlarmLimitValue Dim pv As RTProcessVar e ProcessVar Dim tagname As String pv TagName Dim timestamp As Double pv TimeStamp Dim timestampstring As String timestamp ToString If alarm AlarmState Then Console Out WriteLine timestampstring amp amp tagname amp Warning Alarm Level amp alarmlimitvalue ToString amp Exceeded Else Console Out WriteLine timestampstring amp amp tagname amp Process Value transitioned back to normal range End If End Sub Update data using 100 msec timer Private Sub timerl Tick ByVal sender As Object ByVal e As System EventArgs Random data currentTemperatureValuel 5 0 5 ChartSupport GetRandomDouble currentTemperatureValue2 8 0 5 ChartSupport
286. ller can be used as a simple proportional controller by setting the reset rate and derivative time values to 0 0 Simple proportional control cannot take into account load changes in the process under control An example of a load for a temperature control loop is the ambient temperature of the room the process is in The lower the ambient temperature of the room the larger is the heat loss in the room It will take more energy to maintain the vat at a given temperature in a cold room than in a warm room A simple proportional controller cannot account for load changes which take place while the system is under control Integral control converts the first order proportional controller into a second order system which is capable of tracking process disturbances It adds to the controller output a term that corrects for any changes in the load level of the system under control This integral term is proportional to the sum of all previous process errors in the system As long as there is a process error the integral term will add more and more to the controller output until the sum of all previous errors is zero The term reset rate is used to describe the integral action of a PID controller The term derives from the output response of a PI controller the derivative term set to zero in this case to a step change in the process error signal The response consists of an initial jump from zero to the proportional gain setting K followed by a ramp the
287. lot class Chapter 13 describes the RTGroupMultiValuePlot class and the implementation of scrolling plots based on the QCChart2D GroupPlot Chapter 14 describes custom control classes buttons and track bars Chapter 15 describes the PID control class Chapter 16 describes tricks and techniques for zooming of real time data Chapter 17 describes miscellaneous classes for drawing shapes and creating rectangular and circular backdrops for graphs and controls Chapter 18 describes the RTProcessVarViewer class a data table used to display historical data collected by the RTProcessVar class Chapter 19 describes the new RTAutoIndicator classes RTAutoBarIndicator RTAutoMultiBarIndicator RTAutoMeterIndicator RTAutoClockIndicator RTAutoDialIndicator RTAutoScrollGraph RTAutoPanelMeterIndicator These classes simplify the creation of bar indicators meters dials clocks panel meters and scrolling graphs Chapter 20 is a tutorial that describes how to use Real Time Graphics Tools for WPF to create Windows applications using Visual Studio Net Visual C and Visual Basic Chapter 21 is a tutorial that describes how to use Real Time Graphics Tools for WPF to create ASP NET web applications using Visual Studio Net Visual C and Visual Basic Chapter 22 is a collection of Frequently Asked Questions about Real Time Graphics Tools for WPF 2 Class Architecture of the Real Time Graphics Tools for WPF Class Library Major Design Cons
288. low 1 DashStyles Solid Colors Yellow Dim attribArray As ChartAttribute attribl attrib2 attrib3 attrib4 Dim barwidth As Double 0 1 Dim barbase As Double 0 0 Dim barspace As Double 0 25 Dim barjust As Integer ChartObj JUSTIFY MIN Dim barorient As Integer ChartObj VERT DIR Dim baraxis As New LinearAxis pTransforml ChartObj Y AXIS chartVu AddChartObject baraxis Dim baraxis2 As New LinearAxis pTransforml ChartObj Y AXIS baraxis2 SetAxisIntercept pTransforml GetStopX baraxis2 SetAxisTickDir ChartObj AXIS MAX chartVu AddChartObject baraxis2 148 Multiple Channel Bar Indicator Dim barAxisLab As New NumericAxisLabels baraxis chartVu AddChartObject barAxisLab This uses an RTMultiProcessVar EngineCylindersl to initialize the indicator Dim barplot As New RTMultiBarIndicator pTransforml EngineCylindersl _ barwidth barspace barbase attribArray barjust barorient barplot SegmentSpacing 50 barplot SegmentWidth 30 barplot IndicatorBackground New ChartAttribute Colors Black 1 _ DashStyles Solid Colors Black barplot SegmentValueRoundMode ChartObj RT CEILING VALUE barplot SegmentCornerRadius 0 barplot IndicatorSubType ChartObj RT BAR SEGMENTED SUBTYPE Add panel meters to barplot chartVu AddChartObject barplot End Sub InitializeEnginelTempIndicator Example for an RTMultiBarIndicator Custom Segmented Bar Indicator The custom bar indicator example below is extra
289. m lowheartratealarm AlarmMessage Low Hear lowheartratealarm AlarmSymbolColor lowheartratealarm AlarmTextColor RTAlarm highheartratealarm new RTAlarm C highheartratealarm AlarmMessage highheartratealarm AlarmSymbolColor highheartratealarm AlarmTextColor Colors double heartRa heartRa heartRa heartRa heartRa heartRa heartRa heartRateValue te te te te te te te 0 05 new RTProcessVar Heart Rate MinimumValue 0 MaximumValue 3007 DefaultMinimumDisplayValue DefaultMaximumDisplayValue AddAlarm lowheartratealarm AddAlarm highheartratealarm 0 200 et gt Gh SE et ct These two lines enable alarm transition heartRate AlarmTransitionEventEnable heartRate AlarmTransitionEventHandler heartRate SetCurrentValue heartRateValue priva MessageBoxButtons buttons DialogResult result result MessageBox Show this Emergency Heartrate Shutdown MessageBoxIcon Question MessageBoxOptions RightAlign if result DialogResult Yes Application Exit VB Dim defaultattrib As New ChartAttribute Colors Green Colors Green Dim lowheartratealarm As New RTAlarm ChartObj RT_ALARM LOWERTHAN lowheartratealarm AlarmMessage Low Hear lowheartratealarm AlarmSymbolColor lowheartratealarm AlarmTextColor Dim highheartratealarm As New RTAlarm Char highheartratealarm AlarmMessage highheartratealarm AlarmSymbolColor highheartratealarm AlarmTextColor Colors tRate tRate
290. maller e Build the Solution Build Build Solution If the project fails to compile you need to go back and check the errors and the previous steps When it runs properly it the WpfRTApplicationl chart looks like Wi Window Scroll Application 1 17 15 00 17 15 15 17 15 30 17 15 45 352 Using Real Time Graphics Tools for WPF to Create Windows Applications There are other ways to incorporate charts into your application You can add a UserControl to your program Add UserControl and place the chart entirely in the UserControl The ChartView object is referenced in the Grid panel of the UserControl s xaml file and initialized in the UserControl s behind code file The UserControl derived class is then referenced in the main Window xaml file The QCChart2D UserControlChartExamplel demonstrates this method Or You can add a UserControl to your program but change the inheritance from UserControl to ChartView Since ChartView is a subclass of UserControl this is valid In this case you want to remove the Grid section from the xaml file of the ChartView derived class The Grid panel is opaque and the chart will not show through The ChartView derived class is then referenced in the main Window xaml file See the QCChart2D UserControlChartExample2 program for an example of this technique Or You can just reference the ChartView class in the main Windows xaml file Define the chart in the behind code file Windows xaml cs or Windo
291. mary channel of the indicator 110 Panel Meter Classes from RTPlot RTDataSource inherited from Get Set the array list holding the RTProcessVar RTSingleValueIndicator variables for the indicator RTPlotObj inherited from Set Get the reference RTPlot object RTPanelMeter TextColor Set Get the text color of the panel meter A complete listing of RTPanelMeter properties is found in the QCRTGraphWPFCompiledHelpFile chm documentation file located in the doc subdirectory Positioning Panel Meters The most complicated thing about panel meters is getting them positioned where you want There are over 30 positioning constants that can be used to position panel meters with respect to graph objects the plot area and graph area of the associated graph In addition to the positioning constants you can explicitly place the panel meter anywhere that you want in a graph using the CUSTOM POSITION position constant in conjunction with the RTPanelMeter SetLocation method The table below summarizes the panel meter positioning constants used in the software Positioning Constants CUSTOM POSITION Custom position specified using the RTPanelMeter SetLocation method Position can be set using the DEV POS PHYS POS NORM GRAPH POS NORM PLOT POS coordinate systems Set the justification of the panel meter box using the StringLabel or NumericLabel template of the specific panel meter class CENTERED BAR Used when the panel meter is attache
292. me WpfBrowserApplication 1 Ina WPF browser application the main ASML file is named Pagel whereas in the standard Windows application it is named Windowl Default Namespace Issues There is an annoying difference in the default files generated by the VB project wizard versus the C project wizard The C wizard includes a namespace reference in the class definition found in the main Pagel xaml file as in WpfBrowserApplicationl Pagel In Visual Basic the default Pagel xaml file does not include the namespace reference as in the example below If you stick with the default VB class definition no namespace you must be consistent across all of your source files and not specify a project namespace Most all of our other examples use namespaces throughout the project largely because they were translated directly from the C examples and all of the C examples use namespaces The XAML of Pagel looks like lt Page x Class Pagel 364 Using OCRTGraph for WPF to Create Web Applications xmlns http schemas microsoft com winfx 2006 xaml presentation xmlns x http schemas microsoft com winfx 2006 xaml Title Pagel gt lt Grid gt lt Grid gt lt Page gt The window does not yet have any content First define a default size for the window and add references to the QCChart2D and QCRTGraph namespaces In this case the namespaces are com quinncurtis chart2dwpf and com quinncurtis rtgraphwpf and are loc
293. me RTProcessVar object or it can be based on an entirely different RTProcessVar object It is therefore possible to zoom back to the beginning of an RTProcessVar objects historical buffer without affecting current data collection At any time the graph return to a view that includes the most current information When you want to zoom or pan backwards into the historical buffer of the RTProcessVar object first you must disable the RTScrollFrame updates Since the RTScrollFrame will attempt to always graph the most recent data values you don t want it interfering with a zoom or a pan which explicitly does NOT want the most recent Zooming 247 values displayed Disable the RTScrollFrame updates using the RTScrollFrame ChartObjEnable method set it to ChartObj OBJECT_ DISABLE When you want to start scrolling again set it to ChartObj OBJECT_ENABLE Simple Zooming of a single channel scroll frame Class ChartZoom GraphObj ChartZoom The ChartZoom class implements WPFdelegates for mouse events It implements and uses the mouse events OnMouseMove OnDoubleClick OnMouseDown OnMouseUp and OnClick The default operation of the ChartZoom class starts the zoom operation on the OnMouseDown event it draws the zoom rectangle using the XOR drawing mode during the OnMouseMove event and terminates the zoom operation on the mouse released event During the mouse released event the zoom rectangle is converted from device units into the chart ph
294. me data in a text format Panel meters are available for numeric values string values time date values and alarm values Meter Axis Classes Form Control Classes Scroll Frame Auto Indicator Classes Miscellaneous Classes Class Architecture 15 Meter indicators needed new classes to support the drawing of meter axes meter axis labels and meter alarm objects The WPF Button System Windows Controls Button and Slider System Windows Controls Slider objects have been subclassed and enhanced for use in instrument panels The RTControlButton class implements on off colors and on off text for momentary toggle and radio button style buttons The RTTrackBar class adds real world scaling based on double values to the Slider class RTControlButton and RTTrackBar objects can be group together in a grid organizing the control objects functionally and visually A scroll frame manages constant rescaling of coordinate systems of plot objects RTSimpleSingleValuePlot and RTGroupMultiValuePlot objects that are displayed in a scrolling graph The RTScrollFrame class manages a horizontal scroll frame while the RTVerticalScrollFrame manages a vertical scroll frame A group of classes encapsulate the real time indicators bars meters dials clocks panel meter and scroll graphs as self contained ChartView derived classes so that they can be placed individually on forms Support classes are used to display special symbols used for a
295. me stamp in milliseconds for the process variable pv The value of the process variable If the time stamp value is not explicitly provided as in the case of the last overloaded method the current time as stored in the system clock is used as the time stamp Alarms are added to an RTProcessVar object using the RTProcessVar AddAlarm or RTProcessVar AddCloneAlarm methods The AddCloneAlarm method clones the passed in alarm object so that the same RTAlarmObject can be used to initialize multiple RTProcessVar objects without a conflict occurring Visual Basic Public Sub AddAlarm ByVal alarmobj As RTAlarm 98 Process Variable and Alarm Classes Public AddCloneAlarm ByVal alarmobj As RTAlarm As RTAlarm Ct public void AddAlarm RTAlarm alarmobj IK public RTAlarm AddCloneAlarm RTAlarm alarmobj Parameters alarmobj A reference to the RTAlarm object that is to be added to the process variables alarm list Configure the RTAlarm object and then add it to the RTProcessVar object If you plan to use the RTAlarm event handlers make sure that you create a unique RTAlarm object for every alarm added to a RTProcessVar object The most commonly used RTProcessVar properties are Selected Public Instance Properties AlarmStateEventEnable AlarmTransitionEventEnable CurrentValue DatasetEnableUpdate DefaultAttribute DefaultMaximumDisplayValue DefaultMinimumDisplayV alue DetailedDescription GoodValue
296. mers It your program does any real time updates it probably uses a timer class The Net Forms timer class is Systems Timers Timer while the WPF timer class is System Windows Threading DispatcherTimer They are similar in function with slightly different properties you must set Net Forms CH System Timers Timer timerl new System Timers Timer timerl Enabled true timerl Interval 300 timerl Elapsed new System Timers ElapsedEventHandler timerl Elapsed VB Friend WithEvents timerl As System Timers Timer timerl New System Timers Timer timerl Enabled True timerl Interval 300 WPF CH System Windows Threading DispatcherTimer timerl new System Windows Threading DispatcherTimer timerl IsEnabled true timerl Interval TimeSpan FromMilliseconds 2000 timerl Tick new EventHandler timerl Elapsed VB Private timerl As New System Windows Threading DispatcherTimer timerl IsEnabled True timerl Interval TimeSpan FromMilliseconds 2000 AddHandler timerl Tick New EventHandler AddressOf timerl Elapsed Class Architecture 53 3 QCChart2D for WPF Class Summary This chapter is a summary of the information in the QCChart2DWPFManual PDF file It is not meant to replace that information Refer to that manual for detailed information concerning these classes QCChart2D for WPF Class Summary The following categories of classes realize these design considerations Chart
297. meter numeric value The text properties associated with the panel meter are set using this property In addition the format of the numeric value and the number of digits to the right of the decimal point is also set here A complete listing of RTNumericPanelMeter properties is found in the QCRTGraphWPFCompiledHelpFile chm documentation file located in the doc subdirectory Example The panel meter below extracted from the Treadmill example method InitializeRightPanelMeters is an independent panel meter that displays the METSCumlative process variable The positioning is accomplished using the RTPanelMeter SetLocation method which in this case places the panel meter using normalized graph coordinates The size of the panel meter is determined by two things the font size which in this case is 64 and the number of digits used in the display In order to keep the panel meter box from constantly changing size if the number of digits changes the panel meter box is sized to accommodate the range of values specified by the RTProcessVar DefaultMinimumDisplay Value and RTProcessVar DefaultMaximumDisplay Value C public void InitializeRightPanelMeters ChartFont numericfont font64Numeric ChartFont trackbarTitlefont font12Bold CartesianCoordinates pTransforml new CartesianCoordinates 0 0 0 0 pTransforml SetGraphBorderDiagonal 0 0 ChartAttribute attribl new ChartAttribute Colors LightBlue 7 DashStyles
298. meterneedle VB Dim meterneedle As New RTMeterNeedleIndicator meterframe processVarl meterneedle IndicatorSubtype ChartObj RT METER NEEDLE ARROW SUBTYPE meterneedle SetChartObjAttributes attribl meterneedle NeedleLength 0 55 Dim panelmeterattrib As New ChartAttribute Colors SteelBlue 3 DashStyles Solid Colors Black Dim panelmeter As New RTNumericPanelMeter meterframe processVarl panelmeterattrib panelmeter PanelMeterPosition ChartObj RADIUS LEFT panelmeter NumericTemplate XJust ChartObj JUSTIFY MIN panelmeter NumericTemplate YJust ChartObj JUSTIFY CENTER panelmeter NumericTemplate TextFont FontArchive font24Numeric meterneedle AddPanelMeter panelmeter chartVu AddChartObject meterneedle Symbol Meter Indicators Class RTMeterSymbolIndicator 181 Meter Indicators Needle Arc and Symbol LineStyle com quinncurtis chart2dwpf ChartPlot RTPlot RTSingleValueIndicator RTMeterIndicator RTMeterSymbolIndicator This RTMeterSymbolIndicator class displays the current RTProcessVar value as a symbol moving around in the meter arc Symbols include all of the QCChart2D scatter plot symbols SQUARE TRIANGLE DIAMOND CROSS PLUS STAR LINE HBAR VBAR BAR3D and CIRCLE RTMeterSymbolIndicator constructor Visual Basic Overloads Public Sub New ByVal frame As RTMeterCoordinates ByVal datasource As RTProcessVar ByVal symbolnum As Integer _ ByVal symbolsize As Double _ ByVal attrib As
299. method InitializeMeter2 C RTMeterNeedleIndicator meterneedle new RTMeterNeedleIndicator meterframel processVar2 meterneedle SetChartObjAttributes attribl meterneedle NeedleLength 0 7 meterneedle ZOrder 55 Add panel meters chartVu AddChartObject meterneedle VB Dim meterneedle As New RTMeterNeedleIndicator meterframel processVar2 meterneedle SetChartObjAttributes attribl meterneedle NeedleLength 0 7 meterneedle ZOrder 55 Add panel meters chartVu AddChartObject meterneedle Extracted from the example program RTGraphNetDemo file ArrowMeterUserControll cs method InitializeMeter8 Meter Indicators Needle Arc and Symbol 180 C RTMeterNeedleIndicator meterneedle new RTMeterNeedleIndicator meterframe processVarl meterneedle IndicatorSubtype ChartObj RT METER NEEDLE ARROW SUBTYPE meterneedle SetChartObjAttributes attribl meterneedle NeedleLength 0 55 ChartAttribute panelmeterattrib new ChartAttribute Colors SteelBlue 3 DashStyles Solid Colors Black RTNumericPanelMeter panelmeter new RTNumericPanelMeter meterframe processVarl panelmeterattrib panelmeter PanelMeterPosition ChartObj RADIUS LEFT panelmeter NumericTemplate XJust ChartObj JUSTIFY MIN panelmeter NumericTemplate YJust ChartObj JUSTIFY CENTER panelmeter NumericTemplate TextFont FontArchive font24Numeric meterneedle AddPanelMeter panelmeter chartVu AddChartObject
300. mp Specifies the high clamping value for output If the output of the PID calculation results in a value higher than highclmp the value will be clamped to highclmp rateclmp Clamping limit for the output rate of change measured in output units per minute It limits the rate of change of the algorithm output sampleper Sample period of PID updates in minutes For example if the controller s output is calculated two times a second the value of this parameter is 1 2 60 0 0084 minutes filterconst A value in the range 0 0 to 1 0 affecting the filtering of the noisy measurement signal A value of 0 0 means that no filtering takes place The filtering effect is maximal when rFiltConst is 1 0 The formula for filtering is Filtered value 1 0 rFiltConst Measured value rFiltConst Previous filtered value 242 PID Control Selected Public Instance Properties DerivativeConstant Le SetGetemortermt2 O Boas Set er em E Set Get exponential smoothing constant LastPIDValue MyFilter NewError OldEmor RateClamp Set Get rate first derivative of output clamping value for output SetPoint Set Get steady state output position Set Get sum of all previous errors Selected Public Instance Methods RTCalcPID This method performs a PID loop calculation RTResetErrorTerms This method resets all of the error terms for the PID calculations pdatePIDIntermediateParameters Thi
301. ms Code Data General Web Windows Forms Reporting Workflow WPF Visual Studio installed templates E About Box Ye Class Code File di Component Class Custom Control WPF Dialog EE Explorer Form avg Interface Z LINQ to SQL Classes Local Database Cache al MDI Parent Form E Page WPF A Report A ADO NET Entity Data Model E Class Diagram zv COM Class A Custom Control Zu DataSet fig Dynamic Data Field 13 Flow Document WPF Script File g Local Database ES Login Form Module oc Page Function WPF pr Report Wizard An empty class definition Name ScrollGraph 1 vb The resulting ScrollGraph1 vb file will contain Public Class SorollGraphl End Class e Modify the ScrollGraphl file to create the desired chart Most all of our examples are structured the same way The constructor is changed to pass in a ChartView object Then a chart initialization routine is called which customizes the chart See the ScrollGraph1 vb file of the WpfRTApplicationl example Using QCRTGraph for WPF to Create Windows Applications 347 Imports com quinncurtis chart2dwpf Imports com quinncurtis rtgraphwpf lt summary gt Summary description for ScrollApplicationUserControll U lt summary gt Public Class ScrollGraphl Private timerl As New System Windows Threading DispatcherTimer Private timer2 As New System Windows Threading DispatcherTimer Pri
302. my ChartView Margin 18 11 16 6 Name scrollingApp1 Grid Row 0 gt lt my2 RTProcessVarViewer Margin 18 11 16 6 Name rtProcessVarViewerApp2 Grid Row 1 gt lt Grid gt lt TabItem gt lt TabControl gt lt Grid gt lt Window gt Scroll Application 1 130 120 110 100 11 39 45 11 40 00 11 40 15 11 40 30 115 117 120 122 123 11 40 30 0 11 40 31 0 11 40 32 0 11 40 33 0 11 40 34 0 11 40 35 0 11 40 36 0 11 40 37 0 11 40 38 0 11 40 39 0 127 0 125 4 Temp 1 127 8 125 2 125 0 124 4 126 9 125 9 124 4 123 0 A RTProcessVarViewer displaying two RTProcess Var objects C public void InitProcessVarViewer RTProcessVarViewer rtProcessVarViewerl int rows 3 columns 11 startindex 0 rtProcessVarViewerl InitRTProcessVarViewer chartVu null currentTemperaturel rows columns startindex rtProcessVarViewerl UseStripedGridBackground true rtProcessVarViewerl GridCellFont font12 rtProcessVarViewerl AddProcessVar currentTemperature2 Set custom decimal precision for each row rtProcessVarViewerl SetFormatDecimalPos 0 0 rtProcessVarViewerl SetFormatDecimalPos 1 1 rtProcessVarViewerl SetFormatDecimalPos 2 2 Visual Basic Public Sub InitProcessVarViewer rtProcessVarViewerl As RTProcessVarViewer Dim rows As Integer 3 columns As Integer 11 startindex As Integer 0 rtProcessVarViewerl InitRTProcessVarVie
303. n of bool based data elements This class encapsulates an xyz set of double values used to specify 3D data values This is a utility class for returning data that results from nearest point calculations The axis classes use this class to to organize the location of the individual tick marks of an axis This is a utility class that defines complex 3D shapes as a list of simple 3 sided polygons The contour plotting routines use it QCChart2D Class Summary 91 Rectangle2D This is a utility class that extends the RectangleF class using doubles as internal storage 92 QCChart2D Class Summary A diagram depicts the class hierarchy of the QCChart2D for WPF library Cham TZ Arrow ChartCalendar CSV Dimension Point3D NearestPointData Polysurface ChartScale LinearScale LogScale TimeScale ElapsedTimeScale UserCoordinates WorldCoordinates WorkingCoordinates PhysicalCoordinates CartesianCoordinates PolarCoordinates AntennaCoordinates TimeCoordinates ElapsedTimeCoordinates ChartDataset SimpleDataset TimeSimpleDataset ElapsedTimeSimpleDataset ContourDataset GroupDataset TimeGroupDataset ElapsedTimeGroupDataset AutoScale LinearAutoScale LogAutoScale TimeAutoScale ElapsedTimeAutoScale MouseListener MoveObj FindObj DataToolTip ChartZoom MagniView MoveCoordinates MultiMouseListener DataCursor MoveData ChartAttribute ChartGradient ChartPrint BufferedImage System Windows Controls UserControl ChartView Rectang
304. n of the GroupPlot class and displays stock market data in an open high low close format common in financial technical analysis Cell Plot of Population Density Distance from Closest Walmart Miles Mean Family Income 1000 The Cell plot will plot rectangles of any size color and postion This class is a concrete implementation of the GroupPlot class and displays cell plots A cell plot is a collection of rectangular objects with independent positions widths and heights specified using the values of the associated group dataset ErrorBarPlot WSJ DSP Journal EDN 2 b S E Ss PC Mag Computer Week Info Age FloatingBarPlot Price 35 2003 Feb NASDAQ QCChart2D Class Summary 73 This class is a concrete implementation of the GroupPlot class and displays error bars Error bars are two lines positioned about a data point that signify the statistical error associated with the data point Media Schedule Jun Jul Aug Sep Oct Nov Dec 2004 Year of 2003 Mar Apr May Floating bars are useful for creating scheduling charts This class is a concrete implementation of the GroupPlot class and displays free floating bars in a graph The bars are free floating because each bar does not reference a fixed base value as do simple bar plots stacked bar plots and group bar plots Daily Stock Price 1880 1860 1840 1820 TREE 1800 1 T 1 05 09 FloatingStackedBarPlot
305. nd supports momentary toggle and radio button styles 36 Class Architecture eee FEET ELIT OG I Horizontal and vertical track bars can be scaled for physical real world coordinates RTControlTrackBar Derived from the WPF Control Slider class it adds floating point scaling for the track bar endpoints increments current value and tick mark frequency RTFormControl The RTFormControl class wraps the WPF Form Controls and our RTControlButton and RTControlTrackBar controls so that they can be placed in a graph RTFormControlPanelMeter This panel meter class contains encapsulates an RTFormControl object in a panel meter class so that controls can be added to indicator objects E amp ELE ELETTI amp J 6 EE ELE EE EG I RTFormControlGrid objects are arranged in a row x column format Additional panel meter objects numeric and string panel meters in the track bar example above can be attached to the primary control grid object RTFormControlGrid The RTFormControlGrid organizes a collection of RTFormControl objects functionally and visually in a grid Class Architecture 37 format An RTControlButton must be added to an RTFormControlGrid before the radio button processes of the RTControlButton will work Scroll Frame Class com quinncurtis chart2dwpf ChartPlot RTPlot RTMultiValueIndicator RTScrollFrame RTVerticalScrollFrame Course Difficulty 13 37 40 13 37 50 Heart ECG 13
306. nd to 100 years 64 QCChart2D Class Summary TimeAxis Time Date Axes with Custom Hour Range 8 30 AM to 4 00 PM Dayf2 Hour 4 HourHour Tapi 3 FS ga a TI DEI 4 02 03 4 03 03 40403 830 12 00 8 30 12 00 10103 10203 2 HourHour Heu Minute Ti 830 10 00 1200 1400 830 1000 830900 10 00 11 00 12 00 13 00 1400 uos 102 03 4 0103 Hour Minute 15 Minute Minute Pe a a RE 30 om 10 00 1100 230 8 45 9 00 9 15 930 10103 5 Minute Minute Minute 15 Seconds myrr TETTE STET TTT rar T T 835 840 8 45 850 855 83000 83100 83200 983300 983400 10103 Minute 5 Second 5 Second Second ELOS VEL LO GEL ORI NL IULM RULLI I DE 8 31 00 8 32 00 8 3300 83000 83005 3040 83045 8 30 20 100108 Atime axis can be customized for non 24 hour range This class is the most complex of the axis classes It supports time scales ranging from 1 milliseond to hundreds of years Dates and times are specified using the Net ChartCalendar class The major and minor tick marks can fall on any time base where a time base represents seconds minutes hours days weeks months or years The scale can exclude weekends for example Friday October 20 2000 is immediately followed by Monday October 23 2000 A day can also have a custom range for example a range of 9 30 AM to 4 00 PM The chart time axis excludes time outside of this range This makes the class very useful for the inter day display of financial market information stoc
307. ndicator An RTMultiBarIndicator is used to display the current value of a collection of RTProcessVar objects using a group of bars changing size The bars are always fixed at the specified base value Bars can change their size either in vertical or horizontal direction Sub types within the RTMultiBarIndicator class support segmented bars custom segmented bars with variable width segments and pointer bar indicators Multiple Channel Bar Indicator Class RTMultiBarIndicator com quinncurtis chart2dwpf ChartPlot RTPlot RTMultiValueIndicator RTMultiBarlIndicator The multi bar indicator displays a collection of RTProcessVar objects that are related or at the very least comparable when bar graphed against one another using the same physical coordinate system It is usually combined with axes and axis labels though this is not required Since the bar indicator does not include axes or axis labels as option it is up to the user to explicitly create axis and axis label objects for the bar indicator graph The QCChart2D axis and axis labels routines make this easy to do When an RTPanelMeter object is added to an RTMultiBarIndicator it is used as a template to create a multiple panel meters one for each bar of the multi bar indicator The panel meter for each bar will reference the process variable information associated with that bar stored in the RTProcessVar objects attached to the multi bar indicator RTMultiBarIndicator constructors
308. ndicator is customized using public properties Visual Basic Overloads Public Sub New C public RTAutoMeterIndicator The InitStrings method is used to initialize the clock tag and units strings Method InitStrings VB Public Sub InitStrings _ title As String units As String C public void InitStrings string title string units Parameters title The title or tag string units The units string Use the UpdateClock method to update the clock indicator with a new time value Method UpdatelIndicator VB Public Sub UpdatseClock time As DateTime _ updatedraw As Boolean Public Sub UpdateClock _ time As ChartCalendar updatedraw As Boolean CH public void UpdateClock DateTime time bool updatedraw publics void UpdateClock 310 Auto Indicator Classes ChartCalendar time bool updatedraw Parameters value Update the clock with this time value updatedraw True and the indicator is immediately updated Selected Public Instance Properties Name AlarmList AlarmPanelMeter DefaultAlarmFont DefaultAxisLabelsFont DefaultDataValueFont DefaultFontString DefaultMainTitleFont DefaultTagFont DefaultUnitsFont DialInterior FaceplateBackground GraphBackground GraphBorder GraphFormat Height HighAlarm LowAlarm MainTitle MaximumSize MaxIndicatorValue MinimumSize Description Get the ArrayList holding all of the RTAlarm obj
309. ng System Windows using System Windows Controls using System Windows Data using System Windows Documents Using QCRTGraph for WPF to Create Windows Applications 335 using System Windows Input using System Windows Media using System Windows Media Imaging using System Windows Navigation using System Windows Shapes namespace WpfApplicationl lt summary gt Interaction logic for Windowl xaml lt summary gt public partial class Windowl Window public Windowl InitializeComponent e Adda reference to the QCChart2DWPF and QCRTGraphWPF namespaces com quinncurtis chart2dwpf and com quinncurtis rtgraphwpf in the using section of the program using com quinncurtis chart2dwpf using com quinncurtis rtgraphwpf e Add a new simple class file named ScrollGraph1 to the project Alternatively select Add Existing Item and select the file ScrollGraph1 cs from our WpfRTApplicationl example folder If you do that make sure you change the declared namespace at the top of the file namespace WpfRTApplicationl to the one your project uses probably namespace WpfApplicationl Add New Item WpfRTApplication1 Categories Templates E Visual C Visual Studio installed templates Code 8 Data E About Box d ADO NET Entity Data Model General Application Configuration File Application Manifest File Web e Assembly Information File gg Bitmap File Windows Forms et Class Class Diagram WPF
310. nsforml1 panelmeterattrib panelmeter PanelMeterPosition ChartObj OUTSIDE PLOTAREA MIN barplot AddPanelMeter panelmeter RTAlarmPanelMeter panelmeter2 new RTAlarmPanelMeter pTransforml panelmeterattrib panelmeter2 PanelMeterPosition ChartObj BELOW REFERENCED TEXT barplot AddPanelMeter panelmeter2 RTStringPanelMeter panelmeter3 new RTStringPanelMeter pTransforml1 paneltagmeterattrib ChartObj RT TAG STRING panelmeter3 PanelMeterPosition ChartObj OUTSIDE PLOTAREA MAX barplot AddPanelMeter panelmeter3 chartVu AddChartObject barplot VB Dim pTransforml As New CartesianCoordinates 0 0 0 0 1 0 5000 0 pTransforml SetGraphBorderDiagonal 0 05 0 175 0 08 0 35 Dim background As New Background pTransforml ChartObj PLOT BACKGROUND Colors Gray chartVu AddChartObject background Dim attribl As New ChartAttribute Colors Green 1 DashStyles Solid Colors Green Dim barwidth As Double 1 0 Dim barbase As Double 0 0 Dim barjust As Integer ChartObj JUSTIFY MIN Dim barorient As Integer ChartObj VERT DIR Dim baraxis As New LinearAxis pTransforml ChartObj Y AXIS chartVu AddChartObject baraxis Dim barAxisLab As New NumericAxisLabels baraxis chartVu AddChartObject barAxisLab Dim barplot As New RTBarIndicator pTransforml EngineRPM1 barwidth _ barbase attribl barjust barorient barplot SegmentSpacing 400 barplot SegmentWidth 250 barplot IndicatorBackground New Ch
311. nshape new RTGenShape meterframe shaperect 0 0 ChartObj RT SHAPE ELLIPSE ChartObj NORM GRAPH POS genshape SetChartObjAttributes attrib2 chartVu AddChartObject genshape VB Dim attrib2 As New ChartAttribute Colors Gray 5 DashStyles Solid Colors White Dim shaperect As New Rectangle2D 0 8 0 025 0 19 0 25 Dim genshape As New RTGenShape meterframe shaperect 0 0 ChartObj RT SHAPE ELLIPSE ChartObj NORM GRAPH POS genshape SetChartObjAttributes attrib2 chartVu AddChartObject genshape 18 Process Variable Viewer RTProcessVarViewer The RTProcessVarViewer class extends the QCChart2D DatasetViewer class so that it can display the historical datasets stored in the RTProcessVar objects The RTProcessVarViewer can be updated in real time and synchronized to the chart so that scrolling of the RTProcessVarViewer can scroll the chart Class RTProcessVarViewer ChartView DatasetViewer RTProcessVarViewer The RTProcessVarViewer is a ChartView derived object and as such is an independent UserControl object Use it to view one or more RTProcessVar objects in a real time display Since it is usually not possible or practical to display the entire dataset the RTProcessVarViewer windows a rectangular section of the dataset for display Scroll bars are used to scroll the rows and columns of the dataset The RTProcessVarViewer constructor defines the size position source matrix the number of rows and column
312. nstants RT METER NEEDLE SIMPLE SUBTYPE RT METER NEEDLE PIEWEDGE SUBTYPE RT METER NEEDLE ARROW SUBTYPE Set Get the width of the base end of the needle for the RT METER NEEDLE SIMPLE SUBTYPE needle type in device coordinates Set Get the head length multiplier for the RT METER NEEDLE ARROW SUBTYPE needle type in device coordinates Set Get the head width multiplier for the RT METER NEEDLE ARROW SUBTYPE needle type in device coordinates Set Get the length of the needle in normalized plot coordinates length Set Get the overhang of the back end of the needle indicator specified as a fraction of the needle length Set Get Specifies the arc width of the needle for the RT METER NEEDLE PIEWEDGE SUBTYPE needle type in degrees coordinates Set Get the color of the needle pivot Set to true to draw the needle pivot Set Get in device coordinates the radius of the pivot point of the needle analogous to the bearing or axle supporting the meter needle A complete listing of RTMeterNeedleIndicator properties is found in the QCRTGraphWPFCompiledHelpFile chm documentation file located in the doc subdirectory Examples for needle meter indicators The examples below are program segments that give the important aspects of configuration a needle meter indicator for the image above it 179 Meter Indicators Needle Arc and Symbol LineStyle Extracted from the example program RTGraphNetDemo file NeedleMeterUserControll
313. nt startarcscale endarcscale arcdirection centerx centery arcradius Rectangle2D normrect new Rectangle2D 0 67 0 05 0 32 0 53 RT3DFrame frame3d new RT3DFrame meterframel normrect facePlateAttrib ChartObj NORM GRAPH POS chartVu AddChartObject frame3d meterframel SetGraphBorderDiagonal 0 67 0 05 0 99 0 58 RTMeterNeedleIndicator meterneedle new RTMeterNeedleIndicator meterframel humidity Add panel meters chartVu AddChartObject meterneedle RTMeterAxis meteraxisl new RTMeterAxis meterframel meterneedle meteraxisl SetChartObjAttributes attribl meteraxisl SetAxisTickDir ChartObj AXIS MIN meteraxisl LineWidth 3 meteraxisl LineColor Colors Black meteraxisl SetAxisTickSpace 20 meteraxisl SetAxisMinorTicksPerMajor 1 meteraxisl ShowAlarms false meterneedle MeterAxis meteraxisl chartVu AddChartObject meteraxisl RTMeterAxisLabels meteraxislabelsl new RTMeterAxisLabels meteraxisl meteraxislabelsl SetTextFont meterFont meteraxislabelsl SetAxisLabelsDir meteraxisl GetAxisTickDir meteraxislabelsl OverlapLabelMode ChartObj OVERLAP LABEL DRAW Meters Coordinates Meter Axes and Meter Axis Labels 165 chartVu AddChartObject meteraxislabels1 VB Dim attribl As New ChartAttribute Colors Black 1 DashStyles Solid Colors Blue Fahrenheight scale Dim startarcangle As Double 225 Dim arcextent As Double 270 Dim startarcscale As Double 0 0
314. nt theFont ChartFont theFont FontWeights Bold VB new ChartFont Microsoft Sans Serif 10 FontStyles Normal new ChartFont Microsoft Sans Serif 10 FontStyles Normal Dim theFont As New ChartFont Microsoft Sans Serif 10 FontStyles Normal Dim theFont As New ChartFont Microsoft Sans Serif 10 FontStyles Normal FontWeights Bold Font Style Constants The System Drawing FontStyle enumerated constants are different than the WPF FontStyles constants Net Forms WPF Bold Italic Oblique Regular Normal Strikeout Underline Font Weight Constants The WPF FontWeights enumerated constants include Bold DemiBold ExtraBlack ExtraBold ExtraLight Heavy Light Medium Normal Regular SemiBold Thin UltraBlack UltraThin and UltraBold Grid Grid is a panel class used everywhere in WPF programs for the layout of visual objects Rather than force programmers to fully qualify the QCChart2D Grid class which does something entirely different than the WPF Grid class we changed the name of our grid to ChartGrid Otherwise the parameters remain the same as our original QCChart2D Grid class WPF Class Architecture 51 CH ChartAttribute attrib3 new ChartAttribute Colors Gray 1 DashStyles Dot ChartGrid ygrid new ChartGrid xAxis yAxis ChartObj Y AXIS ChartObj GRID MAJOR ygrid SetChartObjAttributes attrib3 chartVu AddChartObject ygrid VB Dim attrib3 As New ChartAttribute Colors Gray
315. ntation of the AntennaPlot class and displays data in a simple line markder plot format This class is used to highlight or mark a specific attribute of the chart It can mark a constant radial value using a circle or it can mark a constant angular value using a radial line from the origin to the outer edge of the scale 80 QCChart2D Class Summary Pie and Ring Chart Classes It uses data organized as arrays of x and y values where an x value represents the numeric value of a pie wedge and a y value specifies the offset or explosion of a pie wedge with respect to the center of the pie Click on any pie wedge to see a detail Click again on the pie wedge to remove detail PieChart The pie chart plots data in a simple pie chart format It uses data organized as arrays of x and y values where an x value represents the numeric value of a pie wedge and a y value specifies the offset or explosion of a pie wedge with respect to the center of the pie QCChart2D Class Summary 81 RingChart The ring chart plots data in a modified pie chart format known as a ring chartt It uses data organized as arrays of x and y values where an x value represents the numeric value of a ring segment and a y value specifies the offset or explosion of a ring segment with respect to the origin of the ring Simple Plot Classes SimplePlot SimpleBarPlot SimpleLineMarkerPlot SimpleLinePlot SimpleScatterPlot SimpleVeraPlot
316. o be the most flexible Visual C for WPF Ifyou do not already have an application program project create one using the Visual Studio project wizard File New Project Visual C Projects WPF Application On the left select a project type of Visual C Windows Give the project a unique name In our examples wpf folder this example is the WpfRTApplicationl so give your example a different name such as WPFApplicationl You will end with a basic WPF based application For purposes of this example the chart will placed in the initial default window The XAML portion of the project looks like Window x Class WpfApplicationl Window1 xmlns http schemas microsoft com winfx 2006 xaml presentation xmlns x http schemas microsoft com winfx 2006 xaml Title Window1 Height 300 Width 300 gt lt Grid gt lt Grid gt lt Window gt Using QCRTGraph for WPF to Create Windows Applications 333 New Project Project types Templates NET Framework 3 5 E Visual C Visual Studio installed templates Windows Web E Windows Forms Application ss Class Library DocProject a ASP NET Web Application 2 ASP NET Web Service Application Reporting i WPF Application FER WPF Browser Application WCF 3 Console Application Ba wer Service Application Workflow EF Windows Forms Control Library 8 Dynamic Data Entities Web Application E Other Languages Si Dynamic Data Web Application E Visual Basic Windows My
317. o display off scale up to 11 0 Set Get the panel meter list of the RTPlot object Set Get the primary channel of the indicator Get Set the array list holding the RTProcessVar variables for the indicator Get Set the displayable low end of the indicator range as a normalized value based on the RTMeterCoordinates and RTMeterAxis scale For example if the RTMeterAxis scale is 0 to 10 an underRangeNormalizedValue of 0 1 will allow the indicator to display off scale down to 1 Sets the z order of the object in the chart Every object has a z order value Each z order value does NOT have to be unique If z order sorting is turned on in the ChartView object objects are sorted by z order before 171 Meter Indicators Needle Arc and Symbol LineStyle they are drawn A complete listing of RTMeterIndicator properties is found in the QCRTGraphWPFCompiledHelpFile chm documentation file located in the doc subdirectory Arc Meter Indicator RTMeterArcIndicator com quinncurtis chart2dwpf ChartPlot RTPlot RTSingleValueIndicator RTMeterIndicator RTMeterArcIndicator This RTMeterArcIndicator class displays the current RTProcessVar value as an arc Segmented meter arcs are one of the RTMeterArcIndicator subtypes Varying the thickness of the arc the segment width and segment spacing and the segment end caps will produce a wide variety of meter indicators One of the advantages of the meter arc indicator is that it can be hollow in
318. o display the current value It can also have panel meters RTPanelMeter derived objects that display the meter title numeric readout and alarm state The first three objects the meter coordinate system meter axis and meter axis labels are described in this chapter while the meter indicator types are described in the next Meter Coordinates Class RTMeterCoordinates QChart2D PolarCoordinates RTMeterCoordinates A meter coordinate system has more properties than a simple Cartesian coordinate system or even a polar coordinate system Because of the variation in meter styles a meter coordinate system needs to define the start and end angle of the meter arc within the 360 degree polar coordinate system It also needs to map a physical coordinate system representing the meter scale on top of the meter arc And the origin of the meter coordinate system can be offset in both x and y directions with respect to the containing plot area RTMeterCoordinates constructors Visual Basic Overloads Public Sub New _ ByVal startarcangle As Double ByVal arcextent As Double _ ByVal startarcscale As Double ByVal endarcscale As Double _ ByVal arcdirection As Boolean ByVal x As Double _ ByVal y As Double _ ByVal arcradius As Double 154 Meters Coordinates Meter Axes and Meter Axis Labels Overloads Public Sub New _ ByVal startarcangle As Double ByVal arcextent As Double _ ByVal startarcscale As Double ByVal endarc
319. ol Buttons Class RTControlButton System Windows Controls Button RTControlButton The RTControlButton class is subclassed from the WPF Button class It combines the features of a toggle button and momentary closure button A toggle button acts more like a check box when it is pressed it toggles its state to checked or unchecked A momentary button is more like a regular WPF button when the button is pressed it is only in the checked state while pressed otherwise it returns to the unchecked state When an RTControlButton is added to an RTFormControlGrid it can also act as a radio button where all radio buttons in an RTFormControlGrid are mutually exclusive The RTControlButton also adds unique color and text properties for the button in both the checked and unchecked state RTControlButton constructor Visual Basic Overloads Public Sub New _ 220 Buttons Track Bars and Other Form Control Classes ByVal buttontype As Integer _ Ct public RIControlButton int buttontype Parameters buttontype The button type of the new button User on of the button subtype constants RT CONTROL RADIOBUTTON SUBTYPE RT CONTROL MOMENTARYBUTTON SUBTYPE RT CONTROL TOGGLEBUTTON SUBTYPE Selected Public Instance Properties ButtonChecked Get Set the button check state ButtonCheckedColor Get Set the color of the button when the button is checked ButtonCheckedText Get Set the button text when the button is checked ButtonCheckedTextColor Ge
320. ollGraph2 Footer ChartObjEnable ChartObj OBJECT ENABLE tAutoScrollGraph2 YAxisLab2 ChartObjEnable ChartObj OBJECT ENABLE rtAutoScrollGraph2 lInitStrings RTAutoScrollGraph Time Ouarks rtAutoScrollGraph2 GraphBackground FillColor Colors BlanchedAlmond rtAutoScrollGraph2 SubHead TextString Subhead Text rtAutoScrollGraph2 SubHead ChartObjEnable ChartObj OBJECT ENABLE rtAutoScrollGraph2 Footer TextString Footer text r The update of scroll graphs takes place in the timer event handler private void timerl Ticklobject sender EventArgs e ChartCalendar timestamp new ChartCalendar for int i 0 i lt currentValues Length i currentValues i 0 5 ChartSupport GetRandomDouble rtAutoScrollGraphl UpdateScrollGraph timestamp currentValues true get elapsed time in milliseconds double etimemsecs timestamp GetCalendarMsecs startCalendar GetCalendarMsecs TimeSpan etimespan TimeSpan FromMilliseconds etimemsecs rtAutoScrollGraph2 UpdateScrollGraph etimespan currentValues true VB Public Sub InitializeGraph Dim starttime As DateTime DateTime Now Dim endtime As DateTime DateTime Now endtime endtime AddSeconds 10 Auto Indicator Classes 323 tAutoScrollGrap tAutoScrollGrap L Footer ChartObjEnable ChartObj OBJECT ENABLE L YAxisLab2 ChartObjEnable ChartObj OBJECT ENABLE tAutoScrollGraphl LowAlarm AlarmLimitValue 4 tAutoScrol
321. olling graph Note that the y values are now the time based scale rather than the x values as in the RTAutoScrollGraph class Method InitRTAutoScrollGraph VB Initialize the x scale a linear scale and the y scale to a Date Time scale using ChartCalendar objects Public Sub InitRTAutoScrollGraph _ minx As Double _ miny As ChartCalendar _ maxx As Double maxy As ChartCalendar _ Initialize the x scale to a linear scale and the y scale to a Date Time scale using DateTime objects Public Sub InitRTAutoScrollGraph _ minx As Double miny As DateTime _ Auto Indicator Classes 325 maxx As Double maxy As DateTime _ Initialize the x scale to a linear scale and the y scale to a linear scale Public Sub InitRTAutoScrollGraph _ minx As Double _ miny As Double _ maxx As Double _ maxy As Double Initialize the x scale to a linear scale and the y scale to an elapsed time using TimeSpan objects Public Sub InitRTAutoScrollGraph _ minx As Double _ miny As TimeSpan _ maxx As Double maxy As TimeSpan _ Initialize x scale to a linear scale and the y scale to the scale type specified by the parameter Use millisecond values for miny and maxy Public Sub InitRTAutoScrollGraph _ minx As Double _ miny As Double _ maxx As Double _ maxy As Double scaletype As Integer u CH Initialize the x scale a linear scale and the y scale to a Date Time scale using ChartCalendar
322. on centerx centery arcradius meterframe SetGraphBorderDiagonal 0 0 0 0 0 25 0 45 Background gbackground new Background meterframe ChartObj GRAPH BACKGROUND Colors White chartVu AddChartObject gbackground ChartAttribute frameattrib new ChartAttribute Colors Black 3 DashStyles Solid Colors Blue ChartAttribute needleattribl new ChartAttribute Colors Black 1 DashStyles Solid Colors Blue RTMeterNeedleIndicator meterneedlel new RTMeterNeedleIndicator meterframe bigProcessVarArray 0 meterneedlel NeedleBaseWidth 5 meterneedlel SetChartObjAttributes needleattribl meterneedlel NeedleLength 0 55 chartVu AddChartObject meterneedlel ChartAttribute needleattrib2 new ChartAttribute Colors Black 1 DashStyles Solid Colors Blue RTMeterNeedleIndicator meterneedle2 new RTMeterNeedleIndicator meterframe bigProcessVarArray 1 191 Dials and Clocks meterneedle2 NeedleBaseWidth 3 meterneedle2 SetChartObjAttributes needleattrib2 meterneedle2 NeedleLength 0 35 chartVu AddChartObject meterneedle2 VB dialComboProcessVarl New RTComboProcessVar Altimeter processVarl DefaultAttribute dialComboProcessVarl AddProcessVar bigProcessVarArray 0 dialComboProcessVarl AddProcessVar bigProcessVarArray 1 dialComboProcessVarl SetDivisorItem 0 1 dialComboProcessVarl SetDivisorItem 1 10 dialComboProcessVarl SetModuloItem 0 100 dialComboProcess
323. ons for self contained single channel bar indicators RTAutoBarIndicator An RTAutoBarIndicator is a self contained control derived from the ChartView user control It is used to display the current value of a single channel of real time data and includes as options a numeric readout alarm status readout title units alarm indicators and a bar end bulb The indicator can be horizontal or vertical with four different format options for each 42 Class Architecture The RTAutoMultiBarIndicator displays multiple channels of real time data in a single chart RTAutoMultiBarIndicator An RTAutoMultiBarIndicator is a self contained control derived from the ChartView user control It is used to display the current values of multiple channels of real time data and includes as options numeric readouts alarm status readouts channel names title units alarm indicators and bar end bulbs The indicator can be horizontal or vertical with two format options for each Class Architecture 43 The RTAutoMeterIndicator has many different format options for self contained single channel meter indicators RTAutoMeterIndicator An RTAutoMeterIndicator is a self contained control derived from the ChartView user control It is used to display the current value of a single channel of real time data and includes as options a numeric readout alarm status readout title units and alarm arcs There are twelve different
324. ontours of a 3D surface using either lines or regions of solid color The last plot object category is the pie chart were a pie wedge represents each data value The size of the pie wedge is proportional to the fraction data value sum of all data values ChartPlot This class is the abstract base class for chart plot objects It contains a reference to a ChartDataset derived class containing the data associated with the plot Contour Plot of the Heat Distribution of a Plasma Torch Degrees C 1000 0 1200 0 1400 0 1600 0 1800 0 1900 0 2000 0 2100 0 2200 0 2400 0 2600 0 2800 0 3000 0 The contour plot routines work with either an even grid or a random shown grid ContourPlot This class is a concrete implementation of the ChartPlot class and displays a contour plot using either lines or regions filled with color Group Plot Classes 70 QCChart2D Class Summary GroupPlot ArrowPlot BoxWhiskerPlot BubblePlot CandlestickPlot CellPlot ErrorBarPlot FloatingBarPlot FloatingStackedBarPlot GroupBarPlot GroupVersaPlot HistogramPlot LineGapPlot MultiLinePlot OHLCPlot StackedBarPlot StackedLinePlot GroupVersaPlot Group plots use data organized as arrays of x and y values where there is one or more y for every x Group plot types include multi line plots stacked line plots stacked bar plots group bar plots error bar plots floating bar plots floating stacked bar plots open high low close
325. ontrolButton rtbutton ChartFont buttonfont font12Bold CartesianCoordinates pTransforml new CartesianCoordinates 0 0 0 0 1 0 1 0 pTransforml SetGraphBorderDiagonal 0 25 68 0 95 0 97 ChartAttribute attribl new ChartAttribute Colors White 3 DashStyles Solid Colors SandyBrown for int 1 0 i selectorStrings Length i rtbutton new RTControlButton ChartObj RT CONTROL RADIOBUTTON SUBTYPE tbutton ButtonUncheckedText selectorStrings i if i currentRangeSelectorIndex rtbutton ButtonChecked true else rtbutton ButtonChecked false rtbutton Click new System Windows RoutedEventHandler this selector button Click rtbutton ButtonFont buttonfont rangeSelectorButtons Add rtbutton H int numColumns 4 236 Buttons Track Bars and Other Form Control Classes int numRows 7 RTFormControlGrid controlgrid new RTFormControlGrid pTransforml numRows colStrings controlgrid CellRowMargin 0 05 controlgrid CellColumnMargin 0 1 controlgrid FormControlTemplate Frame3DEnable controlgrid HeadersTemplate LineColor controlgrid HeadersTemplate TextFont chartVu AddChartObject controlgrid mall rowStrings rangeSelectorButtons attribl Ems Colors Black font14Bold VB Private rangeSelectorButtons As New ArrayList Volts numColumns Public Sub InitializeRangeSelectorButtons Dim selecterStrings As String Ll0 LOO LK
326. oomY Enable methods Set the rounding mode associated with rescale operations using the SetZoomXRoundMode and SetZoomYRoundMode methods Call the ChartZoom PopZoomStack method at any time and the chart scale reverts to the minimum and maximum values of the previous zoom operation Repeated calls to the PopZoomStack method return the chart scale is to its original condition after which the PopZoomStack method has no effect Super zoom example Adapted from the RTStockDisplay example In this example a new class derives from the ChartZoom class and the MousePressed event overridden The event invokes the Pop Zoom Stack method Otherwise the default operation of the ChartZoom class controls everything else 252 Zooming 28 0 1960 27 5 1950 27 0 1940 26 S 1930 11 52 15 11 52 30 11 52 45 11 53 00 C ChartZoom zoomObj TimeCoordinates timecoordsarray pTransforml pTransform2 zoomObj new ChartZoom chartVu timecoordsarray true zoomObj SetButtonMask MouseButton Left zoomObj SetZoomYEnable true zoomObj SetZoomXEnable true zoomObj SetZoomXRoundMode ChartObj AUTOAXES FAR zoomObj SetZoomYRoundMode ChartObj AUTOAXES FAR zoomObj SetEnable false zoomObj SetZoomStackEnable true zoomObj InternalZoomStackProcesssing true chartVu SetCurrentMouseListener zoomObj private void zoomOn Button Click object sender System EventArgs e Change to display of all collected data scrollFramel
327. oordinates ByVal datasource As RTProcessVar _ ByVal attrib As ChartAttribute Overloads Public Sub New _ ByVal transform As PhysicalCoordinates ByVal attrib As ChartAttribute C public RTElapsedTimePanelMeter PhysicalCoordinates transform RTProcessVar datasource ChartAttribute attrib public RTElapsedTimePanelMeter PhysicalCoordinates transform ChartAttribute attrib Parameters transform The coordinate system for the new RTTimePanelMeter object datasource The process variable associated with the panel meter attrib The color attributes of the panel meter indicator Selected Public Instance Properties ElapsedTimeTemplate Set Get the ElapsedTimeLabel template for the panel meter time date value The text properties associated with the panel meter are set using this property In addition the time or calendar format of the time date value is also set here A complete listing of RTElapsedTimePanelMeter properties is found in the QCRTGraphWPFCompiledHelpFile chm documentation file located in the doc subdirectory Panel Meter Classes 127 Example for RTElpasedTimePanelMeter The panel meter below extracted from the Treadmill example method InitializeStopWatchTimePanelMeter adds an RTElapsedTimePanelMeter as an independent panel meter at the bottom of the display In this example the plot area of the coordinate system is set for the position of the RTElapsedTimePanelMeter using pTran
328. or As New RTMeterSymbolIndicator meterframe processVar2 metersymbolindica metersymbolindica metersymbolindica metersymbolindica metersymbolindica metersymbolindica metersymbolindica Add panel me tor SetChartObjAttributes attribl tor IndicatorSubtype ChartObj RT METER SYMBOL ARC SUBTYPE tor SymbolSpacing 10 tor SymbolNum ChartObj CIRCLE tor IndicatorBackgroundEnable True tor SymbolSize 12 tor SymbolPosPercent 0 9 Lers chartVu AddChartObject metersymbolindicator 10 Dials and Clocks RTComboProcessVar RTMeterNeedleIndicator Clocks and dials use the same meter components as described in the previous chapter RTMeterCoordinates RTMeterAxis RTMeterAxisLabels RTMeterStringAxisLabels RTMeterIndicator RTMeterArcIndicator RTMeterNeedleIndicator and RTMeterSymbolIndicator For the purposes of this discussion a dial and a clock is a meter that has an arc extent of 360 degrees i e a full circle Also the current value of the dial or clock is characterized by a single value In the case of a clock it is a date time value and in the case of a dial it is a simple numeric value While they are characterized by a single value dials and clocks have multiple meter indicators representing that value using varying degrees of precision Everyone is familiar with the hour minute and second hands of clocks so we don t need to describe that further As for a dial the aircraft altimeter gauge is a perfect exam
329. or Windows Presentation Foundation WPF UI Automation clients System Globalization The System Globalization namespace contains classes that define culture related information including the language the country region the calendars in use the format patterns for dates currency and numbers and the sort order for strings System IO The IO namespace contains types that allow synchronous and asynchronous reading and writing on data streams and files System Collections The System Collections namespace contains interfaces and classes that define various collections of objects such as lists queues bit arrays hashtables and dictionaries System Windows Controls Provides classes to create elements known as controls that enable a user to interact with an application The control classes are at the core of the user s experience with any application because they allow a user to view select or enter data or other information System Windows Controls Primitives Contains base classes and controls that are intended to be used as part of other more complex controls System Windows Media Provides types that enable integration of rich media including drawings text and audio video content in Windows Presentation Foundation WPF applications System Windows Media Imaging Provides types that are used to encode and decode bitmap images System Windows Input 6 Introduction Provides types to support the Windows Presentation F
330. ordinate system and the related axes based on limits defined by clicking and dragging a mouse inside the current graph window A typical use of zooming is in applications where the initial chart displays a large number of data points The user interacts with the chart defining smaller and smaller zoom rectangles zeroing in on the region of interest The final chart displays axis limits that have a very small range compared to the range of the original un zoomed chart The ChartZoom class found in the QCChart2D software is used for zooming of RTProcessVar historical data The features of this class include e Automatic recalculation of axis properties for tick mark spacing and axis labels Zooming of time coordinates with smooth transitions between major scale changes years gt months gt weeks gt days gt hours gt minutes gt seconds Zooming of time coordinates that use a 5 day week and a non 24 hour day e Simultaneous zooming of an unlimited number of x and y coordinate systems and axes super zooming The user can recover previous zoom levels using a zoom stack e User definable zoom limits prevent numeric under and overflows The Real Time Graphics Tools for WPF software was designed to allow zooming of real time data while the data is being collected Real time data values are updated using the RTProcessVar class asynchronous to the update of the screen The current graphics display can be historical data from the sa
331. ort Please do not post questions on the forum unless you are familiar with this manual and have run the examples programs provided We try to answer most questions by referring to the manual or to existing example programs We will always attempt to answer any question that you may post but be prepared that we may ask you to create and send to us a simple example program The program should reproduce the problem with no or minimal interaction from the user You should strip out of any code not directly associated with reproducing the problem You can use either your own example or a modified version of one of our own examples Real Time Graphics Tools for WPF Background A large subcategory of the charting software market is concerned with the continuous or on demand update of real time data in a scrolling chart gauge bar graph meter annunciator or text format Software that creates graphs of this type should make the creation and update of real time graphs as simple and as fast as possible The original QCChart2D charting product was designed to allow for the fast creation and update of custom charts using a large number of auto scale auto axes and auto labeling routines A good application for the QCChart2D software is the on demand creation and display of historical stock market data where the data source time frame and scale are defined by user inputs This is the type of charting application that you will find on Yahoo MSN and ever
332. ou change the declared namespace at the top of the file namespace WpfRTBrowserApplicationl to the one your project uses probably namespace WpfBrowserApplicationl Add New Item WpfRTBrowserApplication 1 Categories Visual C Code Windows Forms WPF Reporting Workflow Templates Visual Studio installed templates E About Box a Application Configuration File c Assembly Information File ct Class e Code File Cursor File 5 Custom Control WPF FH Debugger Visualizer T Flow Document WPF Icon File cg Interface SA LINO to SQL Classes fie Local Database Cache d ADO NET Entity Data Model amp Application Manifest File 94 Bitmap File Si Class Diagram dj Component Class Custom Control ju DataSet Di Dynamic Data Field 9 HTML Page d Installer Class S Script File gj Local Database Ej MDI Parent Form An empty dass definition Name ScrollGraph i cs Using OCRTGraph for WPF to Create Web Applications 357 The resulting ScrollGraph1 cs file will contain using System using System Collections Generic using System Linq using System Text namespace WpfBowserApplicationl public class ScorollGraphl Modify the ScrollGraphl file to create the desired chart Most all of our examples are structured the same way The constructor is changed to pass in a ChartView object Then a chart initialization routine is called w
333. oundation WPF input system This includes device abstraction classes for mouse keyboard and stylus devices a common input manager class support for commanding and custom commands and various utility classes System Windows Shapes Provides access to a library of shapes that can be used in Extensible Application Markup Language XAML or code Directory Structure of QCRTGraph for WPF The Real Time Graphics Tools for WPF class library uses the following directory structure Drive Quinn Curtis Root directory DotNet Quinn Curtis Net based products directory Docs Quinn Curtis Net related documentation directory Lib Quinn Curtis Net related compiled libraries and components directory QCRTGraph Language specific code directory Visual CSharp C specific directory QCRTGraphWPF3 contains the source code to the QCRTGraphWPF3 dll library installed only if the source code has been purchased Examples C examples directory AutoGraphDemo Demonstrates the RTAutoBarIndicator RTAutoMultiBarIndicator RTAutoNeedleMeterIndicator RTAutoDialIndicator RTAutoClockIndicator RTAutoPanelMeterIndicator and RTAutoScrollGraph classes AutoInstrumentPanel A simulation of an automobile control panel instrument cluster BarApplication1 A simple dynamic bar graph example program Introduction 7 Dynamometer A simulation of a engine dynamometer test stand application ElapsedTimeScrollApplication1 A coupl
334. ox1 IsChecked Click checkBox1 Click gt Tag string lt CheckBox gt lt CheckBox Name checkBox2 IsChecked Click checkBox2 Click gt Numeric readout lt CheckBox gt lt CheckBox Name checkBox3 IsChecked Click checkBox3 Click gt Alarm readout lt CheckBox gt lt CheckBox Name checkBox4 IsChecked 1 Click checkBox4 Click gt Units string lt CheckBox gt lt StackPanel gt lt Grid gt lt UserControl gt C rtAutoMeterIndicatorl rtAutoMeterIndicatorl rtAutoMeterIndicatorl rtAutoMeterIndicatorl rtAutoMeterIndicatorl rtAutoMeterIndicatorl VB rtAutoMeterIndicatorl rtAutoMeterIndicatorl rtAutoMeterIndicatorl GraphFormat InitStrings Format 0 LowAlarm AlarmLimitValue 50 0 HighAlarm AlarmLimitValue 233 MinIndicatorValue 0 MaxIndicatorValue 300 GraphFormat 0 InitStrings Format 0 Fahr LowAlarm AlarmLimitValue 50 Palo x ame Name ame Name ame Name Name Name Name Name Name ame rtAutoMete rtAutoMete rtAutoMete rtAutoMete rtAutoMete rtAutoMete rtAutoMete rtAutoMete rtAutoMete rtAutoMete rtAutoMete rtAutoMete Grid Column 4 True Margin 5 True Margin 5 True Margin 5 True Margin 5 FIndscstorl rindicator2 rIndicator3 rIndicator4 Flndicatorb5 rIndicator6 FIndscstory7 rIndicator8 rlndicator9 rIndicator10 pindicatozil
335. p error term smoothing error term reset and rate limiting of control outputs This class is used by the RTAlarmIndicator class to draw the alarm indicator symbols 48 Class Architecture RTTextFrame This adds a 3D border to the standard QCChart2D ChartText text object and recalculates justification parameters to take into account the thickness of the border It is used by the RTPanelMeter classes to display text Source Code Differences between the Net Forms version of QCChart2D QCRTGraph and the WPF version There are some minor difference in the names of classes between this and the original Net Forms based version of QCChart2D These differences are summarized below All of these changes are the result of changes in base types used by WPF or conflicts between the original QCChart2D software and base classes in WPF If you intend to translate applications from the original QCChart2D for Net software to the WPF version take special note of these differences It can be confusing because in WPF many classes have the same name as their Net Forms equivalents Color Timer Color FromArgb and MouseEventArgs are a few It is just that they are in different namespaces Usually the default collection of using statements at the top of WPF classes point you to the correct namespaces Other WPF classes have slightly different names than their Net equivalents Colors DashStyles FontStyles FontWeights Color FromRgb MouseButtons and Mous
336. panelmeter3 PanelMeterPosition ChartObj INSIDE BAR panelmeter3 TextColor Colors Black annunciator AddPanelMeter panelmeter3 chartVu AddChartObject annunciator End Sub InitializeAnnunciatorl Multi Channel Annunciators Class RTMultiValueAnnunciator com quinncurtis chart2dwpf ChartPlot RTPlot RTMultiValueIndicator RTMultiValueAnnunciator An RTMultiValueAnnunciator is used to display the current values and alarm states of a collection of RTProcessVar objects It consists of a rectangular grid with individual channels represented by the rows and columns in of the grid Each grid cell can contain the tag name units current value and alarm status message for a single RTProcessVar object Any of these items may be excluded If a channel is in alarm the background of the corresponding cell changes its color giving a strong visual indication that an alarm has occurred RTMultiValueAnnunciator constructors Visual Basic Overloads Public Sub New _ ByVal transform As PhysicalCoordinates ByVal datasource As RTProcessVar ByVal numcols As Integer _ ByVal numrows As Integer _ ByVal attribs As ChartAttribute Ct public RTMultiValueAnnunciator PhysicalCoordinates transform RTProcessVar datasource int numecols int numrows ChartAttribute attribs E Parameters transform The coordinate system for the new RTMultiValueAnnunciator object datasource An array of RTProcessVar objects one for each annun
337. phs RT FIXEDEXTENT MOVINGSTART AUTOSCROLL autoscale the x axis for a fixed range with moving maximum and minimum values use in scrolling graphs RT MAXEXTENT FIXEDSTART AUTOSCROLL autoscale the x axis with the start of the x axis fixed and the end of the x axis moving use in scrolling graphs RT FIXEDNUMPOINT AUTOSCROLL autoscale the x axis for a fixed number of points with moving maximum and minimum values use in scrolling graphs autoscaleymode Specifies y axis auto scale mode of the scroll frame Use one of the y axis scroll frame constants constants RT NO AUTOSCALE Y no auto scale for the y axis RT AUTOSCALE Y MIN autoscale y axis minimum only RT AUTOSCALE Y MAX autoscale y axis maximum only RT AUTOSCALE Y MINMAX autoscale y axis minimum and maximum Selected Public Instance Properties AutoScaleRoundXMode Get Set the auto scale round mode for the x coordinate Use one of the AUTOAXES round mode constants AUTOAXES EXACT AUTOAXES NEAR AUTOAXES FAR AutoScaleRoundY Mode Get Set the auto scale mode for the y coordinate Use one of the AUTOAXES round mode constants AUTOAXES EXACT AUTOAXES NEAR AUTOAXES FAR 204 Single and Multiple Channel Annunciators MaxDisplayHistory MinSamplesForAutoScale ScrollRescaleMargin ScrollScaleModeX ScrollScaleModeY TimeStampMode Get Set the maximum number of points displayed Get Set the minimum number of samples that need to be in the dataset before an auto sc
338. phs RT FIXEDNUMPOINT AUTOSCROLL autoscale the x axis for a fixed number of points with moving maximum and minimum values use in scrolling graphs autoscalexmode Specifies x axis auto scale mode of the scroll frame Use one of the y axis scroll frame constants constants RT NO AUTOSCALE X no auto scale for the y axis RT AUTOSCALE X MIN autoscale y axis minimum only RT AUTOSCALE X MAX autoscale y axis maximum only RT AUTOSCALE X MINMAX autoscale y axis minimum and maximum Selected Public Instance Properties AutoScaleRoundXMode Get Set the auto scale round mode for the x coordinate Use one of the AUTOAXES round mode constants AUTOAXES EXACT AUTOAXES NEAR AUTOAXES FAR AutoScaleRoundY Mode Get Set the auto scale mode for the y coordinate Use one MaxDisplayHistory MinSamplesForAutoScale ScrollRescaleMargin ScrollScaleModeX ScrollScaleModeY TimeStampMode Single and Multiple Channel Annunciators 207 of the AUTOAXES round mode constants AUTOAXES EXACT AUTOAXES NEAR AUTOAXES FAR Get Set the maximum number of points displayed Get Set the minimum number of samples that need to be in the dataset before an auto scale operation is carried out This prevents the first datapoints from generating an arbitrarily small range Get Set the scroll rescale margin When the limits of the scale needs to be increased the ScrollRescaleMargin current range of the x axis is added to the upper and lower limits of the
339. plateBackground GraphBackground GraphBorder GraphFormat GraphScrollFrame GroupPlotObj Height HighAlarm Location LowAlarm MainTitle MaxIndicatorValue MinimumSize MinIndicatorValue NumericPanelMeter PlotAttrib Inherited from RTAutoIndicator Get dataset object list Get the data tooltip object for the chart Set Get the default font used in the chart This is a string specifiying the name of the font Get Set the font used for the legend Get Set the font used for the sub head Set Get the default font object used for the tooltip Inherited from ChartView Set to true to show 3D faceplate Inherited from RTAutoIndicator Get the graph background object Inherited from RTAutoIndicator Get the default graph border for the chart Inherited from RTAutoIndicator Get Set any an indicator format is supported Inherited from RTAutoIndicator Get the graphs RTScrollFrame Get the GroupVersaPlot plot object Gets or sets the height of the control Inherited from Control Get the most recent high RTAlarm object Inherited from RTAutoIndicator Gets or sets the coordinates of the upper left corner of the control relative to the upper left corner of its container Inherited from Control Get the most recent low RTAlarm object Inherited from RTAutoIndicator Get Set the tag string Inherited from RTAutoIndicator The maximum value for the indicator Inherited from RTAutoIndic
340. ple It has a small hand representing thousands of feet and a large hand representing hundreds Clocks and dials must be able to take a single value either time or some floating point value and translate that information into two or more meter indicator values In the case of a clock the current time must be converted into values for the hour minute and second hands The class responsible for this conversion is the RTComboProcessVar class It converts a single RTProcessVar value into multiple RTProcessVar objects one representing the current value of each indicator of the clock or dial Converting Dial and Clock Data using RTComboProcessVar Class RTComboProcessVar RTProcess Var RTComboProcessVar The RTComboProcessVar class has an internal collection of RTProcessVar objects The current value assigned to the RTComboProcessVar object is simultaneously converted to current values for each of the RTProcessVar objects in the collection For each RTProcessVar object the conversion is defined by a divisor and a modulo N value Each RTProcssVar object will have unique combination of divisors and modulo N values as defining characteristics For i 0 to processVarList Count 1 Dials and Clocks 186 processVarList i CurrentValue comboProcessVar CurrentValue divisor i modvalue i where comboProcess Var The main RTComboProcessVar object that is updated by the application program processVarList The collection of RTProcessVar ob
341. pleSingleValuePlot pTransforml lineplotl currentTemperaturel SolarPanelLinePlotl LineColor Colors Yellow chartVu AddChartObject solarPanelLinePlot1l Dim attrib2 As New ChartAttribute Colors Green 2 DashStyles Solid Dim lineplot2 As New SimpleLinePlot pTransforml Nothing attrib2 lineplot2 SetCoordinateSwap True Dim solarPanelLinePlot2 As New RTSimpleSingleValuePlot pTransforml lineplot2 currentTemperature2 SolarPanelLinePlot2 LineColor Colors Yellow solarPanelLinePlot2 EndOfPlotLineMarker ChartObj MARKER HLINE Example for a multi channel scrolling line plot The example below extracted from the Dynamometer example file DynamometerUserControll method InitializeEngine1ScrollGraph creates a multi channel scrolling graph Note You do not have to use an RTGroupMultiValuePlot to plot multi channel data in a scrolling graph You can just use multiple RTSimpleSingleValuePlot objects as in the example below You can also mix object types including line plots bar plots and scatter plot in the same scrolling graph 650 600 500 18 57 40 18 57 50 18 58 00 C scrollFramel new RTScrollFrame this EngineCylinderTemp1 0 pTransforml ChartObj RT_FIXEDEXTENT MOVINGSTART AUTOSCROLL scrollFramel AddProcessVar EngineCylinderTemp1 1 scrollFramel AddProcessVar EngineCylinderTemp1 2 scrollFramel AddProcessVar EngineCylinderTemp1 3 scrollFramel ScrollScaleModeY Chart
342. plots candlestick plots arrow plots histogram plots cell plots box and whisker plots and bubble plots GroupPlot This class is an abstract base class for all group plot classes Flow Analysis Stealth Project The size position and direction of every arrow in an arrow plot is under program control QCChart2D Class Summary 71 ArrowPlot This class is a concrete implementation of the GroupPlot class and it displays a collection of arrows as defined by the data in a group dataset The position size and rotation of each arrow in the collection is independently controlled BubblePlot This class is a concrete implementation of the GroupPlot class and displays bubble plots The values in the dataset specify the position and size of each bubble in a bubble chart Box and Whisker Plots are used in Descriptive Statistics New York Houston San Francisco Boston Pittsburgh BoxWhiskerPlot This class is a concrete implementation of the GroupPlot class and displays box and whisker plots The BoxWhiskerPlot class graphically depicts groups of numerical data through their five number summaries the 72 QCChart2D Class Summary CandlestickPlot CellPlot smallest observation lower quartile Q1 median Q2 upper quartile Q3 and largest observation Technical Analysis Uses Candlestick Plots The Open Close box is filled if the open price is greater than the close price This class is a concrete implementatio
343. positioned in the parent window C public void InitializeGraph this rtAutoClockIndicatorl GraphFormat 0 this rtAutoClockIndicatorl GraphBackground FillColor Colors White this rtAutoClockIndicatorl InvertColors i this rtAntoClockIndiocstorl InitStrings Boston EST his rtAutoClockIndicator2 GraphFormat 1 his hiis his tAutoClockIndicator2 GraphBackground FillColor Colors White tAutoClockIndicator2 PlotAttrib FillColor Colors Blue tAutoCclockIndicator2 InitStrings Pittsburgh EST vet crt St ct HHHH Me Me Me Me Me Me Me Auto Indicator Classes 313 VB rtAutoClockIndicatorl GraphFormat 0 rtAutoClockIndicatorl GraphBackground FillColor Colors White rtAutoClockIndicatorl InvertColors rtAutoCclocklndicatorl InitStrings Boston EST rtAutoClockIndicator2 GraphFormat 1 rtAutoClockIndicator2 GraphBackground FillColor Colors White rtAutoClockIndicator2Z PlotAttrib FillColor Colors Blue rtAutoClockIndicator2 InitStrings Pittsburgh TEST Scrolling Graph Horizontal Indicator Class RTAutoScrollGraph System Windows Controls UserControl ChartView RTAutoIndicator RTAutoBarIndicator RTAutoScrollGraph The RTAutoScrollGraph is a ChartView derived object that encapsulates all of the chart elements needed to draw a horizontal scrolling graph including an array of RTProcessVar objects a coordinate system axes axes labels RTSingleV
344. r _ ByVal initialscale As PhysicalCoordinates ByVal scrollmode As Integer _ Overloads Public Sub New _ ByVal component As ChartView _ ByVal initialscale As PhysicalCoordinates ByVal scrollxmode As Integer _ ByVal autoscaleymode As Integer _ C public RTScrollFrame ChartView component RIProcessVar processvar PhysicalCoordinates initialscale int scrollxmode int autoscaleymode Ls public RTScrollFrame ChartView component RTProcessVar processvar PhysicalCoordinates initialscale int scrollmode public RTScrollFrame ChartView component PhysicalCoordinates initialscale int scrollxmode int autoscaleymode Parameters Single and Multiple Channel Annunciators 203 component This ChartView component the scroll frame is placed in processvar The source process variable initialscale A coordinate system that serves as the initial scale for the scroll frame scrollxmode Specifies x axis auto scale mode of the scroll frame Use one of the x axis scroll frame constants RT NO AUTOSCALE X no auto scale for the x axis use in non scrolling graphs RT AUTOSCALE X CURRENT SCALE auto scale based on current scale use in non scrolling graphs RT AUTOSCALE X MIN autoscale x axis minimum only use in non scrolling graphs RT AUTOSCALE X MAX autoscale x axis maximum only use in non scrolling graphs RT AUTOSCALE X MINMAX autoscale x axis minimum and maximum use in non scrolling gra
345. r zoomObj 250 Zooming private void zoomOn Button Click object sender System EventArgs e Change to display of all collected data fetalHeartECGScrollFrame ScrollScaleModeX ChartObj RT AUTOSCALE X MINMAX Look at updatecounter number of points which is all of them fetalHeartECGScrollFrame MaxDisplayHistory updatecounter Render graph based on new scale showing all past data points this UpdateDraw Now disable scroll frame fetalHeartECGScrollFrame ChartObjEnable ChartObj OBJECT DISABLE Turn on zooming zoomObj SetEnable true private void zoomRestore Button Click object sender System EventArgs e RTControlButton button RTControlButton sender Turn off zooming zoomObj SetEnable false Restore original y scale values fetalHeartECGScrollFrame ChartObjScale ScaleStartY 1 0 fetalHeartECGScrollFrame ChartObjScale ScaleStopY 4 0 Re establish scroll mode fetalHeartECGScrollFrame ScrollScaleModeX ChartOob j RT FIXEDEXTENT MOVINGSTART AUTOSCROLL fetalHeartECGScrollFrame ChartObjEnable ChartObj OBJECT ENABLE Render graph this UpdateDraw Visual Basic Dim zoomObj As New ChartZoom chartVu pTransforml True zoomObj SetButtonMask MouseButton Left zoomObj SetZoomYEnable True zoomObj SetZoomXEnable True zoomObj SetZoomXRoundMode ChartObj AUTOAXES FAR zoomObj SetZoomYRoundMode ChartObj AUTOAXES FAR zoomObj SetEnable True zoomObj SetZoom
346. r ChartObj VERT DIR 1 Colors OrangeRed 4 rtAutoMultiBarIndicatorl MultiBarPlot BarWidth 0 1 rtAutoMultiBarIndicatorl Inittolors barcolors rtAutoMultiBarIndicatorl InitStrings Flow 493 GMB bartags rtAutoMultiBarIndicatorl LowAlarm AlarmLimitValue 23 rtAutoMultiBarIndicatorl HighAlarm AlarmLimitValue 78 rtAutoMultiBarIndicatorl SetpointAlarm AlarmLimitValue 53 rtAutoMultiBarIndicatorl GraphBackground ChartObjAttributes new ChartAttribute Colors LightBlue 5 DashStyles Solid Colors LightBlue rtAutoMultiBarIndicatorl FaceplateBackground true rtAutoMultiBarIndicatorl BarEndBulb barbulb rtAutoMultiBarIndicatorl InteriorAxis interioraxis rtAutoMultiBarIndicatorl NumericPanelMeter ChartObjEnable numeric ChartObj OBJECT ENABLE ChartObj OBJECT DISABLE rtAutoMultiBarIndicatorl AlarmPanelMeter ChartObjEnable alarm ChartObj OBJECT ENABLE ChartObj OBJECT DISABLE rtAutoMultiBarIndicatorl UnitsPanelMeter ChartObjEnable units ChartObj OBJECT ENABLE ChartObj OBJECT DISABLE rtAutoMultiBarIndicatorl YAxisTitle ChartObjEnable units ChartObj OBJECT ENABLE ChartObj OBJECT DISABLE rtAutoMultiBarIndicatorl TagPanelMeter ChartObjEnable tags ChartObj OBJECT ENABLE ChartObj OBJECT DISABLE rtAutoMultiBarIndicatorl MainTitle ChartObjEnable title ChartObj OBJECT ENABLE i ChartObj OBJECT DISABLE VB rtAutoMultiBarIndicatorl InitMultiBarIndicator ChartObj VERT DIR 1 Colors OrangeRed 4 rtAutoMultiBarIn
347. r Languages 2 Dynamic Data Web Application Visual Basic D Visual C My Templates H Other Project Types SE yal DocProject A DocSite Web Application Gg search Online Templates Windows Presentation Foundation dient application NET Framework 3 5 Name WpfApplication1 Location E Quinn Curtis WPF Development DotNet QCRTGraph Visual Basic examples wpf v Solution Create new Solution _w create directory for solution Solution Name wpfApplication1 The window does not yet have any content First define a default size for the window and add references to the QCChart2D and QCRTGraph namespaces In this case the namespaces are com quinncurtis chart2dwpf and com quinncurtis rtgraphwpf and are located in the assemblies DLL with the names QCChart2DWPF3 and QCRTGraphWPF3 So replace the Title line the following lines under the other xmlns namespace tags Title Windowl Height 631 Width 878 n xmlns my clr namespace com quinncurtis chart2dwpf assembly QCChart2DWPF3 xmlIns my2 clr namespace com quinncurtis rtgraphwpf assembly QCRTGraphWPF3 These lines need to be resolved by adding a references to the QCChart2DWPF3 and QCRTGraphWPF3 libraries to the project Right click on Reference in the Solution Explorer window and select Add Reference Browse to the Quinn Curtis DotNet lib subdirectory and select QCChart2DWPF3 DLL and QCRTGraphWPF3 DLL files 344 Using Real Time Grap
348. r WPF package designed to run on any hardware that has a Net runtime installed on it Chapter 2 presents the overall class architecture of the Real Time Graphics Tools for WPF and summarizes all of the classes found in the software Chapter 3 summarizes the important QCChart2D classes that you must be familiar with in order to use the Real Time Graphics Tools for WPF software Chapter 4 describes the process variable and alarm classes that hold Real Time Graphics Tools for WPF data Chapter 5 describes the panel meter classes numeric alarm string and time date panel meters Chapter 6 describes the single channel bar indicator classes including segmented custom and pointer bar subtypes Chapter 7 describes the multi channel bar indicator classes including segmented custom and pointer bar subtypes Chapters 8 describe the meter setup classes meter coordinates meter axes and meter axis labels Chapter 9 describes the meter indicator classes including classes for meter needles arc segmented arc and symbol indicators 10 Introduction Chapter 10 how the meter indicator classes are used to create dials and clocks Chapter 11 describes the annunciator classes Chapter 12 describes the scroll frame classes RTScrollFrame and RTVerticalScrollFrame and the implementation of scrolling plots based on the QCChart2D SimpleLinePlot SimpleBarPlot SimpleScatterPlot and SimpleLineMarkerPlot classes using the RTSimpleSingleValueP
349. r be positioned next to another object Places the panel meter to the left of the reference object Specify the position reference object using the 112 Panel Meter Classes BELOW CENTERED PLOTAREA ABOVE CENTERED PLOTAREA LEFT CENTERED PLOTAREA RIGHT CENTERED PLOTAREA GRAPHAREA TOP GRAPHAREA BOTTOM RADIUS BOTTOM RADIUS_TOP RADIUS LEFT RADIUS RIGHT RADIUS CENTER PanelMeter SetPositionReference method Text justification is set to JUSTIFY MAX JUSTIFY CENTER Positions the panel meter centered below the plot area Text justification is set to JUSTIFY CENTER JUSTIFY MAX Positions the panel meter centered above the plot area Text justification 1s set to JUSTIFY CENTER JUSTIFY MIN Positions the panel meter centered to the left of the plot area Text justification is set to JUSTIFY MAX JUSTIFY CENTER Positions the panel meter centered to the right of the plot area Text justification 1s set to JUSTIFY MIN JUSTIFY CENTER Positions the panel meter centered at the top edge of the graph area Text justification is set to JUSTIFY CENTER JUSTIFY MAX Positions the panel meter centered at the bottom edge of the graph area Text justification is set to JUSTIFY CENTER JUSTIFY MIN Used when the panel meter is attached to a meter indicator Places the panel meter at the bottom at the radius of the MeterCoordinates system You can set the text justification however you want Used when
350. r scale using doubles linear y scale Public Sub InitRTAutoScrollGraph _ minx As Double miny As Double _ maxx As Double maxy As Double Initialize x scale to an elapsed time scale using TimeSpan objects linear y scale Public Sub InitRTAutoScrollGraph _ minx As TimeSpan miny As Double _ maxx As TimeSpan _ maxy As Double Initialize x scale to the scale type specified by the parameter scaltype linear y scale Use millisecond values for minx and maxx Public Sub InitRTAutoScrolleraph minx As Double _ miny As Double _ maxx As Double _ maxy As Double scaletype As Integer C Initialize x scale to a Date Time scale using ChartCalendar objects linear y scale public void InitRTAutoScrollGraph ChartCalendar minx double miny ChartCalendar maxx double maxy Initialize x scale to a Date Time scale using DateTime objects linear y scale Auto Indicator Classes 315 public void InitRTAutoScrollGraph DateTime minx double miny DateTime maxx double maxy Initialize x scale to a linear scale using doubles linear y scale public void InitRTAutoScrollGraph double minx double miny double maxx double maxy Initialize x scale to an elapsed time scale using TimeSpan objects linear y scale public void InitRTAutoScrollGraph Initialize x scale to the scale type specified by the parameter scaltype linear y scale Use millisecond values for minx and max
351. rBackgroundEnable IndicatorSubtype LineColor inherited from GraphObj LineStyle inherited from GraphObj LineWidth inherited from GraphObj MeterAxis NumChannels inherited from RTPlot OverRangeNormalizedValue PanelMeterList inherited from RTPlot PrimaryChannel inherited from RTPlot RTDataSource inherited from RTSingleValueIndicator UnderRangeNormalizedValue ZOrder inherited from GraphObj Meter Indicators Needle Arc and Symbol 170 Sets the fill color for the chart object Get Set the background attribute of the meter indicator Set to true to enable the display of the meter indicator background Set Get the meter indicator subtype Use one of the meter indicator subtype constants RT METER NEEDLE SIMPLE SUBTYPE RT METER NEEDLE PIEWEDGE SUBTYPE RT METER NEEDLE ARROW SUBTYPE RT METER ARC BAND SUBTYPE RT METER SEGMENTED ARC SUBTYPE RT METER SINGLE SEGMENT ARC SUBTYPE RT METER SYMBOL ARC SUBTYPE RT METER SINGLE SYMBOL SUBTYPE Sets the line color for the chart object Sets the line style for the chart object Sets the line width for the chart object Get Set the reference meter axis Get the number of channels in the indicator Get Set the displayable high end of the indicator range as a normalized value based on the RTMeterCoordinates and RTMeterAxis scale For example if the RTMeterAxis scale is 0 to 10 an overRangeNormalizedValue of 0 1 will allow the indicator t
352. rControl 13 14 18 19 41 56 57 94 300 310 322 332 341 347 352 360 365 375 UserCoordinatesS cei 59 94 Visual Basic 8 10 98 99 100 103 107 118 123 126 130 133 135 139 152 166 171 176 181 187 194 198 204 213 217 225 228 232 240 245 253 259 263 272 280 283 284 287 288 290 294 297 306 311 322 333 341 348 353 366 388 Visual 3 arsenali anelli WorkingCoordinates WorldCoordinates Zooming 89 90 94 279 280 281 282 284 285 288 380 Appendix
353. rEndBulb BarFillColor BarLineWidth BarOrientation BarPlot BarWidth BarWidthPixels CoordinateSystem FaceplateBackground GraphBackground GraphBorder GraphFormat Height HighAlarm InteriorAxis LowAlarm MainTitle MaxIndicatorValue MinimumSize MinIndicatorValue Description Get a reference to the RTAlarmIndicator object Get a reference to the RTAlarmPanelMeter object Inherited from RTAutoIndicator Sets the line color for the chart object Get the numeric label template object used to place numeric values on the bars Set Get to true for a bar end bulb Sets the fill color for the chart object Sets the line width for the chart object Get Set the orientation of the chart Get a reference to the RTBarIndicator object Set Get the bar width Set Get to the pixel width of the bar in the bar plot Get the coordinate system object for the indicator Inherited from RTAutoIndicator Set to true to show 3D faceplate Inherited from RTAutoIndicator Get the graph background object Inherited from RTAutoIndicator Get the default graph border for the chart Inherited from RTAutoIndicator Get Set any an indicator format is supported Inherited from RTAutoIndicator Gets or sets the height of the control Inherited from Control Get the most recent high RTAlarm object Inherited from RTAutoIndicator Set Get to true and an interior axis is drawn Get the most recent low RTAlarm object
354. radius of the meter arc in plot area normalized coordinates Meters Coordinates Meter Axes and Meter Axis Labels 155 Selected Public Instance Properties ArcCenterX Get Set Specifies x position of the center of the meter arc in plot area normalized coordinates ArcCenterY Get Set Specifies y position of the center of the meter arc in plot area normalized coordinates ArcDirectionPositive Get Set the direction of the arcExtent The default arcDirectionPositive value of false meter arc starts at startArcAngle and extends in a negative clockwise direction with an extent arcExtent Change to true to have the meter arc extend in a positive counter clockwise direction ArcExtent Specifies the extent of the meter arc in degrees The default meter arc starts at startArcAngle and extends in a negative clockwise direction with an extent arcExtent ArcRadius Get Set radius of the meter arc in plot area normalized coordinates Get Set the scaling value associated with the ending position of the meter arc Get Set Specifies the starting arc angle position of the meter arc in degrees Get Set the scaling value associated with the startArcAngle position of the meter arc A complete listing of RTMeterCoordinates properties is found in the QCRTGraphWPFCompiledHelpFile chm documentation file located in the doc subdirectory Examples for meter coordinate system The example below extracted from the WeatherStation example method In
355. ramework combines customizable rendering of user interface components with a two tier programming model analogous to the the way you program ASP Net web pages using a combination of HTML in the design mode and C or VB in the behind code section of the page In WPF applications the user interface layout is defined as an XAML page using a text tag format based on XML and user interface events are processed in a C or VB behind code page 4 Introduction In a WPF program which uses QCRTGraph the QCChart2D class ChartView is referenced as a visual element in a windows the XAML file as below Window x Class BarApplicationl Window1 xmlns http schemas microsoft com winfx 2006 xaml presentation xmlns x http schemas microsoft com winfx 2006 xaml Title Window1 Height 800 Width 1000 xmlns my clr namespace com quinncurtis chart2dwpf assembly QCChart2DWPF3 xmlns my2 clr namespace com quinncurtis rtgraphwpf assembly QCRTGraphWPF3 Grid my ChartView Margin 5 5 5 5 Name barApp1 gt lt Grid gt lt Window gt In this example the ChartView is placed as the only visual element of the standard WPF layout panel Grid Since the ChartView object is given a Name it can be accessed in the behind code of the window using the variable name barAppl In general all of the chart definition and initialization takes place in the the behind code using either C or VB The chart definition initializa
356. rate Shutdown Emergency buttons MessageBoxIcon Question _ MessageBoxDefaultButton Buttonl MessageBoxOptions RightAlign If result DialogResult Yes Then Application Exit End If End Sub heartRate_HighAlarm 5 Panel Meter Classes RTNumericPanelMeter RTAlarmPanelMeter RTStringPanelMeter RTTimePanelMeter RTElapsedTimePanelMeter RTFormControlPanelMeter The RTPanelMeter derived classes are special cases of the single value indicator classes that are used throughout the software to display real time data in a text format Panel meters are available for numeric values string values time date values and alarm values All of the panel meter classes have a great many options for controlling the text font color size border and background of the panel meter rectangle RTPanelMeter objects are used in two ways First they can be standalone and once attached to an RTProcessVar object they can be added to a ChartView as any other QCChart2D GraphObj derived class Second they can be attached to most of the single channel and multiple channel indicators such as RTBarIndicator RTMultiBarIndicator RTMeterIndicator and RTAnnunciator objects where they provide text output in addition to the indicators graphical output Digital SF ChartFont In our example programs the panel meters often use a simple 7 segment display font It gives the displays an anachronistic look typical of older dedicated instruments This font is not part of the
357. reates a multi channel scrolling graph Note You do not have to use an RTGroupMultiValuePlot to plot multi channel data in a scrolling graph You can just use multiple RTSimpleSingleValuePlot objects as in the InitializeEnginelScrollGraph method 18 57 40 18 57 50 18 58 00 C scrollFrame2 new RTScrollFrame this EngineCylinderTemp2 0 pTransforml ChartObj RT_FIXEDEXTENT MOVINGSTART AUTOSCROLL ScrollFrame2 AddProcessVar EngineCylinderTemp2 1 ScrollFrame2 AddProcessVar EngineCylinderTemp2 2 scrollFrame2 AddProcessVar EngineCylinderTemp2 3 ScrollFrame2 ScrollScaleModeY ChartObj RT AUTOSCALE Y MINMAX scrollFrame2 ScrollRescaleMargin 0 05 MultiLinePlot multilineplot new MultiLinePlot pTransforml null attribarray multilineplot SetFastClipMode ChartObj FASTCLIP X rtMultiLinePlot new RTGroupMultiValuePlot pTransforml multilineplot EngineCylinderTemp2 chartVu AddChartObject rtMultiLinePlot chartVu AddChartObject scrollFrame2 VB scrollFrame2 New RTScrollFrame Me EngineCylinderTemp2 0 _ pTransforml ChartObj RT FIXEDEXTENT MOVINGSTART AUTOSCROLL scrollFrame2 AddProcessVar EngineCylinderTemp2 1 scrollFrame2 AddProcessVar EngineCylinderTemp2 2 scrollFrame2 AddProcessVar EngineCylinderTemp2 3 ScrollFrame2 ScrollScaleModeY ChartObj RT AUTOSCALE Y MINMAX ScrollFrame2 ScrollRescaleMargin 0 05 chartVu AddChartObject scrollFrame2 Dim multilineplot As New
358. rectangular shapes that can be used as backdrops for groupings of chart objects and PID control Miscellaneous Classes com quinncurtis chart2dwpf GraphObj RT3DFrame com quinncurtis chart2dwpf GraphObj RTGenShape com quinncurtis chart2dwpf ChartObj RTPIDControl 46 Class Architecture com quinncurtis chart2dwpf GraphObj RTSymbol com quinncurtis chart2dwpf ChartText RTTextFrame The raised light blue panels are created using RT3DFrame objects RT3DFrame This class is used to draw 3D borders and provide the background for many of the other graph objects most noticeably the RTPanelMeter classes It can also be used directly in your program to provide 3D frames the visually group objects together in a faceplate format Class Architecture 47 The border rectangles in the top graph and the border circle in the bottom graph were created using RTGenShape objects RTGenShape This class is used to draw filled and unfilled rectangles rectangles with rounded corners general ellipses and aspect ratio corrected circles These shapes can be used by the programmer to add visual enhancements to graphs A complete PID Control tuning center can be created using the PID control tools bar indicators scroll frames buttons and track bars RTPIDControl RTSymbol This class represents a simple control loop with support for proportional integral and derivative control It includes advanced features for anti reset windu
359. rence panelmeter annunciator AddPanelMeter panelmeter2 Dim panelmetertagattrib As New ChartAttribute Colors S DashStyles Solid Colors White Dim panelmeter3 As New RTStringPanelMeter pTransforml panelmetertagattrib ChartObj RT TAG STRING panelmeter3 SetPositionReference panelmeter panelmeter3 StringTemplate TextFont FontArchive font panelmeter3 PanelMeterPosition ChartObj ABOVE REFERE panelmeter3 TextColor Colors Black annunciator AddPanelMeter panelmeter3 chartVu AddChartObject annunciator End Sub InitializeAnnunciator2 IBlIue 3 processVar2 14Numeric pn processVarl NCED TEXT 0 teelBlue 3 processVarl 10 NCED TEXT 200 Single and Multiple Channel Annunciators Example for a large multi channel annunciator The example below extracted from the RTGraphNetDemo file AnnunciatorUserControll method InitializeAnnunciator4 example creates a multi channel annunciator that shows the tag name and current value of the associated RTProcessVar object The alarm state is implicit in the annunciator background color See the example program for the code listing 12 The Scroll Frame and Single Channel Scrolling Plots RTScrollFrame RTVerticalScrollFrame RTSimpleSingleValuePlot Scrolling graphs are built using three main classes The first is the RTScrollFrame class that manages the constant rescaling of the coordinate system of the scrolling graph The second
360. rentTemperaturel AddAlarm templowalarml currentTemperaturel AddAlarm temphighalarml Important enables historical data collection for scroll graphs currentTemperaturel DatasetEnableUpdate True AddHandler currentTemperaturel AlarmTransitionEventHandler New RTAlarmEventDelegate AddressOf TemperatureAlarmEventProc templowalarm2 New RTAlarm ChartObj RT ALARM LOWERTHAN 80 templowalarm2 AlarmMessage Low Alarm templowalarm2 AlarmSymbolColor Colors Blue templowalarm2 AlarmTextColor Colors Blue temphighalarm2 New RTAlarm ChartObj RT ALARM GREATERTHAN 120 temphighalarm2 AlarmMessage High Alarm temphighalarm2 AlarmSymbolColor Colors Red temphighalarm2 AlarmTextColor Colors Red Hr currentTemperature2 New RTProcessVar Temp 2 New ChartAttribute Colors Green 1 0 DashStyles Solid Colors Green Hr currentTemperature2 MinimumValue 20 E currentTemperature2 MaximumValue 200 Hr currentTemperature2 DefaultMinimumDisplayValue 0 Hr currentTemperature2 DefaultMaximumDisplayValue 150 Hr currentTemperature2 SetCurrentValue currentTemperatureValue2 Hr currentTemperature2 AddAlarm templowalarm2 currentTemperature2 AddAlarm temphighalarm2 Important enables historical data collection for scroll graphs currentTemperature2 DatasetEnableUpdate True AddHandler currentTemperature2 AlarmTransitionEventHandler New RTAlarmEventDelegate AddressOf TemperatureAlarmEventProc
361. rib timeAxisControlPanelTrackBar PanelMeterPosition ChartObj CUSTOM POSITION timeAxisControlPanelTrackBar SetLocation 0 0 0 timeAxisControlPanelTrackBar FormControlSize new Dimension 1 0 1 0 chartVu AddChartObject timeAxisControlPanelTrackBar VB Public Sub InitializeTimeAxisTrackbar Dim attribl As New ChartAttribute Colors White 3 DashStyles Solid Colors Coral Dim pTransform2 As New CartesianCoordinates 0 0 0 0 1 0 1 0 pTransform2 SetGraphBorderDiagonal 0 7 0 93 0 98 0 99 Dim tbattrib As New ChartAttribute Colors LightBlue 7 DashStyles Solid Colors LightBlue Dim starttime As Double origStartTime GetCalendarMsecs Dim endtime As Double origEndTime GetCalendarMsecs Dim range As Double endtime starttime timeAxisControlTrackbar New RTControlTrackBar 0 100 10 1 10 timeAxisControlTrackbar Orientation Orientation Horizontal AddHandler timeAxisControlTrackbar ValueChanged New System Windows RoutedPropertyChangedEventHandler 0f Double AddressOf Me timeAxisControlTrackbar Click timeAxisControlTrackbar RTValue 100 MUST USE RTValue to set double value Dim timeAxisControlPanelTrackBar As New RTFormControlPanelMeter pTransform2 timeAxisControlTrackbar tbattrib timeAxisControlPanelTrackBar PanelMeterPosition ChartObj CUSTOM POSITION timeAxisControlPanelTrackBar SetLocation 0 0 0 timeAxisControlPanelTrackBar FormControlSize New Dimension 1 0 1 0 chartVu AddChart
362. ribl new ChartAttribute Colors Yellow 1 DashStyles Solid SimpleLinePlot lineplotl new SimpleLinePlot pTransforml null attribl lineplotl SetCoordinateSwap true RTSimpleSingleValuePlot solarPanelLinePlotl new RTSimpleSingleValuePlot pTransforml1 lineplotl currentTemperaturel chartVu AddChartObject solarPanelLinePlotl ChartAttribute attrib2 new ChartAttribute Colors Green 1 DashStyles Solid SimpleLinePlot lineplot2 new SimpleLinePlot pTransforml null attrib2 lineplot2 SetCoordinateSwap true RTSimpleSingleValuePlot solarPanelLinePlot2 new RTSimpleSingleValuePlot pTransforml lineplot2 currentTemperature2 chartVu AddChartObject solarPanelLinePlot2 VB scrollFrame New RTVerticalScrollFrame Me currentTemperaturel pTransforml ChartObj RT FIXEDEXTENT MOVINGSTART AUTOSCROLL scrollFrame AddProcessVar currentTemperature2 212 Single and Multiple Channel Annunciators ScrollFrame ScrollScaleModeX ChartObj RT AUTOSCALE X MINMAX Allow 400 samples to accumlate before autoscaling y axis This prevents rapid changes of the y scale for the first few samples ScrollFrame MinSamplesForAutoScale 400 scrollFrame ScrollRescaleMargin 0 05 chartVu AddChartObject scrollFrame Dim attribl As New ChartAttribute Colors Yellow 2 DashStyles Solid Dim lineplotl As New SimpleLinePlot pTransforml Nothing attribl lineplotl SetCoordinateSwap True Dim solarPanelLinePlotl As New RTSim
363. rings string title string units Auto Indicator Classes 327 Parameters title The title string units The units string Add a channel a plot object to the scrolling graph using the AddRTPlotObject Method AddRTPlotObject VB Public Sub AddRTPlotObject _ plottype As Integer _ colr As Color tag As String CH public void AddRTPlotObject int plottype Color solr string tag Parameters plottype Specifies the simple plot type LINE MARKER PLOT LINE PLOT BAR PLOT SCATTER PLOT colr The primary color of the plot object tag The tag name associated with the plot object Use the UpdateIndicator method to update the scrolling graph with new data Method UpdateIndicator VB Public Sub UpdateIndicator _ values As Double _ updatedraw As Boolean Public Sub UpdateIndicator _ value As Double _ updatedraw As Boolean CH public void UpdateIndicator double values 328 Auto Indicator Classes bool updatedraw public void UpdateIndicator double value bool updatedraw Parameters values An array of new values one for each channel of the indicator value A single value if the scroll graphs only has one channel updatedraw True and the indicator is immediately updated Selected Public Instance Properties Refer to the list of properties under the RTAutoScrollGraph description A complete listing of RTAutoVerticalScrollGraph properties is found in the QCRTGr
364. rmal viewing plane Sets the z order of the object in the chart Every object has a z order value Each z order value does NOT have to be unique If z order sorting is turned on in the ChartView object objects are sorted by z order before they are drawn A complete listing of RTMeterAxisLabels properties is found in the QCRTGraphWPFCompiledHelpFile chm documentation file located in the doc subdirectory Example for meter axis labels The example below extracted from the WeatherStation example method InitializeHumidity creates a meter coordinate system that starts at the arc angle of 225 degrees and has an arc extent of 270 degrees The meter scale extends from 0 0 to 100 0 164 Meters Coordinates Meter Axes and Meter Axis Labels in the counterclockwise direction Two axes are created The first is created so that it draws just the major tick marks using a thicker line width The second uses thin tick marks for the minor tick marks of the meter axis Only the first is included below since it is the one labeled C ChartAttribute attribl new ChartAttribute Colors Black 1 DashStyles Solid Colors Blue double startarcangle 225 double arcextent 270 double startarcscale 0 0 double endarcscale 100 0 bool arcdirection false double arcradius 0 6 double centerx 0 0 centery 0 2 ChartFont meterFont font12 RTMeterCoordinates meterframel new RTMeterCoordinates startarcangle arcexte
365. rn temperatureSetpointD End Get Set ByVal Value As Double temperatureSetpointD Value End Set End Property End Class CustomRTBarIndicator Public Sub InitializeCustomBarIndicator barplot New CustomRTBarIndicator pTransforml currentTemperaturel _ barwidth barbase attribl barjust barorient barplot IndicatorBackground New ChartAttribute Colors Black 1 DashStyles Solid Colors Black barplot SegmentSpacing 1 barplot SegmentWidth 1 barplot IndicatorSubType ChartObj RT BAR SEGMENTED SUBTYPE chartVu AddChartObject barplot End Sub InitializeCustomBarIndicator Example for an RTBarIndicator Solid Bar Indicator and Pointer Indicator Setting up the solid bar and pointer indicators are pretty much identical to the segmented bar indicator The examples below are extracted from the RTGraphNetDemo example program file DynBarsUserControll method InitializeBar1 The default value for the IndicatorSubType property is RT BAR SOLID SUBTYPE so that does not even need to be set 140 Single Channel Bar Indicator 100 4 gt 4 4 40 x 20 x i 0 f For solid bar indicator ChartAttribute attribl new ChartAttribute Colors Black 1 DashStyles Solid Colors Green double barwidth 1 0 barbase 0 0 int barjust ChartObj JUSTIFY MIN int barorient ChartObj VERT DIR 100 80 60 40 20 0 C da RTBarIndicator barplot new RTBarIndicator pTransforml processVarl barwidth barbase attribl
366. rocess variable produces an alarm state condition AlarmTransitionEventHandler Delegate for notification each time the check of a process variable produces aChartView chartVu change of state in alarm state condition A complete listing of RTProcessVar properties is found in the QCRTGraphWPFCompiledHelpFile chm documentation file located in the doc subdirectory Example of Creating an RTProcessVar Object The example below creates and updates an RTProcessVar object that does not use alarms The example was extracted from the Treadmill example program method InitializeGraph See the example in the RTAlarm section of the manual for one that uses alarms C ChartAttribute defaultattrib new ChartAttribute Colors Green 1 0 ashStyles Solid Colors Green c double METSValue 0 METS new RTProcessVar METS defaultattrib METS ShortDescription Metabolic Equivalents METS MinimumValue 0 METS MaximumValue 100 METS DatasetEnableUpdate true Make sure this is on for scrolling graphs ETSValue Math Max 0 heartRateValue 60 60 0 ETS SetCurrentValue METSValue Im Ss d x 100 Process Variable and Alarm Classes VB Dim defaultattrib As New ChartAttribute Colors Green 1 0 DashStyles Solid Colors Green METSValue 0 METS New RTProcessVar METS defaultattrib METS ShortDescription Metabolic Equivalents METS MinimumValue 0 METS MaximumValue 100 METS DefaultMinimumDisp
367. rocessVar2 meterarcindicator SetChartObjAttributes attribl meterarcindicator InnerValueArcNormalized 0 8 meterarcindicator OuterValueArcNormalized 0 95 meterarcindicator IndicatorSubtype ChartObj RT METER ARC BAND SUBTYPE meterarcindicator IndicatorBackgroundEnable true Add panel meters to meter needle chartVu AddChartObject meterarcindicator VB Dim meterarcindicator As New RTMeterArcIndicator meterframe processVar2 meterarcindicator SetChartObjAttributes attribl meterarcindicator InnerValueArcNormalized 0 8 meterarcindicator OuterValueArcNormalized 0 95 meterarcindicator IndicatorSubtype ChartObj RT METER ARC BAND SUBTYPE meterarcindicator IndicatorBackgroundEnable True Add panel meters 175 Meter Indicators Needle Arc and Symbol LineStyle chartVu AddChartObject meterarcindicator Extracted from the example program RTGraphNetDemo file SegmentedArcMeterUserControll method InitializeMeter1 C RTMeterArcIndicator meterarcindicator new RTMeterArcIndicator meterframe processVarl meterarcindicator SetChartObjAttributes attribl meterarcindicator IndicatorSubtype ChartObj RT METER SEGMENTED ARC SUBTYPE meterarcindicator SegmentValueRoundMode ChartObj RT CEILING VALUE meterarcindicator SegmentWidth 7 meterarcindicator SegmentSpacing 10 meterarcindicator InnerValueArcNormalized 0 35 meterarcindicator OuterValueArcNormalized 0 85 meterarc
368. rolling graphs the process variable class also manages a ChartDataset object that holds historical information Updating the process variable with new data values does NOT trigger a screen update Because the screen update is not event driven from the update of the data the process variable can be updated hundreds or even thousands of times faster than the screen The graph should be rendered to the screen using a timer or some other event at a frame rate of 10 updates second or slower The rendered graphs will always reflect the most current data and in the case of scrolling graphs or other graphs that display time persistent data will always display all data within the current scale limits As processor speeds improve and Net because faster the screen updates should be able to approach the 30 60 frames seconds of a CRT monitor It will never need to be higher than that because the eye cannot track changes in the screen faster than that anyway Since all real time plot objects are derived from the QCChart2D ChartPlot class the methods and properties of that class are available to set commonly used attributes such as the real time plot object scale line and fill colors Many new real time classes have been added to the software implementing display objects that render process variable data in a variety of graph and text formats These include single and multiple bar indicator classes meter axis and meter indicator classes panel meter classe
369. rs Coordinates Meter Axes and Meter Axis Labels 157 0 20 40 60 80 100 C double startarcangle 90 double arcextent 180 double startarcscale 0 0 double endarcscale 100 0 bool arcdirection false double arcradius 0 6 double centerx 0 25 centery 0 0 ChartFont meterFont FontArchive font12 RTMeterCoordinates meterframe new RTMeterCoordinates startarcangle arcextent startarcscale endarcscale arcdirection centerx centery arcradius VB Dim startarcangle As Double 90 Dim arcextent As Double 180 Dim startarcscale As Double 0 0 Dim endarcscale As Double 100 0 Dim arcdirection As Boolean False Dim arcradius As Double 0 6 Dim centerx As Double 0 25 Dim centery As Double 0 0 Dim meterFont As ChartFont FontArchive font12 Dim meterframe As New RTMeterCoordinates startarcangle arcextent _ startarcscale endarcscale arcdirection centerx centery arcradius Meter Axis RTMeterAxis com quinncurtis chart2dwpf LinearA xis RTMeterAxis A meter axis extends for the extent of the meter arc and is centered on the origin Major and minor tick marks are placed at evenly spaced intervals perpendicular to the meter arc 158 Meters Coordinates Meter Axes and Meter Axis Labels The meter axis also draws meter alarm arcs using the alarm information in the associated RTProcessVar object RTMeterAxis Constructors Visual Basic Overloads Public Sub New _ ByVal frame
370. rs OrangeRed 0 C void InitializeBargraphs bool barbulb bool interioraxis bool numeric bool alarm bool units bool title bool segmented rtAutoBarIndicatorl InitBargraph ChartObj VERT_ DIR 0 rtAutoBarIndicatorl InitStrings VERI 0 GMB rtAutoBarIndicatorl LowAlarm AlarmLimitValue 23 rtAutoBarIndicatorl HighAlarm AlarmLimitValue 78 rtAutoBarIndicatorl SetpointAlarm AlarmLimitValue 53 rtAutoBarIndicatorl MinIndicatorValue 0 rtAutoBarIndicatorl MaxIndicatorValue 100 rtAutoBarIndicatorl GraphBackground ChartObjAttributes new ChartAttribute Colors LightBlue 5 DashStyles Solid Colors LightBlue rtAutoBarIndicatorl FaceplateBackground true rtAutoBarIndicatorl BarEndBulb barbulb rtAutoBarIndicatorl InteriorAxis interioraxis rtAutoBarIndicatorl NumericPanelMeter ChartObjEnable numeric ChartObj OBJECT ENABLE ChartObj OBJECT DISABLE rtAutoBarIndicatorl NumericPanelMeter NumericTemplate DecimalPos rtAutoBarIndicatorl AlarmPanelMeter ChartObjEnable alarm ChartObj OBJECT ENABLE ChartObj OBJECT DISABLE rtAutoBarIndicatorl UnitsPanelMeter ChartObjEnable units ChartObj OBJECT ENABLE ChartObj OBJECT DISABLE rtAutoBarIndicatorl YAxisTitle ChartObjEnable units ChartObj OBJECT ENABLE ChartObj OBJECT DISABLE 284 Auto Indicator Classes rtAutoBarIndicatorl TagPanelMeter ChartObjEnable title ChartObj OBJECT ENABLE ChartObj OBJECT DISABLE rtAutoBarIndicatorl BarPlot Indi
371. rtObject charttitle public void InitializeGraph timerl IsEnabled false templowalarml new RTAlarm ChartObj RT ALARM LOWERTHAN 80 templowalarml AlarmMessage Low Alarm templowalarml AlarmSymbolColor Colors Blue templowalarml AlarmTextColor Colors Blue temphighalarml new RTAlarm ChartObj RT ALARM GREATERTHAN 120 temphighalarml AlarmMessage High Alarm temphighalarml AlarmSymbolColor Colors Red temphighalarml AlarmTextColor Colors Red currentTemperaturel new RTProcessVar Temp 1 new ChartAttribute Colors Green 1 0 DashStyles Solid Colors Green 360 Using OCRTGraph for WPF to Create Web Applications Hr currentTemperaturel MinimumValue 20 currentTemperaturel MaximumValue 200 currentTemperaturel DefaultMinimumDisplayValue 0 currentTemperaturel DefaultMaximumDisplayValue 150 currentTemperaturel SetCurrentValue currentTemperatureValuel currentTemperaturel AddAlarm templowalarml currentTemperaturel AddAlarm temphighalarml Important enables historical data collection for scroll graphs currentTemperaturel DatasetEnableUpdate true currentTemperaturel AlarmTransitionEventHandler new RTAlarmEventDelegate TemperatureAlarmEventProc templowalarm2 new RTAlarm ChartObj RT ALARM LOWERTHAN 80 templowalarm2 AlarmMessage Low Alarm templowalarm2 AlarmSymbolColor Colors Blue templowalarm2 AlarmTextColor Colors Blue temphighalarm
372. rties is found in the QCRTGraphWPFCompiledHelpFile chm documentation file located in the doc subdirectory See the examples for the RTSimpleSingleValuePlot and RTGroupMultiValuePlot for example of the use of the RTScrollFrame class Single and Multiple Channel Annunciators 205 Class RTVerticalScrollFrame com quinncurtis chart2dwpf ChartPlot RTPlot RTMultiValueIndicator RTVerticalScrollFrame The RTVerticalScrollFrame is basically the same as the original RTScrollFrame except it controls scrolling along the vertical axis When you use a vertical scroll frame typically you would have the y scale setup as an elapsed time or time date based scale It can also be setup as a numeric base scale Otherwise it works much the same as the RTScrollFrame RTVerticalScrollFrame constructors Visual Basic Overloads Public Sub New _ ByVal component As ChartView _ ByVal processvar As RTProcessVar ByVal initialscale As PhysicalCoordinates ByVal scrollymode As Integer _ ByVal autoscalexmode As Integer _ Overloads Public Sub New _ ByVal component As ChartView _ ByVal processvar As RTProcessVar ByVal initialscale As PhysicalCoordinates ByVal scrollymode As Integer _ Overloads Public Sub New _ ByVal component As ChartView _ ByVal initialscale As PhysicalCoordinates ByVal scrollymode As Integer _ ByVal autoscalexmode As Integer Ct public RTVerticalScrollFrame ChartView component
373. s The job of a ChartScale derived object is to convert a dimension from the current physical coordinate system into the current working coordinate system LinearScale A concrete implementation of the ChartScale class It converts a linear physical coordinate system into the working coordinate system QCChart2D Class Summary 57 LogScale A concrete implementation of the ChartScale class It converts a logarithmic physical coordinate system into the working coordinate system TimeScale A concrete implementation of the ChartScale class converts a date time physical coordinate system into the working coordinate system ElapsedTimeScale A concrete implementation of the ChartScale class converts an elapsed time coordinate system into the working coordinate system Coordinate Transform Classes UserCoordinates WorldCoordinates WorkingCoordinates PhysicalCoordinates CartesianCoordinates ElapsedTimeCoordinates PolarCoordinates AntennaCoordinates TimeCoordinates The coordinate transform classes maintain a 2D coordinate system Many different coordinate systems are used to position and draw objects in a graph Examples of some of the coordinate systems include the device coordinates of the current window normalized coordinates for the current window and plotting area and scaled physical coordinates of the plotting area UserCoordinates This contains routines for drawing lines rectangles and text using WPF device coordinates Wor
374. s and annunciator classes Rather than create a whole new set of classes that reproduce all of the SimplePlot and GroupPlot classes of the QCChart2D library two special classes RTSimpleSingleValuePlot and RTGroupMultiValuePlot are used to interface the QCChart2D plot objects to the process variable data classes That way any QCChart2D SimplePlot or GroupPlot object can be converted into a real time scrolling graph without adding any code to the Real Time Graphics Tools for WPF library Class Architecture 13 Real Time Graphics Tools for WPF Class Summary The Real Time Graphics Tools for WPF library is a super set of the QCChart2D library The classes of the QCChart2D library are an integral part of the software A summary of the QCChart2D classes appears below QCChart2D Class Summary Chart view class Data classes Scale transform classes The chart view class is a System Windows Controls UserControl subclass that manages the graph objects placed in the graph There are data classes for simple xy and group data types There are also data classes that handle System DateTime date time data and contour data The scale transform classes handle the conversion of physical coordinate values to working coordinate values for a single dimension Coordinate transform classes The coordinate transform classes handle the conversion Attribute class Auto Scale classes Charting object classes Mouse interaction classes File and prin
375. s ChartFon All values must be converted to this range 5 seconds 5 give seconds position on 0 12 scale 5 60 seconds 300 give minutes on 0 12 scale 60 60 seconds 3600 give hours on 0 12 scale 12 apply modulo 12 base 12 apply modulo 12 base 12 apply modulo 12 base le 90 360 le 0 0 12 0 an False oS 0 049 t font12 Dim meterframe As New RTMeterCoordinates startarcangle arcextent Startarcscale endarcscale arcdirection centerx centery arcradius meterframe SetGraphBorder Di amp gonalt 8 0 0 0 99 0 3 Dim frameattrib As New ChartAttribute Colors Black 3 DashStyles Solid Colors Blue Seconds Dim needleattribl As New ChartAttribute Colors Black 1 DashStyles Solid Colors Blue Dim meterneedlel As New RTMeterNeedleIndicator meterframe clockdata 0 meterneedlel NeedleBaseWi dth 1 meterneedlel SetChartObjAttributes needleattribl meterneedlel NeedleLength chartVu AddChartObject me Minutes Dim needleattrib2 As New Colors Blue Dim meterneedle2 As New R meterneedle2 NeedleBaseWi meterneedle2 SetChartObjA meterneedle2 NeedleLength chartVu AddChartObject me Hours Dim needleattrib3 As New Colors Blue 0 5 terneedlel ChartAttribute Co dth 3 ttributes needlea 0 45 terneedle2 ChartAttribute Co lors Black 1 DashStyles Solid TMeterNeedleIndicator meterframe clockdata 1 ttribz lors Black l Da
376. s method updates the intermediate values in the PID calculation A complete listing of RTPIDControl properties is found in the QCRTGraphWPFCompiledHelpFile chm documentation file located in the doc subdirectory The output of the PID equation calculated using the RTCalcPID method is in the same units as the measured variable If the measured variable is temperature with a potential range of 0 300 then the output of the PID equation will also be temperature in the same range though it can have even wider swings than the measured variable The output of the PID equation is expected to drive some sort of control device either an actuator heater pressure control valve or dc servomotor which has completely different units than the control output It is up to the control engineer to calculate the transfer function usually a basic mx b equation to the control output so that it matches the input range of the control device whether it be 0 10V 4 20mA or some other input range This is completely dependent on the application and resolving this final stage transfer function is entirely up to a control engineer and not part of this software PID Control 243 Example for RTPIDControl The example below is extracted from the PIDControlTuner example The code really needs to be studied in the context of the complete program so study that example program instead of the abbreviated code below C RTPIDControl RTProcessVar RTProcessVar
377. s of the RTProcessVarViewer grid and the starting position of the RTProcessVarViewer scrollbar In normal use you add the RTProcessVarViewer to the XAML file of a window just like you have been adding a ChartView window The RTProcessVarViewer can be aligned with a chart by placing it in a grid row below or above the chart or in a grid column to the left or right of the chart You can allocate a different amount of space for the grid versus the chart using the WPF Grid relative size definition parameters In the example below the ChartView is place in Grid Row 0 where the row has a height of 5 The RTProcessVarViewer is place in GridRow 1 where the row has a size of 2 The result is that the chart will occupy 5 7 of the display space and the dataset viewer 2 7 of the display space No matter how you resize the window that relationship will be maintained Window x Class RTStockDisplay Window 1 Process Variable Viewer 265 xmlns http schemas microsoft com winfx 2006 xaml presentation xmlns x http schemas microsoft com winfx 2006 xaml Title Window1 Height 600 Width 1000 xmlns my clr namespace com quinncurtis chart2dwpf assembly QCChart2DWPF3 xmlns my2 clr namespace com quinncurtis rtgraphwpf assembly QCRTGraphWPF3 gt lt Grid Name grid1 gt lt Grid RowDefinitions gt lt RowDefinition Height 5 gt lt RowDefinition Height 2 gt lt Grid RowDefinitions gt my ChartView x Name rtStockDisplayApp
378. s used to pass alarm data to the event handler If you want the alarm event to be called only on the initial transition from the no alarm state to the alarm state set the RTProcessVar AlarmTransitionEventEnable to true and the RTProcessVar AlarmStateEventEnable to false In this case you will get one event when the process variable goes into alarm and one when it comes out of alarm If you want a continuous stream of alarm events as long as the RTAlarm object is in alarm set the RTProcessVar AlarmTransitionEventEnable to false and the RTProcessVar AlarmStateEventEnable to true The alarm events will be generated at the same rate as the RTProcessVar SetCurrentValue method is called RTAlarmEventArgs constructors You don t really need the constructors since RTAlarmEventArgs objects are created inside the RTProcessVar class when an alarm event needs to be generated Here they are anyway Visual Basic Overloads Public Sub New _ ByVal pv As RTProcessVar ByVal alarm As RTAlarm _ ByVal channel As Integer C public RTAlarmEventArgs RIProcessVar pr RTAlarm alarm int channel Parameters pv The RTProcessVar object associated with the alarm event alarm The RTAlarm object associated with the alarm event channel The channel number associated with the alarm event Process Variable and Alarm Classes 105 The most commonly used RTAlarmEventArgs properties are Selected Public Instance Properties A
379. sFont chartVu AddChartObject yAxisLab scrollFrame new RTScrollFrame chartVu currentTemperaturel pTransforml ChartObj RT FIXEDEXTENT MOVINGSTART AUTOSCROLL 338 Using Real Time Graphics Tools for WPF to Create Windows Applications scrollFrame AddProcessVar currentTemperature2 ScrollFrame ScrollScaleModeY ChartObj RT AUTOSCALE Y MINMAX Allow 100 samples to accumlate before autoscaling y axis This prevents rapid changes of the y scale for the first few samples ScrollFrame MinSamplesForAutoScale 100 scrollFrame ScrollRescaleMargin 0 05 chartVu AddChartObject scrollFrame if scrollMode 0 ChartAttribute attribl new ChartAttribute Colors Yellow 2 DashStyles Solid SimpleLinePlot lineplotl new SimpleLinePlot pTransforml null attribl lineploti SetFastClipMode ChartObj FASTCLIP X RTSimpleSingleValuePlot solarPanelLinePlotl new RTSimpleSingleValuePlot pTransforml lineplotl currentTemperaturel chartVu AddChartObject solarPanelLinePlotl ChartAttribute attrib2 new ChartAttribute Colors Green 2 DashStyles Solid SimpleLinePlot lineplot2 new SimpleLinePlot pTransforml null attrib2 lineplot2 SetFastClipMode ChartObj FASTCLIP X RTSimpleSingleValuePlot solarPanelLinePlot2 new RTSimpleSingleValuePlot pTransforml lineplot2 currentTemperature2 chartVu AddChartObject solarPanelLinePlot2 else ChartAttribute at
380. scale As Double _ ByVal arcdirection As Boolean ByVal arcradius As Double C public RTMeterCoordinates double startarcangle double arcextent double startarcscale double endarcscale bool arcdirection double x double y double arcradius public RTMeterCoordinates double startarcangle double arcextent double startarcscale double endarcscale bool arcdirection double arcradius Parameters startarcangle Specifies the starting arc angle position of the meter arc in degrees arcextent Specifies the extent of the meter arc in degrees The default meter arc starts at startArcAngle and extends in a negative clockwise direction with an extent arcExtent startarcscale Specifies the scaling value associated with the startArcAngle position of the meter arc endarcscale Specifies the scaling value associated with the ending position of the meter arc arcdirection Specifies the direction of the arcextent The default arcDirectionPositive value of false meter arc starts at startArcAngle and extends in a negative clockwise direction with an extent arcExtent Change to true to have the meter arc extend in a positive counter clockwise direction x Specifies x position of the center of the meter arc in plot area normalized coordinates Y Specifies y position of the center of the meter arc in plot area normalized coordinates arcradius Specifies
381. sed copy you are licensed to copy the SOFTWARE only into the memory of the number of computers corresponding to the number of licenses purchased The primary user of the computer on which each licensed copy of the SOFTWARE is installed may make a second copy for his or her exclusive use on a portable computer Under no other circumstances may the SOFTWARE be operated at the same time on more than the number of computers for which you have paid a separate license fee You may not duplicate the SOFTWARE in whole or in part except that you may make one copy of the SOFTWARE for backup or archival purposes You may terminate this license at any time by destroying the original and all copies of the SOFTWARE in whatever form B 30 Day Trial License You may download and use the SOFTWARE without charge on an evaluation basis for thirty 30 days from the day that you DOWNLOAD the trial version of the SOFTWARE The termination date of the trial SOFTWARE is embedded in the downloaded SOFTWARE and cannot be changed You must pay the license fee for a Developer License of the SOFTWARE to continue to use the SOFTWARE after the thirty 30 days If you continue to use the SOFTWARE after the thirty 30 days without paying the license fee you will be using the SOFTWARE on an unlicensed basis Redistribution of 30 Day Trial Copy Bear in mind that the 30 Day Trial version of the SOFTWARE becomes invalid 30 days after downloaded from our web site or one of our sponsor
382. set ChartAttribute defaultattribute Parameters tagname A string representing the tag name of the process variable dataset A dataset that will be used to hold historical values for the process variable If no tag name is supplied in the constructor the tag name for the process variable will be taken from the ChartDataset DataName property of the dataset defaultattribute Specifies the default attributes for the process variable Once created the RTProcessVar object is updated using the SetCurrentValue method The method has several overloads Visual Basic Overridable Overloads Public Sub SetCurrentValue _ Process Variable and Alarm Classes 97 ByVal gv As ChartCalendar ByVal pv As Double Overridable Overloads Public Sub SetCurrentValue _ ByVal dt As DateTime _ ByVal pv As Double Overridable Overloads Public Sub SetCurrentValue _ ByVal timestamp As Double _ ByVal pv As Double Overridable Overloads Public Sub SetCurrentValue _ ByVal pv As Double C public virtual void SetCurrentValue ChartCalendar gv double pv public virtual void SetCurrentValue DateTime dt double pv public virtual void SetCurrentValue double timestamp double pv public virtual void SetCurrentValue double pv Ye Parameters SV The time stamp as a ChartCalendar object for the process variable dt The time stamp as a DateTime object for the process variable timestamp The ti
383. sform1 SetGraphBorderDiagonal It is positioned inside the plot area using the INSIDE INDICATOR position constant A string panel meter places a title above the time panel meter Current Time C CartesianCoordinates pTransforml new CartesianCoordinates 0 0 0 0 1 0 1 0 pTransforml SetGraphBorderDiagonal 0 53 85 0 72 0 96 ChartAttribute panelmeterattrib new ChartAttribute Colors SteelBlue 3 DashStyles Solid Colors Black RTElapsedTimePanelMeter panelmeter new RTElapsedTimePanelMeter pTransforml stopWatch panelmeterattrib panelmeter PanelMeterPosition ChartObj INSIDE INDICATOR panelmeter TimeTemplate TextFont font32Numeric panelmeter TimeTemplate TimeFormat ChartObj TIMEDATEFORMAT 24HMS panelmeter TimeTemplate DecimalPos 0 panelmeter AlarmIndicatorColorMode ChartObj RT INDICATOR COLOR NO ALARM CHANGE chartVu AddChartObject panelmeter VB Dim pTransforml As New CartesianCoordinates 0 0R 0 0R 1 0R 1 0R pTransforml SetGraphBorderDiagonal 0 53 0 85 0 72 0 96 Dim panelmeterattrib As New ChartAttribute Colors SteelBlue 3 DashStyles Solid Colors Black Dim panelmeter As New RTElapsedTimePanelMeter pTransforml stopWatch panelmeterattrib panelmeter PanelMeterPosition ChartObj INSIDE INDICATOR panelmeter TimeTemplate TextFont font32Numeric panelmeter TimeTemplate TimeFormat ChartObj TIMEDATEFORMAT 24HMS panelmeter TimeTemplate DecimalPos 0 panelmeter AlarmIndi
384. shStyles Solid Dim meterneedle3 As New RTMeterNeedleIndicator meterframe clockdata 2 meterneedle3 NeedleBaseWi meterneedle3 SetChartObjA meterneedle3 NeedleLength chartVu AddChartObject me End Sub InitializeClock dth 5 ttributes needlea 0 3 terneedle3 ttrib3 Examples for using RTComboProcessVar in an altimeter application The example extracted from the example program RTGraphNetDemo file Diall methods InitializeGraph and InitializeDial1 show the important aspects of using an Dials and Clocks 190 RTComboProcessVar object to supply data for the two meter needle indicators used as the hands of a clock C dialComboProcessVarl new RTComboProcessVar Altimeter processVarl DefaultAttribute dialComboProcessVarl AddProcessVar bigProcessVarArray 0 dialComboProcessVarl AddProcessVar bigProcessVarArray 1 dialComboProcessVarl SetDivisorItem 0 1 dialComboProcessVarl SetDivisorItem 1 10 dialComboProcessVarl SetModuloItem 0 100 dialComboProcessVarl SetModuloItem 1 100 private void InitializeDiall double startarcangle 90 double arcextent 360 double startarcscale 0 0 double endarcscale 100 0 bool arcdirection false double arcradius 0 90 double centerx 0 0 centery 0 0 ChartFont meterFont FontArchive font12 RTMeterCoordinates meterframe new RTMeterCoordinates startarcangle arcextent Startarcscale endarcscale arcdirecti
385. source The process variable associated with the control attrib The color attributes of the panel meter indicator Selected Instance Properties Set Get to the size mode for the Control Use one of the Control size mode constants RT_ORIG_CONTROL SIZE RT MIN CONTROL SIZE RT INDICATORRECT CONTROL SIZE A complete listing of RTFormControlPanelMeter properties is found in the QCRTGraphWPFCompiledHelpFile chm documentation file located in the doc subdirectory Example for RTControlTrackbar in an RTFormControlPanelMeter The panel meter below extracted from the Treadmill example method InitializeLeftPanelMeters adds an RTFormControlPanelMeter as an independent panel meter at the left of the display In this example the plot area of the coordinate system is set for the position of the RTFormPanelMeter using pTransform1 SetGraphBorderDiagonal It is positioned inside the plot area using the CUSTOM POSITION position constant The lower left cornet of the form control is placed at the 0 0 0 0 position of the plot area in PHYS POS coordinates The size of the form control is set to the size of the plot area width 1 0 height 1 0 in PHYS POS coordinates C CartesianCoordinates pTransforml new CartesianCoordinates 0 0 0 0 1 0 1 0 plransforml SetGraphBorderDiagonal 0 01 12 0 06 0 3 ChartAttribute attribl new ChartAttribute Colors LightBlue 7 DashStyles Solid Colors LightBlue runnersPaceTr
386. stampstring tagname Warning Alarm Level alarmlimitvalue ToString Exceeded else Console Out WriteLine timestampstring tagname Process Value transitioned back to normal range Update data using 100 msec timer private void timerl Tick object sender System EventArgs e temphighalarm2 new RTAlarm ChartObj RT ALARM GREATERTHAN 120 Oy Using OCRTGraph for WPF to Create Web Applications 361 Random data currentTemperatureValuel 5 0 5 ChartSupport GetRandomDouble currentTemperatureValue2 8 0 5 ChartSupport GetRandomDouble These two methods of setting the current value are equivalent if true This method uses the default time stamp which is the current time of day currentTemperaturel SetCurrentValue currentTemperatureValuel currentTemperature2 SetCurrentValue currentTemperatureValue2 else This method you pass in whatever time stamp you want in this case it is the current time of day ChartCalendar tod new ChartCalendar get current time currentTemperaturel SetCurrentValue tod currentTemperatureValuel currentTemperaturel SetCurrentValue tod currentTemperatureValue2 fendif Update screen on 500 msec timer private void timer2 Tick object sender System EventArgs e chartVu UpdateDraw e Reference and initialize the newly created ScrollGraph1 class in the Pagel xaml cs behind code file using
387. string and description RTStringPanelMeter Displays a string either an arbitrary string or a string based on string data in the associated RTProcessVar object It is usually used to display a channels tag string and units string but it can also be used to display longer descriptive strings It contains a template based on the QCChart2D StringLabel class that is used to specify the font and string format information associated with the panel meter The RTTimePanelMeter can display a time date value in any format supported by the QCChart2D TimeLabel format constants You can also create custom format not directly supported RTTimePanelMeter Displays the time date value of the time stamp of the associated RTProcessVar object It contains a template based on the QCChart2D TimeLabel class that is used to 22 Class Architecture specify the font and time date format information associated with the panel meter RTElapsedTimePanelMeter Displays the elapsed time the TimeSpan value of the time stamp in milliseconds of the associated RTProcess Var object It contains a template based on the QCChart2D ElapsedTimeLabel class that is used to specify the font and time date format information associated with the panel meter RTFormControlPanelMeter Encapsulates an RTFormControl object buttons and track bars primarily though others will also work in a panel meter format Single Value Indicators com quinncurtis chart2dwpf ChartPlot
388. t Printing assembly In this case in the Add Reference tab choose Net and scroll to the System Printing assembly 334 Using Real Time Graphics Tools for WPF to Create Windows Applications Add Reference NET COM Projects Browse Recent Look in ib votem Cie zm SEEN 8 occhart2DNet dil X ocsPCChartNet dil S QCSPCChartwpF3 dl 8 QCChart3DNet dl 8 QCChart3DVisionAux dll 5 QcMatPackNet dil 5 QcMatViewNet dil 8 QCRTGraphNet dll File name QCRTGraphWPF3 dll QCChartt2DWPF3 dll L Files of type Component Files dil tib olb ocx exe manifest L a Ice View the Windowl1 xaml code and add the reference to ChartView object scrollAppl in the Grid layout panel The Windowl xaml file now looks like Window x Class WpfApplicationl Window1 xmlns http schemas microsoft com winfx 2006 xaml presentation xmlns x http schemas microsoft com winfx 2006 xaml Title Window1 Height 800 Width 1000 xmlns my clr namespace com quinncurtis chart2dwpf assembly QCChart2DWPF3 xmins my2 clr namespace com quinncurtis rtgraphwpf assembly QCRTGraphWPF3 gt lt Grid gt my ChartView Margin 5 5 5 5 Name scrollApp1 gt lt Grid gt lt Window gt Display the Window1 asml cs behind code file It will look something like this using System using System Collections Generic using System Ling using System Text usi
389. t Set the color of the button text when the button is checked ButtonSubtype Get Set the button subtype RT CONTROL RADIOBUTTON SUBTYPE RT CONTROL MOMENTARYBUTTON SUBTYPE RT CONTROL TOGGLEBUTTON SUBTYPE ButtonUncheckedColor Get Set the color of the button when the button is unchecked ButtonUncheckedText Get Set the button text when the button is unchecked ButtonUncheckedTextColor Get Set the color of the button text when the button is unchecked A complete listing of RTControlButton properties is found in the QCRTGraphWPFCompiledHelpFile chm documentation file located in the doc subdirectory Example for momentary and toggle buttons The example below extracted from the PIDControlTuner example creates three RTControlButton buttons two are momentary buttons and one is a toggle button The buttons are added to an RTFormControlGrid in order to position them as a logical group I C RTControlButton ResetErrorTerm Buttons Track Bars and Other Form Control Classes 221 new RTControlButton ChartObj RT CONTROL MOMENTARYBUTTON SUBTYPE RTControlButton ResetAll new RTControlButton ChartObj RT CONTROL MOMENTARYBUTTON SUBTYPE RTControlButton StartControl new RTControlButton ChartObj RT CONTROL TOGGLEBUTTON SUBTYPE public void InitializeStartStopButtons ChartAttribute attribl new ChartAttribute Colors Black 3 DashStyles Solid Colors Coral ChartFont buttonfont font9Bold Array
390. t and RTGroupMultiValuePlot objects The RTScrollFrame class is discussed in more detail a couple of sections down Alarm Indicator Classes RTAlarmIndicator RTMultiAlarmIndicator The alarm indicator classes are used to indicate alarms limits in displays that use a Cartesian XY coordinate system The alarm indicators can have one of three forms pointer style symbols horizontal or vertical lines or horizontal or vertical filled areas These alarm indicator classes are not used in meter displays Alarm limits for meter displays are handled by the RTMeterAxis class 100 E 60 zs 40 20 b ma 32 Class Architecture 140 MEN bio yo le cliens eer 120 4 e E 100 E 80 60 18 45 00 18 46 00 The alarm indicators can have one of three forms pointer style symbols horizontal or vertical lines or horizontal or vertical filled areas RTAlarmIndicator This class is used to provide alarm limit indicators for RTSingleValueIndicator objects RTMultiAlarmIndicator This class is used to provide alarm limit indicators for RTMultiValueIndicator objects Each indicator in a multi indicator object can have unique alarm settings Meter Axis Classes QChart2D PolarCoordinates RTMeterCoordinates com quinncurtis chart2dwpf LinearA xis RTMeterAxis com quinncurtis chart2dwpf NumericAxisLabels RTMeterAxisLabels com quinneurtis chart2dwpf StringAxisLabels Class Architecture 33 RTMeterStringAxisLabels RTMeterCoordin
391. t equally spaced intervals Logarithmic Axes 1000 50000 100 400 5000 Linear X Log X Log X 10 Log Y 200 Linear Y 500 Log Y 1 0 50 0 1 0 5 O 20 40 60 80 100 0 02 0 2 2 20 200 1 10 100 1000 40 Log X 20 Linear Y 0 0 2 0 4 0 6 1 2 4 6 10 20 40 60 100 499 400600 1000 100 Time X 10 Log Y 1 8 01 02 9 01 02 10 01 02 Logarithmic axes can be combined with linear logarithmic and time axes QCChart2D Class Summary 63 LogAxis This class implements a logarithmic axis with major tick marks placed on logarithmic intervals for example 1 10 100 or 30 300 3000 The minor tick marks are placed within the major tick marks using linear intervals for example 2 3 4 5 6 7 8 9 20 30 40 50 90 An important feature of the LogAxis class is that the major and minor tick marks do not have to fall on decade boundaries A logarithmic axis must have a positive range exclusive of 0 0 and the tick marks can represent any logarithmic scale Date Axes Year YeavQuarter os LL morra 1985 1990 1995 2000 1998 1999 2000 2004 2002 2003 YearMonth QuartevMonth i RLS Sea EL 1998 4900 2000 2001 2002 2003 4 2002 42002 om 40 2002 1 2002 MonthAWieek Month Day 7 Day Week FTTTApOTTT OTT 95402 100102 11 01 02 4204102 40103 110102 120102 10103 Month Day 5 Day Week WeekDay 7 Day Week TT REL EE Mm 10103 20303 20303 40103 dose m am 42503 WeekDay 6 Day Week Daye Hour FTTTTTTTTTTTTTTTTTTTTTA oe e Re EE
392. tAutoClockIndicator3 PlotAttrib FillColor Colors Green Me rtAutoClockIndicator3 InitStrings Ft Myers EST Me rtAutoDialIndicatorl GraphFormat 0 Me rtAutoDialIndicatorl GraphBackground FillColor Colors White Me rtAutoDialIndicatorl InvertColors Me rtAutoDialIndicatorl InitStrings Altimeter Feet Me rtAutoDiallndicator2 GraphFormat 1 Me rtAutoDialIndicator2 GraphBackground FillColor Colors White Me rtAutoDialIndicator2 InitStrings Odometer Miles Me rtAutoDialIndicator3 GraphFormat 2 Me rtAutoDialIndicator3 InitStrings Electric Meter KW Hr End Sub Clock Indicator Class RTAutoClockIndicator System Windows Controls UserControl ChartView RTAutoIndicator RTAutoClockIndicator The RTAutoClockIndicator combines a RTMeterIndicator object with other objects needed to create a self contained meter display These other objects include a RTComboProcessVar variable meter coordinates system a meter axis and axis labels title string units string alarm indicators and panel meters used in the display of the meters numeric value tag name and alarm status Since it contains a RTComboProcessVar object it can divide a single input value time in this case into multiple values hours minutes seconds to drive multiple needles in the display RTAutoClockIndicator constructors Auto Indicator Classes 309 Since the RTAutoClockIndicator is designed to be dropped on a form only a default constructor is used The i
393. tasets Group Digtaeet dude ai 2 378 Appendix GroupBarPlot ie 72 76 95 239 GroupDataset 57 58 61 94 GrouUpDataset c ce cep petet rere tinent Ree 2 GroupPlot 10 13 15 29 31 70 72 73 74 75 76 77 78 79 95 97 239 240 GroupVersaPlot 72 76 95 359 HistogramPlot 72 77 95 239 Image objects Legend classes Legendltem Linear axis LinearAutoScale i LinearAxis 18 33 63 64 69 87 95 143 145 157 158 161 163 171 172 DitieatScale s oo e nitate NS LineGapPlot LogAutoScale seen TO SARKIS Loi got E eee LogScale WEG KA EE Markerg marker Meters Clocks and Dials 188 195 199 Mousel etenerg ee eeeeee seee eeee ee MoveCoordinates Moving chart data 89 90 94 Moving graph Objects i 89 94 MultiLinePlot 31 72 78 95 239 241 NearestPointData esse 91 92 94 Numeric axis labelSs sss 177 Numeric data point Labele 95 NumericAxisLabels 18 33 68 69 95 144 145 157 158 161 163 176 177 NumericLabel 21 87 88 95 114 118 119 141 Open High Low Close plots 72 78 95 239 242 243 Panel Meters minen ar eira Ta AGES 113 114 260 PhysicalCoordinates 58 59 60 62 63 94 118 123 126 130 133
394. teScrollGraph etimespan currentValues True End Sub Scrolling Graph Vertical Indicator Class RTAutoVerticalScrollGraph 324 Auto Indicator Classes System Windows Controls UserControl ChartView RTAutoIndicator RTAutoBarIndicator RTAutoVerticalScrollGraph The RTAutoVerticalScrollGraph is a ChartView derived object that encapsulates all of the chart elements needed to draw a scrolling graph including an array of RTProcessVar objects a coordinate system axes axes labels RTSingleValuePlot RTGroupMultiValuePlot RTAlarmSymbol alarm symbols legend title subhead footer and units strings The RTAutoVerticalScrollGraph support vertical horizontal scrolling Use the RTAutoScrollGraph for horizontal scrolling There are three types of scrolling y scales you can use in a scrolling chart a date time scale an elapsed time scale or a numeric scale Use the appropriate InitRTAutoScroll overload to select which one is most applicable to your data RTAutoVerticalScrollGraph constructors Since the RTAutoVerticalScrollGraph is designed to be dropped on a form only a default constructor is used The indicator is customized using public properties Visual Basic Overloads Public Sub New C public RTAutoVerticalScrollGraph A couple of methods are used to initialize the scroll graph after instantiation InitRTAutoScrollGraph and InitStrings The InitRTAutoScrollGraph method initializes the the x and y scales of the scr
395. ted axis object In addition to the standard font options type size style color etc axis label text can be rotated 360 degrees in one degree increments NumericAxisLabels This class labels the major tick marks of the LinearAxis and LogAxis classes The class supports many predefined and user definable formats including numeric exponent percentage business and currency formats StringAxisLabels This class labels the major tick marks of the LinearAxis and LogAxis classes using user defined strings 68 QCChart2D Class Summary TimeAxisLabels ElapsedTimeAxisLabels PolarAxesLabels AntennaAxesLabels Chart Plot Classes ChartPlot ContourPlot GroupPlot PieChart PolarPlot AntennaPlot SimplePlot This class labels the major tick marks of the associated TimeAxis object The class supports many time 23 59 59 and date 5 17 2001 formats It is also possible to define custom date time formats This class labels the major tick marks of the associated ElapsedTimeAxis object The class supports HH MM SS and MM SS formats with decimal seconds out to 0 00001 i e 12 22 43 01234 It also supports a cumulative hour format 101 51 22 and a couple of day formats 4 5 51 22 AD 5 51 22 This class labels the major tick marks of the associated PolarAxes object The x axis is labeled from 0 0 to the polar scale magnitude and the circular axis is labeled counter clockwise from 0 to 360 degrees starting at 3 00
396. ter rendering of physical coordinate values to working coordinate values for a parametric 2D coordinate system The attribute class encapsulates the most common attributes line color fill color line style line thickness etc for a chart object The coordinate transform classes use the auto scale classes to establish the minimum and maximum values used to scale a 2D coordinate system The axis classes also use the auto scale classes to establish proper tick mark spacing values The chart object classes includes all objects placeable in a chart That includes axes axes labels plot objects line plots bar graphs scatter plots etc grids titles backgrounds images and arbitrary shapes These classes permit the user to create and move data cursors move plot objects display tooltips and select data points in all types of graphs These classes render the chart image to a printer to a variety of file formats including JPEG and BMP or to a WPF System Windows Media Imaging object 14 Class Architecture Miscellaneous utility classes Other classes use these for data storage file I O and data processing For each of these categories see the associated description in the QCChart2D manual The Real Time Graphics Tools for WPF classes are in addition to the ones above They are summarized below Real Time Graphics Tools for WPF Class Summary Process Variable and Alarms Single Value Indicators Multiple Value
397. tesianCoordinates class and implements a coordinate system used to plot polar coordinate data This class is a subclass of the CartesianCoordinates class and implements a coordinate system used to plot antenna coordinate data The antenna coordinate system differs from the more common polar coordinate system in that the radius can have plus minus values the angular values are in degrees and the angular values increase in the clockwise direction This class consolidates the common line and fill attributes as a single class Most of the graph objects have a property of this class that controls the color line thickness and fill QCChart2D Class Summary 59 attributes of the object The ChartGradient class expands the number of color options available in the ChartAttribute class ChartAttribute This class consolidates the common line and fill attributes associated with a GraphObj object into a single class ChartGradient A ChartGradient can be added to a ChartAttribute object defining a multicolor gradient that is applied wherever the color fill attribute is normally used Auto Scaling Classes AutoScale LinearAutoScale LogAutoScale TimeAutoScale ElapsedTimeAutoScale Usually programmers do not know in advance the scale for a chart Normally the program needs to analyze the current data for minimum and maximum values and create a chart scale based on those values Auto scaling and the creation of appropriate axes with endpoints at
398. the GraphFormat property 0 2 to set the format Below you will find a brief description of the differences between the formats 306 Auto Indicator Classes Altimeter AAT 9 1 d 227 s Format 0 dispalys a two needle dial with a scale range of 0 to 10 with a tag string at the top of the windows and a numeric panel meter above the needle pivot point The internal RTComboProcessVar object assigns the update value to the first longest of the two meter needles and the update value 10 to the second smaller of the two needles Format 1 dispalys a three needle dial with a scale range of 0 to 10 with a tag string at the top of the windows and a numeric panel meter above the needle pivot point The internal RTComboProcessVar object assigns the update value to the first longest of the three meter needles the update value 10 to the second middle of the three needles and the update value 100 to the third shortest of the three needles Auto Indicator Classes 307 Electric Meter Format 2 dispalys a three needle dial with a scale range of 0 to 100 with a tag string at the top of the windows and a numeric panel meter above the needle pivot point The internal RTComboProcessVar object assigns the update value to the first longest of the three meter needles the update value 100 to the second middle of the three needles and the update value 10000 to the third shortest of the three needles
399. tion can take place entirely in the behind code of the windows XAML file or it be done in a separate class created for that purpose Almost all of our examples use a separate class to initialize the ChartView object This keeps the code more modular and the Window file much easier to read In the behind code example below extracted from our BarApplicationl example the ChartView object variable name barAppl in the example is initialized using the class BarIndicator1 The BarIndicator1 class adds the coordinate systems axes bars and text to the barAppl object turning it into requisite chart namespace WpfChartApplicationl public partial class Windowl Window BarIndicatorl bal null public Windowl InitializeComponent InitializeCharts void InitializeCharts bal new BarIndicatorl barAppl ChartObj RT BAR SOLID SUBTYPE barAppl PreferredSize new Size 300 250 Real Time Graphics Tools for WPF Dependencies The QCRTGraph for WPF class library is self contained It uses only standard classes that ship with the Microsoft Net API The software uses the major Net WPF namespaces listed below Introduction 5 System Windows Provides several important Windows Presentation Foundation WPF base element classes various classes that support the WPF property system and event logic and other types that are more broadly consumed by the WPF core and framework System System Windows Automation Provides support f
400. tips Data Cursor ss vis unitaire estet 89 90 94 Dataset classes 13 57 70 71 94 97 98 DatasetViewer 300 301 302 303 304 306 Dimension 91 92 94 137 138 256 262 284 288 ElapsedTimeAutoScale sss 61 62 94 ElapsedTimeAxis 63 66 70 ElapsedTimeAxisLabels 69 70 95 ElapsedTimeGroupDataset 57 58 62 94 ElapsedTimeLabel 23 87 88 95 132 133 Elapsed TiraeSc le nici en etes 58 59 ElapsedTimeSimpleDataset 57 58 62 94 ErrorBarPlot EventAutoScale iraniane EvyentAutoScale i4 aae ea t etes 1 EventAxiss occ s OR NS USO A ee oa EventAxis SE i2 EventAxisLabels 4 ee eae ede Dre EventAxisLabels A EventCoordinates 0 2 7 hee Hem eco OC ES EventCoordinates 1 2 EventGroupDataset ie EventGroupDataset A EE EVENtS Caley see Lie rec va a ata dior 2 EventSimpleDataset eee EventSimpleDataset esse 2 FindObj ie decesserit eco dE 89 90 94 FloatingBarPlot 72 75 95 239 Graph object class 141 142 154 155 172 173 177 178 185 186 260 261 264 265 291 295 298 GraphObj 20 46 47 61 62 80 95 112 141 142 154 155 172 173 177 178 185 186 260 261 264 265 280 290 291 294 295 297 298 er Group da
401. tips and select data points in all types of graphs These classes render the chart image to a printer to a variety of file formats including JPEG and BMP or to a WPF System Windows Media Imaging object QCChart2D Class Summary 55 Miscellaneous utility classes Other classes use these for data storage file I O and data processing A summary of each category appears in the following section Chart Window Classes System Windows Controls UserControl ChartView The starting point of a chart is the ChartView class The ChartView class derives from the Net System Windows Controls UserControl class The ChartView class manages a collection of chart objects in a chart and automatically updates the chart objects whenever the control needs to redraw itself Since the ChartView class is a subclass of the UserControl class it can act as a container for other WPF components such as buttons and checkboxes Data Classes ChartDataset SimpleDataset TimeSimpleDataset ElapsedTimeSimpleDataset ContourDataset GroupDataset TimeGroupDataset ElapsedTimeGroupDataset The dataset classes organize the numeric data associated with a plotting object There are two major types of data supported by the ChartDataset class The first is simple xy data where for every x value there is one y value The second data type is group data where every x value can have one or more y values ChartDataset The abstract base class for the other dataset classes
402. tle and subhead shows above above the chart the legend and footer below Example for initializing RTAutoScrollGraph objects The example below extracted from the AutoGraphDemos SimpleAutoScrollUserControll example draws horizontal and vertical scrolling graphs The top horizontal scrolling graph uses a date time scale for the scrolling axis The bottom horizontal scroll graph uses an elapsed time scale for the scrolling axis See the SimpleAutoScrollUserControll xaml file for how the scroll graph is positioned in the underlying window Auto Indicator Classes 321 RTAutoScrollGraph Subhead Text Quarks 14 03 42 14 03 44 14 03 46 14 03 48 14 03 50 Time Channel 1 Channel 2 Channel 3 Footer text Scrolling graph with Date Time x axis scale RTAutoScrollGraph Subhead Text Time Channel 1 Channel 2 Channel 3 Footer text Scrolling graph with elapsed time x axis scale public void InitializeGraph TOP HORIZONTAL GRAPH Date Time scale DateTime starttime DateTime Now DateTime endtime DateTime Now endtime endtime AddSeconds 10 rtAutoScrollGraphl InitRTAutoScrollGraph starttime 0 endtime 15 rtAutoScrollGraphl InitSimpleRTPlotObject ChartObj LINE PLOT Colors Blue Channel 1 322 Auto Indicator Classes rtAutoScrollGraphl InitSimpleRTPlotObject ChartObj LINE PLOT Colors Green Channel 2 rtAutoScrollGraphl InitSimpleRTPlotObject ChartObj SCATTER PLOT
403. tribl new ChartAttribute Colors Yellow 1 DashStyles Solid SimpleScatterPlot lineplotl new SimpleScatterPlot pTransforml null ChartObj CIRCLE attrib l lineplotl SetFastClipMode ChartObj FASTCLIP X RTSimpleSingleValuePlot solarPanelLinePlotl new RTSimpleSingleValuePlot pTransforml lineplotl currentTemperaturel chartVu AddChartObject solarPanelLinePlotl ChartAttribute attrib2 new ChartAttribute Colors Green 1 DashStyles Solid SimpleScatterPlot lineplot2 new SimpleScatterPlot pTransforml null ChartObj SQUARE attrib2 lineplot2 SetFastClipMode ChartObj FASTCLIP X RTSimpleSingleValuePlot solarPanelLinePlot2 new RTSimpleSingleValuePlot pTransforml lineplot2 currentTemperature2 chartVu AddChartObject solarPanelLinePlot2 ChartFont titlefont font14 ChartTitle charttitle new ChartTitle pTransforml titlefont Scroll Application 41 ChartObj CHART HEADER ChartObj CENTER PLOT chartVu AddChartObject charttitle public void InitializeGraph timerl IsEnabled false templowalarml new RTAlarm ChartObj RT ALARM LOWERTHAN 80 templowalarml AlarmMessage Low Alarm templowalarml AlarmSymbolColor Colors Blue templowalarml AlarmTextColor Colors Blue temphighalarml new RTAlarm ChartObj RT ALARM GREATERTHAN 120 temphighalarml AlarmMessage High Alarm temphighalarml AlarmSymbolColor Colors Red temphighalarml AlarmTextColor Colors Red currentTemperat
404. ts the line color for the chart object ight GraphObj Sets the line style for the chart object GraphObj Sets the line width for the chart object ChartObjAttributes inherited FillColor inherited from LineColor inherited from LineStyle inherited from LineWidth inherited from GraphObj PositionType inherited from Get Sets the current position type GraphObj Get Set the rectangle control the size and position of the object Get Set the width of the rectangle Get Set the x value of the shape rectangle Un s 2 DD ve e e Sa Get Set the y value of the shape rectangle Z Order inherited from Sets the z order of the object in the chart Every object GraphObj has a z order value Each z order value does NOT have to be unique If z order sorting is turned on in the ChartView object objects are sorted by z order before they are drawn A complete listing of RTGenShape properties is found in the QCRTGraphWPFCompiledHelpFile chm documentation file located in the doc subdirectory Miscellaneous Shape Drawing 263 Example for drawing RTGenShape objects The example below extracted from the AutoInstrumentPanel example file AutoInstrumentPanelUserControll method InitializeClock draws a circle around the borders of the clock C ChartAttribute attrib2 new ChartAttribute Colors Gray 5 DashStyles Solid Colors White Rectangle2D shaperect new Rectangle2D 0 8 0 025 0 19 0 25 RTGenShape ge
405. ttribl barjust barorient Dim panelmeterattrib As New ChartAttribute Colors SteelBlue 3 DashStyles Solid Colors Black Dim paneltagmeterattrib As New ChartAttribute Colors SteelBlue 0 DashStyles Solid Colors White Dim panelmeter As New RTNumericPanelMeter pTransforml panelmeterattrib panelmeter PanelMeterPosition ChartObj OUTSIDE PLOTAREA MIN panelmeter TextColor Colors SpringGreen panelmeter NumericTemplate TextFont fontl4Numeric panelmeter NumericTemplate DecimalPos 0 panelmeter AlarmIndicatorColorMode ChartObj RT_TEXT BACKGROUND COLOR CHANGE ON ALARM panelmeter PanelMeterNudge New Point2D 0 4 barplot AddPanelMeter panelmeter Alarm Panel Meter Class RTAlarmPanelMeter com quinncurtis chart2dwpf ChartPlot RTPlot RTSingleValueIndicator RTPanelMeter RTAlarmPanelMeter The RTAlarmPanelMeter class displays the alarm state of an RTProcessVar object It pulls alarm text and color information out of the associated RTProcessVar object It 118 Panel Meter Classes contains a template based on the QCChart2D StringLabel class that is used to specify the font and numeric format information associated with the panel meter RTAlarmPanelMeter constructors Visual Basic Overloads Public Sub New _ ByVal transform As PhysicalCoordinates ByVal datasource As RTProcessVar _ ByVal attrib As ChartAttribute _ Overloads Public Sub New _ ByVal transform As PhysicalCoordinates ByVal attrib As ChartAttri
406. tudio project wizard File New Project Visual Basic Projects WPF Application On the left select a project type of Visual Basic Windows Give Using OCRTGraph for WPF to Create Web Applications 363 the project a unique name In our examples wpf folder this example is the WpfRTBrowserApplication1 so give your example a different name such as WPFBrowserApplicationl You will end with a basic WPF based application For purposes of this example the chart will placed in the initial default window New Project Project types Templates NET Framework 3 5 Di E Visual C Visual Studio installed templates Windows e Web ix Windows Forms Application Gel Class Library DocProject QR ASP NET Web Application SA ASP NET Web Service Application Reporting e WPF Application D WPF Browser Application WCF m Console Application EG WCF Service Application Workflow Gel Windows Forms Control Library i Dynamic Data Entities Web Application Other Languages i Dynamic Data Web Application Visual Basic Windows MyTemplates Web FREE DocProject yal DocProject d DocSite Web Application Reporting Ed Search Online Templates WCF Workflow LO Vierial C Windows Presentation Foundation browser application NET Framework 3 5 Name WpfBrowserApplication1 Location E Quinn Curtis WPF Development DotNet QCSPCChart Visual Basic examples wpf Solution Create new Solution IS Create directory for solution Solution Na
407. ual Basic Overloads Public Sub New Ct public RTAutoBarIndicator A couple of methods are used to initialize the bar graph after instantiation InitBarIndicator and InitStrings The InitBarIndicator method initialized the orientation of the bars the format of the bar graph and the bar color Method InitBarIndicator VB Public Sub InitBarIndicator _ orientation As Integer bargraphformat As Integer _ colr As Color C public void InitBarIndicatori int orientation int bargraphformat Color volt Parameters orientation Specifies the orientation of the chart ChartObj VERT_DIR or ChartObj HORIZ DIR bargraphformat Specifies the bar graph format 0 3 colr The color of the bar The InitStrings method initialized the tag and units strings Method InitStrings Auto Indicator Classes 275 VB Public Sub InitStrings title As String _ units As String C public void InitStrings string title string units Use the UpdateIndicator method to update the bar indicator with new data Method UpdateIndicator VB Public Sub UpdateIndicator _ value As Double _ updatedraw As Boolean CH public void UpdateIndicator double value bool updatedraw Parameters value Update the indicator channel with this value updatedraw True and the indicator is immediately updated Selected Public Instance Properties Name Description AlarmIndicator Get a reference to the RTAlarmIndicator
408. ual Basic Overloads Public Sub New _ ByVal transform As PhysicalCoordinates ByVal rect As Rectangle2D _ ByVal corner As Double ByVal shape As Integer _ ByVal postype As Integer _ C public RTGenShape PhysicalCoordinates transform Rectangle2D rect double corner int shape int postype i Parameters transform The coordinate system for the new RTGenShape object rect The source rectangle corner The corner radius of the rounded rectangle shape The shape of the RTGenShape object Use one of the generalized shape constants RT SHAPE RECTANGLE RT SHAPE ROUNDEDRECTANGLE RT SHAPE ELLIPSE postype Specifies what coordinate system the coordinates reference Use one of the position type constants DEV POS PHYS POS POLAR POS NORM GRAPH POS NORM PLOT POS 262 Miscellaneous Shape Drawing Selected Public Instance Properties Get Set the aspect ratio correction mode for the RT SHAPE ELLIPSE shape NO ASPECT RATIO CORRECTION FIXED X ASPECT RATIO CORRECTION FIXED Y ASPECT RATIO CORRECTION Sets the attributes for a chart object using a ChartAttribute object Get Set the corner radius of the rounded rectangle Sets the fill color for the chart object from GraphObj ornerRadius GraphObj GenShape Get Set the shape control property genShape Use one of the generalized shape constants RT SHAPE RECTANGLE RT SHAPE ROUNDEDRECTANGLE RT SHAPE ELLIPSE Get Set the height of the shape rectangle Se
409. uble value Dim formControlTrackBar2 As New RTFormControlPanelMeter pTransform2 treadmillElevationTrackbar attribl formControlTrackBar2 RTDataSource treadmillElevation formControlTrackBar2 SetLocation 0 0 0 formControlTrackBar2 FormControlSize New Dimension 1 0 1 0 Dim panelmeter3 As New RTNumericPanelMeter pTransform2 runnersPace panelmeterattrib panelmeter3 NumericTemplate TextFont trackbarfont panelmeter3 NumericTemplate DecimalPos 1 panelmeter3 PanelMeterPosition ChartObj RIGHT REFERENCED TEXT panelmeter3 SetPositionReference formControlTrackBar2 formControlTrackBar2 AddPanelMeter panelmeter3 Buttons Track Bars and Other Form Control Classes 229 Dim panelmeter4 As New RTStringPanelMeter pTransform2 runnersPace panelmetertagattrib ChartObj RT_TAG STRING panelmeter4 SetPositionReference panelmeter3 panelmeter4 StringTemplate TextFont trackbarTitlefont panelmeter4 PanelMeterPosition ChartObj BELOW REFERENCED TEXT panelmeter4 TextColor Colors Black formControlTrackBar2 AddPanelMeter panelmeter4 chartVu AddChartObject formControlTrackBar2 End Sub Example for multiple RTControlTrackBar controls in an RTFormControlGrid The example below extracted from the PIDControlTuner example creates four RTControlTrackBar controls The trackbars are added to an RTFormControlGrid in order to position them as a logical group Note If an RTNumericPanelMeter template is applied to the RTControlTrac
410. uch as the coordinate conversion classes All chart objects have certain information in common This includes instances of ChartAttribute and PhysicalCoordinates classes The ChartAttribute class contains basic color line style and gradient information for the object while the PhysicalCoordinates maintains the coordinate system used by object The majority of classes in the library derive from the GraphObj class each class a specific charting object such as an axis an axis label a simple plot or a group plot Add GraphObj derived objects axes plots labels title etc to a graph using the ChartView AddChartObject method GraphObj This class is the abstract base class for all drawable graph objects It contains information common to all chart objects This class includes references to instances of the ChartAttribute and PhysicalCoordinates classes The ChartAttribute class contains basic color line style and gradient information for the object while the PhysicalCoordinates maintains the coordinate system used by object The majority of classes in the library derive from the GraphObj class each class a specific charting object such as an axis an axis label a simple plot or a group plot Background This class fills the background of the entire chart or the plot area of the chart using a solid color a color gradient or a texture Axis Classes QCChart2D Class Summary 61 Axis LinearAxis PolarAxes AntennaAxes ElapsedTimeAxis
411. ummary 75 Video Game Usage by Age Group F4 2 EF Ej 5 E o z S a 40 Age Group The height and width of the bars in a Histogram plot carries information HistogramPlot This class is a concrete implementation of the GroupPlot class and displays histogram plots A histogram plot is a collection of rectangular objects with independent widths and heights specified using the values of the associated group dataset The histogram bars share a common base value Sales vs Cost Gap Millions The Line Gap chart is useful for emphasizing the difference between two lines LineGapPlot This class is a concrete implementation of the GroupPlot class A line gap chart consists of two lines plots where a contrasting color fills the area between the two lines highlighting the difference 76 QCChart2D Class Summary MultiLinePlot OHLCPlot Collector Current mA Characteristic Curves for Bipolar Transistor 10 Collector Emitter Voltage The MultLinePlot will plot a multiple y vectors vs a single x vector This class is a concrete implementation of the GroupPlot class and displays group data in multi line format A group dataset with four groups will display four separate line plots The y values for each line of the line plot represent the y values for each group of the group dataset Each line plot share the same x values of the group dataset Daily Stock Price Volume NASDAQ
412. upMultiValuePlot The RTGroupMultiV aluePlot plot class uses a template based on the QCChart2D GroupPlot class to create a real time plot that displays a collection of RTProcessVar objects as a group plot in a scrolling graph format RTGroupMultiValuePlot constructors Visual Basic Overloads Public Sub New ByVal transform As PhysicalCoordinates ByVal plottemplate As GroupPlot _ ByVal datasource As RTProcessVar _ C public RTGroupMultiValuePlot PhysicalCoordinates transform GroupPlot plottemplate RTProcessVar datasource Parameters transform The coordinate system for the new RTGroupMultiPlot object plottemplate A template defining the group plot object datasource An array of RTProcessVar objects one for each group in the group plot template Selected Public Instance Properties EndOfPlotLineMarker Get Set The end of plot marker type Use one of the Marker marker type constants MARKER NULL MARKER VLINE MARKER HLINE MARKER HVLINE MarkerGroupNumber Get Set the group number that is used for the end of plot line marker PlotTemplate Get Set the group plot template A complete listing of RTGroupMultiValuePlot properties is found in the QCRTGraphWPFCompiledHelpFile chm documentation file located in the doc subdirectory Example for a multi channel scrolling line plot The example below extracted from the Dynamometer example file DynamometerUserControll method InitializeEngine2ScrollGraph c
413. urel new RTProcessVar Temp 1 new ChartAttribute Colors Green 1 0 DashStyles Solid Colors Green Using QCRTGraph for WPF to Create Windows Applications 339 Hr currentTemperature Hr currentTemperature Hr currentTemperature currentTemperature currentTemperature Hr currentTemperature currentTemperature Important Hr MinimumValue 20 MaximumValue 200 DefaultMinimumDisplayValue 0 DefaultMaximumDisplayValue 150 SetCurrentValue currentTemperatureValuel AddAlarm templowalarml AddAlarm temphighalarml enables historical data collection for scroll graphs currentTemperaturel DatasetEnableUpdate true Hr currentTemperaturel AlarmTransitionEventHandler new RTAlarmEventDelegate TemperatureAlarmEventProc Hr templowalarm2 templowalarm2 AlarmMessage Low Alarm templowalarm2 AlarmSymbolColor Colors Blue templowalarm2 AlarmTextColor Colors Blue temphighalarm2 temphighalarm2 AlarmMessage High Alarm temphighalarm2 AlarmSymbolColor Colors Red temphighalarm2 AlarmTextColor Colors Red new RTAlarm ChartObj RT ALARM LOWERTHAN 80 new RTAlarm ChartObj RT ALARM GREATERTHAN 120 lemperature2 new RTProcessVar Temp 2 new ChartAttribute Colors Green 1 0 current DashStyles Solid Colors Green currentTemperature2 MinimumValue 20 currentTemperature2 MaximumValue 200 RTAlarmEvent currentTemperature2 DefaultM
414. ustomized in the behind code of the XAML form New Features found in the 2 3 version of QCRTGraph All of the new features found in the 2 3 version of QCRTGraph were added to QCChart2D primarily a new collection of event based charting classes The real time scrolling routines RTScrollFrame will automatically work with the new event base coordinate systems Event Based Charting A new set of classes have been added in support of new event based plotting system In event based plotting the coordinate system is scaled to the number of event objects Each event object represents an x value and one or more y values The x value can be time based or numeric based while the y values are numeric based Since an event object can represent one or more y values for a single x value it can be used as the source for simple plot types simple line plot simple bar plot simple scatter plot simple line marker plot and group plot types open high low close plots candlestick plots group bars stacked bars etc Event objects can also store custom data tooltips and x axis strings The most common use for event based plotting will be for displaying time based data which is discontinuous financial markets data for example In financial markets the number trading hours in a day may change and the actual trading days Weekends holidays and unused portions of the day can be excluded from the plot scale producing continuous plots of discontinuous data
415. vate currentTemperatureValuel As Double 110 0 Private currentTemperaturel As RTProcessVar Private currentTemperatureValue2 As Double 100 0 Private currentTemperature2 As RTProcessVar Private scrollFrame As New RTScrollFrame Private templowalarml As RTAlarm Private temphighalarml As RTAlarm Private templowalarm2 As RTAlarm Private temphighalarm2 As RTAlarm Private font12 As New ChartFont Microsoft Sans Serif 12 FontStyles Normal Private font14 As New ChartFont Microsoft Sans Serif 14 FontStyles Normal Private fontl4Numeric As New ChartFont Digital SF 14 FontStyles Normal Private chartVu As ChartView Private scrollMode As Integer 0 Public Sub New ByVal chartvu 1 As ChartView chartVu chartvu 1 InitializeGraph End Sub Private Sub InitializeScrollGraph Dim x1 As Double 0 1 Dim yl As Double Dal Dim x2 As Double 0 9 Dim y2 As Double 0 9 Dim axisFont As ChartFont font12 Dim startTime As New ChartCalendar Dim endTime As New ChartCalendar endTime Add ChartCalendar SECOND 60 Dim pTransforml As New TimeCoordinates startTime currentTemperaturel DefaultMinimumDisplayValue endTime currentTemperaturel DefaultMaximumDisplayValue pTransforml SetGraphBorderDiagonal xl yl x2 y2 Dim graphbackground As New Background pTransforml ChartObj GRAPH BACKGROUND Colors White chartVu AddChartObject graphbackground Dim plotbackground As New Background pTransforml ChartObj
416. ve text for that symbol The StandardLegend class uses objects of this type as legend items This class is the legend item class for bubble plots Each legend item manages a circle and descriptive text specifying the value of a bubble of this size The BubblePlotLegend class uses objects of this type as legend items This class is a concrete implementation of the Legend class and it is the legend class for all plot objects except for bubble plots The legend item objects display in a row or column format Each legend item contains a symbol and a descriptive string The symbol normally associates the legend item to a particular plot object and the descriptive string describes what the plot object represents This class is a concrete implementation of the Legend class and it is a legend class used exclusively with bubble plots The legend item objects display as offset concentric circles with descriptive text giving the key for the value associated with a bubble of this size Grid lines are perpendicular to an axis extending the major and or minor tick marks of the axis across the width or height of the plot area of the chart ChartGrid This class defines the grid lines associated with an axis Grid lines are perpendicular to an axis extending the major and or minor tick marks of the axis across the width or QCChart2D Class Summary 85 height of the plot area of the chart This class works in conjunction with the LinearAxis LogAxis
417. view class Data classes Scale transform classes The chart view class is a System Windows Controls UserControl subclass that manages the graph objects placed in the graph There are data classes for simple xy and group data types There are also data classes that handle System DateTime date time data and contour data The scale transform classes handle the conversion of physical coordinate values to working coordinate values for a single dimension Coordinate transform classes The coordinate transform classes handle the conversion Attribute class Auto Scale classes Charting object classes Mouse interaction classes File and printer rendering of physical coordinate values to working coordinate values for a parametric 2D coordinate system The attribute class encapsulates the most common attributes line color fill color line style line thickness etc for a chart object The coordinate transform classes use the auto scale classes to establish the minimum and maximum values used to scale a 2D coordinate system The axis classes also use the auto scale classes to establish proper tick mark spacing values The chart object classes includes all objects placeable in a chart That includes axes axes labels plot objects line plots bar graphs scatter plots etc grids titles backgrounds images and arbitrary shapes These classes permit the user to create and move data cursors move plot objects display tool
418. wDefinition Height 10 gt lt Grid RowDefinitions gt lt Grid ColumnDefinitions gt lt ColumnDefinition Width 10 gt lt ColumnDefinition Width 10 gt lt ColumnDefinition Width 10 gt lt ColumnDefinition Width 10 gt 302 Auto Indicator Classes ColumnDefinition Width 10 gt lt Grid ColumnDefinitions gt lt my2 RTAutoMeterIndicator Margin 2 2 2 2 Grid Row 0 Grid Column D gt lt my2 RTAutoMeterIndicator Margin 2 2 2 2 Grid Row 0 Grid Column 1 gt lt my2 RTAutoMeterIndicator Margin 2 2 2 2 Grid Row 0 Grid Column 2 gt lt my2 RTAutoMeterIndicator Margin 2 2 2 2 Grid Row 0 Grid Column 3 gt lt my2 RTAutoMeterIndicator Margin 2 2 2 2 Grid Row 1 Grid Column 0 gt lt my2 RTAutoMeterIndicator Margin 2 2 2 2 Grid Row 1 Grid Column 1 gt lt my2 RTAutoMeterIndicator Margin 2 2 2 2 Grid Row 1 Grid Column 2 gt lt my2 RTAutoMeterIndicator Margin 2 2 2 2 Grid Row 1 Grid Column 3 gt lt my2 RTAutoMeterIndicator Margin 2 2 2 2 Grid Bow 2 Grid Columa 0 ZS lt my2 RTAutoMeterIndicator Margin 2 2 2 2 Grid Row 2 Grid Column 1 gt lt my2 RTAutoMeterIndicator Margin 2 2 2 2 Grid Row 2 Grid Column 2 gt lt my2 RTAutoMeterIndicator Margin 2 2 2 2 Grid Row 2 Grid Column 3 gt lt StackPanel Margin 20 20 10 10 Grid Row 2 lt CheckBox Name checkB
419. wer chartVu Nothing currentTemperaturel rows columns startindex rtProcessVarViewerl UseStripedGridBackground True rtProcessVarViewerl GridCellFont font12 rtProcessVarViewerl AddProcessVar currentTemperature2 Set custom decimal precision for each row rtProcessVarViewerl SetFormatDecimalPos 0 0 rtProcessVarViewerl SetFormatDecimalPos 1 1 rtProcessVarViewerl SetFormatDecimalPos 2 2 270 Process Variable Viewer End Sub Vertical Orientation DatasetViewer example extracted from the example program ProcessVarDataTables ElapsedTimeVerticalScrolling Window x Class ProcessVarDataTables Window1 xmlns http schemas microsoft com winfx 2006 xaml presentation xmlns x http schemas microsoft com winfx 2006 xaml Title Window1 Height 600 Width 1000 xmlns my clr namespace com quinncurtis chart2dwpf assembly QCChart2DWPF3 xmlns my2 clr namespace com quinncurtis rtgraphwpf assembly QCRTGraphWPF3 gt lt Grid Name grid1 gt lt TabControl Margin 4 7 8 13 Name tabControl1 gt Tabltem Header Vertical RTProcessVarDataTable Name tabItem1 gt lt Grid gt lt Grid ColumnDefinitions gt lt ColumnDefinition Width 40 gt lt ColumnDefinition Width 15 gt lt Grid ColumnDefinitions gt my ChartView Margin 18 11 16 6 Name elapsedTimeVerticalScrollingApp1 Grid Column 0 gt lt my2 RTProcessVarViewer Margin 18 11 16 6 Name rtProcessVarViewerApp1 Grid Column 1 gt lt Grid gt lt Ta
420. ws xaml vb See the QCChart2D UserControlChartExample3 program for an example of this technique 21 Using Real Time Graphics Tools for WPF to Create Web Applications Using WPF it is very easy to create web applications program which run on servers When developing your application you don t need a ful blown server you can run your applications on the server built into the VS 2008 and higher compilers Nothing special needs to be done Just load the project and run Not all browsers support WPF web applications though At the time of this writing only Microsoft IE and Foxfire will run WPF applications though others may follow Visual C for Net Creating an WPF web application is almost identical to creating a WPF workstation applications If you do not already have an application program project create one using the Visual Studio project wizard File New Project Visual C Projects WPF Browser Application On the left select a project type of Visual C Give the project a unique name In our examples wpf folder this example is the WpfRTBrowserApplicationl so give your example a different name such as WpfBrowserApplicationl You will end with a basic WPF based application For purposes of this example the chart will placed in the initial default window H New Project Templates NET Framework 3 5 x Eal visual Studio installed templates Windows Web EA Windows Forms Application E Class Library DocProject
421. x public void InitRTAutoScrollGraph double minx double miny double maxx double maxy int scaletype Parameters minx The starting x value as a DateTime ChartCalendar double or TimeSpan value depending on which of the overloads is used miny The starting y value maxx The ending x value as a DateTime ChartCalendar double or TimeSpan value depending on which of the overloads is used maxy The ending y value The InitStrings method initialized the title and units strings Method InitStrings 316 Auto Indicator Classes VB public void InitStrings string title string units C public void InitStrings string title string units Parameters title The title string units The units string Add a channel a plot object to the scrolling graph using the AddRTPlotObject Method AddRTPlotObject VB Public Sub AddRTPlotObject _ plottype As Integer _ colr As Color _ tag As String _ C public void AddRTPlotObject int plottype Color colr string tag Parameters plottype Specifies the simple plot type LINE MARKER PLOT LINE PLOT BAR PLOT SCATTER PLOT colr The primary color of the plot object tag The tag name associated with the plot object Use the UpdateIndicator method to update the scrolling graph with new data Method UpdateIndicator VB Public Sub UpdateIndicator _ values As Double _ updatedraw As Boolean Public Sub UpdateIndicator
422. y brokerage firm web site A related application would involve the second by second update of real time stock market data as it streams from a real time data source The software that is used for the display of historical data is seldom used to display real time data because its data structures are not designed for incremental updates and its Introduction 3 rendering routines are not fast enough to convert the data to a chart within the allowable display update interval The Real Time Graphics Tools for WPF integrates the QCChart2D charting software with real time data structures and specialized rendering routines It is designed for on the fly rendering of the real time data using new specialized classes for scrolling graphs gauges bar graphs meters annunciators and text Plot objects created using the QCChart2D classes can be freely mixed with the new Real Time Graphics Tools for WPF classes Advanced user interface features such as zooming and tool tips can used with real time scrolling charts WPF Background Initially the primary graphics text rendering and user interface framework for programmers using the Net languages was GDI an evolutionary adaptation of the older Windows GDI programming model in place since Windows 1 0 GDI under Net is extremely successful and there are no indications Microsoft plans to end support for it in subsequent releases of Visual Studio But Microsoft has long had an alternative graphics framework
423. ysical coordinates and this information is stored and optionally used to rescale the chart scale and all axis objects that reference the chart scale If four axis objects reference a single chart scale for example when axes bound a chart on all for sides all four axes re scale to match the new chart scale In real time applications do not update the screen with the ChartView UpdateDraw method from another thread while in the middle of a zoom i e while the XOR zoom rectangle is on the screen This messes up the XOR drawing of the zoom rectangle because the UpdateDraw method will overwrite and erase any previously drawn portion of the zoom rectangle You must place a check to see if the zoom object is active before the timer based call of the ChartView UpdateDraw method to make sure that you are not in the middle of a zoom operation Extracted from the RTStockDisplay example program if zoomObj ZoomObjActive this UpdateDraw ChartZoom constructor The constructor below creates a zoom object for a single chart coordinate system Visual Basic Overloads Public Sub New _ ByVal component As ChartView _ ByVal transform As PhysicalCoordinates ByVal brescale As Boolean C public ChartZoom 248 Zooming ChartView component PhysicalCoordinates transform bool brescale component A reference to the ChartView object that the chart is placed in transform The PhysicalCoordinates object associated with

Download Pdf Manuals

image

Related Search

Related Contents

Samsung F508 黑色 User Manual  ZScope M-Class Digital Storage Oscilloscope Soft Front Panel  Human Factor X ELISA Kit  Sencor SBG 400 barbecue  Certification Report  Samsung 592-89452 User Manual  LevelOne 1.3-Megapixel Day/Night P/T PoE Network Camera  NOTICE TRILINGUE LS28 - LS16 _fra ang alld_  Scarica il Modello  ントの - 福岡労働局  

Copyright © All rights reserved.
Failed to retrieve file