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

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

?? machdevice.cpp

?? MachDevice Project: Blank Plugin
?? CPP
字號:
// MachDevice.cpp : Defines the initialization routines for the DLL.
//
// Revision history
// 9 June John Prentice - this version separates the user supplied code into another file or files with functions
//							called as externals. 
//							It should be safe to replace the source of the SDK framework
//							as upgrades are made with no more user effort than providing dummy entries for
//							any new unused functionality and recompiling the plugin.
//							The linker will advise of this need so it should be quite crash-resistant

// =======================================================================================================
//


#include "stdafx.h"
#include "resource.h"
#include "MachDevice.h"
#include "TrajectoryControl.h"
#include "Mach4View.h"
#include "Engine.h"
#include "rs274ngc.h"
#include "XMLProfile.h"




#pragma warning(disable:4005) //kills redef errors from resources.

// =======================================================================================================
// This is a Generalized Device file
// The actual device is implemented in the file with these entries. 
// Conventionally this is MachDevImplementation.cpp


// Here are the routines in the implemetors file

extern CString myProfileInit (CString, CXMLProfile*);			// initial access to Mach profile
																// when enumerating available plugins
extern void	myInitControl ();									// called during Mach initialisation
																// you can influence subsequent init by actions here
																// **** Not used in typical device plugin
extern void	myPostInitControl ();								// called when mach fully set up
extern void	myConfig (CXMLProfile*);							// Called to configure the device

extern void	myUpdate ();										// 10Hz update loop
extern void	myHighSpeedUpdate ();								// called at 40Hz

extern void myCleanUp();                                             //Destrucion routine for clenaup.

 
// =========================================================================================================
 
//System Varibles
CXMLProfile        *DevProf;
OneShort           DoButton;     // void DoButton( code )
DoubleShort        GetDRO;       // Double GetDRO( code )
VoidShortDouble  SetDRO;       // void   SetDRO( short code, double value);
BoolShort          GetLED;       // bool   GetLED( short code );
VoidShortBool      SetLED;       //SetLED Fucntion
CSTRret            GetProName;   // CString GetProName()
VoidLPCSTR         Code;         // void    Code( "G0X10Y10" );

// High spped thread data block


bool  KickTimer = false; //this will be a special case variable. See Update loop;
bool  TimerOn = false;   // this tells us the timer is not yet running. (See Update Loop );

 
// CXMLProfile
CXMLProfile *AppProf;
CString ProfileName;



#ifdef _DEBUG
#define new DEBUG_NEW
#endif

// Mach3 defines of External Variables. These var's are directly usable in this dll as they are all 
// instantiated prior to this dll being opened. Most work in Mach can be done by attaching to these variables 
// You cannot, however, call functions in these classes, they are not bound to the plugin. You may only call 
// the functions instantiated in thsi dll. All variables and structures , however, may be used.
// Note the way this example uses various objects.

TrajectoryControl *MainPlanner; //used for most planner funcitons and program control 
CMach4View *MachView;  //used for most framework and configuration calls. 
TrajBuffer *Engine;     //Ring0 memory for printer port control and other device syncronisation
setup *_setup;          //Trajectory planners setup block. Always in effect


 
// CMachDeviceApp

///////////////////////////////////////////////////////////////  Following routines are for this DLL to fucntion properly
// They are used to create and lock the instinces of this dll. The Dll can be loaded mumiple times, so locks are maintained. 
// Most users can ignore these functions.. Look further down for the start of the Mach callback functions.

BEGIN_MESSAGE_MAP(CMachDeviceApp, CWinApp)
END_MESSAGE_MAP()


// CMachDeviceApp construction

CMachDeviceApp::CMachDeviceApp()
{
	// TODO: add construction code here,
	// Place all significant initialization in InitInstance
}

CMachDeviceApp::~CMachDeviceApp()
{

}

// The one and only CMachDeviceApp object

CMachDeviceApp theApp;

const GUID CDECL BASED_CODE _tlid =
		{ 0xC9FB259, 0xB864, 0x40A5, { 0xB5, 0x9F, 0x65, 0xE1, 0x1E, 0x20, 0x9F, 0xC4 } };
const WORD _wVerMajor = 1;
const WORD _wVerMinor = 0;


// CMachDeviceApp initialization

BOOL CMachDeviceApp::InitInstance()
{
	CWinApp::InitInstance();

	if (!AfxSocketInit())
	{
		AfxMessageBox("Sockets Init Failed");
		return FALSE;
	}

	// Register all OLE server (factories) as running.  This enables the
	//  OLE libraries to create objects from other applications.
	COleObjectFactory::RegisterAll();

	return TRUE;
}

// DllGetClassObject - Returns class factory

STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
{
	AFX_MANAGE_STATE(AfxGetStaticModuleState());
	return AfxDllGetClassObject(rclsid, riid, ppv);
}


// DllCanUnloadNow - Allows COM to unload DLL

STDAPI DllCanUnloadNow(void)
{
	AFX_MANAGE_STATE(AfxGetStaticModuleState());
	return AfxDllCanUnloadNow();
}


// DllRegisterServer - Adds entries to the system registry

STDAPI DllRegisterServer(void)
{
	AFX_MANAGE_STATE(AfxGetStaticModuleState());

	if (!AfxOleRegisterTypeLib(AfxGetInstanceHandle(), _tlid))
		return SELFREG_E_TYPELIB;

	if (!COleObjectFactory::UpdateRegistryAll())
		return SELFREG_E_CLASS;

	return S_OK;
}


// DllUnregisterServer - Removes entries from the system registry

STDAPI DllUnregisterServer(void)
{
	AFX_MANAGE_STATE(AfxGetStaticModuleState());
    
	if (!AfxOleUnregisterTypeLib(_tlid, _wVerMajor, _wVerMinor))
		return SELFREG_E_TYPELIB;

	if (!COleObjectFactory::UpdateRegistryAll(FALSE))
		return SELFREG_E_CLASS;

	
	return S_OK;
}
// Callback Functions are instantiated here for general use.
//
// Get the Callbacks to the Mach3 System
//*******************************************************


extern "C" __declspec(dllexport) void SetDoButton(OneShort pFunc)          //void DoButton( short code );
{
   DoButton = pFunc; 
}

extern "C" __declspec(dllexport) void SetSetDRO(VoidShortDouble pFunc)   //void SetDRO( short code, double value );
{
   SetDRO = pFunc; 
}

extern "C" __declspec(dllexport) void SetGetDRO(DoubleShort pFunc)         // double GetDRO( short code );
{
   GetDRO = pFunc; 
}

extern "C" __declspec(dllexport) void SetGetLED(BoolShort pFunc)           // bool  GetLED( short code );  
{
   GetLED = pFunc; 
}

extern "C" __declspec(dllexport) void SetSetLED(VoidShortBool pFunc)           // bool  GetLED( short code );  
{
   SetLED = pFunc; 
}

extern "C" __declspec(dllexport) void SetCode(VoidLPCSTR pFunc)           // bool  GetLED( short code );  
{
   Code = pFunc; 
}



extern "C" __declspec(dllexport) char* SetProName( CString name)           // CString  GetProfName();  
{
	  static CString strPlgName, strVer;
      ProfileName =   name;
      DevProf = new  CXMLProfile(); //start up the Profile class for XML usage. Same as Mach3's. 
	 
			strVer = myProfileInit (name, DevProf); // call implementors code

	  strPlgName = AfxGetApp() ->m_pszExeName + strVer;

	  delete DevProf;
	  return (char*)(LPCTSTR)strPlgName;
   
}
    

// Calls into the DLL ////////////////////////////////////////////
//*****************************************************
//
// Mach3 Calls to the Plugin Follow
//
// Tells Mach3 whether to start the printer driver in Ring 0 or not. Return false to run a different device.
// Also gives access to parameter blocks and varibles form the 4 main classes of Mach3. 

//This is a timer loop set for 25ms to keep latency low. We do need to disable it though
//if the callback loop is not running. 

extern "C" __declspec(dllexport) void StopPlug(void)           // bool  GetLED( short code );  
{
  AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
  myCleanUp(); 
}

extern "C" __declspec(dllexport) void DoDwell(double time)           // bool  GetLED( short code );  
{
 AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
  
}


VOID CALLBACK MYProc( HWND hwnd,UINT uMsg,UINT_PTR idEvent,DWORD dwTime)
{
  static int ticks = 0;
  //If the update loop doesnt turn this back on in 20 ticks. ( 1/2 second) then kill the timer, user 
  // has shut us down. 
  ticks++;
  if( ticks > 20 && !KickTimer )
  {
	  KillTimer( hwnd, idEvent );
	  TimerOn = false;
	  return;
  }
  //Alternately , lets make sure the user has us selected, if so, keep the timer running
  // in an indefinite loop of 40hz. 
  if( KickTimer )
  { 
	  KickTimer = false;
	  ticks = 0; //reset the test
	  TimerOn = true;
  }
  //We get here at 40hz only if the user has selected us as ON, and the Mach3 programs update loops are runnign correctly
  //Any interruption of Mach3 will operate as a safety watchdog and we wont get here in that case.

   myHighSpeedUpdate ();

}

extern "C" __declspec(dllexport) void PostInitControl()
{
    AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
	//this routine is called after Mach3 has initialised. Use it as Init, BUT no usage of the XML files at all here. Only in  Init.
	//this routine is handy for changing variables that Mach3 has loaded at startup. Usually, Mach3 will permanently save any var's you change here..

    myPostInitControl (); 
	return; 
}


