本文整理汇总了C++中set_display函数的典型用法代码示例。如果您正苦于以下问题:C++ set_display函数的具体用法?C++ set_display怎么用?C++ set_display使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了set_display函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: from_XML
void TestingAnalysis::from_XML(const tinyxml2::XMLDocument& document)
{
std::ostringstream buffer;
const tinyxml2::XMLElement* root_element = document.FirstChildElement("TestingAnalysis");
if(!root_element)
{
buffer << "OpenNN Exception: TestingAnalysis class.\n"
<< "void from_XML(const tinyxml2::XMLDocument&) method.\n"
<< "Testing analysis element is NULL.\n";
throw std::logic_error(buffer.str());
}
// Display
const tinyxml2::XMLElement* element = root_element->FirstChildElement("Display");
if(element)
{
std::string new_display_string = element->GetText();
try
{
set_display(new_display_string != "0");
}
catch(const std::logic_error& e)
{
std::cout << e.what() << std::endl;
}
}
}
开发者ID:Quanteek,项目名称:OpenNN-CMake,代码行数:33,代码来源:testing_analysis.cpp
示例17: tan
void SciCalc::cb_but_tan_i(Fl_Button*, void*) {
if (base > 10) handle_number(14.0);
else
if (! inv)
{
value[top] = tan(to_drg(value[top]));
set_display(value[top],NORM);
ready = 1;
}
else
{
value[top] = from_drg(atan(value[top]));
set_display(value[top],NORM);
ready = 1;
};
}
开发者ID:GustavoMOG,项目名称:ede,代码行数:16,代码来源:SciCalc.cpp
示例18: msg_received
void msg_received(struct message *input_msg)
{
gint i;
if (input_msg->sender < 10)
return;
traffic_last_rec_time = time(NULL);
#if 0
g_print("msg type = %d from %d\n",
input_msg->type, input_msg->sender);
#endif
switch (input_msg->type) {
case MSG_MATCH_INFO:
handle_info_msg(&input_msg->u.match_info);
break;
case MSG_11_MATCH_INFO:
for (i = 0; i < 11; i++) {
handle_info_msg(&input_msg->u.match_info_11.info[i]);
}
break;
case MSG_NAME_INFO:
avl_set_data(input_msg->u.name_info.index,
input_msg->u.name_info.first,
input_msg->u.name_info.last,
input_msg->u.name_info.club);
//refresh_window();
#if 0
g_print("name info %d: %s %s, %s\n",
input_msg->u.name_info.index,
input_msg->u.name_info.first,
input_msg->u.name_info.last,
input_msg->u.name_info.club);
#endif
break;
case MSG_EDIT_COMPETITOR:
set_display(&input_msg->u.edit_competitor);
break;
#if 0
case MSG_CANCEL_REST_TIME:
for (tatami = 0; tatami < NUM_TATAMIS; tatami++) {
for (position = 0; position < NUM_LINES; position++) {
if (match_list[tatami][position].category == input_msg->u.cancel_rest_time.category &&
match_list[tatami][position].number == input_msg->u.cancel_rest_time.number) {
match_list[tatami][position].rest_end = 0;
match_list[tatami][position].flags = 0;
//refresh_window();
return;
}
}
}
break;
#endif
}
}
开发者ID:mahiso,项目名称:JudoShiai,代码行数:59,代码来源:comm.c
示例19: idle
/*-----------------------------------------------------------------------*/
static
uint8_t idle(void)
{
uint8_t s1_status = 0xff;
uint16_t prev;
/* 1/8 Clock */
cli();
CLKPR = _BV(CLKPCE);
CLKPR = 0b0011;
PRR = _BV(PRTWI) | _BV(PRTIM0) | _BV(PRTIM1) | _BV(PRSPI) | _BV(PRUSART0) | _BV(PRADC);
counter = prev = 0;
set_display(par_count);
dot = 1;
/* TC2 : 2ms Interval Interrupt */
OCR2A = 250-1; /* (F_CPU / 8 / 8 / 250= 500Hz (2ms)) */
TCCR2A = 0b010;
TCCR2B = 0b010;
TIMSK2 = _BV(OCIE2A);
PCMSK1 = _BV(PCINT9) | _BV(PCINT11);
PCIFR = _BV(PCIF1);
PCICR = _BV(PCIE1);
sei();
set_sleep_mode(SLEEP_MODE_EXT_STANDBY);
do {
uint16_t tmp;
sleep_mode();
cli();
tmp = counter;
sei();
/* check 10ms interval */
if (tmp != prev) {
prev = tmp;
xorshift();
s1_status <<= 1;
if ( !(PINC & _BV(5)) ) ++s1_status;
/* 10min -> enter deep sleep */
if (prev >= 60000) break;
}
} while ( s1_status != 1 );
TIMSK2 = 0;
TCCR2A = TCCR2B = 0;
return (s1_status != 1);
}
开发者ID:mick909,项目名称:ncnl,代码行数:60,代码来源:main.c
示例20: set_display
void rocvfd_t::update_display()
{
for (int i =0; i<16; i++)
{
m_outputs[i] = set_display(m_chars[i]);
machine().output().set_indexed_value("vfd", (m_port_val*16) + i, m_outputs[i]);
}
}
开发者ID:Robbbert,项目名称:store1,代码行数:8,代码来源:roc10937.cpp
注:本文中的set_display函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论