void CSpeedMeter::SetRange(UINT nMin, UINT nMax, bool bDelete) { m_nMin = nMin; m_nMax = nMax; ResetGraph(bDelete); }
void Filterer::Plot(ChannelEvent *event_){ ///The limits of the vertical axis static float axisMin, axisMax; // Draw the trace if(event_->size != x_vals.size()){ // The length of the trace has changed. resetGraph_ = true; } if (resetGraph_) { ResetGraph(event_->size); axisMax = 0; axisMin = 1E9; } // Run the fast filter (trigger) on the trace. Filter(event_->yvals, event_->size, fast_filter_y, trig_rise, trig_flat); // Run the slow filter (energy) on the trace. Filter(event_->yvals, event_->size, slow_filter_y, energy_rise, energy_flat); for (size_t i = 0; i < event_->size ; i++) { graph->SetPoint(i, x_vals[i], event_->yvals[i]); f_fast->SetPoint(i, x_vals[i], fast_filter_y[i]); f_slow->SetPoint(i, x_vals[i], slow_filter_y[i]); } if (graph->GetYaxis()->GetXmax() > axisMax) axisMax = graph->GetYaxis()->GetXmax(); if (graph->GetYaxis()->GetXmin() < axisMin) axisMin = graph->GetYaxis()->GetXmin(); if (f_fast->GetYaxis()->GetXmax() > axisMax) axisMax = f_fast->GetYaxis()->GetXmax(); if (f_fast->GetYaxis()->GetXmin() < axisMin) axisMin = f_fast->GetYaxis()->GetXmin(); if (f_slow->GetYaxis()->GetXmax() > axisMax) axisMax = f_slow->GetYaxis()->GetXmax(); if (f_slow->GetYaxis()->GetXmin() < axisMin) axisMin = f_slow->GetYaxis()->GetXmin(); graph->GetYaxis()->SetLimits(axisMin, axisMax); graph->GetYaxis()->SetRangeUser(axisMin, axisMax); graph->Draw("APL"); f_fast->Draw("LSAME"); f_slow->Draw("LSAME"); canvas->Update(); num_displayed++; num_traces++; }
void ResetGraphView (HWND hWndGraph) { PGRAPHSTRUCT pGraph ; pGraph = GraphData (hWndGraph) ; if (!pGraph) { return ; } ChangeSaveFileName (NULL, IDM_VIEWCHART) ; if (pGraph->pSystemFirst) { ResetGraph (pGraph) ; } } // ResetGraphView
VOID ChartDeleteLine (PGRAPHSTRUCT pGraph, PLINESTRUCT pLine) { PLINESTRUCT npLine; pGraph->bModified = TRUE ; if (pGraph->pLineFirst == pLine) pGraph->pLineFirst = pLine->pLineNext; else { for (npLine = pGraph->pLineFirst; npLine; npLine = npLine->pLineNext) { if (npLine->pLineNext == pLine) npLine->pLineNext = pLine->pLineNext; } } if (!pGraph->pLineFirst) { ResetGraph (pGraph) ; } else { // BuildNewValueListForGraph () ; } // Delete the legend entry for this line. // If the line was highlighted then this will undo the highlight. LegendDeleteItem (hWndGraphLegend, pLine) ; LineFree (pLine) ; SizeGraphComponents (hWndGraph) ; }
init_all() { u_long *dop; GsDOBJ2 *objp; int i; ResetGraph(0); PadInit(0); GsInitVcount(); padd = 0; ismip = 0; GsInitGraph(320, 240, GsNONINTER | GsOFSGPU, 1, 0); GsDefDispBuff(0, 0, 0, 240); GsInit3D(); Wot[0].length = OT_LENGTH; Wot[0].org = zsorttable[0]; Wot[1].length = OT_LENGTH; Wot[1].org = zsorttable[1]; /* 座標定義 */ GsInitCoordinate2(WORLD, &DWorld); PWorld.vx = 70*ONE/360; PWorld.vy = PWorld.vz = 0; DWorld.coord.t[2] = -400; /* モデリングデータ読み込み */ dop = (u_long *) MODEL_ADDR; dop++; GsMapModelingData(dop); dop++; Objnum = *dop; dop++; for (i = 0; i < Objnum; i++) GsLinkObject4((u_long) dop, &object[i], i); for (i = 0, objp = object; i < Objnum; i++, objp++) { objp->coord2 = &DWorld; objp->attribute = 0; } /* 視点設定 */ GsSetProjection(250); view.vpx = 0; view.vpy = 000; view.vpz = 400; view.vrx = 0; view.vry = 0; view.vrz = 0; view.rz = 0; view.super = WORLD; GsSetRefView2(&view); /* 平行光源設定 */ pslt[0].vx = 0; pslt[0].vy = 0; pslt[0].vz = -100; pslt[0].r = 0xf0; pslt[0].g = 0xf0; pslt[0].b = 0xf0; GsSetFlatLight(0, &pslt[0]); pslt[1].vx = 0; pslt[1].vy = 100; pslt[1].vz = -100; pslt[1].r = 0xf0; pslt[1].g = 0xf0; pslt[1].b = 0xf0; GsSetFlatLight(1, &pslt[1]); pslt[2].vx = 0; pslt[2].vy = 100; pslt[2].vz = 0; pslt[2].r = 0x60; pslt[2].g = 0x60; pslt[2].b = 0x60; GsSetFlatLight(2, &pslt[2]); GsSetAmbient(0, 0, 0); GsSetLightMode(0); /* テクスチャデータの読み込み */ texture_init(TEX_ADDR); texture_init(TEX_ADDR1); /* デバッグプリントの準備 */ KanjiFntOpen(-120,-100,256,200,896,0,768,256,0,512); }
main() { DB db[2]; /* packet double buffer */ DB *cdb; /* current db */ MATRIX rottrans; /* rot-trans matrix */ int i; /* work */ int dmy, flg; /* dummy */ CVECTOR col[12]; /* cube color */ u_long cnt; etc.near_clip=500; etc.far_clip=5000; etc.clip_off=0; PadInit(0); /* initialize PAD */ ResetGraph(0); /* reset graphic subsystem (0:cold,1:warm) */ SetGraphDebug(0); /* set debug mode (0:off, 1:monitor, 2:dump) */ InitGeom(); /* initialize geometry subsystem */ SetGeomOffset(320, 240); /* set geometry origin as (160, 120) */ SetGeomScreen(SCR_Z); /* distance to viewing-screen */ SetLightMatrix(&LLM); SetColorMatrix(&LCM); SetBackColor(BK.vx,BK.vy,BK.vz); SetFarColor(FC.vx,FC.vy,FC.vz); SetFogNear(1*SCR_Z,SCR_Z); /* initialize environment for double buffer (interlace) * buffer ID VRAM address *------------------------------------------------------- * buffer #0 (0, 0)-(640,480) * buffer #1 (0, 0)-(640,480) */ SetDefDrawEnv(&db[0].draw, 0, 0, 640, 480); SetDefDrawEnv(&db[1].draw, 0, 0, 640, 480); SetDefDispEnv(&db[0].disp, 0, 0, 640, 480); SetDefDispEnv(&db[1].disp, 0, 0, 640, 480); FntLoad(960,256); SetDumpFnt(FntOpen(64,64,256,200,0,512)); SetRCnt(RCntCNT2,0xffff,RCntMdNOINTR|RCntMdFR); StartRCnt(RCntCNT2); /* set surface colors */ for (i = 0; i < 12; i+=2) { col[i].r = col[i+1].r = 0xff/*rand()*/; /* R */ col[i].g = col[i+1].g = 0xff/*rand()*/; /* G */ col[i].b = col[i+1].b = 0xff/*rand()*/; /* B */ col[i].cd = col[i+1].cd = CODE_G3; /* cd */ } init_prim(&db[0]); /* set primitive parameters on buffer #0 */ init_prim(&db[1]); /* set primitive parameters on buffer #1 */ SetDispMask(1); /* enable to display (0:inhibit, 1:enable) */ while (pad_read(&rottrans) == 0) { cdb = (cdb==db)? db+1: db; /* swap double buffer ID */ ClearOTagR(cdb->ot, OTSIZE); /* clear ordering table */ /* add cube */ ResetRCnt(RCntCNT2); add_cube(cdb->ot, cdb->s, v, n, col); cnt= GetRCnt(RCntCNT2); FntPrint("cnt=%d\n",cnt); /* swap buffer */ DrawSync(0); /* wait for end of drawing */ VSync(0); /* wait for the next V-BLNK */ PutDrawEnv(&cdb->draw); /* update drawing environment */ PutDispEnv(&cdb->disp); /* update display environment */ DrawOTag(cdb->ot+OTSIZE-1); /* draw */ FntFlush(-1); } PadStop(); exit(); }
main() { int i; int hsync; int ret; int tmp_v; ResetCallback(); // initialize CD subsystem CdInit(); CdSetDebug(0); // initialize graphics ResetGraph(0); // initialize debug display FntLoad(960, 256); SetDumpFnt(FntOpen(64, 64, 128, 128, 0, 512)); // initialize display double buffer SetDefDrawEnv(&db[0].draw, 0, 0, 320, 240); SetDefDrawEnv(&db[1].draw, 0, 240, 320, 240); SetDefDispEnv(&db[0].disp, 0, 240, 320, 240); SetDefDispEnv(&db[1].disp, 0, 0, 320, 240); db[0].draw.isbg = 1; setRGB0(&db[0].draw, 0, 0, 0); db[1].draw.isbg = 1; setRGB0(&db[1].draw, 0, 0, 0); setPolyF4(&db[0].prim); setRGB0(&db[0].prim, 255, 255, 0); setPolyF4(&db[1].prim); setRGB0(&db[1].prim, 255, 255, 0); for (i = 0; i < READ_FILES; i++) { set_read_file(i, filename[file_order[i]], (void *)0x80100000); } file_num = 0; // set CD subsystem mode param[0] = CdlModeSpeed; // x2 speed while (CdControl(CdlSetmode, param, 0) == 0) ; SetDispMask(1); // enable display // main loop while(1) { cdb = (cdb==db)? db+1: db; // swap double buffer ID ClearOTag(cdb->ot, OTSIZE); moving_object(); FntPrint("CD READ TEST 2\n----------------\n"); FntPrint("FILE: %d\n", file_num); FntPrint("POS: %02x:%02x:%02x\n", fp[file_num].pos.minute, fp[file_num].pos.second, fp[file_num].pos.sector); FntPrint("SECTORS: %d\n", read_remain_sector); FntPrint("READ V: %d\n", read_v); if ((ret = check_read_file()) == CD_READ_COMPLETE) { if (++file_num > READ_FILES-1) { file_num = 0; tmp_v = VSync(-1); read_v = tmp_v - start_v; start_v = tmp_v; } read_remain_sector = READ_SECTORS; // for display start_read_file(file_num); } else if (ret != CD_READ_BUSY) { start_read_file(0); start_v = VSync(-1); } read_manage(); hsync = VSync(0); PutDispEnv(&cdb->disp); // update display environment PutDrawEnv(&cdb->draw); // update drawing environment DrawOTag(cdb->ot); print_hsync(hsync); FntPrint("\nERROR: %d\n", errcnt); // flush debug strings FntFlush(-1); } }