Пример #1
0
void Zsave_file(void)
{
	if (Argp)
		saveall(false);
	else
		filesave();
}
Пример #2
0
Файл: is1.c Проект: 3ki5tj/alge
/* entropic sampling */
static int run(ising_t *is, double trun)
{
  algei_t *al;
  double t, *ehis, verr[8], ave2 = 0, alf = 0;
  int it = 0, u0 = 0, u1, du = 0;
  int *stack, nstack = 0;

  xnew(stack, seglen);

  al = algei_open(epmin, epmax, epdel, beta0, beta1);
  /* equilibrate the system till is->E > epmin */
  for (t = 1; is->E <= epmin + 4; t++) {
    int id, h;
    IS2_PICK(is, id, h);
    IS2_FLIP(is, id, h);
  }
  printf("equilibration finished in %d steps\n", it);

  xnew(ehis, ECNT);

  u0 = is->E;

  for (t = 1; t <= trun; t++) {
    ehis[ (is->E - EMIN)/EDEL ] += 1;
    move(is, al, stack, &nstack);

    if (++it % seglen == 0) {
      u1 = is->E;
      du = u1 - u0;
      assert(u0 >= epmin && u0 < epmax);
      algei_fupdate(al, u0, du, alf0, alfc, &alf,
          delmax, &ave2, 0, betmax);
      if (u1 < epmin || u1 >= epmax) { /* undo out-of-boudary segments */
        undo(is, stack, nstack);
        u1 = is->E;
      }
      u0 = u1; /* set the new start point */
      nstack = 0; /* clear the stack */

      if (it % nevery == 0) {
        printf("t %g, ep %d, du %d, e2 %g, alf %g\n", t, is->E, du, ave2, alf);
      }

      if (it % nreport == 0 || t >= nsteps - .1) {
        saveall(al, is->logdos, verr, ehis, fnhis);
        printf("trun %g, eabsave %g, eabsmax %g, erelave %g, erelmax %g\n",
          trun, verr[0], verr[1], verr[2], verr[3]);
        algei_save(al, fnout);
        it = 0; /* reset the integer counter */
      }
    }
  }
  algei_close(al);
  free(ehis);
  free(stack);
  return 0;
}
Пример #3
0
/*
 * Save lines before visual between unddol and truedol.
 * Accomplish this by throwing away current [unddol,truedol]
 * and then saving all the lines in the buffer and moving
 * unddol back to dol.  Don't do this if in a global.
 *
 * If you do
 *	g/xxx/vi.
 * and then do a
 *	:e xxxx
 * at some point, and then quit from the visual and undo
 * you get the old file back.  Somewhat weird.
 */
void
savevis(void)
{

	if (inglobal)
		return;
	truedol = unddol;
	saveall();
	unddol = dol;
	undkind = UNDNONE;
}
Пример #4
0
void Zsave_all_files(void)
{
	if (Argp) {
		zbuff_t *tbuff;

		foreachbuff(tbuff)
			if (!(tbuff->bmode & SYSBUFF) && tbuff->fname)
				tbuff->buff->bmodf = true;
	}
	saveall(true);
}
Пример #5
0
/*
 * Push st onto the front of vmacp. This is tricky because we have to
 * worry about where vmacp was previously pointing. We also have to
 * check for overflow (which is typically from a recursive macro)
 * Finally we have to set a flag so the whole thing can be undone.
 * canundo is 1 iff we want to be able to undo the macro.  This
 * is false for, for example, pushing back lookahead from fastpeekkey(),
 * since otherwise two fast escapes can clobber our undo.
 */
