亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? visualizer.cpp

?? 無限傳感器網絡的模擬環境
?? CPP
字號:
/************************************************************************* *   @<title> Visualizer.cpp </title>@ * *   @<!-- Copyright 2006 Mark Lisee, Boleslaw K. Szymanski and Rensselaer *   Polytechnic Institute. All worldwide rights reserved.  A license to use, *   copy, modify and distribute this software for non-commercial research *   purposes only is hereby granted, provided that this copyright notice and *   accompanying disclaimer is not modified or removed from the software. * *   DISCLAIMER: The software is distributed "AS IS" without any express or *   implied warranty, including but not limited to, any implied warranties of *   merchantability or fitness for a particular purpose or any warranty of *   non-infringement of any current or pending patent rights. The authors of *   the software make no representations about the suitability of this *   software for any particular purpose. The entire risk as to the quality *   and performance of the software is with the user. Should the software *   prove defective, the user assumes the cost of all necessary servicing, *   repair or correction. In particular, neither Rensselaer Polytechnic *   Institute, nor the authors of the software are liable for any indirect, *   special, consequential, or incidental damages related to the software, *   to the maximum extent the law permits.-->@ * *************************************************************************/#include "ether_addr.h"#include "path.h"#include "Visualizer.h"using namespace std;Visualizer	*Visualizer::instance = NULL;const char	intro[] = "#Use the gnuplot command 'plot \"%s\" using 2:3 with lines' to display.\n"			  "#Use scripts/extractPaths to extract a subset of paths.\n#\n";Visualizer::Visualizer(  const char	*base)     : enabled( false), connectFileOpen( false), cfMaxX( 0.0), cfMaxY( 0.0){  if( base != NULL)  {    int		len = strlen( base);    char	*str = new char[ len + 6 + 1];    strcpy( str, base);    strcpy( str + len, ".nodes");    nodeFile = fopen( str, "w");    if( nodeFile == NULL)      printf( "Unable to open file %s for writing\n", str);    else    {      fprintf( nodeFile, "#use the gnuplot command "	       "'plot \"%s\" using 2:3' to display\n#\n", str);      strcpy( str + len, ".paths");      pathFile = fopen( str, "w");      if( pathFile == NULL)      {	printf( "Unable to open file %s for writing\n", str);	fclose( nodeFile);	nodeFile = NULL;      }      else      {	fprintf( pathFile, intro, str);	strcpy( str + len, ".drops");	dropFile = fopen( str, "w");	if( dropFile == NULL)	{	  printf( "Unable to open file %s for writing\n", str);	  fclose( nodeFile);	  fclose( pathFile);	  nodeFile = NULL;	  pathFile = NULL;	}	else	{	  fprintf( dropFile, intro, str);	  enabled = true;	  baseName = new char[ len + 6 + 1];	// extra room for extension	  if( baseName != NULL)	    strcpy( baseName, base);	}      }    }    delete [] str;  }  return;}Visualizer::~Visualizer(){  if( enabled == true)  {    fclose( nodeFile);    fclose( pathFile);    fclose( dropFile);    if( baseName != NULL)      delete [] baseName;  }  if( connectFileOpen == true)    endConnectFile();  enabled = false;  LocationList::iterator	iter;  for( iter = nodes.begin(); iter != nodes.end(); iter++)  {    delete (*iter).second;    nodes.erase( iter);  }  return;}Visualizer *Visualizer::instantiate(){  return instantiate( NULL);}Visualizer *Visualizer::instantiate(  const char	*baseName){  if( instance == NULL)    instance = new Visualizer( baseName);  return instance;}void Visualizer::nodeLocation(  int	addr,  double	xLoc,  double	yLoc){  if( instance == NULL)  {    printf( "***** Visualizer not instantiated.\n");    assert( instance != NULL);  }  if( enabled == false)    return;  LocationList::iterator	iter;  LocInfo	*li;  iter = nodes.find( addr);  if( iter != nodes.end())  {    delete iter->second;    nodes.erase( iter);  }  li = new LocInfo( xLoc, yLoc);  nodes.insert( make_pair( addr, li));  displayNode( addr, wFNode);  return;}void Visualizer::writePath(  int		src,  int		dest,  int		seqNumber,  Path		path,  bool		atDestination){  if( enabled == false)    return;  int		id;  bool		status;  FILE		*fp = atDestination == true ? pathFile : dropFile;  whichFile	wF = atDestination == true ? wFPath : wFDrop;  fprintf( fp, "\n# src %3d; dest %3d; sn%08X\n", src, dest, seqNumber);  if( displayNode( src, wF) == false)    return;  for( status = path.firstNode( id); status == true;       status = path.nextNode( id))    if( displayNode( id, wF) == false)      break;  if( path.getOverFlow() == true)    fprintf( fp, "888 10000 10000\n***** Path incomplete *****\n");  fprintf( fp, "##\n");  return;}bool Visualizer::displayNode(  int		node,  whichFile	wF){  LocationList::iterator	iter;  FILE		*fp = wF == wFNode ? nodeFile : wF == wFPath ? pathFile : dropFile;    iter = nodes.find( node);  if( iter == nodes.end())  {    fprintf( fp, "********** node %d not in map **********\n", (int) node);    return false;  }  fprintf( fp, "%d %f %f\n", (int) node, iter->second->x, iter->second->y);  return true;}bool Visualizer::startConnectFile(  double	maxX,  double	maxY){  if( enabled == false)    return false;  // constructor allocated enough space to hold file name extension  int		len = strlen( baseName);  strcpy( baseName + len, ".links");  connectFile = fopen( baseName, "w");  baseName[ len] = 0;	// restore baseName  if( connectFile == NULL)    return false;  cfMaxX = maxX;  cfMaxY = maxY;  fprintf( connectFile, "# This file may be used as input for gnuplot, "	   "Version 4.0\n# It provides a graphical representation of the "	   "topology described in the configuration file.\n# Links are "	   "unidirectional unless there are arrow heads at both ends.\n#\n");  return true;}void Visualizer::addConnection(  double	srcX,  double	srcY,  double	destX,  double	destY){  if( enabled == false)    return;  fprintf( connectFile, "set arrow from %f,%f to %f,%f\n", srcX, srcY, destX,	   destY);  return;}void Visualizer::endConnectFile(){  if( enabled == false)    return;  fprintf( connectFile, "plot [0:%f] [0:%f] \"%s.nodes\" using 2:3 with "	   "points lt 3 pt 6 ps 2\n", cfMaxX, cfMaxY, baseName);  fclose( connectFile);  connectFileOpen = false;  return;}/* end file Visualizer.cpp */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区二区三区观看| av中文一区二区三区| 国产精品视频一区二区三区不卡| 色拍拍在线精品视频8848| 激情久久久久久久久久久久久久久久| 成人欧美一区二区三区在线播放| 欧美一区二区免费观在线| av午夜一区麻豆| 激情亚洲综合在线| 调教+趴+乳夹+国产+精品| 亚洲天堂福利av| 国产精品日产欧美久久久久| 久久综合久久综合九色| 欧美一区二视频| 欧美日韩国产首页| 日本丰满少妇一区二区三区| 成人一区二区三区视频| 久久69国产一区二区蜜臀| 日日夜夜精品视频天天综合网| 亚洲天堂2014| 国产精品麻豆欧美日韩ww| 国产欧美视频在线观看| 精品电影一区二区| 日韩一区二区在线免费观看| 欧美日韩精品欧美日韩精品| 色激情天天射综合网| 波多野结衣精品在线| 国产精品亚洲专一区二区三区| 美国一区二区三区在线播放| 日韩精品一二三区| 性久久久久久久| 亚洲成av人**亚洲成av**| 亚洲一本大道在线| 亚洲大型综合色站| 五月激情综合婷婷| 轻轻草成人在线| 免费视频一区二区| 精品在线一区二区三区| 国产综合色视频| 国产老妇另类xxxxx| 国产成人啪免费观看软件| 国产高清久久久| 成人av资源在线观看| av电影在线观看一区| 一本色道久久加勒比精品| 色综合久久99| 欧美日韩高清一区二区不卡| 日韩一级在线观看| 精品伦理精品一区| 久久久久国产精品厨房| 中文字幕+乱码+中文字幕一区| 国产精品嫩草影院com| 1024成人网色www| 亚洲精品大片www| 日欧美一区二区| 九九视频精品免费| 国产成人综合自拍| 97se亚洲国产综合在线| 在线精品视频小说1| 制服丝袜av成人在线看| 精品国偷自产国产一区| 欧美激情中文不卡| 亚洲一区二区三区影院| 麻豆国产精品一区二区三区 | 国产酒店精品激情| 懂色av一区二区夜夜嗨| 99久久伊人网影院| 欧美揉bbbbb揉bbbbb| 精品国免费一区二区三区| 日本一区二区综合亚洲| 亚洲精品videosex极品| 日韩av电影天堂| 国产精品亚洲一区二区三区在线| 91亚洲精品一区二区乱码| 综合在线观看色| 精品国产乱码久久久久久老虎| 韩国v欧美v日本v亚洲v| 欧美色国产精品| 久久一夜天堂av一区二区三区| 国产无人区一区二区三区| 蜜臀a∨国产成人精品| 欧美视频在线不卡| 久久久欧美精品sm网站| 美女脱光内衣内裤视频久久网站 | 精品系列免费在线观看| 日韩免费电影一区| 日本美女一区二区| √…a在线天堂一区| 国产91在线看| 欧美国产在线观看| 国产成人综合亚洲91猫咪| 久久九九久精品国产免费直播| 奇米影视一区二区三区小说| 欧美xxxxx裸体时装秀| 国产精一区二区三区| 国产欧美精品一区aⅴ影院| 粉嫩蜜臀av国产精品网站| 亚洲精品午夜久久久| 欧美一区二区三区视频在线观看| 另类小说一区二区三区| 国产拍揄自揄精品视频麻豆| 97se亚洲国产综合在线| 亚洲五码中文字幕| 精品国产第一区二区三区观看体验 | 亚洲国产精品成人综合| 91免费观看在线| 日日摸夜夜添夜夜添国产精品| 日韩欧美另类在线| 97久久精品人人做人人爽| 香蕉久久一区二区不卡无毒影院 | 国产日产欧美一区| 日本精品一区二区三区四区的功能| 亚洲一区二区三区四区的| xnxx国产精品| 91精品办公室少妇高潮对白| 久久国产精品99久久久久久老狼| 久久蜜桃香蕉精品一区二区三区| 972aa.com艺术欧美| 久久精品二区亚洲w码| 亚洲精品中文在线观看| 日韩一级片网址| 色偷偷久久人人79超碰人人澡| 日本网站在线观看一区二区三区| 国产精品萝li| 精品剧情在线观看| 欧美高清你懂得| aaa亚洲精品一二三区| 国产在线精品一区二区不卡了 | 欧美日韩精品一区二区天天拍小说| 国产精品一区二区久久不卡 | 亚洲成国产人片在线观看| 国产日本欧美一区二区| 91精品国产品国语在线不卡| 色欧美乱欧美15图片| 成人午夜av电影| 麻豆一区二区三区| 亚洲成人av免费| 亚洲综合色区另类av| 中文字幕电影一区| 国产日产欧美一区二区视频| 日韩一区二区精品在线观看| 欧美午夜精品久久久久久超碰| av不卡在线观看| 不卡的av电影在线观看| 国产99久久久国产精品免费看| 精品一区二区在线视频| 免费观看在线综合色| 日韩精彩视频在线观看| 丝袜亚洲另类欧美综合| 水蜜桃久久夜色精品一区的特点| 亚洲第一激情av| 午夜影院在线观看欧美| 亚洲高清不卡在线观看| 亚洲国产精品久久久久婷婷884| 亚洲精品久久7777| 亚洲免费观看高清完整版在线观看 | 极品少妇xxxx精品少妇偷拍| 青青草97国产精品免费观看| 日本成人在线看| 精品综合久久久久久8888| 国产一区二区免费看| 国产麻豆精品95视频| 国产激情精品久久久第一区二区| 国产露脸91国语对白| 丰满少妇在线播放bd日韩电影| 国产精一区二区三区| 不卡免费追剧大全电视剧网站| 不卡视频在线观看| 欧美亚洲国产怡红院影院| 在线不卡欧美精品一区二区三区| 日韩一区二区影院| 久久精品在线免费观看| 中文字幕亚洲不卡| 日产国产欧美视频一区精品| 精品一二三四区| 91首页免费视频| 色综合激情五月| 亚洲一区在线视频| 从欧美一区二区三区| 99久久久免费精品国产一区二区 | 激情综合色播五月| 亚洲一区在线播放| 蜜桃视频一区二区三区在线观看| 黄色资源网久久资源365| 懂色av噜噜一区二区三区av| 91蝌蚪porny| 日韩免费电影一区| 亚洲欧洲av另类| 免费的成人av| 91网站最新地址| 日韩免费视频一区| 亚洲欧美日韩一区| 美女性感视频久久| 在线观看成人免费视频| 精品国产网站在线观看| 伊人开心综合网| 国产成a人无v码亚洲福利| 欧美日韩高清一区二区三区| 欧美国产1区2区| 久久精品久久综合|