当前位置: 首页>>代码示例>>C++>>正文


C++ set_display函数代码示例

本文整理汇总了C++中set_display函数的典型用法代码示例。如果您正苦于以下问题:C++ set_display函数的具体用法?C++ set_display怎么用?C++ set_display使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了set_display函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: init_value

void SciCalc::factorial() {
  double lg, alpha;

  /* uses gamma functions to get result for non-integer values */

	alpha = value[top] + 1.0;
	if ((floor(alpha) == alpha)&&(alpha <= 0.0))
	{
		init_value(0);
		leddisplay->label("Error: -ve integer ");
		leddisplay->redraw();
	}
	else
	if (alpha > 32)
	 {
		lg = exp(gammaln(alpha));
    		value[top] = lg;
   		 set_display(value[top],NORM);
		ready = 1;
	}
	else
	if (alpha > 1.0)
	{
		int n = (int)truncf(alpha);
		lg = 1.0;
		for (int i = 1; i <n; i++) lg *= i;
		value[top] = lg;
		set_display(value[top],NORM);
		ready = 1;
	}
}
开发者ID:GustavoMOG,项目名称:ede,代码行数:31,代码来源:SciCalc.cpp

示例2: set_display

void SciCalc::exponent_pi() {
  if ((value[top] == 0.0) || (ready)) {
    value[top] = M_PI;
    set_display(value[top],NORM);
    ready = 1;
  }
  else if ((! emode) && (base == 10)) {
    emode = 1;
    exponent = 0;
    mantissa = value[top];
    set_display(mantissa,EXP);
  }
}
开发者ID:GustavoMOG,项目名称:ede,代码行数:13,代码来源:SciCalc.cpp

示例3: log

void SciCalc::cb_but_ln_i(Fl_Button*, void*) {
  if (! inv)
	{
		value[top] = log(value[top]);
		set_display(value[top],NORM);
		ready = 1;
	}
	else
	{
		value[top] = exp(value[top]);
		set_display(value[top],NORM);
		ready = 1;
	};
}
开发者ID:GustavoMOG,项目名称:ede,代码行数:14,代码来源:SciCalc.cpp

示例4: truncf

void SciCalc::cb_but_int_i(Fl_Button*, void*) {
  if (! inv)
	{
		value[top] = truncf(value[top]);
		set_display(value[top],NORM);
		ready = 1;
	}
	else
	{
		value[top] = value[top] - truncf(value[top]);
		set_display(value[top],NORM);
		ready = 1;
	};
}
开发者ID:GustavoMOG,项目名称:ede,代码行数:14,代码来源:SciCalc.cpp

示例5: set_display

void rocvfd_t::update_display()
{
	for (int i =0; i<16; i++)
	{
		if (m_reversed)
		{
			m_outputs[i] = set_display(m_chars[15-i]);
		}
		else
		{
			m_outputs[i] = set_display(m_chars[i]);
		}
		output_set_indexed_value("vfd", (m_port_val*16) + i, m_outputs[i]);
	}
}
开发者ID:broftkd,项目名称:mess-svn,代码行数:15,代码来源:roc10937.c

示例6: fec

void
fec(u_char *command, u_char *args, u_char *subargs)
{
	u_char	*pointer;
	u_char	*list = NULL;
	u_char	*var = NULL;
	u_char	stuff[2];
	int	args_flag = 0;
	unsigned display;
	u_char	*sa, *todo;

	list = next_expr(&args, '(');		/* ) */
	if (list == NULL)
	{
		yell ("FEC: Missing List for /FEC");
		return;
	}

	sa = subargs ? subargs : empty_string();
	list = expand_alias(NULL, list, sa, &args_flag, NULL);
	pointer = list;

	var = next_arg(args, &args);
	args = my_index(args, '{');		/* } */

	if ((todo = next_expr(&args, '{')) == NULL)
	{
		yell ("FE: Missing }");
		return;
	}

	stuff[1] = '\0';

	while (*pointer)
	{
		display = set_display_off();
		stuff[0] = *pointer++;
		add_alias(VAR_ALIAS, var, stuff);
		set_display(display);
		parse_line(NULL, todo, 
		    subargs ? subargs : empty_string(), 0, 0, 0);
	}
	display = set_display_off();
	delete_alias(VAR_ALIAS, var);
	set_display(display);

	new_free(&list);
}
开发者ID:choppsv1,项目名称:ircii,代码行数:48,代码来源:if.c

