Exemple #1
0
int main(int argc, char* argv[])
{
// Get Progran args
    if (argc!=2 && argc!=4)
    {
        Usage();
        return 1;
    }
    Address=argv[1];
    if (argc==4)
    {
        Rack=atoi(argv[2]);
        Slot=atoi(argv[3]);
    }

// Client Creation
    Client=Cli_Create();
    Cli_SetAsCallback(Client, CliCompletion,NULL);

// Connection
    if (CliConnect())
    {
        PerformTests();
        CliDisconnect();
    };

// Deletion
    Cli_Destroy(&Client);
    Summary();

    return 0;
}
CRTF_Table* CRTF_SummaryBuilder::CreateSummaryTable(CRtfDocumentChainBuilder* pHost, CRTF_CharacterProperties* pChPrwops)
{
	bool bRealTable = pHost->m_Options.Flags.m_bShowSummary;

	CRTF_Table* pTable = NULL;

	if (pHost->m_Options.Flags.m_bShowInfoTables)
	{
		pTable=	pHost->m_Options.GetSummaryTemplate();
	}

	// Create summary info
	CChainTraverser_CreateSummary Summary(pHost, false, false, pHost->m_Options.Flags.m_bOldStyleSummary, pHost->m_Options.Flags.m_bFullSummary);

	pHost->m_pAnchor[1]->GetSummaryInfo(Summary);

	// Get style sheet
	CRTF_Header* pHeader = (CRTF_Header*)pHost->m_pAnchor[1];

	RTFstylesheet* pStyles = pHeader->GetStylesheet();

	// Create text formatting and add to manager
	int iParaStyleIndex = pStyles->FindStyleByName(szTableBodyStyle);
		
	CRTF_CharacterProperties* pChProps = CRTF_CharacterProperties::Create(pStyles, szTableBodyStyle);

	pChProps = pHost->m_ChPropsMgr.Add(pChProps);

	// Add rows to table in this style
	AddSummaryRowsToTableInStyle(pHost, pTable, pChProps, Summary);

	pHost->SetNewChangeSummary(Summary.DetachChanges());

	return pTable;
}
Exemple #3
0
void XmlOutput::ModuleBegin(const String &name)
{
	xml << "<TestRun>";

	summary = Summary();
	summary.module_name = name;

	xml << "<Module name='" << name << "'>";
}
Exemple #4
0
void QRPlot::on_actionOpen_triggered()
{
    QString filename = QFileDialog::getOpenFileName(this, tr("Open RSM file"), "/home/", tr("Readable summary files (*.RSM)"));
    RSMReader file = RSMReader(filename);
    summaries.append(Summary(file.getTitle(), file.getPropertyList()));
    qDebug() << "Open files:";
    foreach (Summary summary, summaries) {
        qDebug() << summary.getTitle();
    }
    updateSummaryTree();

}
//---------------------------------------------------------
void MaxwellCurved2D::InitRun()
//---------------------------------------------------------
{
  StartUp2D();        // construct grid and metric

#if (0)
  umLOG(1, "before refine : K = %5d\n", K);
  //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
  DMat Q2(Np*K, 1);  IMat refineflag;
  refineflag = Ones(K,Nfaces); Q2 = ConformingHrefine2D(refineflag, Q2);
  umLOG(1, "after refine 1: K = %5d\n", K);
  //refineflag = Ones(K,Nfaces); Q2 = ConformingHrefine2D(refineflag, Q2);
  //umLOG(1, "after refine 1: K = %5d\n", K);
  //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
#endif


  BuildBCMaps2D();    // build boundary condition maps
//OutputNodes(true);  // face nodes
  AdjustCylBC(1., 0.,0., BC_All); // Push all boundary faces to unit cylinder
//OutputNodes(true);  // face nodes
  Resize();           // allocate work arrays
  SetIC();            // set initial conditions
  SetStepSize();      // calculate step size (dt)

  BuildCurvedOPS2D(3*N);

  //---------------------------------------------
  // base class version sets counters and flags
  //---------------------------------------------
  NDG2D::InitRun();   

  //---------------------------------------------
  // Adjust reporting and render frequencies
  //---------------------------------------------
  Nreport =  Nsteps/20;
//Nreport =  2;         // set frequency of reporting (param)
//Nreport = 10;         // set frequency of reporting (param)
//Nreport = 50;        // set frequency of reporting (param)
  Nrender = Nreport;    // output frequency           (param)
//Nrender = 10;         // output frequency           (param)
//Nrender = 100000;     // output frequency           (param)
  
  NvtkInterp = 12;      // set output resolution
//NvtkInterp =  6;      // set output resolution

  Summary();          // Show simulation details
}
int TestTreeFind(tTree &Tree)
{
    int Passed = 0;
    int Run    = 0;

    ++Run;
    Passed += (int) TestFind(Tree,  10,   -10);
    ++Run;
    Passed += (int) TestFind(Tree,  20,   -20);
    ++Run;
    Passed += (int) TestFind(Tree,  30,   -30);
    ++Run;
    Passed += (int) TestFind(Tree,  40,   -40);
    ++Run;
    Passed += (int) TestFind(Tree,  50,   -50);
    ++Run;
    Passed += (int) TestFind(Tree,  60,   -60);
    ++Run;
    Passed += (int) TestFind(Tree,  70,   -70);
    ++Run;
    Passed += (int) TestFind(Tree,  80,   -80);
    ++Run;
    Passed += (int) TestFind(Tree,  90,   -90);
    ++Run;
    Passed += (int) TestFind(Tree, 100,  -100);
    ++Run;
    Passed += (int) TestFind(Tree, 110,  -110);
    ++Run;
    Passed += (int) TestFind(Tree, 120,  -120);
    ++Run;
    Passed += (int) TestFind(Tree, 130,  -130);
    ++Run;
    Passed += (int) TestFind(Tree, 140,  -140);
    ++Run;
    Passed += (int) TestFind(Tree, 150,  -150);
    ++Run;
    Passed += (int) TestFind(Tree, 160,  -160);

    ++Run;
    Passed += (int) TestFind(Tree, 999,   -1);
    ++Run;
    Passed += (int) TestFind(Tree,  -1,   -1);

    Summary("TestTreeFind: " << Run << " tests run; " << Passed << " passed");
    return Passed;
}                                   // TestTreeFind()
Exemple #7
0
void MainFrame::UpdateEvents() {
	Event *CurrentEvent;
	int Index;

	ViewQuery->Criteria.From << FromDatePicker->GetValue();
	ViewQuery->Criteria.To << ToDatePicker->GetValue();
	ViewQuery->Criteria.To[HOUR] = 23;
	ViewQuery->Criteria.To[MINUTE] = 59;
	ViewQuery->Criteria.To[SECOND] = 59;

  EventsList->DeleteAllItems();

	ViewQuery->ResetPosition();
	while ((CurrentEvent = ViewQuery->GetNextEvent()) != NULL) {
		wxString Summary(CurrentEvent->Summary.c_str(), wxConvUTF8);
		wxString Categories(CurrentEvent->Categories.c_str(), wxConvUTF8);
		if (
		(SearchText->GetValue().IsEmpty() || Summary.Lower().Contains(SearchText->GetValue().Lower())) &&
		(CategoriesText->GetValue().IsEmpty() || Categories.Lower().Contains(CategoriesText->GetValue().Lower()))
		) {
			Index = EventsList->InsertItem(COLUMN_SUMMARY, Summary, ICON_EVENT);

			EventsList->SetItem(Index, COLUMN_START, wxString(CurrentEvent->DtStart.Format().c_str(), wxConvLibc));
			if (!CurrentEvent->DtEnd.IsEmpty())
				EventsList->SetItem(Index, COLUMN_END, wxString(CurrentEvent->DtEnd.Format().c_str(), wxConvLibc));
			else
				EventsList->SetItem(Index, COLUMN_END, wxT(""));
			EventsList->SetItem(Index, COLUMN_CATEGORIES, Categories);
			EventsList->SetItem(Index, COLUMN_ALARM, wxT(""), CurrentEvent->Alarms->empty() ? -1 : ICON_ALARM);
			if (CurrentEvent->RecurrenceNo > 0)
				EventsList->SetItem(Index, COLUMN_RECURRENCE, wxString::Format(wxT("%d"), CurrentEvent->RecurrenceNo), ICON_RECURRENT);
			else if (!CurrentEvent->RRule.IsEmpty())
				EventsList->SetItem(Index, COLUMN_RECURRENCE, wxT(""), ICON_RECURRENT);

			EventsList->SetItemPtrData(Index, (wxUIntPtr)CurrentEvent);
		}
	}

	ToolBar->EnableTool(wxID_DELETE, false);
	ToolBar->EnableTool(wxID_PROPERTIES, false);

	EventsList->SortItems(CompareEvents, (long)&SortOptions);
}
int TestIterIncAndDec(tTree &Tree, tExpectedKeys &ExpectedKeys)
    {
    int Passed = 0;
    int Tried  = 0;

    Passed += Test(Tree, ExpectedKeys.pBreadthFirst, eBreadthFirstSmall, Tried);
    Passed += Test(Tree, ExpectedKeys.     pInOrder,      eInOrderSmall, Tried);
    Passed += Test(Tree, ExpectedKeys.   pPostOrder,    ePostOrderSmall, Tried);
    Passed += Test(Tree, ExpectedKeys.    pPreOrder,     ePreOrderSmall, Tried);

    Passed += Test(Tree, ExpectedKeys.pBreadthFirst,  eBreadthFirstFast, Tried);
    Passed += Test(Tree, ExpectedKeys.     pInOrder,       eInOrderFast, Tried);
    Passed += Test(Tree, ExpectedKeys.   pPostOrder,     ePostOrderFast, Tried);
    Passed += Test(Tree, ExpectedKeys.    pPreOrder,      ePreOrderFast, Tried);

    Passed += Test(Tree, ExpectedKeys.     pInOrder,           eDefault, Tried);

    Summary("TestIterIncAndDec: " << Tried << " tests run; " << Passed << " passed");
    return (Passed == Tried);
    }                                   // TestIterIncAndDec()
