本文整理汇总了C++中SignalArgs类的典型用法代码示例。如果您正苦于以下问题:C++ SignalArgs类的具体用法?C++ SignalArgs怎么用?C++ SignalArgs使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SignalArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: convergence_history
void CPlotXY::convergence_history( SignalArgs & args )
{
if( is_not_null(m_data.get()) )
{
SignalFrame reply = args.create_reply( uri() );
SignalFrame& options = reply.map( Protocol::Tags::key_options() );
// std::vector<Real> data(8000);
CTable<Real>& table = *m_data.get();
std::vector<std::string> labels =
list_of<std::string>("x")("y")("z")("u")("v")("w")("p")("t");
add_multi_array_in(options.main_map, "Table", m_data->array(), ";", labels);
// for(Uint row = 0 ; row < 1000 ; ++row)
// {
// for(Uint col = 0 ; col < 8 ; ++col)
// data[ (row * 8) + col ] = table[row][col];
// }
// XmlNode node = options.add("Table", data, " ; ");
// node.set_attribute("dimensions", "8");
}
else
throw SetupError( FromHere(), "Data to plot not setup" );
}
示例2: dispatch_signal
void LocalDispatcher::dispatch_signal(const std::string & target, const URI & receiver,
SignalArgs & args)
{
Component & comp = Core::instance().root().access_component( receiver );
args.options().flush();
comp.call_signal( target, args );
}
示例3:
void C3DViewBuilder::signature_create_3dview(SignalArgs &args)
{
SignalFrame& options = args.map( Protocol::Tags::key_options() );
options.set_option("3DView name", common::class_name<std::string>(), std::string(), "Name for the new 3DView");
options.set_option("Parent", common::class_name<URI>(), Core::instance().root().uri().path(), "Parent of the new component");
}
示例4: signature_create_model
void ShockTube::signature_create_model( SignalArgs& args )
{
SignalFrame& p = args.map( Protocol::Tags::key_options() );
p.set_option<std::string>("model_name", "shocktube" , "Name for created model" );
p.set_option<Uint>("nb_cells", 100u , "Number of Cells to be generated");
p.set_option<Uint>("dimension", 1u , "Dimension of the problem");
}
示例5: signal_create_function_bc
void BoundaryConditions::signal_create_function_bc ( SignalArgs& node )
{
SignalOptions options( node );
SignalFrame reply = node.create_reply(uri());
SignalOptions reply_options(reply);
reply_options.add_option("created_component", add_function_bc(options.value<std::string>("region_name"), options.value<std::string>("variable_name"))->uri());
}
示例6: signal_create_lss
void LSSAction::signal_create_lss(SignalArgs& node)
{
SignalOptions options(node);
LSS::System& lss = create_lss(options.option("matrix_builder").value<std::string>());
SignalFrame reply = node.create_reply(uri());
SignalOptions reply_options(reply);
reply_options.add("created_component", lss.uri());
}
示例7: dispatch_signal
void NetworkQueue::dispatch_signal( const std::string & target,
const URI & receiver,
SignalArgs &args )
{
args.options().flush();
Transaction * transaction = send( args, LOW );
if( is_not_null(transaction) )
transaction->from_script = true;
}
示例8: new_signal
void TreeThread::new_signal( SignalArgs & args)
{
const char * tag = Protocol::Tags::node_frame();
if( args.node.is_valid() )
{
SignalFrame real_frame;
if( args.has_reply() )
real_frame = args.get_reply();
else
real_frame = args;
std::string type = real_frame.node.attribute_value("target");
std::string receiver = real_frame.node.attribute_value("receiver");
try
{
Handle< Component > real_root = root();
if(real_root->uri().path() == URI(receiver).path())
root()->call_signal(type, real_frame);
else
real_root->access_component(receiver)->call_signal(type, real_frame);
}
catch(cf3::common::Exception & cfe)
{
NLog::global()->add_exception(/*QString("%1 %2").arg(type.c_str()).arg(receiver.c_str()) + */cfe.what());
}
catch(std::exception & stde)
{
NLog::global()->add_exception(stde.what());
}
catch(...)
{
CFerror << "Unknown exception thrown during execution of action [" << type
<< "] on component " << " [" << receiver << "]." << CFendl;
}
}
}
示例9:
void N3DView::launch_pvserver( SignalArgs& node ){
SignalFrame& options = node.map( Protocol::Tags::key_options() );
std::vector<std::string> data = options.get_array<std::string>("infoServer");
std::string host = data[0];
std::string port = data[1];
TabBuilder::instance()->getWidget<Widget3D>(as_ptr<CNode>())
->connectToServer(host.c_str(), port.c_str());
}
示例10: change_link
void Link::change_link( SignalArgs & args )
{
SignalOptions options( args );
SignalFrame reply = args.create_reply();
std::string path = options.value<std::string>("target_path");
Handle<Component> target = access_component(path);
link_to (*target);
reply.map("options").set_option("target_path", class_name<std::string>(), path);
}
示例11: change_link
void CLink::change_link( SignalArgs & args )
{
SignalOptions options( args );
SignalFrame reply = args.create_reply();
std::string path = options.value<std::string>("target_path");
Component::Ptr target = m_root.lock()->access_component_ptr(path);
link_to (target);
reply.map("options").set_option("target_path", path);
}
示例12: signalSignature
void SignalManager::signalSignature(SignalArgs & args)
{
if(m_waitingForSignature)
{
URI path = m_node->realComponent()->uri();
ActionInfo & info = m_signals[m_currentAction];
const char * tag = Protocol::Tags::key_options();
m_frame = SignalFrame(info.name.toStdString(), path, path);
SignalFrame& options = m_frame.map( Protocol::Tags::key_options() );
if( args.has_map(tag) )
args.map(tag).main_map.content.deep_copy( options.main_map.content );
try
{
SignatureDialog * sg = new SignatureDialog();
connect(sg, SIGNAL(finished(int)), this, SLOT(dialogFinished(int)));
sg->show(options.main_map.content, m_currentAction->text());
}
catch( Exception & e)
{
NLog::globalLog()->addException(e.what());
}
catch( ... )
{
NLog::globalLog()->addException("Unknown exception caught");
}
m_waitingForSignature = false;
}
}
示例13: signal_create_initial_condition
void InitialConditions::signal_create_initial_condition(SignalArgs& args)
{
SignalOptions options(args);
Handle<common::Action> ic;
if(options.check("builder_name"))
{
ic = create_initial_condition(options["field_tag"].value<std::string>(), options["builder_name"].value<std::string>());
}
else
{
ic = create_initial_condition(options["field_tag"].value<std::string>());
}
SignalFrame reply = args.create_reply(uri());
SignalOptions reply_options(reply);
reply_options.add("created_component", ic->uri());
}
示例14: QString
void N3DView::send_server_info_to_client( SignalArgs& node ){
SignalFrame& options = node.map( Protocol::Tags::key_options() );
std::vector<std::string> data = options.get_array<std::string>("pathinfo");
std::string path = data[0];
std::string name = data[1];
std::vector<QString> path_list(1);
path_list[0] = QString(path.c_str());
std::vector<QString> name_list(1);
name_list[0] = QString(name.c_str());
TabBuilder::instance()->getWidget<Widget3D>(as_ptr<CNode>())
->loadPaths(path_list, name_list);
}
示例15: send_next_signal
void RemoteDispatcher::send_next_signal( SignalArgs & args )
{
if( m_running )
{
SignalOptions & options = args.options();
std::string frameid = options.value<std::string>( "frameid" );
if( m_currentFrameId == frameid )
{
if ( m_nextIndex <= m_pendingSignals.count() )
{
bool success = options.value<bool>( "success" );
if( !success )
{
std::string message = options.value<std::string>( "message" );
QString msg("Error while running the script. The following error occured : %1"
"\n When executing the signal \n%2");
std::string str;
to_string( m_pendingSignals[m_nextIndex-1].node, str );
NLog::global()->add_exception( msg.arg(message.c_str()).arg(str.c_str()) );
m_running = false;
emit finished();
}
else
{
NLog::global()->add_message( QString("Frame %1 was ack'ed").arg(frameid.c_str()) );
send_signal( m_nextIndex );
m_nextIndex++;
}
}
else
{
m_running = false;
// m_connectionManager->manage_connection("ack")->disconnect();
NLog::global()->add_message("Script is finished");
emit finished();
}
}
}
}