emcsched.hh
1 /******************************************************************** 2 * Description: emcsched.hh 3 * Headers for common program scheduling calls 4 * 5 * Derived from a work by Fred Proctor & Will Shackleford 6 * Further derived from work by jmkasunich, Alex Joni 7 * 8 * Author: Eric H. Johnson 9 * License: GPL Version 2 10 * System: Linux 11 * 12 * Copyright (c) 2009 All rights reserved. 13 * 14 * Last change: 15 ********************************************************************/ 16 17 #ifndef EMCSCHED_HH 18 #define EMCSCHED_HH 19 20 #include "emc_nml.hh" 21 #include "nml_oi.hh" // NML_ERROR_LEN 22 #include <string> 23 24 using namespace std; 25 26 typedef enum { 27 qsStop, qsRun, qsPause, qsResume, qsError, qsUnknown} queueStatusType; 28 29 typedef struct { 30 int priority; 31 int tagId; 32 float xpos, ypos, zpos; 33 int zone; 34 char fileName[255]; 35 float feedOverride; 36 float spindleOverride; 37 int tool; 38 } qRecType; 39 40 extern int addProgram(int pri, int tag, float x, float y, float z, int azone, string progName, float feedOvr, float spindleOvr, int toolNum); 41 extern void updateQueue(); 42 extern int getQueueSize(); 43 extern void clearQueue(); 44 extern int getStatus(); 45 extern void queueStart(); 46 extern void queueStop(); 47 extern void queuePause(); 48 extern int getProgramById(int id, qRecType *qRec); 49 extern int getProgramByIndex(int idx, qRecType *qRec); 50 extern int getQueueCRC(); 51 extern int getFirstTagId(); 52 extern int getLastTagId(); 53 extern int deleteProgramById(int id); 54 extern int deleteProgramByIndex(int idx); 55 extern int changePriorityById(int id, int newPriority); 56 extern int changePriorityByIndex(int idx, int newPriority); 57 extern int getPriorityById(int id, int &pri); 58 extern int getPriorityByIndex(int idx, int &pri); 59 extern int getNextTagId(); 60 extern void resetTagIds(int startId); 61 extern void schedInit(); 62 63 #endif /* ifndef SHCOM_HH */