
This is a remote control tester, it uses a CNC, Ethernet Communication with a JAVAFX interface and a PLC in order to control some valves.
Dependencies: EthernetInterface mbed-rtos mbed
Fork of CNC_CONTROLLER by
EixoMonitoring.h@2:835c883d81b0, 2017-12-15 (annotated)
- Committer:
- kevencastro7
- Date:
- Fri Dec 15 19:40:41 2017 +0000
- Revision:
- 2:835c883d81b0
- Parent:
- 1:ef18c260ce02
This is a remote control tester, it uses a CNC, Ethernet Communication with a JAVAFX interface and a PLC in order to control some valves.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
waspSalander | 0:7cedfb720712 | 1 | #ifndef EIXO_MONITORING_H |
waspSalander | 0:7cedfb720712 | 2 | #define EIXO_MONITORING_H |
waspSalander | 0:7cedfb720712 | 3 | |
waspSalander | 0:7cedfb720712 | 4 | #include "mbed.h" |
waspSalander | 0:7cedfb720712 | 5 | #include "rtos.h" |
waspSalander | 0:7cedfb720712 | 6 | #include "Debug.h" |
kevencastro7 | 2:835c883d81b0 | 7 | #include "PCF8574.h" |
kevencastro7 | 2:835c883d81b0 | 8 | |
waspSalander | 0:7cedfb720712 | 9 | |
waspSalander | 0:7cedfb720712 | 10 | |
waspSalander | 0:7cedfb720712 | 11 | //#define DELAY_TIMER 500 |
waspSalander | 0:7cedfb720712 | 12 | |
waspSalander | 0:7cedfb720712 | 13 | class EixoMonitoring { |
waspSalander | 0:7cedfb720712 | 14 | |
waspSalander | 0:7cedfb720712 | 15 | public: |
waspSalander | 1:ef18c260ce02 | 16 | int delayTimer; |
waspSalander | 1:ef18c260ce02 | 17 | int hitSensor; |
waspSalander | 0:7cedfb720712 | 18 | Debug* debug; |
kevencastro7 | 2:835c883d81b0 | 19 | PCF8574* pcf; |
kevencastro7 | 2:835c883d81b0 | 20 | int sensor_Origin; |
kevencastro7 | 2:835c883d81b0 | 21 | int sensor_End; |
waspSalander | 0:7cedfb720712 | 22 | |
waspSalander | 0:7cedfb720712 | 23 | |
waspSalander | 0:7cedfb720712 | 24 | // Variáveis e Controle do Movimento do Eixo |
waspSalander | 0:7cedfb720712 | 25 | static bool stopAll; // false: n calibrado true: calibrado, cnc está no estágio de teste |
waspSalander | 0:7cedfb720712 | 26 | static bool isCalibrated; // false: n calibrado true: calibrado, cnc está no estágio de teste |
waspSalander | 0:7cedfb720712 | 27 | bool stopMoviment; // false: gira motor true: pára motor |
waspSalander | 0:7cedfb720712 | 28 | bool stopMonitoring; // false: executa threads true: pára threads |
waspSalander | 0:7cedfb720712 | 29 | |
waspSalander | 0:7cedfb720712 | 30 | // Switches e seu vetor de leitura |
waspSalander | 0:7cedfb720712 | 31 | int sensorInput_End; |
kevencastro7 | 2:835c883d81b0 | 32 | int sensorInput_Origin; |
waspSalander | 0:7cedfb720712 | 33 | |
waspSalander | 0:7cedfb720712 | 34 | // Threads |
waspSalander | 0:7cedfb720712 | 35 | Mutex stdioMutex; // controle de Acesso Mútuo |
waspSalander | 0:7cedfb720712 | 36 | Thread sensorThread_End; // threads de leitura dos sensores |
waspSalander | 0:7cedfb720712 | 37 | Thread handleSensorThread_End; // threads para lidar com a leitura dos sensores |
waspSalander | 0:7cedfb720712 | 38 | Thread sensorThread_Origin; // threads de leitura dos sensores |
waspSalander | 0:7cedfb720712 | 39 | Thread handleSensorThread_Origin; // threads para lidar com a leitur |
waspSalander | 0:7cedfb720712 | 40 | |
kevencastro7 | 2:835c883d81b0 | 41 | EixoMonitoring(PCF8574*,int,int); |
waspSalander | 0:7cedfb720712 | 42 | void startThreads(); |
waspSalander | 0:7cedfb720712 | 43 | void stopThreads(); |
waspSalander | 0:7cedfb720712 | 44 | void readSensor_End(); |
waspSalander | 0:7cedfb720712 | 45 | |
waspSalander | 0:7cedfb720712 | 46 | void handleReadSensor_End(); |
waspSalander | 0:7cedfb720712 | 47 | void readSensor_Origin(); |
waspSalander | 0:7cedfb720712 | 48 | void handleReadSensor_Origin(); |
waspSalander | 0:7cedfb720712 | 49 | }; |
waspSalander | 0:7cedfb720712 | 50 | |
waspSalander | 0:7cedfb720712 | 51 | #endif |
waspSalander | 0:7cedfb720712 | 52 |