示例#1
0
void loadData(Database *database, const QString &qtPath)
{
     GitClient gitClient(qtPath);
     QStringList branches =
             gitClient.runCommand(QStringList() << "branch" << "-r");
     // qDebug() << "branches" << branches;

     // filter branches, allow x.y and "master"
    QStringList filteredBranches;
    foreach (const QString &candidate, branches) {
        if (candidate.simplified() == "origin/1.0.0") // for creator
            filteredBranches.append(candidate.simplified());
        if (candidate.simplified() == "origin/master")
            filteredBranches.append(candidate.simplified());
        if (candidate.count('.') == 1 && candidate.count('-') == 0)
            filteredBranches.append(candidate.simplified());

        //if (filteredBranches.count() > 1)
        //    break;
    }

    qDebug() << "Accepted branches" << filteredBranches;
    foreach (const QString &branch, filteredBranches)
        loadBranchData(database, branch, qtPath);
}
示例#2
0
/**
 * Reset existing vector from current component state on network
 * @param vector existing vector (should be generated from same mapper)
 */
void mapToVector(gridpack::math::Vector &vector)
{
  int t_set, t_bus, t_branch;
  vector.zero();
  loadBusData(vector,false);
  loadBranchData(vector,false);
  GA_Pgroup_sync(p_GAgrp);
  vector.ready();
}
示例#3
0
/**
 * Generate vector from current component state on network and return a
 * conventional pointer to it. Used for Fortran interface.
 * @return return a pointer to new vector
 */
gridpack::math::Vector* intMapToVector(void)
{
  gridpack::parallel::Communicator comm = p_network->communicator();
  int blockSize = p_maxIndex-p_minIndex+1;
  gridpack::math::Vector*
    Ret(new gridpack::math::Vector(comm, blockSize));
  loadBusData(*Ret,false);
  loadBranchData(*Ret,false);
  GA_Pgroup_sync(p_GAgrp);
  Ret->ready();
  return Ret;
}