DummyDriver.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /* This file implements a dummy robo driver using Nero's new robot driver scheme */
  2. #ifndef DUMMYROBO_H
  3. #define DUMMYROBO_H
  4. #include "RoboDriver.h" // For CNeroRoboDriver
  5. #include "RoboCommNode.h" // For IRoboCommNode
  6. /* Our driver name which will be present to the application. */
  7. #define DUMMYDRIVER_ID "Dummy Driver"
  8. /* And the driver version number. */
  9. #define DUMMYDRIVER_MAJOR 1
  10. #define DUMMYDRIVER_MINOR 1
  11. /* Simulated robo movement for 5 seconds. */
  12. #define SIMULATEROBOMOVEMENT_TIMEOUT 5000
  13. /* By default we should print after burning and parallelize these two processes. */
  14. #define DEFAULTCONFIG_PRINTBEFOREBURN FALSE
  15. #define DEFAULTCONFIG_PARALLELIZE TRUE
  16. #define CONFIG_PRINTBEFOREBURN "PrintBeforeBurn"
  17. #define CONFIG_PARALLELIZE "Parallelize"
  18. class CDummyRoboDriver : public CNeroRoboDriver
  19. {
  20. public:
  21. virtual ~CDummyRoboDriver();
  22. /* This is the driver's interface towards the Nero core application. Think hooks here.
  23. * The methods below will be called respectively
  24. * - at the beginning of a burning session, just after the driver has been loaded
  25. * - when Nero wants the robo to insert a writeable CD
  26. * - when Nero has found an invalid CD in the recorder and wants it to be removed
  27. * - when the recording process was finished successfully
  28. * - " - " with an error */
  29. virtual BOOL InitBurn();
  30. virtual BOOL PreBurn();
  31. virtual BOOL InsertCD();
  32. virtual BOOL RemoveNonWriteableCD();
  33. virtual BOOL RemoveUntouchedCD();
  34. virtual BOOL PostBurnOK();
  35. virtual BOOL PostBurnFAILURE();
  36. virtual BOOL ExitBurn();
  37. virtual BOOL CleanUp();
  38. virtual BOOL StartPrintLabel();
  39. virtual BOOL StartRoboTest();
  40. /* Only this method is allowed to call our constructor */
  41. friend CNeroRoboDriver *nerorobodriver_createdriver(IRoboCommNode *commnode);
  42. private:
  43. /* Called from nerorobodriver_createdriver() */
  44. CDummyRoboDriver(IRoboCommNode *commnode);
  45. static UINT PrintThreadEntry(void *pData);
  46. UINT PrintThread();
  47. BOOL WaitForPrintThread();
  48. private:
  49. IRoboCommNode* m_pCommNode; /* Our access to hardware, the user and to the operating system. */
  50. IRoboMutex* m_pRoboMutex; /* Synchronize between print and burn threads. */
  51. IRoboThread* m_pPrintThread; /* For parallelization purpose we print in separate thread. */
  52. CSerial* m_pCommInterface; /* Communication interface to the robot. */
  53. BOOL m_bShowInfoMessage; /* Initially TRUE, and FALSE if user doesn't wish to show information dialogs. */
  54. BOOL m_bPrintBeforeBurn; /* Should we print before burning? */
  55. BOOL m_bParallelizePrinting; /* If TRUE we will burn and print at the same time. Will speed up burning/printing process. */
  56. BOOL m_bIsTesting; /* We are only testing. Can a little bit change the behaviour. */
  57. BOOL m_bHasNewInterface; /* Important if working with older Nero versions. */
  58. IRoboCommNode::ERoboLocationNode m_eCurrentDiscPos; /* Remember current disc position to make appropriate cleaning tasks. */
  59. };
  60. #endif // DUMMYROBO_H