//This routine is for setting variosu pointers, and for shutting off the Movement Engines for an external device to use Mach3, is necessary. It
//can interrupt things from occuring.. 

extern "C" __declspec(dllexport) bool InitControl( void *oEngine , void *oSetup , void *oMainPlanner, void *oView)
{
    AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
    Engine = (TrajBuffer*)oEngine;
    _setup = (setup*) oSetup;
    MachView = (CMach4View*)oView;
	MainPlanner = (TrajectoryControl *) oMainPlanner;
	TimerOn = false;
    KickTimer = false; //see update loop
	myInitControl ();
	return true; //start the printer port.. Use this for all devices that need the printer port. For now..thats all of them..
}

extern "C" __declspec(dllexport) void Config( )           // CString  GetProfName();  
{
	AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
	 DevProf = new  CXMLProfile(); //start up the Profile class for XML usage. Same as Mach3's. 

	 //XML reading and writing can occur here..

	 myConfig (DevProf);

	 delete DevProf;
 
}


extern "C" __declspec(dllexport) void Reset() ////////////////////  Called when Reset is pressed. 
{
	AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
	//Called when reset is pressed, at end of actual reset commend in Mach3. 
	//Check the Engine.Estop variable to see if we have reset or not..
}

extern "C" __declspec(dllexport) void JogOn( short axis, short dir, double speed ) ////////////////////  Called when Reset is pressed. 
{
	//Called when Jog is commanded. 0 for speed is Jog% jog, otherwise it is a new jog%
	AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
	 

}

extern "C" __declspec(dllexport) void JogOff( short axis ) ////////////////////  Called when Reset is pressed. 
{
	//Called when jog shoudl stop on a particular axis
	AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
	 
}

extern "C" __declspec(dllexport) void Purge( short flags ) ////////////////////  Called when Reset is pressed. 
{
	//Called when jog shoudl stop on a particular axis
	AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
}


extern "C" __declspec(dllexport) void Probe( ) ////////////////////  Called when Reset is pressed. 
{
	//Called when jog shoudl stop on a particular axis
	AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
	 
}

extern "C" __declspec(dllexport) void Home( short axis ) ////////////////////  Called when Reset is pressed. 
{
	//Called when jog shoudl stop on a particular axis
	AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
	 
}


extern "C" __declspec(dllexport) void Update() ////////////////////  UPDATE LOOP 10 Times a Second.
{
    // This is your main update loop. Approx 10hz or so..
	// Since the Timer refresh is too low for ModIO at only 10hz, and we want smooth control at 40hz or so, 
	// we will use this loop only to shut down the main timing loop if the user disables this plugin. 
	// If the plugin gets enabled, the timer proceedure is kicked into life at 25ms update, or about 40hz.
    AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
    KickTimer = true;
	//if( !TimerOn ) SetTimer(NULL, 1, 25, MYProc);
	myUpdate ();
}   // Update