void
macpush(char *st, int canundo)
{
	char tmpbuf[BUFSIZ];

	if (st==0 || *st==0)
		return;
#ifdef notdef
	if (!value(UNDOMACRO))
		canundo = 0;
#endif
#ifdef TRACE
	if (trace)
		fprintf(trace, "macpush(%s), canundo=%d\n",st,canundo);
#endif
	if ((vmacp ? strlen(vmacp) : 0) + strlen(st) > BUFSIZ)
		error("Macro too long@ - maybe recursive?");
	if (vmacp) {
		strcpy(tmpbuf, vmacp);
		if (!FIXUNDO)
			canundo = 0;	/* can't undo inside a macro anyway */
	}
	strcpy(vmacbuf, st);
	if (vmacp)
		strcat(vmacbuf, tmpbuf);
	vmacp = vmacbuf;
	/* arrange to be able to undo the whole macro */
	if (canundo) {
#ifdef notdef
		otchng = tchng;
		vsave();
		saveall();
		inopen = -1;	/* no need to save since it had to be 1 or -1 before */
		vundkind = VMANY;
#endif
		vch_mac = VC_NOCHANGE;
	}
}
Пример #6
0
STATUS original_test_end(int argc, char *argv[])
{
	FINDLIST *find = find_objects(FL_GROUP,"class=node;");
	OBJECT *obj;
	AGGREGATION *aggr;
	char *exp = "class=node";
	char *agg = "max(V.ang)";

	for (obj=find_first(find); obj!=NULL; obj=find_next(find,obj))
		output_message("object %s found", object_name(obj));
	free(find);

	output_message("Aggregation of %s over %s...", agg,exp);
	aggr = aggregate_mkgroup(agg,exp);
	if (aggr)
		output_message("Result is %lf", aggregate_value(aggr));
	else
		output_message("Aggregation failed!");

	if (!saveall("-"))
		perror("save failed");

	return SUCCESS;
}
Пример #7
0
/*
该函数用于保存数据
2011-02-14
21:26
*/
TYPE_STATUS fileio::saveall(TYPE_FILENAME fn, TYPE_BYTE_STRING& sa)
{
	return saveall(fn, sa.buf, sa.size);
}
Пример #8
0
/** The main entry point of GridLAB-D
 Exit codes
 - \b 0 run completed ok
 - \b 1 command-line processor stopped
 - \b 2 environment startup failed
 - \b 3 test procedure failed
 - \b 4 user rejects conditions of use
 - \b 5 simulation stopped before completing
 - \b 6 initialization failed
 **/