示例7: from_XML

void IndependentParametersError::from_XML(const tinyxml2::XMLDocument& document)
{
    const tinyxml2::XMLElement* root_element = document.FirstChildElement("IndependentParametersError");

    if(!root_element)
    {
        std::ostringstream buffer;

        buffer << "OpenNN Exception: IndependentParametersError class.\n"
               << "void from_XML(const tinyxml2::XMLDocument&) method.\n"
               << "Independent parameters error element is NULL.\n";

        throw std::logic_error(buffer.str());
    }

  // Display
  {
     const tinyxml2::XMLElement* display_element = root_element->FirstChildElement("Display");

     if(display_element)
     {
        const std::string new_display_string = display_element->GetText();

        try
        {
           set_display(new_display_string != "0");
        }
        catch(const std::logic_error& e)
        {
           std::cout << e.what() << std::endl;
        }
     }
  }
}
开发者ID:pappakrishnan,项目名称:OpenNN,代码行数:34,代码来源:independent_parameters_error.cpp

示例8: main

/*-----------------------------------------------------------------------*/
int main (void)
{
  PORTB = 0b00111011;
  DDRB  = 0b00111100;

  PORTC = 0b00111111;
  DDRC  = 0b00000000;

  PORTD = 0b00000000;
  DDRD  = 0b11111111;

  update_qdec();
  update_qdec();
  dec99 = dec9900 = 0;
  par_count = 0;
  set_display(0);
  dot = 1;

  PRR = _BV(PRTWI) | _BV(PRTIM2) | _BV(PRTIM0) | _BV(PRTIM1) | _BV(PRSPI) | _BV(PRUSART0) | _BV(PRADC);

  count5 = 5;
  counter = 0;
  par_count = 0;

  do {
    do {
    } while (idle() && sleep());

    do {
      if (PINC & _BV(4)) delay();
    } while (run());
  } while (1);
}
开发者ID:mick909,项目名称:ncnl,代码行数:34,代码来源:main.c

示例9: gst_vaapi_video_meta_new_from_pool

/**
 * gst_vaapi_video_meta_new_from_pool:
 * @pool: a #GstVaapiVideoPool
 *
 * Creates a #GstVaapiVideoMeta with a video object allocated from a @pool.
 * Only #GstVaapiSurfacePool and #GstVaapiImagePool pools are supported.
 *
 * The meta object is destroyed through the last call to
 * gst_vaapi_video_meta_unref() and the video objects are pushed back
 * to their respective pools.
 *
 * Return value: the newly allocated #GstVaapiVideoMeta, or %NULL on error
 */
GstVaapiVideoMeta *
gst_vaapi_video_meta_new_from_pool (GstVaapiVideoPool * pool)
{
  GstVaapiVideoMeta *meta;
  GstVaapiVideoPoolObjectType object_type;

  g_return_val_if_fail (pool != NULL, NULL);

  meta = _gst_vaapi_video_meta_new ();
  if (G_UNLIKELY (!meta))
    return NULL;

  object_type = gst_vaapi_video_pool_get_object_type (pool);
  switch (object_type) {
    case GST_VAAPI_VIDEO_POOL_OBJECT_TYPE_IMAGE:
      if (!set_image_from_pool (meta, pool))
        goto error;
      break;
    case GST_VAAPI_VIDEO_POOL_OBJECT_TYPE_SURFACE:
      if (!set_surface_proxy_from_pool (meta, pool))
        goto error;
      break;
    default:
      GST_ERROR ("unsupported video buffer pool of type %d", object_type);
      goto error;
  }
  set_display (meta, gst_vaapi_video_pool_get_display (pool));
  return meta;

error:
  gst_vaapi_video_meta_unref (meta);
  return NULL;
}
开发者ID:DarkLighters,项目名称:gstreamer-vaapi,代码行数:46,代码来源:gstvaapivideometa.c