?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲v日本v欧美v久久精品| 亚洲一区二区三区爽爽爽爽爽| 成人国产视频在线观看| 一区二区三区四区不卡视频| 91精品国产欧美一区二区| 风间由美性色一区二区三区| 日欧美一区二区| 中文字幕日韩精品一区| 精品日韩99亚洲| 在线观看国产日韩| 99精品热视频| 国产福利一区二区三区视频| 午夜精品福利久久久| 国产精品高潮呻吟| 久久久综合视频| 欧美一区二区三区免费视频 | 中文字幕佐山爱一区二区免费| 日韩欧美一二三区| 欧美日本国产一区| 日本道色综合久久| 波多野结衣中文字幕一区二区三区| 久久精品国产在热久久| 亚洲高清在线精品| 亚洲三级在线观看| 国产精品久久久久久一区二区三区| 欧美精品一区二区三| 91精品久久久久久蜜臀| 欧美亚洲一区三区| 色噜噜夜夜夜综合网| 成人av第一页| 成人av网在线| 成人久久久精品乱码一区二区三区 | 91精品综合久久久久久| 在线观看欧美黄色| 欧美日韩另类国产亚洲欧美一级| 91啦中文在线观看| 97精品久久久久中文字幕| 不卡的看片网站| 成人免费高清视频| av高清久久久| 一本大道久久a久久精二百| av福利精品导航| jiyouzz国产精品久久| av在线播放成人| 97精品国产露脸对白| 色av一区二区| 欧美色综合网站| 欧美日韩免费一区二区三区| 欧洲精品在线观看| 欧美日韩国产成人在线91| 制服.丝袜.亚洲.中文.综合| 欧美一区三区四区| 日韩一级大片在线观看| 久久这里只有精品首页| 国产日产精品一区| 国产精品成人一区二区三区夜夜夜| 国产欧美日韩久久| 亚洲成人动漫av| 老司机精品视频线观看86| 看片的网站亚洲| 黄色小说综合网站| 国产一区二区在线视频| 成人天堂资源www在线| 91色视频在线| 91精品国产乱码| 国产日韩av一区二区| 亚洲激情中文1区| 日韩激情一区二区| 国产一区二区三区四区五区美女 | 蜜臀精品久久久久久蜜臀| 天堂在线亚洲视频| 九九精品视频在线看| 成人一级片网址| 欧美在线观看一二区| 欧美二区乱c少妇| 久久久久久久电影| 17c精品麻豆一区二区免费| 天天爽夜夜爽夜夜爽精品视频| 老司机免费视频一区二区三区| 成人av综合在线| 在线电影国产精品| 欧美激情一区二区三区| 亚洲大片免费看| 粉嫩av一区二区三区| 欧美日韩小视频| 日本一区二区三区dvd视频在线| 一区二区三区资源| 精品制服美女丁香| 91色综合久久久久婷婷| 精品日韩成人av| 亚洲一级二级在线| 国产不卡在线播放| 在线不卡一区二区| 中文字幕中文在线不卡住| 欧美aa在线视频| 色婷婷av一区二区三区gif| 精品粉嫩超白一线天av| 亚洲综合丝袜美腿| 国产69精品久久99不卡| 91精品婷婷国产综合久久性色| 中文av字幕一区| 久久99精品国产91久久来源| 色婷婷久久久久swag精品| 久久久一区二区三区| 久久蜜桃香蕉精品一区二区三区| 久久美女高清视频| 国产午夜精品福利| 欧美成va人片在线观看| 亚洲欧美日韩久久| 国产精品一区三区| 日韩一区二区三区免费观看| 一级女性全黄久久生活片免费| 国产在线播放一区三区四| 制服丝袜亚洲网站| 一区二区国产盗摄色噜噜| av中文字幕在线不卡| 国产无遮挡一区二区三区毛片日本| 日韩高清中文字幕一区| 欧洲视频一区二区| 一区在线播放视频| 成人激情av网| 国产性天天综合网| 国产资源在线一区| 精品国产亚洲一区二区三区在线观看 | 国内精品自线一区二区三区视频| 精品1区2区3区| 亚洲成人黄色小说| 欧美日韩一区二区欧美激情| 伊人夜夜躁av伊人久久| 91丨porny丨户外露出| 日本一区二区三区dvd视频在线| 国产麻豆视频精品| 国产日韩精品视频一区| 国产精华液一区二区三区| 欧美精品一区二| 九九国产精品视频| 精品成人一区二区三区四区| 国产一区美女在线| 国产亚洲一区二区在线观看| 国产一区在线精品| 国产三级久久久| www.在线成人| 亚洲欧洲日产国产综合网| 色综合色综合色综合色综合色综合| 最新国产成人在线观看| 99国产精品久久久久| 亚洲狼人国产精品| 欧美日韩一区二区在线观看视频| 亚洲国产乱码最新视频 | 欧美va在线播放| 国产精品一级片| 国产精品色哟哟网站| 91小宝寻花一区二区三区| 亚洲婷婷在线视频| 在线观看成人免费视频| 日韩高清电影一区| 亚洲精品在线网站| 99久久精品国产毛片| 亚洲高清视频的网址| 91麻豆精品国产91久久久使用方法 | 亚洲国产精品一区二区www| 欧美三片在线视频观看| 日本亚洲视频在线| 国产网红主播福利一区二区| www.欧美日韩国产在线| 亚洲妇女屁股眼交7| 日韩精品一区国产麻豆| 成人av电影免费在线播放| 亚洲黄色小说网站| 91精品国产综合久久福利软件| 久久9热精品视频| 国产精品少妇自拍| 欧美精品一卡二卡| 高清久久久久久| 亚洲国产一区二区三区| 久久久久久综合| 色先锋aa成人| 国产综合成人久久大片91| 亚洲视频一区二区在线观看| 91精品免费在线观看| 国产成人一区在线| 亚洲成av人片一区二区三区 | 亚洲成av人片一区二区| 亚洲精品在线观看网站| 在线免费一区三区| 国产真实乱对白精彩久久| 一区二区三区高清在线| 日韩精品一区二区在线观看| 91在线观看污| 久久爱www久久做| 亚洲一区二区影院| 久久精品亚洲精品国产欧美kt∨| 欧洲精品视频在线观看| 国产suv精品一区二区6| 日韩高清不卡在线| 亚洲精品老司机| 久久精品欧美日韩| 91精品国产综合久久久蜜臀粉嫩| 成人亚洲精品久久久久软件| 日韩av电影天堂|