int main(int argc, /**< the number entries on command-line argument list \p argv */
		 char *argv[]) /**< a list of pointers to the command-line arguments */
{
	int rv = 0;
	time_t t_load = time(NULL);
	global_process_id = getpid();
#if defined WIN32 && _DEBUG 
	atexit(pause_at_exit);
#endif
	/* main initialization */
	if (!output_init(argc,argv) || !exec_init())
		exit(6);

	/* process command line arguments */
	if (cmdarg_load(argc,argv)==FAILED)
	{
		output_fatal("shutdown after command line rejected");
		/*	TROUBLESHOOT
			The command line is not valid and the system did not
			complete its startup procedure.  Correct the problem
			with the command line and try again.
		 */
		exit(1);
	}

	/* setup the random number generator */
	random_init();

	/* pidfile */
	if (strcmp(global_pidfile,"")!=0)
	{
		FILE *fp = fopen(global_pidfile,"w");
		if (fp==NULL)
		{
			output_fatal("unable to create pidfile '%s'", global_pidfile);
			/*	TROUBLESHOOT
				The system must allow creation of the process id file at
				the location indicated in the message.  Create and/or
				modify access rights to the path for that file and try again.
			 */
			exit(1);
		}
#ifdef WIN32
#define getpid _getpid
#endif
		fprintf(fp,"%d\n",getpid());
		output_verbose("process id %d written to %s", getpid(), global_pidfile);
		fclose(fp);
		atexit(delete_pidfile);
	}

	/* do legal stuff */
#ifdef LEGAL_NOTICE
	if (strcmp(global_pidfile,"")==0 && legal_notice()==FAILED)
		exit(4);
#endif

	/* set up the test */
	if (global_test_mode)
	{
#ifndef _NO_CPPUNIT
		output_message("Entering test mode");
		if (test_start(argc,argv)==FAILED)
		{
			output_fatal("shutdown after startup test failed");
			/*	TROUBLESHOOT
				A self-test procedure failed and the system stopped.
				Check the output of the test stream and correct the 
				indicated problem.  If the test stream is not redirected
				so as to save the output, try using the <b>--redirect</b>
				command line option.
			 */
			exit(3);
		}
		exit(0); /* There is no environment to speak of, so exit. */
#else
		output_message("Unit Tests not enabled.  Recompile with _NO_CPPUNIT unset");
#endif
	}
	
	/* start the processing environment */
	output_verbose("load time: %d sec", time(NULL) - t_load);
	output_verbose("starting up %s environment", global_environment);
	if (environment_start(argc,argv)==FAILED)
	{
		output_fatal("environment startup failed: %s", strerror(errno));
		/*	TROUBLESHOOT
			The requested environment could not be started.  This usually
			follows a more specific message regarding the startup problem.
			Follow the recommendation for the indicated problem.
		 */
		rv = 2;
	}

	/* post process the test */
	if (global_test_mode)
	{
#ifndef _NO_CPPUNIT
		output_message("Exiting test mode");
		if (test_end(argc,argv)==FAILED)
		{
			output_error("shutdown after end test failed");
			exit(3);
		}
#endif
	}

	/* save the model */
	if (strcmp(global_savefile,"")!=0)
	{
		if (saveall(global_savefile)==FAILED)
			output_error("save to '%s' failed", global_savefile);
	}

	/* do module dumps */
	if (global_dumpall!=FALSE)
	{
		output_verbose("dumping module data");
		module_dumpall();
	}

	/* KML output */
	if (strcmp(global_kmlfile,"")!=0)
		kml_dump(global_kmlfile);

	/* wrap up */
	output_verbose("shutdown complete");

	/* profile results */
	if (global_profiler)
		class_profiles();

	/* restore locale */
	locale_pop();

	/* compute elapsed runtime */
	output_verbose("elapsed runtime %d seconds", realtime_runtime());

	exit(rv);
}
Пример #9
0
void
global(bool k)
{
	register char *gp;
	register int c;
	register line *a1;
	char globuf[GBSIZE], *Cwas;
	int lines = lineDOL();
	char *oglobp = globp;

	Cwas = Command;
	if (inglobal)
		error("Global within global@not allowed");
	markDOT();
	setall();
	nonzero();
	if (skipend())
		error("Global needs re|Missing regular expression for global");
	c = ex_getchar();
	ignore(compile(c, 0));
	savere(scanre);
	gp = globuf;
	while ((c = ex_getchar()) != '\n') {
		switch (c) {

		case EOF:
			c = '\n';
			goto brkwh;

		case '\\':
			c = ex_getchar();
			switch (c) {

			case '\\':
				ungetchar(c);
				break;

			case '\n':
				break;

			default:
				*gp++ = '\\';
				break;
			}
			break;
		}
		*gp++ = c;
		if (gp >= &globuf[GBSIZE - 2])
			error("Global command too long");
	}
brkwh:
	ungetchar(c);
	ex_newline();
	*gp++ = c;
	*gp++ = 0;
	inglobal = 1;
	for (a1 = one; a1 <= dol; a1++) {
		*a1 &= ~01;
		if (a1 >= addr1 && a1 <= addr2 && execute(0, a1) == k)
			*a1 |= 01;
	}
	/* should use gdelete from ed to avoid n**2 here on g/.../d */
	saveall();
	if (inopen)
		inopen = -1;
	for (a1 = one; a1 <= dol; a1++) {
		if (*a1 & 01) {
			*a1 &= ~01;
			dot = a1;
			globp = globuf;
			commands(1, 1);
			a1 = zero;
		}
	}
	globp = oglobp;
	inglobal = 0;
	endline = 1;
	Command = Cwas;
	netchHAD(lines);
	setlastchar(EOF);
	if (inopen) {
		ungetchar(EOF);
		inopen = 1;
	}
}
Пример #10
0
/** The main entry point of GridLAB-D
    @returns Exit codes XC_SUCCESS, etc. (see gridlabd.h)
 **/
