Exemple #1
0
void ViewPlotLineYX( View view, double slope, double intercept) {

  double	x1, x2, y1, y2;

  if ( view->user_top > view->user_bottom ) {

    y1 = view->user_bottom;
    x1 = slope * y1 + intercept;
    if (x1 > view->user_right) {
      x1 = view->user_right;
      y1 = (x1 - intercept) / slope;
    }
    if (x1 < view->user_left) {
      x1 = view->user_left;
      y1 = (x1 - intercept) / slope;
    }
		
    y2 = view->user_top;
    x2 = slope * y2 + intercept;
    if (x2 > view->user_right) {
      x2 = view->user_right;
      y2 = (x2 - intercept) / slope;
    }
    if (x2 < view->user_left) {
      x2 = view->user_left;
      y2 = (x2 - intercept) / slope;
    }

  }
  else {

    y1 = view->user_top;
    x1 = slope * y1 + intercept;
    if (x1 > view->user_right) {
      x1 = view->user_right;
      y1 = (x1 - intercept) / slope;
    }
    if (x1 < view->user_left) {
      x1 = view->user_left;
      y1 = (x1 - intercept) / slope;
    }
		
    y2 = view->user_bottom;
    x2 = slope * y2 + intercept;
    if (x2 > view->user_right) {
      x2 = view->user_right;
      y2 = (x2 - intercept) / slope;
    }
    if (x2 < view->user_left) {
      x2 = view->user_left;
      y2 = (x2 - intercept) / slope;
    }

  }
		
  ViewLine(view, x1, y1, x2, y2);
	
}
Exemple #2
0
void ViewPlotLine (View view, double slope, double intercept) {

  double	x1, x2, y1, y2;
	
  if ( view->user_top > view->user_bottom ) {

    x1 = view->user_left;
    y1 = slope * x1 + intercept;
    if (y1 > view->user_top) {
      y1 = view->user_top;
      x1 = (y1 - intercept) / slope;
    }
    if (y1 < view->user_bottom) {
      y1 = view->user_bottom;
      x1 = (y1 - intercept) / slope;
    }
		
    x2 = view->user_right;
    y2 = slope * x2 + intercept;
    if (y2 > view->user_top) {
      y2 = view->user_top;
      x2 = (y2 - intercept) / slope;
    }
    if (y2 < view->user_bottom) {
      y2 = view->user_bottom;
      x2 = (y2 - intercept) / slope;
    }
		
  }
  else {

    x1 = view->user_left;
    y1 = slope * x1 + intercept;
    if (y1 < view->user_top) {
      y1 = view->user_top;
      x1 = (y1 - intercept) / slope;
    }
    if (y1 > view->user_bottom) {
      y1 = view->user_bottom;
      x1 = (y1 - intercept) / slope;
    }
		
    x2 = view->user_right;
    y2 = slope * x2 + intercept;
    if (y2 < view->user_top) {
      y2 = view->user_top;
      x2 = (y2 - intercept) / slope;
    }
    if (y2 > view->user_bottom) {
      y2 = view->user_bottom;
      x2 = (y2 - intercept) / slope;
    }
  }

  ViewLine(view, x1, y1, x2, y2);
	
}
Exemple #3
0
void ProcessChannel(ChannelSearchInfo * info)
{
	switch (info->type)
	{
	case CH_LINE_TYPE:
		ViewLine(info->hChannel);
		break;
	case CH_SPECTRUM_TYPE:
		ViewSpectrum(info->hChannel);
		break;
	case CH_DOTS_TYPE:
		ViewDots(info->hChannel);
		break;
	case CH_TEXT_TYPE:
		ViewText(info->hChannel);
		break;
	default:
		ViewData(info->hChannel);
	}	
}