示例10: sdl_plain_button

sdl_text_button::sdl_text_button(const char *bla, int x, int y, sdl_user *who, funcptr *stuff)
	: sdl_plain_button(-1, x, y, who, stuff)
{
	xpos = x;
	ypos = y;
	set_display(bla);
}
开发者ID:tea91,项目名称:l1j-client,代码行数:7,代码来源:sdl_text_button.cpp

示例11: cos

inline void SciCalc::cb_but_cos_i(Fl_Button*, void*) {
  if (base > 10) handle_number(13.0);
  else
  	if (! inv) 
  	{
  		value[top] = cos(to_drg(value[top]));
  		set_display(value[top],NORM);
  		ready = 1;
  	}
  	else
  	{
  		value[top] = from_drg(acos(value[top]));
  		set_display(value[top],NORM);
  		ready = 1;
  	}
;}
开发者ID:GustavoMOG,项目名称:efltk,代码行数:16,代码来源:SciCalc.cpp

示例12: sqrt

inline void SciCalc::cb_but_sqrt_i(Fl_Button*, void*) {
  if (base > 10) handle_number(10.0); 
  	else
  	if (! inv) 
  	{
  		value[top] = sqrt(value[top]);
  		set_display(value[top],NORM);
  		ready = 1;
  	}
  	else
  	{
  		value[top] = pow(value[top], 2.0);
  		set_display(value[top],NORM);
  		ready = 1;
  	}
;}
开发者ID:GustavoMOG,项目名称:efltk,代码行数:16,代码来源:SciCalc.cpp

示例13: new_disp_obj

Disp_Obj *open_display(QSP_ARG_DECL  const char *name,int desired_depth)
{
	Disp_Obj *dop;
	static int siz_done=0;

	dop = new_disp_obj(QSP_ARG  name);
	if( dop == NO_DISP_OBJ ){
		sprintf(ERROR_STRING, "Couldn't create object for display %s",
					name);
		NWARN(ERROR_STRING);
		return(NO_DISP_OBJ);
	}

	if( dop_open(QSP_ARG  dop) < 0 ){
		return(NO_DISP_OBJ);
	}

	if( dop_setup(QSP_ARG  dop,desired_depth) < 0 ){
		/* Bug - XCloseDisplay?? */
		/* need to destroy object here */
		del_disp_obj(QSP_ARG  dop);
		rls_str((char *)dop->do_name);
		return(NO_DISP_OBJ);
	}
	set_display(dop);

	if( ! siz_done ){
		siz_done++;
		add_sizable(QSP_ARG  disp_obj_itp,&dpy_sf, NULL );
	}

	return(dop);
}
开发者ID:felipebetancur,项目名称:QuIP,代码行数:33,代码来源:dpy.c

示例14: set_display

void NormalizedSquaredError::from_XML(const tinyxml2::XMLDocument& document)
{
   const tinyxml2::XMLElement* root_element = document.FirstChildElement("NormalizedSquaredError");

   if(!root_element)
   {
      return;
   }

   const tinyxml2::XMLElement* display_element = root_element->FirstChildElement("Display");

   if(display_element)
   {
      const std::string new_display_string = display_element->GetText();     

      try
      {
         set_display(new_display_string != "0");
      }
      catch(const std::logic_error& e)
      {
         std::cout << e.what() << std::endl;		 
      }
   }
}
开发者ID:Artelnics,项目名称:OpenNN,代码行数:25,代码来源:normalized_squared_error.cpp

示例15: log10

void SciCalc::cb_but_log_i(Fl_Button*, void*) {
  if (base > 10) handle_number(15.0);
else
	if (! inv)
	{
		value[top] = log10(value[top]);
		set_display(value[top],NORM);
		ready = 1;
	}
	else
	{
		value[top] = pow(10.0, value[top]);
		set_display(value[top],NORM);
		ready = 1;
	};
}
开发者ID:GustavoMOG,项目名称:ede,代码行数:16,代码来源:SciCalc.cpp


注:本文中的set_display函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。