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


C++ Console::NoteLn方法代码示例

本文整理汇总了C++中Console::NoteLn方法的典型用法代码示例。如果您正苦于以下问题:C++ Console::NoteLn方法的具体用法?C++ Console::NoteLn怎么用?C++ Console::NoteLn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Console的用法示例。


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

示例1: ExecuteGlobal

bool INDIDeviceControllerInstance::ExecuteGlobal()
{
   Console console;

   Exception::DisableGUIOutput();

   INDIClient* indi = INDIClient::TheClient();

   try
   {
      if ( p_serverConnect )
      {
         if ( indi == nullptr )
         {
            indi = INDIClient::NewClient( p_serverHostName.ToUTF8(), p_serverPort );
            if ( p_verbosity > 0 )
            {
               console.NoteLn( "<end><cbr>INDI Control Client --- (C) Klaus Kretzschmar, 2014-2016" );
               console.Flush();
            }
         }

         indi->SetVerbosity( p_verbosity );

         if ( !indi->IsServerConnected() )
         {
            indi->connectServer();
            if ( !indi->IsServerConnected() )
               throw Error( "INDIDeviceControllerInstance: Failure to connect to INDI server " + p_serverHostName + ", port=" + String( p_serverPort ) );

            if ( p_verbosity > 0 )
            {
               console.NoteLn( "* Successfully connected to INDI server " + p_serverHostName + ", port=" + String( p_serverPort ) );
               console.Flush();
            }
         }

         if ( !p_serverCommand.IsEmpty() )
         {
            console.EnableAbort();

            if ( p_serverCommand == "GET" )
            {
               o_getCommandResult.Clear();
               String device( PropertyUtils::Device( p_getCommandParameters ) );
               String property( PropertyUtils::Property( p_getCommandParameters ) );
               String element( PropertyUtils::Element( p_getCommandParameters ) );
               INDIPropertyListItem item;
               if ( !indi->GetPropertyItem( device, property, element, item ) )
                  throw Error( "INDIDeviceControllerInstance: Could not get value of property '" + String( p_getCommandParameters ) + "'" );
               o_getCommandResult = item.PropertyValue;
               if ( p_verbosity > 1 )
                  console.WriteLn( "<end><cbr>Device=" + device +
                                   ", Property=" + property +
                                   ", Element=" + element +
                                   ", Value=" + o_getCommandResult );
            }
            else if ( p_serverCommand == "SET" )
            {
               for ( auto newProperty : p_newProperties )
               {
                  GetNewPropertyListItemParametersFromKey( newProperty );
                  if ( !indi->SendNewPropertyItem( newProperty, false/*async*/ ) )
                     throw Error( "INDIDeviceControllerInstance: Failure to send new property values." );
               }
               p_newProperties.Clear();
            }
            else if ( p_serverCommand == "SET_ASYNC" )
            {
               for ( auto newProperty : p_newProperties )
               {
                  GetNewPropertyListItemParametersFromKey( newProperty );
                  if ( !indi->SendNewPropertyItem( newProperty, true/*async*/ ) )
                     throw Error( "INDIDeviceControllerInstance: Failure to send new property values (asynchronous)." );
               }
               p_newProperties.Clear();
            }
            else
               throw Error( "INDIDeviceControllerInstance: Unknown command '" + p_serverCommand + "'" );

            console.Flush();
         }

         AcquireINDIClientProperties();
      }
      else
      {
         if ( indi != nullptr )
         {
            if ( indi->IsServerConnected() )
            {
               AcquireINDIClientProperties();
               indi->SetVerbosity( p_verbosity );
               indi->disconnectServer();
               if ( p_verbosity > 0 )
                  console.NoteLn( "* Disconnected from INDI server " + p_serverHostName + ", port=" + String( p_serverPort ) );
            }

            INDIClient::DestroyClient();
         }
//.........这里部分代码省略.........
开发者ID:GeorgViehoever,项目名称:PCL,代码行数:101,代码来源:INDIDeviceControllerInstance.cpp


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