749N/A/*********************************************************** 749N/ACopyright (c) 1987, 1988, 1994 X Consortium 749N/APermission is hereby granted, free of charge, to any person obtaining a copy 749N/Aof this software and associated documentation files (the "Software"), to deal 749N/Ain the Software without restriction, including without limitation the rights 749N/Ato use, copy, modify, merge, publish, distribute, sublicense, and/or sell 749N/Acopies of the Software, and to permit persons to whom the Software is 749N/Afurnished to do so, subject to the following conditions: 749N/AThe above copyright notice and this permission notice shall be included in 749N/Aall copies or substantial portions of the Software. 749N/ATHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 749N/AIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 749N/AFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 749N/AX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 749N/AAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 749N/ACONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 749N/AExcept as contained in this notice, the name of the X Consortium shall not be 749N/Aused in advertising or otherwise to promote the sale, use or other dealings 749N/Ain this Software without prior written authorization from the X Consortium. 749N/ACopyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts. 749N/APermission to use, copy, modify, and distribute this software and its 749N/Adocumentation for any purpose and without fee is hereby granted, 749N/Aprovided that the above copyright notice appear in all copies and that 749N/Aboth that copyright notice and this permission notice appear in 749N/Asupporting documentation, and that the name of Digital not be 749N/Aused in advertising or publicity pertaining to distribution of the 749N/Asoftware without specific, written prior permission. 749N/ADIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING 749N/AALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL 749N/ADIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR 749N/AANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 749N/AWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, 749N/AARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 749N/A******************************************************************/ 749N/A /* class_name */ "StripChart",
749N/A {
/* Simple class fields */ 749N/A/**************************************************************** 749N/A ****************************************************************/ 749N/A/* Function Name: CreateGC 749N/A * Description: Creates the GC's 749N/A * Arguments: w - the strip chart widget. 749N/A * which - which GC's to create. 749N/A/* Function Name: DestroyGC 749N/A * Description: Destroys the GC's 749N/A * Arguments: w - the strip chart widget. 749N/A * which - which GC's to destroy. 749N/A * NOTE: This function really needs to recieve graphics exposure 749N/A * events, but since this is not easily supported until R4 I am 749N/A * going to hold off until then. 749N/A /* Get the value, stash the point and draw corresponding line. */ 749N/A * Keep w->strip_chart.max_value up to date, and if this data 749N/A * point is off the graph, change the scale to make it fit. 749N/A * Fill in the graph lines we just painted over. 749N/A/* Blts data according to current size, then redraws the stripChart window. 749N/A * Next represents the number of valid points in data. Returns the (possibly) 749N/A * adjusted value of next. If next is 0, this routine draws an empty window 749N/A * (scale - 1 lines for graph). If next is less than the current window width, 749N/A * the returned value is identical to the initial value of next and data is 749N/A * unchanged. Otherwise keeps half a window's worth of data. If data is 749N/A * changed, then w->strip_chart.max_value is updated to reflect the 749N/A /* Compute the minimum scale required to graph the data, but don't go 749N/A lower than min_scale. */ 749N/A /* Draw data point lines. */ 749N/A i, y, (
unsigned int)
1,
749N/A /* Draw graph reference lines */ 749N/A/* Function Name: MoveChart 749N/A * Description: moves the chart over when it would run off the end. 749N/A * Arguments: w - the load widget. 749N/A * Since we just lost some data, recompute the 749N/A * w->strip_chart.max_value. 749N/A /* Draw graph reference lines */ 749N/A/* Function Name: SetPoints 749N/A * Description: Sets up the polypoint that will be used to draw in 749N/A * Arguments: w - the StripChart widget. 749N/A /* Draw graph reference lines into clip mask */