int main(int argc, /**< the number entries on command-line argument list \p argv */
		 char *argv[]) /**< a list of pointers to the command-line arguments */
{
	char *pd1, *pd2;
	int i, pos=0;
	
	char *browser = getenv("GLBROWSER");

	/* set the default timezone */
	timestamp_set_tz(NULL);

	exec_clock(); /* initialize the wall clock */
	realtime_starttime(); /* mark start */
	
	/* set the process info */
	global_process_id = getpid();

	/* specify the default browser */
	if ( browser!= NULL )
		strncpy(global_browser,browser,sizeof(global_browser)-1);

#if defined WIN32 && _DEBUG 
	atexit(pause_at_exit);
#endif

#ifdef WIN32
	kill_starthandler();
	atexit(kill_stophandler);
#endif

	/* capture the execdir */
	strcpy(global_execname,argv[0]);
	strcpy(global_execdir,argv[0]);
	pd1 = strrchr(global_execdir,'/');
	pd2 = strrchr(global_execdir,'\\');
	if (pd1>pd2) *pd1='\0';
	else if (pd2>pd1) *pd2='\0';

	/* determine current working directory */
	getcwd(global_workdir,1024);

	/* capture the command line */
	for (i=0; i<argc; i++)
	{
		if (pos < (int)(sizeof(global_command_line)-strlen(argv[i])))
			pos += sprintf(global_command_line+pos,"%s%s",pos>0?" ":"",argv[i]);
	}

	/* main initialization */
	if (!output_init(argc,argv) || !exec_init())
		exit(XC_INIERR);

	/* set thread count equal to processor count if not passed on command-line */
	if (global_threadcount == 0)
		global_threadcount = processor_count();
	output_verbose("detected %d processor(s)", processor_count());
	output_verbose("using %d helper thread(s)", global_threadcount);

	/* process command line arguments */
	if (cmdarg_load(argc,argv)==FAILED)
	{
		output_fatal("shutdown after command line rejected");
		/*	TROUBLESHOOT
			The command line is not valid and the system did not
			complete its startup procedure.  Correct the problem
			with the command line and try again.
		 */
		exit(XC_ARGERR);
	}

	/* stitch clock */
	global_clock = global_starttime;

	/* initialize scheduler */
	sched_init(0);

	/* recheck threadcount in case user set it 0 */
	if (global_threadcount == 0)
	{
		global_threadcount = processor_count();
		output_verbose("using %d helper thread(s)", global_threadcount);
	}

	/* see if newer version is available */
	if ( global_check_version )
		check_version(1);

	/* setup the random number generator */
	random_init();

	/* pidfile */
	if (strcmp(global_pidfile,"")!=0)
	{
		FILE *fp = fopen(global_pidfile,"w");
		if (fp==NULL)
		{
			output_fatal("unable to create pidfile '%s'", global_pidfile);
			/*	TROUBLESHOOT
				The system must allow creation of the process id file at
				the location indicated in the message.  Create and/or
				modify access rights to the path for that file and try again.
			 */
			exit(XC_PRCERR);
		}
#ifdef WIN32
#define getpid _getpid
#endif
		fprintf(fp,"%d\n",getpid());
		output_verbose("process id %d written to %s", getpid(), global_pidfile);
		fclose(fp);
		atexit(delete_pidfile);
	}

	/* do legal stuff */
#ifdef LEGAL_NOTICE
	if (strcmp(global_pidfile,"")==0 && legal_notice()==FAILED)
		exit(XC_USRERR);
#endif
	
	/* start the processing environment */
	output_verbose("load time: %d sec", realtime_runtime());
	output_verbose("starting up %s environment", global_environment);
	if (environment_start(argc,argv)==FAILED)
	{
		output_fatal("environment startup failed: %s", strerror(errno));
		/*	TROUBLESHOOT
			The requested environment could not be started.  This usually
			follows a more specific message regarding the startup problem.
			Follow the recommendation for the indicated problem.
		 */
		if ( exec_getexitcode()==XC_SUCCESS )
			exec_setexitcode(XC_ENVERR);
	}

	/* save the model */
	if (strcmp(global_savefile,"")!=0)
	{
		if (saveall(global_savefile)==FAILED)
			output_error("save to '%s' failed", global_savefile);
	}

	/* do module dumps */
	if (global_dumpall!=FALSE)
	{
		output_verbose("dumping module data");
		module_dumpall();
	}

	/* KML output */
	if (strcmp(global_kmlfile,"")!=0)
		kml_dump(global_kmlfile);

	/* terminate */
	module_termall();

	/* wrap up */
	output_verbose("shutdown complete");

	/* profile results */
	if (global_profiler)
	{
		class_profiles();
		module_profiles();
	}

#ifdef DUMP_SCHEDULES
	/* dump a copy of the schedules for reference */
	schedule_dumpall("schedules.txt");
#endif

	/* restore locale */
	locale_pop();

	/* if pause enabled */
#ifndef WIN32
        if (global_pauseatexit) {
                output_verbose("pausing at exit");
		while (true) {
                        sleep(5);
                }
        }
#endif

	/* compute elapsed runtime */
	output_verbose("elapsed runtime %d seconds", realtime_runtime());
	output_verbose("exit code %d", exec_getexitcode());
	exit(exec_getexitcode());
}
Пример #11
0
/*
 * Routine to handle a change inside a macro.
 * Fromvis is true if we were called from a visual command (as
 * opposed to an ex command).  This has nothing to do with being
 * in open/visual mode as :s/foo/bar is not fromvis.
 */
