/* This file implements a dummy robo driver using Nero's new robot driver scheme */ #ifndef DUMMYROBO_H #define DUMMYROBO_H #include "RoboDriver.h" // For CNeroRoboDriver #include "RoboCommNode.h" // For IRoboCommNode /* Our driver name which will be present to the application. */ #define DUMMYDRIVER_ID "Dummy Driver" /* And the driver version number. */ #define DUMMYDRIVER_MAJOR 1 #define DUMMYDRIVER_MINOR 1 /* Simulated robo movement for 5 seconds. */ #define SIMULATEROBOMOVEMENT_TIMEOUT 5000 /* By default we should print after burning and parallelize these two processes. */ #define DEFAULTCONFIG_PRINTBEFOREBURN FALSE #define DEFAULTCONFIG_PARALLELIZE TRUE #define CONFIG_PRINTBEFOREBURN "PrintBeforeBurn" #define CONFIG_PARALLELIZE "Parallelize" class CDummyRoboDriver : public CNeroRoboDriver { public: virtual ~CDummyRoboDriver(); /* This is the driver's interface towards the Nero core application. Think hooks here. * The methods below will be called respectively * - at the beginning of a burning session, just after the driver has been loaded * - when Nero wants the robo to insert a writeable CD * - when Nero has found an invalid CD in the recorder and wants it to be removed * - when the recording process was finished successfully * - " - " with an error */ virtual BOOL InitBurn(); virtual BOOL PreBurn(); virtual BOOL InsertCD(); virtual BOOL RemoveNonWriteableCD(); virtual BOOL RemoveUntouchedCD(); virtual BOOL PostBurnOK(); virtual BOOL PostBurnFAILURE(); virtual BOOL ExitBurn(); virtual BOOL CleanUp(); virtual BOOL StartPrintLabel(); virtual BOOL StartRoboTest(); /* Only this method is allowed to call our constructor */ friend CNeroRoboDriver *nerorobodriver_createdriver(IRoboCommNode *commnode); private: /* Called from nerorobodriver_createdriver() */ CDummyRoboDriver(IRoboCommNode *commnode); static UINT PrintThreadEntry(void *pData); UINT PrintThread(); BOOL WaitForPrintThread(); private: IRoboCommNode* m_pCommNode; /* Our access to hardware, the user and to the operating system. */ IRoboMutex* m_pRoboMutex; /* Synchronize between print and burn threads. */ IRoboThread* m_pPrintThread; /* For parallelization purpose we print in separate thread. */ CSerial* m_pCommInterface; /* Communication interface to the robot. */ BOOL m_bShowInfoMessage; /* Initially TRUE, and FALSE if user doesn't wish to show information dialogs. */ BOOL m_bPrintBeforeBurn; /* Should we print before burning? */ BOOL m_bParallelizePrinting; /* If TRUE we will burn and print at the same time. Will speed up burning/printing process. */ BOOL m_bIsTesting; /* We are only testing. Can a little bit change the behaviour. */ BOOL m_bHasNewInterface; /* Important if working with older Nero versions. */ IRoboCommNode::ERoboLocationNode m_eCurrentDiscPos; /* Remember current disc position to make appropriate cleaning tasks. */ }; #endif // DUMMYROBO_H