Exemple #9
0
eOSState cMenuSwitchTimers::ProcessKey(eKeys Key)
{
  eOSState state = cOsdMenu::ProcessKey(Key);
  if (state == osUnknown) {
    switch (Key) {
	case kOk:
	    state = Summary();
	    break;
	case kGreen:
	    state = DeleteAll();
	    break;
	case kYellow:
	    state = Delete();
	    break;
	case kRed:
	    if (HasSubMenu())
		return osContinue;
	    if (CurrentSwitchTimer())
		state = AddSubMenu(new cMenuEditSwitchTimer(CurrentSwitchTimer()));
	    else
		state = osContinue;
	    break;
	case k0:
	    if (CurrentSwitchTimer())
	    {
		cSwitchTimer* switchTimer = CurrentSwitchTimer();
	        switchTimer->announceOnly = 1 - switchTimer->announceOnly;
		cMutexLock SwitchTimersLock(&SwitchTimers);
		SwitchTimers.Save();
		RefreshCurrent();
		Display();
	    }
	    break;
      default: break;
    }
  }

  return state;
}
Exemple #10
0
//---------------------------------------------------------
void Maxwell2D::InitRun()
//---------------------------------------------------------
{
  StartUp2D();          // construct grid and metric

  Resize();             // allocate work arrays
  SetIC();              // set initial conditions
  SetStepSize();        // calculate step size (dt)

  // just call base class version 
  NDG2D::InitRun();

  //---------------------------------------------
  // Adjust reporting and render frequencies
  //---------------------------------------------
  Nreport =  Nsteps/20;
  Nrender = Nreport;    // output frequency           (param)

  NvtkInterp = 12;      // set output resolution

  Summary();            // show simulation details
}
Exemple #11
0
std::vector<FileCoverageSummary>
CoverageReport::prepareFileReports(const coverage::CoverageMapping &Coverage,
                                   FileCoverageSummary &Totals,
                                   ArrayRef<StringRef> Files) {
  std::vector<FileCoverageSummary> FileReports;
  unsigned LCP = 0;
  if (Files.size() > 1)
    LCP = getLongestCommonPrefixLen(Files);

  for (StringRef Filename : Files) {
    FileCoverageSummary Summary(Filename.drop_front(LCP));

    // Map source locations to aggregate function coverage summaries.
    DenseMap<std::pair<unsigned, unsigned>, FunctionCoverageSummary> Summaries;

    for (const auto &F : Coverage.getCoveredFunctions(Filename)) {
      FunctionCoverageSummary Function = FunctionCoverageSummary::get(F);
      auto StartLoc = F.CountedRegions[0].startLoc();

      auto UniquedSummary = Summaries.insert({StartLoc, Function});
      if (!UniquedSummary.second)
        UniquedSummary.first->second.update(Function);

      Summary.addInstantiation(Function);
      Totals.addInstantiation(Function);
    }

    for (const auto &UniquedSummary : Summaries) {
      const FunctionCoverageSummary &FCS = UniquedSummary.second;
      Summary.addFunction(FCS);
      Totals.addFunction(FCS);
    }

    FileReports.push_back(Summary);
  }

  return FileReports;
}
Exemple #12
0
void TPerformanceCounterBase::DoPrint(bool finished, const size_t currentCounter) const {
    (*Output) << Name << ": " << Summary(StartTime, currentCounter, PrevTime, LogFreq, !finished);
    PrintCustomInfo();
    (*Output) << Endl;
}
//---------------------------------------------------------
void CurvedINS2D::InitRun()
//---------------------------------------------------------
{
  // construct grid and metric
  StartUp2D();

  // Optional mesh refinement: split each parent 
  // element into 4 conforming "child" elements

  if (Nrefine>0) {
    umLOG(1, "before refine : K = %5d\n", K);
    DMat Q2(Np*K, 1);  IMat refineflag;
    refineflag = Ones(K,Nfaces);
    for (int i=1; i<=Nrefine; ++i) {
      Q2 = ConformingHrefine2D(refineflag, Q2);
      umLOG(1, "after refine %d: K = %5d\n", i, K);
    }
  }

  // Adjust faces on circular boundaries,
  // and perform any sim-specific setup:

  switch (sim_type) {

  case eVolkerCylinder:
    // move Cylinder bdry faces to radius 0.05
    AdjustCylBC(0.05, 0.,0., BC_Cyl);
    break;

  default:
    // set default maps for {straight,curved} elements
    straight.range(1,K); curved.resize(0);
    break;
  }

  Resize();             // allocate arrays
  BuildBCMaps2D();      // build boundary condition maps
  SetIC();              // set initial conditions
  SetStepSize();        // calculate step size (dt)

  // reset various work timers
  time_setup = time_advection = 0.0;
  time_viscous = time_viscous_sol = 0.0;
  time_pressure = time_pressure_sol = 0.0;

  //---------------------------------------------
  // base class version sets counters and flags
  //---------------------------------------------
  NDG2D::InitRun();   

  //---------------------------------------------
  // set frequency of reporting
  //---------------------------------------------
//Nreport =  Nsteps/150;
//Nreport =  10;
//Nreport =  2;

  Nreport = 10;
//Nreport = 250;

//Nreport = 1000;
//Nreport = 10000;

  //---------------------------------------------
  // set frequency of rendering
  //---------------------------------------------
  Nrender = Nreport;
//Nrender = 250;
//Nrender = 1000;

//NvtkInterp = 12;        // set output resolution
//NvtkInterp =  5;        // set output resolution
  NvtkInterp = this->N;   // use original nodes

  Summary();  // show simulation details
}
//---------------------------------------------------------
void EulerShock2D::InitRun()
//---------------------------------------------------------
{
  // base class performs usual startup sequence
  // CurvedEuler2D::InitRun();

  //-------------------------------------
  // construct grid and metric
  //-------------------------------------
  StartUp2D();

  //-------------------------------------
  // refine default mesh
  //-------------------------------------
  if (Nrefine>=1) {
    umLOG(1, "before refinement K = %6d\n", K);
    for (int i=1; i<=Nrefine; ++i) {
      DMat Qtmp(Np*K, 1);  IMat refineflag;
      refineflag = Ones(K,Nfaces); Qtmp = ConformingHrefine2D(refineflag, Qtmp);
      umLOG(1, "after h-refine %d: K = %6d\n", i,K);
    }
  }

  // store original BC types before adjusting, 
  // (e.g. BC_Cyl faces may be set to BC_Wall)
  saveBCType = BCType;

  //-------------------------------------
  // Adjust faces on circular boundaries
  //-------------------------------------
  switch (sim_type) {

  case eForwardStep:
    // no cylinder faces
    straight.range(1,K); curved.resize(0);
    break;

  case eScramInlet:
    // no cylinder faces
    straight.range(1,K); curved.resize(0);
    break;
  
  default:
    // set default maps for {straight,curved} elements
    straight.range(1,K); curved.resize(0);
    break;
  }

  BuildBCMaps2D();  // map faces subject to boundary conditions
  Resize();         // allocate arrays
  SetIC();          // set initial conditions

#if (1)
  OutputNodes(false); // volume nodes
#endif


#if (0)
  tstep = -1;
  Report(true);
#endif

  SetStepSize();    // compute initial timestep (using IC's)

  // storage for residual at each time-step,
  // allowing for variable step size
  resid.resize(2*Nsteps);

  // base class version sets counters and flags
  NDG2D::InitRun();   

  // pre-calculate constant data for limiter routine
  precalc_limiter_data();

  //---------------------------------------------
  // Adjust reporting and render frequencies
  //---------------------------------------------

  switch (sim_type) {

  case eForwardStep:
    Nreport     = 100;    // frequency of reporting
    Nrender     = 300;    // frequency of rendering
    NvtkInterp  = 3;      // resolution of vtk output
    break;

  case eScramInlet:
    NvtkInterp = 2;
    switch (mesh_level) {
    case 1:   Nreport =  100;  Nrender =  100;   break;
    case 2:   Nreport =  250;  Nrender =  250;   break;
    case 3:   Nreport =  500;  Nrender =  500;   break;
    case 4:   Nreport = 1000;  Nrender = 1000;   break;
    default:  Nreport = 1000;  Nrender = 1000;   break;
    }
    break;
  }

  // Show simulation details
  Summary();
}
Exemple #15
0
void Gogame::AddStone(unsigned int color, unsigned int x, unsigned int y,
                      bool ismove, int nodeid)
{
  // Add a stone of a color at (x, y)
  // may either be play or setup
  // if x or y is out-of-bounds, this is regarded as 'pass' move
  //
  // ismove indicates whether this is a move or setup
  // if setup, the movenumber does not increase

  // ismove flag indicates if this play is a move or setup

  // Rcpp::Rcout << "add stone: " <<
  //   "(" << color << "," << x << "," <<
  //   y << "," << ismove << "," << nodeid << ") ";

  // check validity of color
  if (color != BL && color != WH && color != EM) {
    Rcpp::Rcout << "at nodeid " << nodeid << " ";
    Rcpp::stop("invalid color");
  }
  if (ismove && color == EM) {
    Rcpp::Rcout << "at nodeid " << nodeid << " ";
    Rcpp::stop("empty stone is invalid for moves");
  }
  // check if the stone can be put there
  if (!IsLegal(x, y, color, ismove)) {
    Summary();
    Rcpp::Rcout << "at nodeid " << nodeid <<
      ", tries to play: (x, y, color, ismove) = (" <<
      x << ", " << y << ", " << color << ", " << (int)ismove << ")\n";
    Rcpp::stop("illegal move");
  }


  // update current node member field
  currentnode = nodeid;
  // case for setup move
  if (!ismove) {
    // if this is a setup move, then add stone at the point and
    // no need to check the liberty.
    // but do nothing if the x or y is out of bounds because
    // you cannot add stone there!
    if (x >= 1 && y >= 1 && (int)x <= boardsize && (int)y <= boardsize) {
      // if a stone is already there, then you need to first remove the stone
      if (board[y][x] == BL || board[y][x] == WH) {
        transitions.push_back(Transition(movenumber, x, y,
                                         -board[y][x], currentnode, false));
        board[y][x] = EM;
      }
      // if this new stone is colored, add that stone
      if (color == BL || color == WH) {
        board[y][x] = color;
        transitions.push_back(Transition(movenumber, x, y,
                                         color, currentnode, false));
      }
    }
    return;
  }

  // reaching here means it is a move
  movenumber++;

  // coordinates out of bounds are regarded as pass,
  // append transition, but do nothing afterwards
  // x = y = 0 means this move is a pass
  if (x < 1 || y < 1 || (int)x > boardsize || (int)y > boardsize) {
    transitions.push_back(Transition(movenumber, 0, 0, color, currentnode, true));
    return;
  }

  // put the stone temporarily
  board[y][x] = color;

  // and record it in the transitions field
  transitions.push_back(Transition(movenumber, x, y, color, currentnode, true));


  // enter four adjacent points to the checklist
  // if they are opponent color
  unsigned int opponent_color;
  if (color == BL) {
    opponent_color = WH;
  } else {
    opponent_color = BL;
  }


  // check if any opponent stone becomes captured due to this play

  // loop over the four adjacent point
  unsigned int xx;
  unsigned int yy;
  int increment;
  for (int k = 0; k < 4; k++)
  {
    increment = 2*(k % 2) - 1;
    if (k < 2) {
      xx = x + increment;
      yy = y;
    } else {
      xx = x;
      yy = y + increment;
    }

    // if this is a opponent stone,
    // check the liberty of this point,
    // and if it does not have a liberty,
    // remove all stones connected to it
    if (board[yy][xx] == opponent_color)
      CheckAndRemove(xx, yy);
  }

}