void 
vmacchng(int fromvis)
{
	line *savedot, *savedol;
	char *savecursor;
	char *savelb;
	int nlines, more;
	/* register line *a1, *a2; */
	/* char ch; */	/* DEBUG */

	if (!inopen)
		return;
	if (!vmacp)
		vch_mac = VC_NOTINMAC;
#ifdef TRACE
	if (trace)
		fprintf(trace, "vmacchng, vch_mac=%d, linebuf='%s', *dot=%o\n", vch_mac, linebuf, *dot);
#endif
	if (vmacp && fromvis)
		vsave();
#ifdef TRACE
	if (trace)
		fprintf(trace, "after vsave, linebuf='%s', *dot=%o\n", linebuf, *dot);
#endif
	switch(vch_mac) {
	case VC_NOCHANGE:
		vch_mac = VC_ONECHANGE;
		break;
	case VC_ONECHANGE:
		savelb = smalloc(LBSIZE);
		/* Save current state somewhere */
#ifdef TRACE
		vudump("before vmacchng hairy case");
#endif
		savedot = dot; savedol = dol; savecursor = cursor;
		CP(savelb, linebuf);
		nlines = dol - zero;
		while ((line *) endcore - truedol < nlines)
			morelines();
		copyw(truedol+1, zero+1, nlines);
		truedol += nlines;

#ifdef TRACE
		visdump("before vundo");
#endif
		/* Restore state as it was at beginning of macro */
		vundo(0);
#ifdef TRACE
		visdump("after vundo");
		vudump("after vundo");
#endif

		/* Do the saveall we should have done then */
		saveall();
#ifdef TRACE
		vudump("after saveall");
#endif

		/* Restore current state from where saved */
		more = savedol - dol; /* amount we shift everything by */
		if (more)
			(*(more>0 ? copywR : copyw))(savedol+1, dol+1, truedol-dol);
		unddol += more; truedol += more; undap2 += more;

		truedol -= nlines;
		copyw(zero+1, truedol+1, nlines);
		dot = savedot; dol = savedol ; cursor = savecursor;
		CP(linebuf, savelb);
		vch_mac = VC_MANYCHANGE;

		/* Arrange that no further undo saving happens within macro */
		otchng = tchng;	/* Copied this line blindly - bug? */
		inopen = -1;	/* no need to save since it had to be 1 or -1 before */
		vundkind = VMANY;
#ifdef TRACE
		vudump("after vmacchng");
#endif
		free(savelb);
		break;
	case VC_NOTINMAC:
	case VC_MANYCHANGE:
		/* Nothing to do for various reasons. */
		break;
	}
}
Пример #12
0
// Action create
void MapView::createActions()
{
	openAction = new QAction(tr("&Open"),this);
	openAction->setIcon(QIcon(":/images/open.png"));
	openAction->setShortcut(QKeySequence::Open);
	openAction->setStatusTip(tr("Open a map file"));
	connect(openAction,SIGNAL(triggered()),this,SLOT(open()));

	saveAllAction = new QAction(tr("&Save All"),this);
	saveAllAction->setIcon(QIcon(":/images/save.png"));
	saveAllAction->setShortcut(QKeySequence::Save);
	saveAllAction->setStatusTip(tr("Save map and user layer to disk and database"));
	connect(saveAllAction,SIGNAL(triggered()),this,SLOT(saveall()));

	//file save
	saveFileAction = new QAction(tr("Save &File"),this);
	saveFileAction->setIcon(QIcon(":/images/save.png"));
	saveFileAction->setShortcut(tr("Ctrl+Shift+S"));
	saveFileAction->setStatusTip(tr("Save map to disk including user layer"));
	connect(saveFileAction,SIGNAL(triggered()),main,   SLOT(save()));

	//save as
	saveAsAction = new QAction(tr("Save &As"),this);
	saveAsAction->setIcon(QIcon(":/images/saveas.png"));
	saveAsAction->setShortcut(tr("Ctrl+A"));
	saveAsAction->setStatusTip(tr("Save map to disk with new file name including user layer"));
	connect(saveAsAction,SIGNAL(triggered()),this,SLOT(saveas()));

	//load ul from db
	GetUserLayerFromDbAction=new QAction(tr("Load U&L from Db"),this);
	GetUserLayerFromDbAction->setIcon(QIcon(":/images/fromdb.png"));
	GetUserLayerFromDbAction->setStatusTip(tr("Get user layer from database"));
	connect(GetUserLayerFromDbAction,SIGNAL(triggered()),main,SLOT(getulfromdb()));

	//save ul to db
	LoadUserLayerToDbAction =new QAction(tr("Save UL to &Db"),this);
	LoadUserLayerToDbAction->setIcon(QIcon(":/images/todb.png"));
	LoadUserLayerToDbAction->setStatusTip(tr("Save user layer to database"));
	connect(LoadUserLayerToDbAction,SIGNAL(triggered()),main,SLOT(saveultodb()));

	makeMapFromDBAction = new QAction(tr("Make map file from Db"), this);
	//makeMapFromDBAction->setIcon(QIcon(":/images/todb.png"));
	makeMapFromDBAction->setStatusTip(tr("Create Map file from database"));
	connect(makeMapFromDBAction,SIGNAL(triggered()),main,SLOT(makeMapFromDb()));

	//panel
	leftpanelVisibleAction = new QAction(tr("&Layer Panel Hide"),this);
	leftpanelVisibleAction->setIcon(QIcon(":/images/layer_blue.png"));
	leftpanelVisibleAction->setShortcut(tr("Ctrl+L"));
	leftpanelVisibleAction->setStatusTip(tr("hide show layer panel (Ctrl+L)"));
	connect(leftpanelVisibleAction,SIGNAL(triggered()),this,SLOT(setLeftPanelVisible()));

	objectpanelVisibleAction = new QAction(tr("&Object Panel Hide"),this);
	objectpanelVisibleAction->setIcon(QIcon(":/images/panel_blue.png"));
	objectpanelVisibleAction->setShortcut(tr("Ctrl+P"));
	objectpanelVisibleAction->setStatusTip(tr("hide or show object panel (Ctrl+P)"));
	connect(objectpanelVisibleAction,SIGNAL(triggered()),this,SLOT(setObjectPanelVisible()));

	//map control
	zoomInAction = new QAction(tr("zoom &in"),this);
	zoomInAction->setIcon(QIcon(":/images/zoomin.png"));
	zoomInAction->setStatusTip(tr("Zoom in map, short key : + "));
	connect(zoomInAction,SIGNAL(triggered()),this,SLOT(zoomIn()));

	zoomOutAction = new QAction(tr("zoom &out"),this);
	zoomOutAction->setIcon(QIcon(":/images/zoomout.png"));
	zoomOutAction->setStatusTip(tr("Zoom out map, short key : - "));
	connect(zoomOutAction,SIGNAL(triggered()),this,SLOT(zoomOut()));

	moveHomeAction = new QAction(tr("se&t Init"),this);
	moveHomeAction->setIcon(QIcon(":/images/sethome.png"));
	moveHomeAction->setStatusTip(tr("move to initiali zoom and postion"));
	connect(moveHomeAction,SIGNAL(triggered()),this,SLOT(moveHome()));

	moveLeftAction = new QAction(tr("move &Left"),this);
	moveLeftAction->setIcon(QIcon(":/images/arrow_left.png"));
	moveLeftAction->setStatusTip(tr("move map to left , short key : arrow left "));
	connect(moveLeftAction,SIGNAL(triggered()),this,SLOT(moveLeft()));

	moveRightAction = new QAction(tr("move &Right"),this);
	moveRightAction->setIcon(QIcon(":/images/arrow_right.png"));
	moveRightAction->setStatusTip(tr("move map to right, short key : arrow right"));
	connect(moveRightAction,SIGNAL(triggered()),this,SLOT(moveRight()));

	moveUpAction = new QAction(tr("move &Up"),this);
	moveUpAction->setIcon(QIcon(":/images/arrow_up.png"));
	moveUpAction->setStatusTip(tr("move map to upper , short key : arrow up"));
	connect(moveUpAction,SIGNAL(triggered()),this,SLOT(moveUp()));

	moveDownAction = new QAction(tr("move &Down"),this);
	moveDownAction->setIcon(QIcon(":/images/arrow_down.png"));
	moveDownAction->setStatusTip(tr("move map to down , short key : arrow down"));
	connect(moveDownAction,SIGNAL(triggered()),this,SLOT(moveDown()));

	//compass
	drawCrossAction = new QAction(tr("show &Compass"),this);
	drawCrossAction->setIcon(QIcon(":/images/cross.png"));
	drawCrossAction->setStatusTip(tr("show compass "));
	drawCrossAction->setCheckable(true);
	drawCrossAction->setChecked(false);
	connect(drawCrossAction,SIGNAL(triggered(bool)),main,SLOT(showBearingCircle(bool)));

	//경위도
	drawLatlonAction = new QAction(tr("show &Lat lon"),this);
	drawLatlonAction->setIcon(QIcon(":/images/latlon.png"));
	drawLatlonAction->setStatusTip(tr("show latitude and longitude"));
	drawLatlonAction->setCheckable(true);
	drawLatlonAction->setChecked(true);
	connect(drawLatlonAction,SIGNAL(triggered(bool)),main,SLOT(showLatLon(bool)));

	//id text 표시여부
	drawLayerIdAction = new QAction(tr("show Layer &Id"),this);
	drawLayerIdAction->setIcon(QIcon(":/images/idvisible.png"));
	drawLayerIdAction->setStatusTip(tr("show  id text on map"));
	drawLayerIdAction->setCheckable(true);
	drawLayerIdAction->setChecked(false);
	//connect(drawLayerIdAction,SIGNAL(triggered()),this,SLOT(drawLayerId()));
	connect(drawLayerIdAction,SIGNAL(triggered(bool)),main,SLOT(onoffLayerIdText(bool)));

	savePixmapAction = new QAction(tr("save map &image"),this);
	savePixmapAction->setStatusTip(tr("save map to file"));
	connect(savePixmapAction,SIGNAL(triggered()),this,SLOT(savePixmap()));

	exitAction = new QAction(tr("E&xit"),this);
	exitAction->setIcon(QIcon(":/images/quit.png"));
	exitAction->setShortcut(tr("Ctrl+Q"));
	exitAction->setStatusTip(tr("Exit the application"));
	connect(exitAction,SIGNAL(triggered()),this,SLOT(close()));

	//거리와 방향을 표시
	pointdistanceAction = new QAction(tr("Distance and Direction"),this);
	pointdistanceAction->setIcon(QIcon(":/images/pointdistance.png"));
	pointdistanceAction->setStatusTip(tr("display distance and direction from a point"));
	pointdistanceAction->setCheckable(true);
	connect(pointdistanceAction,SIGNAL(triggered(bool)),main,SLOT(onoffDistancBearing(bool)));

	// Track Report Menu
	trackCreateAction = new QAction(tr("Create"), this);
	trackCreateAction->setStatusTip(tr("Track Report Create"));
	connect(trackCreateAction, SIGNAL(triggered()), main, SLOT(trackCreate()));

	trackSaveAction = new QAction(tr("Save"), this);
	trackSaveAction->setStatusTip(tr("Track Report Save"));
	connect(trackSaveAction, SIGNAL(triggered()), main, SLOT(trackSave()));

	trackOpenAction = new QAction(tr("Open"), this);
	trackOpenAction->setStatusTip(tr("Track Report Open"));
	connect(trackOpenAction, SIGNAL(triggered()), main, SLOT(trackOpen()));

	trackOptionAction = new QAction(tr("Options"), this);
	trackOptionAction->setStatusTip(tr("Track Report Options select"));
	connect(trackOptionAction, SIGNAL(triggered()), main, SLOT(trackOption()));

	trackClTableAction = new QAction(tr("Clear Table"), this);
	trackClTableAction->setStatusTip(tr("Track Report Clear Table"));
	connect(trackClTableAction, SIGNAL(triggered()), main, SLOT(trackClTable()));

	trackClPanelAction = new QAction(tr("Clear Panel"), this);
	trackClPanelAction->setStatusTip(tr("Track Report Clear Panel"));
	connect(trackClPanelAction, SIGNAL(triggered()), main, SLOT(trackClPanel()));

	trackPrintAction = new QAction(tr("Print"), this);
	trackPrintAction->setStatusTip(tr("Track Report Print"));
	connect(trackPrintAction, SIGNAL(triggered()), main, SLOT(trackPrint()));
}