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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? emccanon.cc

?? Source code for an Numeric Cmputer
?? CC
?? 第 1 頁(yè) / 共 4 頁(yè)
字號(hào):
/********************************************************************* 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);

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩情趣电影| 看片网站欧美日韩| 92精品国产成人观看免费 | 欧美在线视频全部完| 亚洲视频一区在线| 日本精品视频一区二区| 五月婷婷欧美视频| 欧美岛国在线观看| 国产成人高清在线| 亚洲自拍偷拍综合| 日韩一区二区在线观看视频| 国产一区二区不卡老阿姨| 欧美经典三级视频一区二区三区| 91啪九色porn原创视频在线观看| 亚洲国产精品一区二区www| 91精品国产入口| 国产不卡视频在线观看| 玉米视频成人免费看| 欧美一区三区二区| 成人av网站在线| 亚洲不卡av一区二区三区| 精品久久久三级丝袜| 94-欧美-setu| 久久99久久精品欧美| 中文字幕精品一区二区精品绿巨人 | 欧美在线观看视频一区二区三区| 日韩成人伦理电影在线观看| 久久精品一区二区三区四区| 在线精品视频免费播放| 久久电影网站中文字幕 | 亚洲精品乱码久久久久久日本蜜臀| 欧美日韩在线电影| 国产福利一区二区| 亚洲成人精品影院| 亚洲国产精品av| 欧美一区在线视频| 色999日韩国产欧美一区二区| 美女在线视频一区| 一级女性全黄久久生活片免费| 欧美一级在线视频| 欧洲色大大久久| 成人精品鲁一区一区二区| 日日噜噜夜夜狠狠视频欧美人| 中文字幕乱码亚洲精品一区| 日韩欧美一区在线| 欧美色老头old∨ideo| 丁香啪啪综合成人亚洲小说| 久久国产视频网| 午夜精品久久久久| 亚洲资源中文字幕| 国产精品私房写真福利视频| 日韩欧美成人午夜| 欧美日韩午夜影院| 欧美性高清videossexo| 成人免费av在线| 韩国中文字幕2020精品| 日本在线不卡视频| 亚洲成人av电影在线| 亚洲激情在线播放| 亚洲天堂2014| 日韩美女啊v在线免费观看| 国产欧美一区视频| 久久久噜噜噜久噜久久综合| 欧美成人性战久久| 日韩欧美不卡一区| 欧美一区二区三区四区五区| 欧美日韩精品电影| 在线精品亚洲一区二区不卡| 91免费观看视频在线| 成人av在线电影| 99免费精品视频| 99久久精品免费观看| 成人动漫视频在线| 成人免费看的视频| 99久久久久免费精品国产 | 91麻豆免费视频| 91小视频免费观看| 色婷婷综合久久久中文字幕| 91麻豆swag| 在线观看av一区二区| 91麻豆高清视频| 色88888久久久久久影院按摩| 91丨九色丨蝌蚪富婆spa| 91麻豆国产精品久久| 在线影视一区二区三区| 欧美日韩一本到| 日韩欧美色综合网站| 亚洲精品一区二区精华| 久久久国产一区二区三区四区小说 | 久久久久久毛片| 国产人久久人人人人爽| 亚洲欧美日韩在线不卡| 亚洲一区在线观看免费观看电影高清 | 亚洲亚洲人成综合网络| 亚洲成人av在线电影| 日本美女视频一区二区| 国产麻豆精品视频| 91网址在线看| 69av一区二区三区| 欧美精品一区二区不卡| 国产精品视频看| 亚洲国产一区视频| 蜜桃av一区二区三区电影| 国产999精品久久| 色88888久久久久久影院按摩| 678五月天丁香亚洲综合网| 久久新电视剧免费观看| 亚洲欧美日韩国产中文在线| 日韩va欧美va亚洲va久久| 经典三级视频一区| 一本大道久久精品懂色aⅴ| 777久久久精品| 中文字幕日韩一区二区| 日韩电影免费一区| 成人av综合在线| 7777女厕盗摄久久久| 国产欧美日韩在线| 日韩中文字幕区一区有砖一区| 国产老女人精品毛片久久| 在线日韩av片| 国产欧美一区二区三区网站| 亚洲国产精品一区二区久久| 国产91精品欧美| 欧美精品一级二级三级| 国产精品久久毛片| 日本一区中文字幕| 91极品视觉盛宴| 日本一区二区三区高清不卡| 亚洲成人一区二区| 99久久精品免费看国产免费软件| 欧美videofree性高清杂交| 一区二区免费看| 成人在线综合网站| 日韩一区二区三区电影在线观看| 亚洲欧洲成人自拍| 国产乱码字幕精品高清av | 久久精品一区二区三区不卡牛牛 | 精品人伦一区二区色婷婷| 亚洲国产成人高清精品| 不卡av电影在线播放| 日韩精品一区二区在线观看| 亚洲综合视频网| 成人丝袜高跟foot| 亚洲精品一区在线观看| 日日摸夜夜添夜夜添亚洲女人| 色999日韩国产欧美一区二区| 国产精品视频看| 国产美女视频91| 精品欧美一区二区三区精品久久 | 不卡的电视剧免费网站有什么| 日韩三区在线观看| 亚洲国产精品久久人人爱蜜臀| 91丨九色porny丨蝌蚪| 久久影院电视剧免费观看| 免费精品视频在线| 91精品国产品国语在线不卡| 亚洲成人免费视| 欧美色图在线观看| 亚洲国产综合色| 欧美日韩久久一区二区| 亚洲影视资源网| 欧美羞羞免费网站| 天天综合网 天天综合色| 色综合久久88色综合天天| 国产精品不卡在线观看| 成人av在线网站| 亚洲视频一二区| 成人精品视频.| 亚洲色图一区二区三区| 色综合久久久久综合| 亚洲激情校园春色| 欧美人与禽zozo性伦| 午夜精品久久久久久久蜜桃app| 在线成人午夜影院| 另类小说一区二区三区| 久久综合资源网| 成人中文字幕在线| 亚洲人被黑人高潮完整版| 色老头久久综合| 日韩福利视频导航| 精品少妇一区二区三区在线视频| 久久精品99久久久| 国产女人aaa级久久久级| a级精品国产片在线观看| 玉米视频成人免费看| 欧美久久婷婷综合色| 狠狠色狠狠色综合系列| 久久精品亚洲麻豆av一区二区| 99麻豆久久久国产精品免费 | 精彩视频一区二区| 国产精品久久夜| 欧美日韩性生活| 国产一区91精品张津瑜| 亚洲视频在线一区| 欧美一区二视频| 成人黄色软件下载| 午夜久久久久久久久久一区二区| 精品国产免费视频| 在线免费观看日本欧美| 日本免费新一区视频|