예제 #1
0
void MyGesture::printGestureInfo(Mat src){
	int fontFace = FONT_HERSHEY_PLAIN;
	Scalar fontColor(245, 200, 200);
	int xpos = src.cols / 1.5;
	int ypos = src.rows / 1.6;
	float fontSize = 0.7f;
	int lineChange = 14;
	std::string info = "Figure Info:";
	putText(src, info, Point(ypos, xpos), fontFace, fontSize, fontColor);
	xpos = xpos + lineChange;
	info = std::string("bounding box height, width ") + std::string(int2String(numOfDefects));
	putText(src, info, Point(ypos, xpos), fontFace, fontSize, fontColor);
	xpos = xpos + lineChange;
	info = std::string("is Hande: ") + std::string(bool2String(isHand));
	putText(src, info, Point(ypos, xpos), fontFace, fontSize, fontColor);
} //ENDOF Method: printGestureInfo(Mat src)
예제 #2
0
//----------------------------------------------------------------------------------------
void PgmCtrl::OnSelChanged(wxMouseEvent& WXUNUSED(event))
{
    int i;
    Temp0.Empty();   Temp1.Empty();
#if wxUSE_STATUSBAR
    pDoc->p_MainFrame->SetStatusText(Temp0,0);
#endif // wxUSE_STATUSBAR
    // Get the Information that we need
    wxTreeItemId itemId = GetSelection();
    TreeData *item = (TreeData *)GetItemData(itemId);
    if (item != NULL )
    {
        int Treffer = 0;
        Temp1.Printf(_T("%s"),item->m_desc.c_str());
        //--------------------------------------------------------------------------------------
        if (Temp1 == _T("Language English"))
        {
            Temp0 = _T("std");
            p_ProgramCfg->Write(_T("/Local/langid"),Temp0);
            Temp0 = _("-I-> After a programm restart, the language will be changed to English.");
            wxMessageBox(Temp0);
        }
        if (Temp1 == _T("Language German"))
        {
            Temp0 = _T("de");
            p_ProgramCfg->Write(_T("/Local/langid"),Temp0);
            Temp0 = _("-I-> After a programm restart, the language will be changed to German.");
            wxMessageBox(Temp0);
        }
        //--------------------------------------------------------------------------------------
        if (Temp1 == _T("wxConfigBase Delete"))
        {
            if (p_ProgramCfg->DeleteAll()) // Default Diretory for wxFileSelector
                Temp0 = _("-I-> wxConfigBase.p_ProgramCfg->DeleteAll() was successful.");
            else
                Temp0 = _("-E-> wxConfigBase.p_ProgramCfg->DeleteAll() was not successful !");
            wxBell();     // Ding_a_Ling
            Treffer++;
        }
        //--------------------------------------------------------------------------------------
        if (Temp1.Contains(_T("ODBC-")))
        {
            Temp1 = Temp1.Mid(5,wxSTRING_MAXLEN);
            for (i=0;i<pDoc->i_DSN;i++)
            {
                if (Temp1 == (pDoc->p_DSN+i)->Dsn)
                {
                    pDoc->OnChosenDSN(i);
                }
            }
            Treffer++;
        }
        //--------------------------------------------------------------------------------------
        if (Treffer == 0)
        {
            //-------------------------------------------------------------------------------------
            Temp0.Printf(_("Item '%s': %sselected, %sexpanded, %sbold, %u children (%u immediately under this item)."),
                item->m_desc.c_str(),
                bool2String(IsSelected(itemId)),
                bool2String(IsExpanded(itemId)),
                bool2String(IsBold(itemId)),
                GetChildrenCount(itemId),
                GetChildrenCount(itemId));
            LogBuf.Printf(_T("-I-> PgmCtrl::OnSelChanged - %s"),Temp0.c_str());
            wxLogMessage( _T("%s"), LogBuf.c_str() );
            //-------------------------------------------------------------------------------------
        }
    }
}
예제 #3
0
void DeviceItem::comboChanged( int index )
{
    const SDeviceFeatures & features = p->devices[index].deviceFeatures();
    const SDiscFeatures   & disc     = p->devices[index].currentDiscFeatures();

    p->ui->read_speed_text->setText(      QString::number(features.read_speed_int)  );
    p->ui->device_address_text->setText(  features.device_block_str                 );
    p->ui->drive_type_text->setText(      features.storage_drive_type_str           );
    p->ui->firmware_text->setText(        features.storage_firmware_str             );
    p->ui->disc_type_text->setText(       disc.volume_disc_type_str                 );
    p->ui->disc_blank_text->setText(      bool2String(disc.volume_disc_is_blank)    );
    p->ui->disc_capacity_text->setText(   QString::number(disc.volume_capacity_int) );
    p->ui->removable_media_text->setText( bool2String(features.removable_stt)       );
    p->ui->cdr_text->setText(             bool2String(features.cdr_stt)             );
    p->ui->cdrw_text->setText(            bool2String(features.cdrw_stt)            );
    p->ui->dvd_text->setText(             bool2String(features.dvd_stt)             );
    p->ui->dvdr_text->setText(            bool2String(features.dvdr_stt)            );
    p->ui->dvdrw_text->setText(           bool2String(features.dvdrw_stt)           );
    p->ui->dvdrdl_text->setText(          bool2String(features.dvdrdl_stt)          );
    p->ui->dvdram_text->setText(          bool2String(features.dvdram_stt)          );
    p->ui->dvdplusr_text->setText(        bool2String(features.dvdplusr_stt)        );
    p->ui->dvdplusrw_text->setText(       bool2String(features.dvdplusrw_stt)       );
    p->ui->dvdplusrwdl_text->setText(     bool2String(features.dvdplusrwdl_stt)     );
    p->ui->dvdplusrdl_text->setText(      bool2String(features.dvdplusrdl_stt)      );
    p->ui->bd_text->setText(              bool2String(features.bd_stt)              );
    p->ui->bdr_text->setText(             bool2String(features.bdr_stt)             );
    p->ui->hddvd_text->setText(           bool2String(features.hddvd_stt)           );
    p->ui->hddvdr_text->setText(          bool2String(features.hddvdr_stt)          );
    p->ui->hddvdrw_text->setText(         bool2String(features.hddvdrw_stt)         );

    p->ui->volume_text->setText(      disc.volume_label_str                       );
    p->ui->fstype_text->setText(      disc.volume_fstype_str                      );
    p->ui->fsversion_text->setText(   disc.volume_fsversion_str                   );
    p->ui->disc_type_text_2->setText( disc.volume_disc_type_str                   );
    p->ui->volume_size_text->setText( QString::number(disc.volume_size_int)       );
    p->ui->block_size_text->setText(  QString::number(disc.volume_block_size_int) );
    p->ui->mountpoint_text->setText(  disc.mount_point_str                        );
    p->ui->appendable_text->setText(  bool2String(disc.volume_is_appendable)      );
    p->ui->data_text->setText(        bool2String(disc.dataDisc)                  );
    p->ui->audio_text->setText(       bool2String(disc.audio)                     );
    p->ui->vcd_text->setText(         bool2String(disc.vcd)                       );
    p->ui->svcd_text->setText(        bool2String(disc.svcd)                      );
    p->ui->vdvd_text->setText(        bool2String(disc.videoDVD)                  );
    p->ui->vbr_text->setText(         bool2String(disc.videoBluRay)               );
}
void main(int argc, char**argv)
{
	std::wcout << L"\n ===================================\n";
	std::wcout << L"\n  TextFinderComponent C++ Interface ";
	std::wcout << L"\n ===================================\n";

	HRESULT hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);

	if (!SUCCEEDED(hr))
	{
		std::wcout << L"\n  could not initialize COM";
	}

	try
	{
		CComQIPtr<ITextCompCOM> TextFinderComp;

		TextFinderComp.CoCreateInstance(CLSID_TextCompCOM);
		
		if (TextFinderComp != 0)
		{
			std::wcout << L"\n =============================================================\n";

			std::wcout << "The Text Component Interface was successfully initialized" << std::endl;

			std::wcout << L"\n =============================================================\n";

			InputArgumentParser parser;

			if (parser.parseCommandLineArgs2TextCompArguments(argc, argv))
			{
				HRESULT h0 = TextFinderComp->InitializeComponent();

				HRESULT h1 = TextFinderComp->SetSearchPath(CComBSTR(parser.getDirectoryPath().c_str()));

				BSTR allPatterns;
				BSTR recursion;

				allPatterns = convertstdSTR2BSTR(bool2String(true)) ;    //By default find all patterns
				
				recursion = convertstdSTR2BSTR(bool2String(false)) ;  // By default Recursion is disabled

				if (parser.getRecursionFlag())
				{
					recursion = convertstdSTR2BSTR(bool2String(true));
				}

				if (!parser.getAllPatternsFlag())
				{
					allPatterns = convertstdSTR2BSTR(bool2String(false));
				}

				HRESULT h2 = TextFinderComp->SetSpecialSearchClause(recursion, allPatterns);

				HRESULT h3 = TextFinderComp->SetFilePatterns(convertVector2CCOMSafeArray(parser.getFilePatterns()).GetSafeArrayPtr());

				HRESULT h4 = TextFinderComp->SetTextPatterns(convertVector2CCOMSafeArray(parser.getTextPatterns()).GetSafeArrayPtr());

				if (SUCCEEDED(h0) && SUCCEEDED(h1) && SUCCEEDED(h2) && SUCCEEDED(h3) && SUCCEEDED(h4))
				{
					
					SAFEARRAY files;
				
					SAFEARRAY* pFiles = &files;

					TextFinderComp->GetQualifyingFileList(&pFiles);

					CComSafeArray<BSTR> Files;

					Files.Attach(pFiles);	

					std::wcout << L"\n =============================================================\n";
					std::wcout << L"\n =============================================================\n";

					std::wcout<<"The Qualifying Files from the Text Search Component via C++ COM interface"<<std::endl;

					displayCCOMBSTRFiles(Files);

					std::cout << "End of C++ Client for Text Search Component" << std::endl;

					std::wcout << L"\n =============================================================\n";

				}
			}

			else
			{
				parser.displayIllegalArgumentMessage();
			}

		}

	}
	catch (std::exception& ex)
	{
		std::wcout << L"\n  Exception Encountered during COM Stuff .. Contact Admin and Bug Him!" << ex.what() << L"\n\n";
		return;
	}

	std::wcout << L"\n\n";
	CoUninitialize();
}