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

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

?? emccanon.cc

?? Source code for an Numeric Cmputer
?? CC
?? 第 1 頁 / 共 4 頁
字號:
/********************************************************************* Description: emccanon.cc*   Canonical definitions for 3-axis NC application**   Derived from a work by Fred Proctor & Will Shackleford** Author:* License: GPL Version 2* System: Linux*    * Copyright (c) 2004 All rights reserved.*********************************************************************//*  Notes:  Units  -----  Values are stored internally as mm and degree units, e.g, program  offsets, end point, tool length offset.  These are "internal  units". "External units" are the units used by the EMC motion planner.  All lengths and units output by the interpreter are converted to  internal units here, using FROM_PROG_LEN,ANG, and then  TO_EXT_LEN(),ANG are called to convert these to external units.  Tool Length Offsets  -------------------  The interpreter does not subtract off tool length offsets. It calls  USE_TOOL_LENGTH_OFFSETS(length), which we record here and apply to  all subsequent Z values.  */#include "config.h"#include <stdio.h>#include <stdarg.h>#include <math.h>#include <string.h>		// strncpy()#include <ctype.h>		// isspace()#include "emc.hh"		// EMC NML#include "canon.hh"		// these decls#include "interpl.hh"		// interp_list#include "emcglb.h"		// TRAJ_MAX_VELOCITY#include "emcpos.h"#ifndef MIN#define MIN(a,b) ((a)<(b)?(a):(b))#endif#ifndef MIN3#define MIN3(a,b,c) (MIN(MIN((a),(b)),(c)))#endif#ifndef MAX#define MAX(a,b) ((a)>(b)?(a):(b))#endif#ifndef MAX4#define MAX4(a,b,c,d) (MAX(MAX((a),(b)),MAX((c),(d))))#endifstatic PM_QUATERNION quat(1, 0, 0, 0);/*  These decls were from the old 3-axis canon.hh, and refer functions  defined here that are used for convenience but no longer have decls  in the 6-axis canon.hh. So, we declare them here now.*/extern void CANON_ERROR(const char *fmt, ...);/*  Origin offsets, length units, and active plane are all maintained  here in this file. Controller runs in absolute mode, and does not  have plane select concept.  programOrigin is stored in mm always, and converted when set or read.  When it's applied to positions, convert positions to mm units first  and then add programOrigin.  Units are then converted from mm to external units, as reported by  the GET_EXTERNAL_LENGTH_UNITS() function.  */static CANON_POSITION programOrigin(0.0, 0.0, 0.0, 0.0, 0.0, 0.0);static CANON_UNITS lengthUnits = CANON_UNITS_MM;static CANON_PLANE activePlane = CANON_PLANE_XY;/*  canonEndPoint is the last programmed end point, stored in case it's  needed for subsequent calculations. It's in absolute frame, mm units.  */static CANON_POSITION canonEndPoint;static void canonUpdateEndPoint(double x, double y, double z, double a,				double b, double c){    canonEndPoint.x = x;    canonEndPoint.y = y;    canonEndPoint.z = z;    canonEndPoint.a = a;    canonEndPoint.b = b;    canonEndPoint.c = c;}/* motion control mode is used to signify blended v. stop-at-end moves.   Set to 0 (invalid) at start, so first call will send command out */static CANON_MOTION_MODE canonMotionMode = 0;/* motion path-following tolerance is used to set the max path-following   deviation during CANON_CONTINUOUS.   If this param is 0, then it will behave as emc always did, allowing   almost any deviation trying to keep speed up. */static double canonMotionTolerance = 0.0;/* macros for converting internal (mm/deg) units to external units */#define TO_EXT_LEN(mm) ((mm) * GET_EXTERNAL_LENGTH_UNITS())#define TO_EXT_ANG(deg) ((deg) * GET_EXTERNAL_ANGLE_UNITS())/* macros for converting external units to internal (mm/deg) units */#define FROM_EXT_LEN(ext) ((ext) / GET_EXTERNAL_LENGTH_UNITS())#define FROM_EXT_ANG(ext) ((ext) / GET_EXTERNAL_ANGLE_UNITS())/* macros for converting internal (mm/deg) units to program units */#define TO_PROG_LEN(mm) ((mm) / (lengthUnits == CANON_UNITS_INCHES ? 25.4 : lengthUnits == CANON_UNITS_CM ? 10.0 : 1.0))#define TO_PROG_ANG(deg) (deg)/* macros for converting program units to internal (mm/deg) units */#define FROM_PROG_LEN(prog) ((prog) * (lengthUnits == CANON_UNITS_INCHES ? 25.4 : lengthUnits == CANON_UNITS_CM ? 10.0 : 1.0))#define FROM_PROG_ANG(prog) (prog)/* Spindle speed is saved here */static double spindleSpeed = 0.0;/* Prepped tool is saved here */static int preppedTool = 0;/* Tool length offset is saved here */static double currentToolLengthOffset = 0.0;/*  Feed rate is saved here; values are in mm/sec or deg/sec.  It will be initially set in INIT_CANON() below.*/static double currentLinearFeedRate = 0.0;static double currentAngularFeedRate = 0.0;/* Used to indicate whether the current move is linear, angular, or    a combination of both. */   //AJ says: linear means axes XYZ move (lines or even circles)   //         angular means axes ABC movestatic int linear_move = 0;static int angular_move = 0;/* sends a request to set the vel, which is in internal units/sec */static int sendVelMsg(double vel, double ini_maxvel){    EMC_TRAJ_SET_VELOCITY velMsg;    if (linear_move && !angular_move) {	velMsg.velocity = TO_EXT_LEN(vel);	velMsg.ini_maxvel = TO_EXT_LEN(ini_maxvel);    } else if (!linear_move && angular_move) {	velMsg.velocity = TO_EXT_ANG(vel);	velMsg.ini_maxvel = TO_EXT_ANG(ini_maxvel);    } else if (linear_move && angular_move) {	velMsg.velocity = TO_EXT_LEN(vel);	velMsg.ini_maxvel = TO_EXT_LEN(ini_maxvel);    } else { //seems this case was forgotten, neither linear, neither angular move (we are only sending vel)	velMsg.velocity = TO_EXT_LEN(vel);	velMsg.ini_maxvel = TO_EXT_LEN(ini_maxvel);    }	    interp_list.append(velMsg);    return 0;}static int sendAccMsg(double acc){    EMC_TRAJ_SET_ACCELERATION accMsg;    if (linear_move && !angular_move) {	accMsg.acceleration = TO_EXT_LEN(acc);    } else if (!linear_move && angular_move) {	accMsg.acceleration = TO_EXT_ANG(acc);    } else if (linear_move && angular_move) {	accMsg.acceleration = TO_EXT_LEN(acc);    }    interp_list.append(accMsg);    return 0;}/* Representation */void SET_ORIGIN_OFFSETS(double x, double y, double z,			double a, double b, double c){    EMC_TRAJ_SET_ORIGIN set_origin_msg;    /* convert to mm units */    x = FROM_PROG_LEN(x);    y = FROM_PROG_LEN(y);    z = FROM_PROG_LEN(z);    a = FROM_PROG_ANG(a);    b = FROM_PROG_ANG(b);    c = FROM_PROG_ANG(c);    programOrigin.x = x;    programOrigin.y = y;    programOrigin.z = z;    programOrigin.a = a;    programOrigin.b = b;    programOrigin.c = c;    /* append it to interp list so it gets updated at the right time, not at       read-ahead time */    set_origin_msg.origin.tran.x = TO_EXT_LEN(programOrigin.x);    set_origin_msg.origin.tran.y = TO_EXT_LEN(programOrigin.y);    set_origin_msg.origin.tran.z = TO_EXT_LEN(programOrigin.z);    set_origin_msg.origin.a = TO_EXT_ANG(programOrigin.a);    set_origin_msg.origin.b = TO_EXT_ANG(programOrigin.b);    set_origin_msg.origin.c = TO_EXT_ANG(programOrigin.c);    interp_list.append(set_origin_msg);}void USE_LENGTH_UNITS(CANON_UNITS in_unit){    lengthUnits = in_unit;    emcStatus->task.programUnits = in_unit;}/* Free Space Motion */void SET_TRAVERSE_RATE(double rate){    // nothing need be done here}void SET_FEED_RATE(double rate){    /* convert from /min to /sec */    rate /= 60.0;    /* convert to traj units (mm & deg) if needed */    currentLinearFeedRate = FROM_PROG_LEN(rate);    currentAngularFeedRate = FROM_PROG_ANG(rate);}void SET_FEED_REFERENCE(CANON_FEED_REFERENCE reference){    // nothing need be done here}double getStraightAcceleration(double x, double y, double z,			   double a, double b, double c){    double dx, dy, dz, da, db, dc;    double tx, ty, tz, ta, tb, tc, tmax;    double acc, dtot;    const double tiny = 1e-10;    acc = 0.0; // if a move to nowhere    // Compute absolute travel distance for each axis:    dx = fabs(x - canonEndPoint.x);    dy = fabs(y - canonEndPoint.y);    dz = fabs(z - canonEndPoint.z);    da = fabs(a - canonEndPoint.a);    db = fabs(b - canonEndPoint.b);    dc = fabs(c - canonEndPoint.c);    if(dx < tiny) dx = 0.0;    if(dy < tiny) dy = 0.0;    if(dz < tiny) dz = 0.0;    if(da < tiny) da = 0.0;    if(db < tiny) db = 0.0;    if(dc < tiny) dc = 0.0;    // Figure out what kind of move we're making:    if (dx <= 0.0 && dy <= 0.0 && dz <= 0.0) {	linear_move = 0;    } else {	linear_move = 1;    }    if (da <= 0.0 && db <= 0.0 && dc <= 0.0) {	angular_move = 0;    } else {	angular_move = 1;    }    // Pure linear move:    if (linear_move && !angular_move) {	tx = (dx / FROM_EXT_LEN(AXIS_MAX_ACCELERATION[0]));	ty = (dy / FROM_EXT_LEN(AXIS_MAX_ACCELERATION[1]));	tz = (dz / FROM_EXT_LEN(AXIS_MAX_ACCELERATION[2]));	tmax = tx > ty ? tx : ty;	tmax = tz > tmax ? tz : tmax;	dtot = sqrt(dx * dx + dy * dy + dz * dz);	if (tmax > 0.0) {	    acc = dtot / tmax;	}    }    // Pure angular move:    else if (!linear_move && angular_move) {	ta = da? (da / FROM_EXT_ANG(AXIS_MAX_ACCELERATION[3])): 0.0;	tb = db? (db / FROM_EXT_ANG(AXIS_MAX_ACCELERATION[4])): 0.0;	tc = dc? (dc / FROM_EXT_ANG(AXIS_MAX_ACCELERATION[5])): 0.0;	tmax = ta > tb ? ta : tb;	tmax = tc > tmax ? tc : tmax;	dtot = sqrt(da * da + db * db + dc * dc);	if (tmax > 0.0) {	    acc = dtot / tmax;	}    }    // Combination angular and linear move:    else if (linear_move && angular_move) {	tx = (dx / FROM_EXT_LEN(AXIS_MAX_ACCELERATION[0]));	ty = (dy / FROM_EXT_LEN(AXIS_MAX_ACCELERATION[1]));	tz = (dz / FROM_EXT_LEN(AXIS_MAX_ACCELERATION[2]));	ta = da? (da / FROM_EXT_ANG(AXIS_MAX_ACCELERATION[3])): 0.0;	tb = db? (db / FROM_EXT_ANG(AXIS_MAX_ACCELERATION[4])): 0.0;	tc = dc? (dc / FROM_EXT_ANG(AXIS_MAX_ACCELERATION[5])): 0.0;	tmax = tx > ty ? tx : ty;	tmax = tz > tmax ? tz : tmax;	tmax = ta > tmax ? ta : tmax;	tmax = tb > tmax ? tb : tmax;	tmax = tc > tmax ? tc : tmax;/*  According to NIST IR6556 Section 2.1.2.5 Paragraph A    a combnation move is handled like a linear move, except    that the angular axes are allowed sufficient time to    complete their motion coordinated with the motion of    the linear axes.*/	dtot = sqrt(dx * dx + dy * dy + dz * dz);	if (tmax > 0.0) {	    acc = dtot / tmax;	}    }    return acc;}double getStraightVelocity(double x, double y, double z,			   double a, double b, double c){    double dx, dy, dz, da, db, dc;    double tx, ty, tz, ta, tb, tc, tmax;    double vel, dtot;    const double tiny = 1e-10;/* If we get a move to nowhere (!linear_move && !angular_move)   we might as well go there at the currentLinearFeedRate...*/    vel = currentLinearFeedRate;    // Compute absolute travel distance for each axis:    dx = fabs(x - canonEndPoint.x);    dy = fabs(y - canonEndPoint.y);    dz = fabs(z - canonEndPoint.z);    da = fabs(a - canonEndPoint.a);    db = fabs(b - canonEndPoint.b);    dc = fabs(c - canonEndPoint.c);    if(dx < tiny) dx = 0.0;    if(dy < tiny) dy = 0.0;    if(dz < tiny) dz = 0.0;    if(da < tiny) da = 0.0;    if(db < tiny) db = 0.0;    if(dc < tiny) dc = 0.0;    // Figure out what kind of move we're making:    if (dx <= 0.0 && dy <= 0.0 && dz <= 0.0) {	linear_move = 0;    } else {	linear_move = 1;    }    if (da <= 0.0 && db <= 0.0 && dc <= 0.0) {	angular_move = 0;    } else {	angular_move = 1;    }    // Pure linear move:    if (linear_move && !angular_move) {	tx = fabs(dx / FROM_EXT_LEN(AXIS_MAX_VELOCITY[0]));	ty = fabs(dy / FROM_EXT_LEN(AXIS_MAX_VELOCITY[1]));	tz = fabs(dz / FROM_EXT_LEN(AXIS_MAX_VELOCITY[2]));	tmax = tx > ty ? tx : ty;	tmax = tz > tmax ? tz : tmax;	dtot = sqrt(dx * dx + dy * dy + dz * dz);	if (tmax <= 0.0) {	    vel = currentLinearFeedRate;	} else {	    vel = dtot / tmax;	}    }    // Pure angular move:    else if (!linear_move && angular_move) {	ta = da? fabs(da / FROM_EXT_ANG(AXIS_MAX_VELOCITY[3])):0.0;	tb = db? fabs(db / FROM_EXT_ANG(AXIS_MAX_VELOCITY[4])):0.0;	tc = dc? fabs(dc / FROM_EXT_ANG(AXIS_MAX_VELOCITY[5])):0.0;	tmax = ta > tb ? ta : tb;	tmax = tc > tmax ? tc : tmax;	dtot = sqrt(da * da + db * db + dc * dc);	if (tmax <= 0.0) {	    vel = currentAngularFeedRate;	} else {	    vel = dtot / tmax;	}    }    // Combination angular and linear move:    else if (linear_move && angular_move) {	tx = fabs(dx / FROM_EXT_LEN(AXIS_MAX_VELOCITY[0]));	ty = fabs(dy / FROM_EXT_LEN(AXIS_MAX_VELOCITY[1]));	tz = fabs(dz / FROM_EXT_LEN(AXIS_MAX_VELOCITY[2]));	ta = da? fabs(da / FROM_EXT_ANG(AXIS_MAX_VELOCITY[3])):0.0;	tb = db? fabs(db / FROM_EXT_ANG(AXIS_MAX_VELOCITY[4])):0.0;	tc = dc? fabs(dc / FROM_EXT_ANG(AXIS_MAX_VELOCITY[5])):0.0;	tmax = tx > ty ? tx : ty;	tmax = tz > tmax ? tz : tmax;	tmax = ta > tmax ? ta : tmax;	tmax = tb > tmax ? tb : tmax;	tmax = tc > tmax ? tc : tmax;/*  According to NIST IR6556 Section 2.1.2.5 Paragraph A    a combnation move is handled like a linear move, except    that the angular axes are allowed sufficient time to    complete their motion coordinated with the motion of    the linear axes.*/	dtot = sqrt(dx * dx + dy * dy + dz * dz);	if (tmax <= 0.0) {	    vel = currentLinearFeedRate;	} else {	    vel = dtot / tmax;	}    }    return vel;}void STRAIGHT_TRAVERSE(double x, double y, double z,		       double a, double b, double c){    double vel, acc;    EMC_TRAJ_LINEAR_MOVE linearMoveMsg;    // convert to mm units    x = FROM_PROG_LEN(x);    y = FROM_PROG_LEN(y);    z = FROM_PROG_LEN(z);    a = FROM_PROG_ANG(a);    b = FROM_PROG_ANG(b);    c = FROM_PROG_ANG(c);    x += programOrigin.x;    y += programOrigin.y;    z += programOrigin.z;    a += programOrigin.a;    b += programOrigin.b;    c += programOrigin.c;    z += currentToolLengthOffset;    // now x, y, z, and b are in absolute mm or degree units    linearMoveMsg.end.tran.x = TO_EXT_LEN(x);    linearMoveMsg.end.tran.y = TO_EXT_LEN(y);    linearMoveMsg.end.tran.z = TO_EXT_LEN(z);    // fill in the orientation    linearMoveMsg.end.a = TO_EXT_ANG(a);    linearMoveMsg.end.b = TO_EXT_ANG(b);    linearMoveMsg.end.c = TO_EXT_ANG(c);    vel = getStraightVelocity(x, y, z, a, b, c);    sendVelMsg(vel, vel);    if((acc = getStraightAcceleration(x, y, z, a, b, c)))        sendAccMsg(acc);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品久久久久7777按摩| 国产专区综合网| 久久久久一区二区三区四区| 日韩欧美一二三四区| 欧美日韩一区 二区 三区 久久精品| av一区二区三区| 99精品国产热久久91蜜凸| 91麻豆高清视频| 在线观看视频欧美| 51精品久久久久久久蜜臀| 日韩三级精品电影久久久| 欧美一级片在线| 久久香蕉国产线看观看99| 国产女人aaa级久久久级| 国产精品水嫩水嫩| 亚洲国产精品人人做人人爽| 午夜激情一区二区三区| 国产在线播放一区二区三区| 成人性生交大片免费看在线播放| 91蜜桃网址入口| 欧美日韩黄视频| 久久中文娱乐网| 亚洲免费观看视频| 免费观看一级特黄欧美大片| 国产精品综合在线视频| 在线看国产日韩| 欧美精品一区二区三区在线播放| 一区二区三区欧美在线观看| 琪琪一区二区三区| av激情综合网| 欧美性生活久久| 精品日韩99亚洲| 亚洲欧美一区二区久久| 婷婷成人激情在线网| 国产精品一品二品| 色国产精品一区在线观看| 欧美va日韩va| 亚洲韩国一区二区三区| 国产成人免费视| 欧美一级日韩免费不卡| 亚洲久草在线视频| 国产高清一区日本| 91精品国产入口| 一区二区三区在线播| 国产91精品久久久久久久网曝门| 欧美日韩高清一区二区| 亚洲欧美激情插| 国产成人免费视| 精品国产制服丝袜高跟| 视频在线在亚洲| 在线一区二区三区四区五区| 国产精品三级久久久久三级| 久久91精品久久久久久秒播| 欧美日韩精品欧美日韩精品| 亚洲女性喷水在线观看一区| 国产69精品久久99不卡| 亚洲精品一区二区三区香蕉| 日韩电影在线看| 欧美老肥妇做.爰bbww| 最新不卡av在线| 国产成人精品免费视频网站| 欧美精品一区二区三区四区| 日韩电影免费一区| 在线播放视频一区| 婷婷亚洲久悠悠色悠在线播放| 91精品办公室少妇高潮对白| 一区二区三区四区乱视频| av在线一区二区三区| 中文字幕在线观看不卡| 成年人国产精品| 国产精品久久久久国产精品日日| 国产福利91精品一区| 久久久久国产精品人| 国产高清精品网站| 中文字幕第一页久久| 国产69精品一区二区亚洲孕妇| 中文字幕乱码一区二区免费| www.亚洲国产| 最好看的中文字幕久久| 色成人在线视频| 性久久久久久久| 欧美一区欧美二区| 美国欧美日韩国产在线播放| 26uuu亚洲综合色| 国产成人自拍网| 国产精品二三区| 欧美又粗又大又爽| 日韩专区欧美专区| 一级日本不卡的影视| 日本精品视频一区二区三区| 亚洲国产精品久久不卡毛片 | 97久久精品人人爽人人爽蜜臀| 国产色婷婷亚洲99精品小说| 成人h动漫精品| 一区二区三区久久| 91精品国产综合久久精品图片| 久久99精品国产麻豆婷婷| 欧美激情在线看| 欧美三级电影在线观看| 久久成人免费电影| 国产精品全国免费观看高清 | 欧美三级一区二区| 日韩中文字幕一区二区三区| 久久久久久久综合色一本| 高清国产一区二区| 亚洲国产精品视频| 久久精品水蜜桃av综合天堂| 在线看日本不卡| 国产成人综合亚洲91猫咪| 亚洲黄色小说网站| 久久久三级国产网站| 色一区在线观看| 国产一区欧美一区| 一区二区三区四区不卡视频| 精品国产伦一区二区三区免费| 91蝌蚪国产九色| 国内外成人在线| 亚洲电影第三页| 国产精品久久久久aaaa樱花 | 日本v片在线高清不卡在线观看| 国产精品天美传媒| 日韩视频中午一区| 色综合av在线| 国产精品一区不卡| 日韩黄色片在线观看| 亚洲视频一区二区在线观看| 精品久久五月天| 欧美日韩免费在线视频| 成人av片在线观看| 国产一区免费电影| 美女高潮久久久| 亚洲6080在线| 一二三四社区欧美黄| 国产精品家庭影院| 国产日韩av一区| 久久久久亚洲综合| 欧美大片在线观看一区二区| 欧美福利视频导航| 在线观看91视频| 在线观看视频91| 一本大道久久a久久综合| 成人v精品蜜桃久久一区| 狠狠色丁香婷综合久久| 美国十次了思思久久精品导航| 午夜伦欧美伦电影理论片| 一区二区三区高清| 亚洲免费观看高清完整版在线观看| 久久久不卡网国产精品二区| 精品处破学生在线二十三| 欧美va日韩va| 久久久99精品免费观看不卡| 欧美精品一区二区在线播放| 久久综合狠狠综合久久激情| 国产人久久人人人人爽| 国产欧美日韩精品一区| 国产精品乱人伦| 中文字幕一区视频| 一区二区三区日韩欧美| 亚洲福利一区二区| 日韩av网站免费在线| 久久精品国产99久久6| 国产在线观看一区二区| 国产成人欧美日韩在线电影| 成人中文字幕在线| 91蜜桃网址入口| 欧美精品色综合| 久久综合色天天久久综合图片| 久久老女人爱爱| 国产精品拍天天在线| 国产亚洲一区字幕| 亚洲国产精华液网站w| 国产精品久久久久久久久晋中 | 欧美艳星brazzers| 欧美精选一区二区| 精品国产伦理网| 国产精品午夜春色av| 一区二区成人在线视频| 日韩国产高清影视| 韩国成人精品a∨在线观看| 国产成人免费视频网站| 色婷婷国产精品| 欧美性色综合网| 欧美精品777| 日本一区二区三区免费乱视频| 国产精品国产自产拍在线| 一区二区三区免费| 久久精品国产第一区二区三区| 粉嫩13p一区二区三区| 欧日韩精品视频| 国产清纯白嫩初高生在线观看91| 中文字幕一区二区三区视频| 亚洲不卡av一区二区三区| 国产乱人伦偷精品视频免下载| 99久久99久久精品免费观看| 欧美精品1区2区| 中文字幕日韩一区二区| 美女精品一区二区| 欧美性感一区二区三区| 久久嫩草精品久久久精品| 亚洲午夜在线电影|