本文整理汇总了C++中Core::GetExperiments方法的典型用法代码示例。如果您正苦于以下问题:C++ Core::GetExperiments方法的具体用法?C++ Core::GetExperiments怎么用?C++ Core::GetExperiments使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Core
的用法示例。
在下文中一共展示了Core::GetExperiments方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _tmain
int _tmain(int argc, _TCHAR* argv[])
{
QString strdir = QString::fromWCharArray(argv[1]);
Core coreRecepient;
Core coreDonor;
coreDonor.SetDonorDB();
std::vector<int> donorExpsId, recepientExpsId;
std::vector<Experiment> donorExps, recepientExps;
if (coreDonor.ConnectDatabase() == 0) {
coreDonor.GetExperiments(donorExpsId, donorExps, true);
}
else
{
cout << "Exit with Error in connect to donor DB!" << endl;
system("pause");
return 1;
}
if (coreRecepient.ConnectDatabase() == 0) {
coreRecepient.GetExperiments(recepientExpsId, recepientExps, true);
}
else
{
cout << "Exit with Error in connect to recepient DB!" << endl;
system("pause");
return 1;
}
int cnt = 0;
for (size_t i = 0; i < donorExps.size(); ++i)
{
size_t j;
for (j = 0; j < recepientExps.size(); ++j)
{
if (donorExps[i].comment == recepientExps[j].comment)
{
break;
}
}
if (j == recepientExps.size())
{
std::vector<Antenna> antennas;
std::vector<int> antennasId;
if (coreDonor.GetAntennasByExperiment(antennas, antennasId, donorExpsId[i]) == 0) {
if (coreRecepient.SetData(donorExps[i], antennas) == 0) {
cout << "Write experiment to DB" << endl;
if (coreRecepient.WriteData() == 0) {
cnt++;
}
}
}
}
}
cout << "Success!" << endl;
cout << "Copied " << cnt << " experiments" << endl;
system("pause");
return 0;
}