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

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

?? emctaskmain.cc

?? Source code for an Numeric Cmputer
?? CC
?? 第 1 頁 / 共 5 頁
字號:
/********************************************************************* Description: emctaskmain.cc*   Main program for EMC task level**   Derived from a work by Fred Proctor & Will Shackleford** Author:* License: GPL Version 2* System: Linux*    * Copyright (c) 2004 All rights reserved.*********************************************************************//*  Principles of operation:  1.  The main program calls emcTaskPlan() and emcTaskExecute() cyclically.  2.  emcTaskPlan() reads the new command, and decides what to do with  it based on the mode (manual, auto, mdi) or state (estop, on) of the  machine. Many of the commands just go out immediately to the  subsystems (motion and IO). In auto mode, the interpreter is called  and as a result the interp_list is appended with NML commands.  3.  emcTaskExecute() executes a big switch on execState. If it's done,  it gets the next item off the interp_list, and sets execState to the  preconditions for that. These preconditions include waiting for motion,  waiting for IO, etc. Once they are satisfied, it issues the command, and  sets execState to the postconditions. Once those are satisfied, it gets  the next item off the interp_list, and so on.  4.  preconditions and postconditions are only looked at in conjunction  with commands on the interp_list. Immediate commands won't have any  pre- or postconditions associated with them looked at.  5.  At this point, nothing in this file adds anything to the interp_list.  This could change, for example, when defining pre- and postconditions for  jog or home commands. If this is done, make sure that the corresponding  abort command clears out the interp_list.  6. Single-stepping is handled in checkPreconditions() as the first  condition. If we're in single-stepping mode, as indicated by the  variable 'stepping', we set the state to waiting-for-step. This  polls on the variable 'steppingWait' which is reset to zero when a  step command is received, and set to one when the command is  issued.  */extern "C" {#include <stdio.h>		// vsprintf()#include <string.h>		// strcpy()#include <stdarg.h>		// va_start()#include <stdlib.h>		// exit()#include <signal.h>		// signal(), SIGINT#include <float.h>		// DBL_MAX#include <sys/types.h>		// pid_t#include <unistd.h>		// fork()#include <sys/wait.h>		// waitpid(), WNOHANG, WIFEXITED#include <ctype.h>		// isspace()#include <libintl.h>}#include "rcs.hh"		// NML classes, nmlErrorFormat()#include "emc.hh"		// EMC NML#include "canon.hh"		// CANON_TOOL_TABLE stuff#include "inifile.hh"		// INIFILE#include "interpl.hh"		// NML_INTERP_LIST, interp_list#include "emcglb.h"		// EMC_INIFILE,NMLFILE, EMC_TASK_CYCLE_TIME#include "interp_return.hh"	// public interpreter return values#ifdef USE_NLS#define _(string) gettext(string)#else#define _(string) (string)#endif// command line args-- global so that other modules can access int Argc;char **Argv;// NML channelsstatic RCS_CMD_CHANNEL *emcCommandBuffer = 0;static RCS_STAT_CHANNEL *emcStatusBuffer = 0;static NML *emcErrorBuffer = 0;// NML command channel data pointerstatic RCS_CMD_MSG *emcCommand = 0;// global EMC statusEMC_STAT *emcStatus = 0;// timer stuffstatic RCS_TIMER *timer = 0;// flag signifying that ini file [TASK] CYCLE_TIME is <= 0.0, so// we should not delay at all between cycles. This means also that// the EMC_TASK_CYCLE_TIME global will be set to the measured cycle// time each cycle, in case other code references this.static int emcTaskNoDelay = 0;static double EMC_TASK_CYCLE_TIME_ORIG = 0.0;// delay counterstatic double taskExecDelayTimeout = 0.0;// emcTaskQueueCommand puts cmd on interp_liststatic int emcTaskQueueCommand(NMLmsg * cmd);// emcTaskIssueCommand issues command immediatelystatic int emcTaskIssueCommand(NMLmsg * cmd);// pending command to be sent out by emcTaskExecute()static NMLmsg *emcTaskCommand = 0;// signal handling code to stop main loopstatic int done;static int emctask_shutdown(void);static int pseudoMdiLineNumber = -1;static void emctask_quit(int sig){    // set main's done flag    done = 1;    // restore signal handler    signal(sig, emctask_quit);}// implementation of EMC error loggerint emcOperatorError(int id, const char *fmt, ...){    EMC_OPERATOR_ERROR error_msg;    va_list ap;    // check channel for validity    if (emcErrorBuffer == NULL)	return -1;    if (!emcErrorBuffer->valid())	return -1;    if (NULL == fmt) {	return -1;    }    if (0 == *fmt) {	return -1;    }    // prepend error code, leave off 0 ad-hoc code    error_msg.error[0] = 0;    if (0 != id) {	sprintf(error_msg.error, "[%d] ", id);    }    // append error string    va_start(ap, fmt);    vsprintf(&error_msg.error[strlen(error_msg.error)], fmt, ap);    va_end(ap);    // force a NULL at the end for safety    error_msg.error[LINELEN - 1] = 0;    // write it    rcs_print("%s\n", error_msg.error);    return emcErrorBuffer->write(error_msg);}int emcOperatorText(int id, const char *fmt, ...){    EMC_OPERATOR_TEXT text_msg;    va_list ap;    // check channel for validity    if (emcErrorBuffer == NULL)	return -1;    if (!emcErrorBuffer->valid())	return -1;    // write args to NML message (ignore int text code)    va_start(ap, fmt);    vsprintf(text_msg.text, fmt, ap);    va_end(ap);    // force a NULL at the end for safety    text_msg.text[LINELEN - 1] = 0;    // write it    return emcErrorBuffer->write(text_msg);}int emcOperatorDisplay(int id, const char *fmt, ...){    EMC_OPERATOR_DISPLAY display_msg;    va_list ap;    // check channel for validity    if (emcErrorBuffer == NULL)	return -1;    if (!emcErrorBuffer->valid())	return -1;    // write args to NML message (ignore int display code)    va_start(ap, fmt);    vsprintf(display_msg.display, fmt, ap);    va_end(ap);    // force a NULL at the end for safety    display_msg.display[LINELEN - 1] = 0;    // write it    return emcErrorBuffer->write(display_msg);}/*  handling of EMC_SYSTEM_CMD *//* convert string to arg/argv set */static int argvize(const char *src, char *dst, char *argv[], int len){    char *bufptr;    int argvix;    char inquote;    char looking;    strncpy(dst, src, len);    dst[len - 1] = 0;    bufptr = dst;    inquote = 0;    argvix = 0;    looking = 1;    while (0 != *bufptr) {	if (*bufptr == '"') {	    *bufptr = 0;	    if (inquote) {		inquote = 0;		looking = 1;	    } else {		inquote = 1;	    }	} else if (isspace(*bufptr) && !inquote) {	    looking = 1;	    *bufptr = 0;	} else if (looking) {	    looking = 0;	    argv[argvix] = bufptr;	    argvix++;	}	bufptr++;    }    argv[argvix] = 0;		// null-terminate the argv list    return argvix;}static pid_t emcSystemCmdPid = 0;int emcSystemCmd(char *s){    char buffer[EMC_SYSTEM_CMD_LEN];    char *argv[EMC_SYSTEM_CMD_LEN / 2 + 1];    if (0 != emcSystemCmdPid) {	// something's already running, and we can only handle one	if (EMC_DEBUG & EMC_DEBUG_TASK_ISSUE) {	    rcs_print		("emcSystemCmd: abandoning process %d, running ``%s''\n",		 emcSystemCmdPid, s);	}    }    emcSystemCmdPid = fork();    if (-1 == emcSystemCmdPid) {	// we're still the parent, with no child created	if (EMC_DEBUG & EMC_DEBUG_TASK_ISSUE) {	    rcs_print("system command ``%s'' can't be executed\n", s);	}	return -1;    }    if (0 == emcSystemCmdPid) {	// we're the child	// convert string to argc/argv	argvize(s, buffer, argv, EMC_SYSTEM_CMD_LEN);	// drop any setuid privileges	setuid(getuid());	execvp(argv[0], argv);	// if we get here, we didn't exec	if (EMC_DEBUG & EMC_DEBUG_TASK_ISSUE) {	    rcs_print("emcSystemCmd: can't execute ``%s''\n", s);	}	return -1;    }    // else we're the parent    return 0;}// shorthand typecasting ptrsstatic EMC_AXIS_HALT *axis_halt_msg;static EMC_AXIS_DISABLE *disable_msg;static EMC_AXIS_ENABLE *enable_msg;static EMC_AXIS_HOME *home_msg;static EMC_AXIS_JOG *jog_msg;static EMC_AXIS_ABORT *axis_abort_msg;static EMC_AXIS_INCR_JOG *incr_jog_msg;static EMC_AXIS_ABS_JOG *abs_jog_msg;//static EMC_AXIS_SET_CYCLE_TIME *set_cycle_time_msg;//static EMC_AXIS_SET_GAINS *set_gains_msg;static EMC_AXIS_SET_BACKLASH *set_backlash_msg;static EMC_AXIS_SET_HOMING_PARAMS *set_homing_params_msg;//static EMC_AXIS_SET_INPUT_SCALE *set_input_scale_msg;//static EMC_AXIS_SET_OUTPUT_SCALE *set_output_scale_msg;static EMC_AXIS_SET_FERROR *set_ferror_msg;static EMC_AXIS_SET_MIN_FERROR *set_min_ferror_msg;static EMC_AXIS_SET_MAX_POSITION_LIMIT *set_max_limit_msg;static EMC_AXIS_SET_MIN_POSITION_LIMIT *set_min_limit_msg;static EMC_AXIS_OVERRIDE_LIMITS *axis_lim_msg;//static EMC_AXIS_SET_OUTPUT *axis_output_msg;static EMC_AXIS_LOAD_COMP *axis_load_comp_msg;static EMC_AXIS_ALTER *axis_alter_msg;//static EMC_AXIS_SET_STEP_PARAMS *set_step_params_msg;static EMC_TRAJ_SET_SCALE *emcTrajSetScaleMsg;static EMC_TRAJ_SET_VELOCITY *emcTrajSetVelocityMsg;static EMC_TRAJ_SET_ACCELERATION *emcTrajSetAccelerationMsg;static EMC_TRAJ_LINEAR_MOVE *emcTrajLinearMoveMsg;static EMC_TRAJ_CIRCULAR_MOVE *emcTrajCircularMoveMsg;static EMC_TRAJ_DELAY *emcTrajDelayMsg;static EMC_TRAJ_SET_TERM_COND *emcTrajSetTermCondMsg;static EMC_TRAJ_SET_SPINDLESYNC *emcTrajSetSpindlesyncMsg;// These classes are commented out because the compiler// complains that they are "defined but not used".//static EMC_MOTION_SET_AOUT *emcMotionSetAoutMsg;//static EMC_MOTION_SET_DOUT *emcMotionSetDoutMsg;static EMC_SPINDLE_ON *spindle_on_msg;static EMC_TOOL_PREPARE *tool_prepare_msg;static EMC_TOOL_LOAD_TOOL_TABLE *load_tool_table_msg;static EMC_TOOL_SET_OFFSET *emc_tool_set_offset_msg;static EMC_TASK_SET_MODE *mode_msg;static EMC_TASK_SET_STATE *state_msg;static EMC_TASK_PLAN_RUN *run_msg;static EMC_TASK_PLAN_EXECUTE *execute_msg;static EMC_TASK_PLAN_OPEN *open_msg;// commands we compose herestatic EMC_TASK_PLAN_RUN taskPlanRunCmd;	// 16-Aug-1999 FMPstatic EMC_TASK_PLAN_INIT taskPlanInitCmd;static EMC_TASK_PLAN_SYNCH taskPlanSynchCmd;static int interpResumeState = EMC_TASK_INTERP_IDLE;static int programStartLine = 0;	// which line to run program from// how long the interp list can be/*! \todo FIXME-- make an ini file global */#define EMC_TASK_INTERP_MAX_LEN 1000static int stepping = 0;static int steppingWait = 0;static int steppedLine = 0;/*  checkInterpList(NML_INTERP_LIST *il, EMC_STAT *stat) takes a pointer  to an interpreter list and a pointer to the EMC status, pops each NML  message off the list, and checks it against limits, resource availability,  etc. in the status.  It returns 0 if all messages check out, -1 if any of them fail. If one  fails, the rest of the list is not checked. */static int checkInterpList(NML_INTERP_LIST * il, EMC_STAT * stat){    NMLmsg *cmd = 0;    // let's create some shortcuts to casts at compile time#define operator_error_msg ((EMC_OPERATOR_ERROR *) cmd)#define linear_move ((EMC_TRAJ_LINEAR_MOVE *) cmd)#define circular_move ((EMC_TRAJ_CIRCULAR_MOVE *) cmd)    while (il->len() > 0) {	cmd = il->get();	switch (cmd->type) {	case EMC_OPERATOR_ERROR_TYPE:	    emcOperatorError(operator_error_msg->id,			     operator_error_msg->error);	    break;	case EMC_TRAJ_LINEAR_MOVE_TYPE:	    if (linear_move->end.tran.x >		stat->motion.axis[0].maxPositionLimit) {		emcOperatorError(0, "%s\n%s", stat->task.command,				 _("exceeds +X limit"));		return -1;	    }	    if (linear_move->end.tran.y >		stat->motion.axis[1].maxPositionLimit) {		emcOperatorError(0, "%s\n%s", stat->task.command,				 _("exceeds +Y limit"));		return -1;	    }	    if (linear_move->end.tran.z >		stat->motion.axis[2].maxPositionLimit) {		emcOperatorError(0, "%s\n%s", stat->task.command,				 _("exceeds +Z limit"));		return -1;	    }	    if (linear_move->end.tran.x <		stat->motion.axis[0].minPositionLimit) {		emcOperatorError(0, "%s\n%s", stat->task.command,				 _("exceeds -X limit"));		return -1;	    }	    if (linear_move->end.tran.y <		stat->motion.axis[1].minPositionLimit) {		emcOperatorError(0, "%s\n%s", stat->task.command,				 _("exceeds -Y limit"));		return -1;	    }	    if (linear_move->end.tran.z <		stat->motion.axis[2].minPositionLimit) {		emcOperatorError(0, "%s\n%s", stat->task.command,				 _("exceeds -Z limit"));		return -1;	    }	    break;	case EMC_TRAJ_CIRCULAR_MOVE_TYPE:	    if (circular_move->end.tran.x >		stat->motion.axis[0].maxPositionLimit) {		emcOperatorError(0, "%s\n%s", stat->task.command,				 _("exceeds +X limit"));		return -1;	    }	    if (circular_move->end.tran.y >		stat->motion.axis[1].maxPositionLimit) {		emcOperatorError(0, "%s\n%s", stat->task.command,				 _("exceeds +Y limit"));		return -1;	    }	    if (circular_move->end.tran.z >		stat->motion.axis[2].maxPositionLimit) {		emcOperatorError(0, "%s\n%s", stat->task.command,				 _("exceeds +Z limit"));		return -1;	    }	    if (circular_move->end.tran.x <		stat->motion.axis[0].minPositionLimit) {		emcOperatorError(0, "%s\n%s", stat->task.command,				 _("exceeds -X limit"));		return -1;	    }	    if (circular_move->end.tran.y <		stat->motion.axis[1].minPositionLimit) {		emcOperatorError(0, "%s\n%s", stat->task.command,				 _("exceeds -Y limit"));		return -1;	    }	    if (circular_move->end.tran.z <		stat->motion.axis[2].minPositionLimit) {		emcOperatorError(0, "%s\n%s", stat->task.command,				 _("exceeds -Z limit"));		return -1;	    }	    break;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩欧美一区二区久久婷婷| av电影一区二区| 欧美一二三四在线| 激情文学综合网| 国产午夜精品理论片a级大结局 | 777色狠狠一区二区三区| 午夜视频在线观看一区二区 | 中文字幕五月欧美| 91理论电影在线观看| 亚洲成人三级小说| 日韩欧美一级片| 国产激情一区二区三区| 亚洲欧洲日本在线| 欧美群妇大交群中文字幕| 精品一区二区三区视频| 国产精品亲子乱子伦xxxx裸| 91蝌蚪porny成人天涯| 天堂av在线一区| 国产日韩精品一区二区三区| 91免费看视频| 美女被吸乳得到大胸91| 国产精品每日更新在线播放网址| 色狠狠综合天天综合综合| 青青草一区二区三区| 中文字幕第一区综合| 欧美日韩中文字幕一区| 国产毛片精品国产一区二区三区| 亚洲精品一二三| 欧美成人高清电影在线| 色综合一个色综合亚洲| 久草精品在线观看| 亚洲一区在线观看视频| 久久久国产综合精品女国产盗摄| 色婷婷一区二区| 国产精品伊人色| 偷拍亚洲欧洲综合| 中文字幕在线一区| 日韩精品综合一本久道在线视频| 色呦呦国产精品| 国产另类ts人妖一区二区| 午夜精彩视频在线观看不卡| 国产精品色一区二区三区| 日韩亚洲欧美在线| 欧美最猛性xxxxx直播| 国产宾馆实践打屁股91| 久久精品国产亚洲a| 亚洲综合激情小说| 亚洲欧洲另类国产综合| 久久久久久久久99精品| 日韩一区二区不卡| 欧美日韩综合一区| 色呦呦国产精品| 成人免费高清视频在线观看| 韩国精品一区二区| 日本欧美久久久久免费播放网| 一片黄亚洲嫩模| 亚洲欧洲另类国产综合| 国产精品久久三区| 久久久99久久| 久久精品视频网| 精品少妇一区二区三区在线视频| 欧美日韩不卡在线| 色综合天天综合色综合av| 成人精品国产福利| 国产二区国产一区在线观看| 精品一区二区三区的国产在线播放| 亚洲成人精品一区| 三级精品在线观看| 天堂影院一区二区| 偷拍与自拍一区| 日本aⅴ亚洲精品中文乱码| 日韩一区欧美二区| 日韩和欧美的一区| 美洲天堂一区二卡三卡四卡视频| 五月天激情综合| 日本中文字幕一区二区视频 | 久久精品国产一区二区三| 图片区小说区区亚洲影院| 丝袜国产日韩另类美女| 天堂成人免费av电影一区| 日韩二区三区四区| 久久精品国产秦先生| 久久er精品视频| 国产乱妇无码大片在线观看| 国产风韵犹存在线视精品| 99久久精品久久久久久清纯| 一本大道久久a久久综合婷婷| 欧美在线观看一区二区| 欧美午夜精品理论片a级按摩| 欧美精品日韩综合在线| 欧美一卡2卡3卡4卡| 精品久久久久久久久久久久包黑料| 精品理论电影在线观看| 中文字幕精品一区二区精品绿巨人| 欧美国产在线观看| 亚洲国产一二三| 麻豆精品一区二区综合av| 黑人巨大精品欧美黑白配亚洲| 国产ts人妖一区二区| 色噜噜偷拍精品综合在线| 欧美日韩精品高清| 2017欧美狠狠色| 亚洲激情第一区| 美女久久久精品| 成人丝袜高跟foot| 欧美日韩黄色一区二区| 欧美xxx久久| 一区在线观看视频| 日本欧美一区二区三区乱码 | 一区二区三区国产精品| 日韩av中文字幕一区二区三区| 国产精品一区二区男女羞羞无遮挡| av在线一区二区三区| 91麻豆精品国产91久久久使用方法 | 亚洲精品一区二区精华| 中文字幕日韩欧美一区二区三区| 亚洲一区视频在线| 国产精品一级在线| 欧美揉bbbbb揉bbbbb| 国产精品网站导航| 蜜桃视频在线一区| 在线观看国产日韩| 国产亚洲一区二区在线观看| 一区二区三区加勒比av| 国产不卡视频在线播放| 宅男在线国产精品| 亚洲天堂网中文字| 韩国精品在线观看| 正在播放一区二区| 亚洲黄色av一区| 国产东北露脸精品视频| 日韩一级视频免费观看在线| 亚洲欧美激情一区二区| 国内精品伊人久久久久影院对白| 在线视频综合导航| 中文字幕免费在线观看视频一区| 免费日韩伦理电影| 欧美性猛交xxxx黑人交| 国产精品―色哟哟| 国产精品亚洲人在线观看| 欧美剧在线免费观看网站| 国产精品麻豆一区二区| 精品一区二区免费视频| 欧美一区二区三区免费观看视频| 亚洲欧美日韩电影| 不卡一区二区中文字幕| 久久久国产精华| 激情另类小说区图片区视频区| 欧美精品亚洲一区二区在线播放| 亚洲色图色小说| 成人一区二区视频| 久久久91精品国产一区二区精品| 蜜臀va亚洲va欧美va天堂| 欧美剧情片在线观看| 亚洲超碰97人人做人人爱| 日本精品一区二区三区四区的功能| 欧美激情在线一区二区| 粉嫩高潮美女一区二区三区| 久久久久久97三级| 国产一区二区三区在线看麻豆| 日韩欧美中文一区| 美女看a上一区| 日韩欧美国产一区二区在线播放 | 亚洲国产精品一区二区久久恐怖片| 99精品视频免费在线观看| 国产蜜臀97一区二区三区 | 麻豆国产欧美日韩综合精品二区 | 色综合久久99| 亚洲欧美电影一区二区| 91女人视频在线观看| 亚洲视频免费在线| 一本色道久久综合亚洲91 | 国产成a人亚洲精| 国产人伦精品一区二区| 成人美女视频在线观看18| 国产精品毛片久久久久久| 懂色av一区二区三区免费看| 国产精品乱码一区二三区小蝌蚪| av成人免费在线观看| 一区二区三区在线观看国产| 欧美三级中文字| 免费在线欧美视频| 久久久久99精品一区| 99久久er热在这里只有精品66| 亚洲精品国产精华液| 欧美日韩国产中文| 韩国成人精品a∨在线观看| 欧美国产欧美亚州国产日韩mv天天看完整| 成人av在线一区二区| 亚洲欧美日韩一区二区三区在线观看| 在线一区二区视频| 麻豆久久久久久久| 欧美激情中文不卡| 欧美日韩国产精品成人| 乱中年女人伦av一区二区| 国产精品三级av| 91麻豆精品国产91久久久使用方法| 国内精品国产成人| 自拍偷拍亚洲激情| 欧美一级xxx|