From a20d25bb885b3ec46d63bda7263fd98faa4095c2 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Wed, 7 Oct 2020 21:40:34 +0300 Subject: winder calibration from main EEPROM (for #3782, #3761). waste prepare (#2995) increased suction after job (#2994) --- Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Thread') diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c index f4d34284d..4ec45c5b8 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c @@ -17,7 +17,7 @@ #include "Common/report/report.h" #include "drivers/FPGA/FPGA.h" - +#include "drivers/Flash_ram/MCU_E2Prom.h" #include "drivers/FPGA/FPGA_SPI_Comm.h" #include "drivers/FPGA/FPGA_GPIO/FPGA_GPIO.h" @@ -102,15 +102,22 @@ char ScrewStr[150]; uint32_t InternalWindingConfigMessage(JobSpool* request) { uint32_t status = PASSED; + int limitswitchstartpointoffset = 0; InternalWinderCfg.segmentoffsetpulses = request->segmentoffsetpulses; InternalWinderCfg.spoolbackingrate = request->backingrate; InternalWinderCfg.startoffsetpulses = request->startoffsetpulses; if (request->has_limitswitchstartpointoffset) { - InternalWinderCfg.startoffsetpulses += request->limitswitchstartpointoffset; + //InternalWinderCfg.startoffsetpulses += request->limitswitchstartpointoffset; Report("limit switch start point offset",__FILE__,__LINE__,(int)(request->startoffsetpulses),RpWarning,(int)(request->limitswitchstartpointoffset), 0); } + status |= MCU_E2PromRead(EEPROM_STORAGE_WINDER_CALIBRATION,&limitswitchstartpointoffset); + if ((status!= OK )||(limitswitchstartpointoffset == 0xFFFF)) + limitswitchstartpointoffset = 0; + Report("limit switch start point offset",__FILE__,(int)(request->startoffsetpulses),(int)(limitswitchstartpointoffset),RpWarning,status, 0); + InternalWinderCfg.startoffsetpulses += limitswitchstartpointoffset; + InternalWinderCfg.SpoolBottomBackingRate = request->bottombackingrate; InternalWinderCfg.NumberOfRotationPerPassage = 3.1415926*3;//request->rotationsperpassage; if (request->rotationsperpassage > 6.1) -- cgit v1.3.1 From 74c1d6a5f8f905d03abea94a2b5bf5ef1d12eb71 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Thu, 8 Oct 2020 11:01:57 +0300 Subject: remove compilation warnings --- Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA.c | 1 - .../I2C_Communication/WHS_Card/D_MAX11614_ADC/WHS_MAX11614_A2D.c | 2 -- .../I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c | 3 +-- .../Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c | 1 - Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c | 7 ++++--- Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c | 1 - Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c | 3 +-- Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c | 4 +++- Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c | 6 ++---- Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c | 1 - .../Embedded_SW/Embedded/StateMachines/Initialization/PowerIdle.c | 4 ++-- .../Embedded/StateMachines/Initialization/PowerOffSequence.c | 4 ++-- 12 files changed, 15 insertions(+), 22 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Thread') diff --git a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA.c b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA.c index 21056e162..95651eba2 100644 --- a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA.c +++ b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA.c @@ -434,7 +434,6 @@ uint32_t Read_Speed_Sensor_TypeII()//must be delay between Set_Speed_Sensor_Type temp1/=F1_Prescaler1_reg6; Speed_Hz = temp1; #endif - #warning change the speed from Hz to Cm/Sec return Speed_Hz; } diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_MAX11614_ADC/WHS_MAX11614_A2D.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_MAX11614_ADC/WHS_MAX11614_A2D.c index f7253a2e2..fff11f493 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_MAX11614_ADC/WHS_MAX11614_A2D.c +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_MAX11614_ADC/WHS_MAX11614_A2D.c @@ -396,8 +396,6 @@ double GetWHSAirFlow(uint8_t OR_Id) //------------------------------ waste volume measurement ------------------------------ -#warning need to update low and high limits and to read the eeprom on the initialization - double DefaultCoefficient = 10.5;//Coefficient is 10.5mV/mm for TI (not water). 9.72//TBD double Coefficient_LowLimit = 0;//TBD double Coefficient_HighLimit = 255;//TBD diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c index 9e626ec7f..4484f1932 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c @@ -175,7 +175,6 @@ bool WHS_init_Blower() bool LDACn_value = true; bool AUXn_value = true; bool update = 0; - int i; /* ---- config the WHS card 9555 configuration ----*/ @@ -630,7 +629,7 @@ uint32_t WHS_Pid_Testing_Func(double setParam,double measuredParam) { float calculated_speed; //float avreageSampleValue = 0; - int i; + //int i; /*WhsBlowerSamples[WhsBlowerSamplesPointer] = measuredParam;//(-1 * TranslatedReadValue); WhsBlowerSamplesPointer++; diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c index 4cd91443b..71343c78f 100644 --- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c +++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c @@ -631,7 +631,6 @@ uint32_t Diagnostics_Dryer_Loading_Callback(uint32_t MotorId, uint32_t ReadValue uint32_t Diagnostics_Dryer_Loading(void) { //float Calc_angle; -#warning assuming loading starts from 0 if (dryerbufferlength) LoadArmRounds = (int)dryerbufferlength; MCU_E2PromRead(EEPROM_STORAGE_DRYER_CENTER,&D_DrierPrevLocation); diff --git a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c index 6f5b5fe23..3f5e4f5b2 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c +++ b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c @@ -837,10 +837,11 @@ void FlashInitAndLoad(void) uint32_t Bytes = 0; ConfigurationParameters *Params = NULL; - ProcessParameters* ProcessParams = NULL; - UploadProcessParametersRequest* request = NULL; + //ProcessParameters* ProcessParams = NULL; + //UploadProcessParametersRequest* request = NULL; + + //char ProcessParamsPath[50] = "0://SysInfo//ProcessP.cfg"; - char ProcessParamsPath[50] = "0://SysInfo//ProcessP.cfg"; #ifdef WATCHDOG ROM_WatchdogResetDisable(WATCHDOG0_BASE); uint32_t timeout = 0xFFFFFFFFU; diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c index 2abcc2b31..1568e51c5 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c @@ -1115,7 +1115,6 @@ uint32_t HeaterBlowerMaxTempCBFunction(uint32_t IfIndex, uint32_t readValue) uint32_t BlowerPt100Read = 0; int index=HEATER_TYPE_MAX_HEATERS; - int32_t MaxreadValue; if (IfIndex>>8 != IfTypeHeaters) { diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c index 0d81e5447..b52f8b908 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c @@ -558,7 +558,6 @@ bool AdjustDispenserSpeedToPressure(int DispenserId, double RefMaxPressure,doubl int i; int NumofReadyDispensers = 0; TimerMotors_t HW_Motor_Id; - float updatedSpeed,tempSpeed; JobDispenser **Dispensers; //set the speed only before the first segment, speed is constant accros job int Dispenser_i,n_dispensers; @@ -1230,7 +1229,7 @@ uint32_t IDS_Cleaning_Stop_Cleaning_Solution (callback_fptr callback); } if (segmentfirst_speed > MINIMAL_MOTOR_SPEED) { - char IdMessage[100]; + //char IdMessage[100]; segmentfirst_speed *= (100+WFCF); segmentfirst_speed /= 100; DispenserSegmentReady[DispenserId] = false; diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c index 4ec45c5b8..c37617037 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c @@ -363,7 +363,9 @@ uint32_t Screw100msecDirectionChange(uint32_t deviceID, uint32_t BusyFlag) { //uint32_t Steps; double temp,tempScrewSpeed; - int i,tempmot; +#ifdef FOUR_WINDERS + int tempmot; +#endif //double screw_horizontal_speed = 0; //double RotationsPerSecond; if (WinderMotorSpeedCounter++>=MAX_WINDER_SPEED_CALCULATION) diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c index e7336cc9d..f13f76cfb 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c @@ -560,7 +560,6 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue) //extern int MotorSamplePointer[MAX_THREAD_MOTORS_NUM]; //read value is the dancer angle int i,index=MAX_THREAD_MOTORS_NUM; - int len; int DancerId; int32_t TranslatedReadValue, avreageSampleValue = 0;//,avreageMotorSampleValue = 0; //double tempcalcspeed = 0; @@ -747,7 +746,7 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue) if (index >= WINDER_MOTOR) { // FirstCalcInJob = false; - len = usnprintf(ATMessage[index], 150, "index %d read %d avg %d error(6) %d integral(9) %d,delta(9) %d, calc(3) %d speed %d %d",index-WINDER_MOTOR+1, + usnprintf(ATMessage[index], 150, "index %d read %d avg %d error(6) %d integral(9) %d,delta(9) %d, calc(3) %d speed %d %d",index-WINDER_MOTOR+1, TranslatedReadValue,avreageSampleValue,(int)(MotorControlConfig[index].m_mesuredParam*1000000), (int)(MotorControlConfig[index].m_integral*1000000000),(int)((MotorControlConfig[index].m_mesuredParam*MotorControlConfig[index].m_params.dt)*1000000000), (int)(MotorControlConfig[index].m_calculatedError*1000),(int)calculated_speed, (int)(InitialDryerSpeed*100/OriginalMotorSpd_2PPS[DRYER_MOTOR])); @@ -784,7 +783,6 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue) ReportWithPackageFilter(ThreadFilter,"MotorSpeedUpdated",__FILE__,index,(int)OriginalMotorSpd_2PPS[index],RpWarning,(int)CurrentControlledSpeed[index],0); }*/ #ifdef TEST_PID_THREAD - int len; if ((JobCounter % 2000) == index*100) //if (keepdata == true) { @@ -796,7 +794,7 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue) NormError[controlIndex] = MotorControlConfig[index].m_mesuredParam; mIntegral[controlIndex] = MotorControlConfig[index].m_integral; timestamp[controlIndex] = msec_millisecondCounter;*/ - len = usnprintf(TMessage, 150, "read %d avg %d error(6) %d integral(9) %d,delta(9) %d, calc(3) %d speed %d", + usnprintf(TMessage, 150, "read %d avg %d error(6) %d integral(9) %d,delta(9) %d, calc(3) %d speed %d", ReadValue,avreageSampleValue,(int)(MotorControlConfig[index].m_mesuredParam*1000000), (int)(MotorControlConfig[index].m_integral*1000000000),(int)((MotorControlConfig[index].m_mesuredParam*MotorControlConfig[index].m_params.dt)*1000000000), (int)(MotorControlConfig[index].m_calculatedError*1000),(int)calculated_speed); diff --git a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c index fa89164d3..1ace8a50b 100644 --- a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c +++ b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c @@ -330,7 +330,6 @@ uint32_t Waste_DoorOpenDuringEmptying(uint32_t IfIndex, uint32_t ReadValue) } } return OK; -#warning add alarm on door open } void Waste_StateMachine_OneSecond_Call(void) diff --git a/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerIdle.c b/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerIdle.c index 57da1574b..604324948 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerIdle.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerIdle.c @@ -187,7 +187,7 @@ bool getIdleState (void) {return powerIdleState;} uint32_t OutOfIdleUpdate(bool last) { uint32_t status = NOT_SUPPORTED; - +/* double calculate; int result = 0; MessageContainer responseContainer; @@ -197,7 +197,7 @@ uint32_t OutOfIdleUpdate(bool last) if (PowerUpToken[0] == 0) return OK; -/* response.has_state = true; + response.has_state = true; response.has_progresspercentage = true; if (last == false) diff --git a/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c b/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c index 15f363b9a..0a980159d 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c @@ -286,7 +286,7 @@ uint32_t PowerOffWaitForProcessesCallback(uint32_t IfIndex, uint32_t BusyFlag) } } if ((WHS_IsEmptying()|| - //MidTankFillingActive()|| + IFS_MidTankFilling()|| ThreadLoadingActive()|| SwUpgradeActive()|| (HomingActive == true))&& @@ -321,7 +321,7 @@ uint32_t PowerOffWaitForProcesses(void) } if (WHS_IsEmptying()|| - //MidTankFillingActive()|| + IFS_MidTankFilling()|| ThreadLoadingActive()|| SwUpgradeActive()|| (HomingActive == true)) -- cgit v1.3.1 From 07276289ff121853256bb894bc3040c4f5bfb2b0 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Fri, 9 Oct 2020 16:46:20 +0300 Subject: ifs filling / waste emptying interface --- .../Embedded/Common/Utilities/RFIDTagHandling.c | 18 ++ .../Embedded/Common/Utilities/RFIDTagHandling.h | 2 + .../Embedded_SW/Embedded/Communication/Container.c | 7 + .../Communication/PMR/Common/MessageType.pb-c.c | 264 +++++++++++---------- .../Communication/PMR/Common/MessageType.pb-c.h | 6 + .../PMR/Debugging/StartDebugLogResponse.pb-c.c | 8 +- .../PMR/Debugging/StartDebugLogResponse.pb-c.h | 8 +- .../PMR/Diagnostics/FillingAction.pb-c.c | 45 ++++ .../PMR/Diagnostics/FillingAction.pb-c.h | 47 ++++ .../PMR/Diagnostics/StartInkFillingRequest.pb-c.c | 72 ++++++ .../PMR/Diagnostics/StartInkFillingRequest.pb-c.h | 70 ++++++ .../PMR/Diagnostics/StartInkFillingResponse.pb-c.c | 131 ++++++++++ .../PMR/Diagnostics/StartInkFillingResponse.pb-c.h | 78 ++++++ .../Diagnostics/StartWasteEmptyingRequest.pb-c.c | 72 ++++++ .../Diagnostics/StartWasteEmptyingRequest.pb-c.h | 70 ++++++ .../Diagnostics/StartWasteEmptyingResponse.pb-c.c | 131 ++++++++++ .../Diagnostics/StartWasteEmptyingResponse.pb-c.h | 78 ++++++ .../PMR/MachineStatus/MachineStatus.pb-c.c | 32 ++- .../PMR/MachineStatus/MachineStatus.pb-c.h | 7 +- .../PMR/MachineStatus/WasteCartridgeState.pb-c.c | 43 ++++ .../PMR/MachineStatus/WasteCartridgeState.pb-c.h | 46 ++++ .../PMR/Stubs/StubAllHardwareRequest.pb-c.c | 72 ++++++ .../PMR/Stubs/StubAllHardwareRequest.pb-c.h | 70 ++++++ .../PMR/Stubs/StubAllHardwareResponse.pb-c.c | 144 +++++++++++ .../PMR/Stubs/StubAllHardwareResponse.pb-c.h | 81 +++++++ .../Embedded_SW/Embedded/Drivers/Valves/Valve.c | 1 + .../Embedded/Modules/AlarmHandling/AlarmHandling.c | 1 + .../Embedded/Modules/General/MachineStatus.c | 51 +++- .../Embedded/Modules/Heaters/Heaters_ex.h | 1 + Software/Embedded_SW/Embedded/Modules/IFS/ifs.c | 51 ++++ Software/Embedded_SW/Embedded/Modules/IFS/ifs.h | 1 + .../Embedded/Modules/Thread/ThreadLoad.c | 2 +- .../Embedded_SW/Embedded/Modules/Waste/Waste_ex.h | 2 + .../Embedded/Modules/Waste/Waste_maint.c | 55 ++++- .../Initialization/PowerOffSequence.c | 1 + .../Embedded/StateMachines/Printing/JobSTM.c | 1 + Software/PMR/Messages/Common/MessageType.proto | 7 +- .../Diagnostics/StartInkFillingRequest.proto | 2 +- .../Diagnostics/StartInkFillingResponse.proto | 2 +- .../Diagnostics/StartWasteEmptyingRequest.proto | 2 +- .../Diagnostics/StartWasteEmptyingResponse.proto | 2 +- 41 files changed, 1636 insertions(+), 148 deletions(-) create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/FillingAction.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/FillingAction.pb-c.h create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartInkFillingRequest.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartInkFillingRequest.pb-c.h create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartInkFillingResponse.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartInkFillingResponse.pb-c.h create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartWasteEmptyingRequest.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartWasteEmptyingRequest.pb-c.h create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartWasteEmptyingResponse.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartWasteEmptyingResponse.pb-c.h create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/MachineStatus/WasteCartridgeState.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/MachineStatus/WasteCartridgeState.pb-c.h create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubAllHardwareRequest.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubAllHardwareRequest.pb-c.h create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubAllHardwareResponse.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubAllHardwareResponse.pb-c.h (limited to 'Software/Embedded_SW/Embedded/Modules/Thread') diff --git a/Software/Embedded_SW/Embedded/Common/Utilities/RFIDTagHandling.c b/Software/Embedded_SW/Embedded/Common/Utilities/RFIDTagHandling.c index f6bc50a7e..2bb073bf8 100644 --- a/Software/Embedded_SW/Embedded/Common/Utilities/RFIDTagHandling.c +++ b/Software/Embedded_SW/Embedded/Common/Utilities/RFIDTagHandling.c @@ -18,6 +18,24 @@ #include "CartridgeTagContent.pb-c.h" #include "Cartridge.pb-c.h" +uint32_t LoadCartridgeData(PANEL_BUTTON_OR_CRAT_ID Cart,void *CartridgePtr) +{ + if (CartridgePtr == NULL) return ERROR; + if (Cart>CART_3) return ERROR; + Cartridge *Cartridge = CartridgePtr; + /* + ProtobufCMessage base; + protobuf_c_boolean has_slot; + CartridgeSlot slot; + CartridgeTagContent *tag; + protobuf_c_boolean has_index; + int32_t index; + * */ + Cartridge->has_slot = true; + Cartridge->slot = Cart-1; + //Cartridge->tag = NFCTag_Tag2PPC(NFC_TagRead[Cart-1].Struct); + return OK; +} /* typedef struct { diff --git a/Software/Embedded_SW/Embedded/Common/Utilities/RFIDTagHandling.h b/Software/Embedded_SW/Embedded/Common/Utilities/RFIDTagHandling.h index 496b1aae3..0eee787f4 100644 --- a/Software/Embedded_SW/Embedded/Common/Utilities/RFIDTagHandling.h +++ b/Software/Embedded_SW/Embedded/Common/Utilities/RFIDTagHandling.h @@ -11,4 +11,6 @@ CartridgeTagContent * NFCTag_Tag2PPC(NFCTag_t *Tag); NFCTag_t * NFCTag_PPC2Tag( CartridgeTagContent *PpcTag); + uint32_t LoadCartridgeData(PANEL_BUTTON_OR_CRAT_ID Cart,void *CartridgePtr); + diff --git a/Software/Embedded_SW/Embedded/Communication/Container.c b/Software/Embedded_SW/Embedded/Communication/Container.c index 307e4eecb..546f4bb58 100644 --- a/Software/Embedded_SW/Embedded/Communication/Container.c +++ b/Software/Embedded_SW/Embedded/Communication/Container.c @@ -42,6 +42,7 @@ #include "Modules/General/process.h" #include "Modules/Thread/Thread_ex.h" #include "Modules/Ids/Ids_ex.h" +#include "Modules/waste/waste_ex.h" #include "Modules/Ifs/Ifs.h" #include "Common/SWUpdate/FileSystem.h" @@ -469,6 +470,12 @@ void receive_callback(char* buffer, size_t length) case MESSAGE_TYPE__CartridgeValidationResponse: CartridgeValidationResponseFunc(requestContainer); break; + case MESSAGE_TYPE__StartWasteEmptyingRequest: + StartWasteEmptyingRequestFunc(requestContainer); + break; + case MESSAGE_TYPE__StartInkFillingRequest: + StartInkFillingRequestFunc(requestContainer); + break; case MESSAGE_TYPE__MidTankDataSetupRequest: MidTankDataSetupFunc(requestContainer); break; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Common/MessageType.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Common/MessageType.pb-c.c index d6c0259e2..a59dccb97 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/Common/MessageType.pb-c.c +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Common/MessageType.pb-c.c @@ -7,7 +7,7 @@ #endif #include "MessageType.pb-c.h" -static const ProtobufCEnumValue message_type__enum_values_by_number[263] = +static const ProtobufCEnumValue message_type__enum_values_by_number[269] = { { "", "", 0 }, { "", "", 1 }, @@ -121,6 +121,8 @@ static const ProtobufCEnumValue message_type__enum_values_by_number[263] = { "", "", 110 }, { "", "", 111 }, { "", "", 112 }, + { "", "", 113 }, + { "", "", 114 }, { "", "", 1000 }, { "", "", 1001 }, { "", "", 1002 }, @@ -188,6 +190,10 @@ static const ProtobufCEnumValue message_type__enum_values_by_number[263] = { "", "", 2043 }, { "", "", 2044 }, { "", "", 2045 }, + { "", "", 2046 }, + { "", "", 2047 }, + { "", "", 2048 }, + { "", "", 2049 }, { "", "", 3000 }, { "", "", 3001 }, { "", "", 3002 }, @@ -274,151 +280,155 @@ static const ProtobufCEnumValue message_type__enum_values_by_number[263] = { "", "", 11007 }, }; static const ProtobufCIntRange message_type__value_ranges[] = { -{0, 0},{3, 2},{1000, 112},{2000, 133},{3000, 179},{4000, 193},{5000, 201},{6000, 205},{7000, 211},{8000, 235},{9000, 243},{10000, 247},{11000, 255},{0, 263} +{0, 0},{3, 2},{1000, 114},{2000, 135},{3000, 185},{4000, 199},{5000, 207},{6000, 211},{7000, 217},{8000, 241},{9000, 249},{10000, 253},{11000, 261},{0, 269} }; -static const ProtobufCEnumValueIndex message_type__enum_values_by_name[263] = +static const ProtobufCEnumValueIndex message_type__enum_values_by_name[269] = { - { "", 191 }, - { "", 192 }, - { "", 181 }, - { "", 182 }, - { "", 249 }, - { "", 250 }, - { "", 253 }, - { "", 254 }, - { "", 233 }, - { "", 234 }, + { "", 197 }, + { "", 198 }, + { "", 187 }, + { "", 188 }, + { "", 255 }, + { "", 256 }, + { "", 259 }, + { "", 260 }, + { "", 239 }, + { "", 240 }, { "", 2 }, { "", 3 }, - { "", 177 }, - { "", 178 }, - { "", 125 }, - { "", 126 }, - { "", 131 }, - { "", 132 }, - { "", 207 }, - { "", 208 }, - { "", 257 }, - { "", 258 }, - { "", 219 }, - { "", 220 }, - { "", 185 }, - { "", 186 }, - { "", 221 }, - { "", 222 }, - { "", 117 }, - { "", 118 }, - { "", 209 }, - { "", 210 }, - { "", 143 }, - { "", 144 }, - { "", 149 }, - { "", 150 }, - { "", 235 }, - { "", 236 }, + { "", 179 }, + { "", 180 }, + { "", 127 }, + { "", 128 }, + { "", 133 }, + { "", 134 }, + { "", 213 }, + { "", 214 }, + { "", 263 }, + { "", 264 }, + { "", 225 }, + { "", 226 }, + { "", 191 }, + { "", 192 }, + { "", 227 }, + { "", 228 }, + { "", 119 }, + { "", 120 }, + { "", 215 }, + { "", 216 }, { "", 145 }, { "", 146 }, + { "", 151 }, + { "", 152 }, + { "", 241 }, + { "", 242 }, { "", 147 }, { "", 148 }, + { "", 149 }, + { "", 150 }, { "", 1 }, - { "", 215 }, - { "", 216 }, - { "", 113 }, - { "", 114 }, + { "", 221 }, + { "", 222 }, { "", 115 }, { "", 116 }, - { "", 112 }, + { "", 117 }, + { "", 118 }, + { "", 114 }, + { "", 235 }, + { "", 236 }, + { "", 219 }, + { "", 220 }, + { "", 233 }, + { "", 234 }, + { "", 217 }, + { "", 218 }, + { "", 131 }, + { "", 132 }, + { "", 231 }, + { "", 232 }, { "", 229 }, { "", 230 }, - { "", 213 }, - { "", 214 }, - { "", 227 }, - { "", 228 }, + { "", 185 }, + { "", 186 }, { "", 211 }, { "", 212 }, - { "", 129 }, - { "", 130 }, - { "", 225 }, - { "", 226 }, { "", 223 }, { "", 224 }, - { "", 179 }, - { "", 180 }, - { "", 205 }, - { "", 206 }, - { "", 217 }, - { "", 218 }, - { "", 239 }, - { "", 240 }, - { "", 241 }, - { "", 242 }, - { "", 237 }, - { "", 238 }, - { "", 135 }, - { "", 136 }, - { "", 141 }, - { "", 142 }, + { "", 245 }, + { "", 246 }, + { "", 247 }, + { "", 248 }, + { "", 243 }, + { "", 244 }, { "", 137 }, { "", 138 }, + { "", 143 }, + { "", 144 }, { "", 139 }, { "", 140 }, + { "", 141 }, + { "", 142 }, { "", 0 }, - { "", 119 }, - { "", 120 }, + { "", 121 }, + { "", 122 }, { "", 4 }, { "", 5 }, + { "", 161 }, + { "", 162 }, + { "", 193 }, + { "", 194 }, + { "", 171 }, + { "", 172 }, { "", 159 }, { "", 160 }, - { "", 187 }, - { "", 188 }, + { "", 203 }, + { "", 204 }, + { "", 153 }, + { "", 154 }, { "", 169 }, { "", 170 }, - { "", 157 }, - { "", 158 }, - { "", 197 }, - { "", 198 }, - { "", 151 }, - { "", 152 }, - { "", 167 }, - { "", 168 }, - { "", 171 }, - { "", 172 }, - { "", 199 }, - { "", 200 }, - { "", 121 }, - { "", 122 }, { "", 173 }, { "", 174 }, - { "", 193 }, - { "", 194 }, - { "", 133 }, - { "", 134 }, - { "", 163 }, - { "", 164 }, - { "", 189 }, - { "", 190 }, - { "", 243 }, - { "", 244 }, - { "", 247 }, - { "", 248 }, - { "", 251 }, - { "", 252 }, - { "", 255 }, - { "", 256 }, + { "", 205 }, + { "", 206 }, { "", 123 }, { "", 124 }, { "", 175 }, { "", 176 }, - { "", 195 }, - { "", 196 }, - { "", 161 }, - { "", 162 }, + { "", 199 }, + { "", 200 }, + { "", 135 }, + { "", 136 }, { "", 165 }, { "", 166 }, - { "", 245 }, - { "", 246 }, - { "", 259 }, - { "", 260 }, + { "", 195 }, + { "", 196 }, + { "", 183 }, + { "", 184 }, + { "", 249 }, + { "", 250 }, + { "", 253 }, + { "", 254 }, + { "", 257 }, + { "", 258 }, + { "", 261 }, + { "", 262 }, + { "", 181 }, + { "", 182 }, + { "", 125 }, + { "", 126 }, + { "", 177 }, + { "", 178 }, + { "", 201 }, + { "", 202 }, + { "", 163 }, + { "", 164 }, + { "", 167 }, + { "", 168 }, + { "", 251 }, + { "", 252 }, + { "", 265 }, + { "", 266 }, { "", 100 }, { "", 101 }, { "", 6 }, @@ -461,6 +471,8 @@ static const ProtobufCEnumValueIndex message_type__enum_values_by_name[263] = { "", 21 }, { "", 56 }, { "", 57 }, + { "", 112 }, + { "", 113 }, { "", 22 }, { "", 23 }, { "", 62 }, @@ -525,22 +537,22 @@ static const ProtobufCEnumValueIndex message_type__enum_values_by_name[263] = { "", 31 }, { "", 106 }, { "", 107 }, - { "", 203 }, - { "", 204 }, + { "", 209 }, + { "", 210 }, + { "", 157 }, + { "", 158 }, { "", 155 }, { "", 156 }, - { "", 153 }, - { "", 154 }, - { "", 261 }, - { "", 262 }, - { "", 127 }, - { "", 128 }, - { "", 201 }, - { "", 202 }, - { "", 183 }, - { "", 184 }, - { "", 231 }, - { "", 232 }, + { "", 267 }, + { "", 268 }, + { "", 129 }, + { "", 130 }, + { "", 207 }, + { "", 208 }, + { "", 189 }, + { "", 190 }, + { "", 237 }, + { "", 238 }, }; const ProtobufCEnumDescriptor message_type__descriptor = { @@ -549,9 +561,9 @@ const ProtobufCEnumDescriptor message_type__descriptor = "", "", "", - 263, + 269, message_type__enum_values_by_number, - 263, + 269, message_type__enum_values_by_name, 13, message_type__value_ranges, diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Common/MessageType.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Common/MessageType.pb-c.h index 58bd2112c..6df8fa5f9 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/Common/MessageType.pb-c.h +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Common/MessageType.pb-c.h @@ -132,6 +132,8 @@ typedef enum _MessageType { MESSAGE_TYPE__StubMainCardEEpromReadResponse = 110, MESSAGE_TYPE__StubMainCardEEpromWriteRequest = 111, MESSAGE_TYPE__StubMainCardEEpromWriteResponse = 112, + MESSAGE_TYPE__StubHeadEEpromRequest = 113, + MESSAGE_TYPE__StubHeadEEpromResponse = 114, MESSAGE_TYPE__ExternalBridgeUdpDiscoveryPacket = 1000, MESSAGE_TYPE__ExternalBridgeLoginRequest = 1001, MESSAGE_TYPE__ExternalBridgeLoginResponse = 1002, @@ -199,6 +201,10 @@ typedef enum _MessageType { MESSAGE_TYPE__StopCartridgesUpdateResponse = 2043, MESSAGE_TYPE__CartridgeValidationRequest = 2044, MESSAGE_TYPE__CartridgeValidationResponse = 2045, + MESSAGE_TYPE__StartWasteEmptyingRequest = 2046, + MESSAGE_TYPE__StartWasteEmptyingResponse = 2047, + MESSAGE_TYPE__StartInkFillingRequest = 2048, + MESSAGE_TYPE__StartInkFillingResponse = 2049, MESSAGE_TYPE__JobRequest = 3000, MESSAGE_TYPE__JobResponse = 3001, MESSAGE_TYPE__AbortJobRequest = 3002, diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Debugging/StartDebugLogResponse.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Debugging/StartDebugLogResponse.pb-c.c index 855480fa4..2640767b6 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/Debugging/StartDebugLogResponse.pb-c.c +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Debugging/StartDebugLogResponse.pb-c.c @@ -82,7 +82,7 @@ static const ProtobufCFieldDescriptor start_debug_log_response__field_descriptor "", 3, PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_INT32, offsetof(StartDebugLogResponse, has_linenumber), offsetof(StartDebugLogResponse, linenumber), NULL, @@ -94,7 +94,7 @@ static const ProtobufCFieldDescriptor start_debug_log_response__field_descriptor "", 4, PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_INT32, offsetof(StartDebugLogResponse, has_filter), offsetof(StartDebugLogResponse, filter), NULL, @@ -118,7 +118,7 @@ static const ProtobufCFieldDescriptor start_debug_log_response__field_descriptor "", 6, PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_INT32, offsetof(StartDebugLogResponse, has_moduleid), offsetof(StartDebugLogResponse, moduleid), NULL, @@ -130,7 +130,7 @@ static const ProtobufCFieldDescriptor start_debug_log_response__field_descriptor "", 7, PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_UINT32, + PROTOBUF_C_TYPE_INT32, offsetof(StartDebugLogResponse, has_parameter), offsetof(StartDebugLogResponse, parameter), NULL, diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Debugging/StartDebugLogResponse.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Debugging/StartDebugLogResponse.pb-c.h index ec58375ac..5a58da7ea 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/Debugging/StartDebugLogResponse.pb-c.h +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Debugging/StartDebugLogResponse.pb-c.h @@ -31,14 +31,14 @@ struct _StartDebugLogResponse DebugLogCategory category; char *filename; protobuf_c_boolean has_linenumber; - uint32_t linenumber; + int32_t linenumber; protobuf_c_boolean has_filter; - uint32_t filter; + int32_t filter; char *message; protobuf_c_boolean has_moduleid; - uint32_t moduleid; + int32_t moduleid; protobuf_c_boolean has_parameter; - uint32_t parameter; + int32_t parameter; }; #define START_DEBUG_LOG_RESPONSE__INIT \ { PROTOBUF_C_MESSAGE_INIT (&start_debug_log_response__descriptor) \ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/FillingAction.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/FillingAction.pb-c.c new file mode 100644 index 000000000..686c3c58f --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/FillingAction.pb-c.c @@ -0,0 +1,45 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: FillingAction.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "FillingAction.pb-c.h" +static const ProtobufCEnumValue filling_action__enum_values_by_number[6] = +{ + { "", "", 0 }, + { "", "", 1 }, + { "", "", 2 }, + { "", "", 3 }, + { "", "", 4 }, + { "", "", 5 }, +}; +static const ProtobufCIntRange filling_action__value_ranges[] = { +{0, 0},{0, 6} +}; +static const ProtobufCEnumValueIndex filling_action__enum_values_by_name[6] = +{ + { "", 5 }, + { "", 3 }, + { "", 4 }, + { "", 2 }, + { "", 1 }, + { "", 0 }, +}; +const ProtobufCEnumDescriptor filling_action__descriptor = +{ + PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC, + "", + "", + "", + "", + 6, + filling_action__enum_values_by_number, + 6, + filling_action__enum_values_by_name, + 1, + filling_action__value_ranges, + NULL,NULL,NULL,NULL /* reserved[1234] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/FillingAction.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/FillingAction.pb-c.h new file mode 100644 index 000000000..e48f99397 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/FillingAction.pb-c.h @@ -0,0 +1,47 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: FillingAction.proto */ + +#ifndef PROTOBUF_C_FillingAction_2eproto__INCLUDED +#define PROTOBUF_C_FillingAction_2eproto__INCLUDED + +#include + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + + + +/* --- enums --- */ + +typedef enum _FillingAction { + FILLING_ACTION__None = 0, + FILLING_ACTION__Inserted = 1, + FILLING_ACTION__Filling = 2, + FILLING_ACTION__End = 3, + FILLING_ACTION__Error = 4, + FILLING_ACTION__Ejected = 5 + PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(FILLING_ACTION) +} FillingAction; + +/* --- messages --- */ + +/* --- per-message closures --- */ + + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCEnumDescriptor filling_action__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_FillingAction_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartInkFillingRequest.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartInkFillingRequest.pb-c.c new file mode 100644 index 000000000..b56884185 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartInkFillingRequest.pb-c.c @@ -0,0 +1,72 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StartInkFillingRequest.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StartInkFillingRequest.pb-c.h" +void start_ink_filling_request__init + (StartInkFillingRequest *message) +{ + static const StartInkFillingRequest init_value = START_INK_FILLING_REQUEST__INIT; + *message = init_value; +} +size_t start_ink_filling_request__get_packed_size + (const StartInkFillingRequest *message) +{ + assert(message->base.descriptor == &start_ink_filling_request__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t start_ink_filling_request__pack + (const StartInkFillingRequest *message, + uint8_t *out) +{ + assert(message->base.descriptor == &start_ink_filling_request__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t start_ink_filling_request__pack_to_buffer + (const StartInkFillingRequest *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &start_ink_filling_request__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +StartInkFillingRequest * + start_ink_filling_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (StartInkFillingRequest *) + protobuf_c_message_unpack (&start_ink_filling_request__descriptor, + allocator, len, data); +} +void start_ink_filling_request__free_unpacked + (StartInkFillingRequest *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &start_ink_filling_request__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +#define start_ink_filling_request__field_descriptors NULL +#define start_ink_filling_request__field_indices_by_name NULL +#define start_ink_filling_request__number_ranges NULL +const ProtobufCMessageDescriptor start_ink_filling_request__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "", + "", + "", + "", + sizeof(StartInkFillingRequest), + 0, + start_ink_filling_request__field_descriptors, + start_ink_filling_request__field_indices_by_name, + 0, start_ink_filling_request__number_ranges, + (ProtobufCMessageInit) start_ink_filling_request__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartInkFillingRequest.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartInkFillingRequest.pb-c.h new file mode 100644 index 000000000..bda7b4229 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartInkFillingRequest.pb-c.h @@ -0,0 +1,70 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StartInkFillingRequest.proto */ + +#ifndef PROTOBUF_C_StartInkFillingRequest_2eproto__INCLUDED +#define PROTOBUF_C_StartInkFillingRequest_2eproto__INCLUDED + +#include + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _StartInkFillingRequest StartInkFillingRequest; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _StartInkFillingRequest +{ + ProtobufCMessage base; +}; +#define START_INK_FILLING_REQUEST__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&start_ink_filling_request__descriptor) \ + } + + +/* StartInkFillingRequest methods */ +void start_ink_filling_request__init + (StartInkFillingRequest *message); +size_t start_ink_filling_request__get_packed_size + (const StartInkFillingRequest *message); +size_t start_ink_filling_request__pack + (const StartInkFillingRequest *message, + uint8_t *out); +size_t start_ink_filling_request__pack_to_buffer + (const StartInkFillingRequest *message, + ProtobufCBuffer *buffer); +StartInkFillingRequest * + start_ink_filling_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void start_ink_filling_request__free_unpacked + (StartInkFillingRequest *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*StartInkFillingRequest_Closure) + (const StartInkFillingRequest *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor start_ink_filling_request__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StartInkFillingRequest_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartInkFillingResponse.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartInkFillingResponse.pb-c.c new file mode 100644 index 000000000..d68ad33e7 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartInkFillingResponse.pb-c.c @@ -0,0 +1,131 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StartInkFillingResponse.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StartInkFillingResponse.pb-c.h" +void start_ink_filling_response__init + (StartInkFillingResponse *message) +{ + static const StartInkFillingResponse init_value = START_INK_FILLING_RESPONSE__INIT; + *message = init_value; +} +size_t start_ink_filling_response__get_packed_size + (const StartInkFillingResponse *message) +{ + assert(message->base.descriptor == &start_ink_filling_response__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t start_ink_filling_response__pack + (const StartInkFillingResponse *message, + uint8_t *out) +{ + assert(message->base.descriptor == &start_ink_filling_response__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t start_ink_filling_response__pack_to_buffer + (const StartInkFillingResponse *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &start_ink_filling_response__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +StartInkFillingResponse * + start_ink_filling_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (StartInkFillingResponse *) + protobuf_c_message_unpack (&start_ink_filling_response__descriptor, + allocator, len, data); +} +void start_ink_filling_response__free_unpacked + (StartInkFillingResponse *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &start_ink_filling_response__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor start_ink_filling_response__field_descriptors[4] = +{ + { + "", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_MESSAGE, + 0, /* quantifier_offset */ + offsetof(StartInkFillingResponse, cartridge), + &cartridge__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_ENUM, + offsetof(StartInkFillingResponse, has_action), + offsetof(StartInkFillingResponse, action), + &filling_action__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 3, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(StartInkFillingResponse, has_progresspercentage), + offsetof(StartInkFillingResponse, progresspercentage), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 4, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(StartInkFillingResponse, message), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned start_ink_filling_response__field_indices_by_name[] = { + 1, /* field[1] = Action */ + 0, /* field[0] = Cartridge */ + 3, /* field[3] = Message */ + 2, /* field[2] = ProgressPercentage */ +}; +static const ProtobufCIntRange start_ink_filling_response__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 4 } +}; +const ProtobufCMessageDescriptor start_ink_filling_response__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "", + "", + "", + "", + sizeof(StartInkFillingResponse), + 4, + start_ink_filling_response__field_descriptors, + start_ink_filling_response__field_indices_by_name, + 1, start_ink_filling_response__number_ranges, + (ProtobufCMessageInit) start_ink_filling_response__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartInkFillingResponse.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartInkFillingResponse.pb-c.h new file mode 100644 index 000000000..5c1c7ddb2 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartInkFillingResponse.pb-c.h @@ -0,0 +1,78 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StartInkFillingResponse.proto */ + +#ifndef PROTOBUF_C_StartInkFillingResponse_2eproto__INCLUDED +#define PROTOBUF_C_StartInkFillingResponse_2eproto__INCLUDED + +#include + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + +#include "Cartridge.pb-c.h" +#include "FillingAction.pb-c.h" + +typedef struct _StartInkFillingResponse StartInkFillingResponse; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _StartInkFillingResponse +{ + ProtobufCMessage base; + Cartridge *cartridge; + protobuf_c_boolean has_action; + FillingAction action; + protobuf_c_boolean has_progresspercentage; + double progresspercentage; + char *message; +}; +#define START_INK_FILLING_RESPONSE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&start_ink_filling_response__descriptor) \ + , NULL, 0, FILLING_ACTION__None, 0, 0, NULL } + + +/* StartInkFillingResponse methods */ +void start_ink_filling_response__init + (StartInkFillingResponse *message); +size_t start_ink_filling_response__get_packed_size + (const StartInkFillingResponse *message); +size_t start_ink_filling_response__pack + (const StartInkFillingResponse *message, + uint8_t *out); +size_t start_ink_filling_response__pack_to_buffer + (const StartInkFillingResponse *message, + ProtobufCBuffer *buffer); +StartInkFillingResponse * + start_ink_filling_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void start_ink_filling_response__free_unpacked + (StartInkFillingResponse *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*StartInkFillingResponse_Closure) + (const StartInkFillingResponse *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor start_ink_filling_response__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StartInkFillingResponse_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartWasteEmptyingRequest.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartWasteEmptyingRequest.pb-c.c new file mode 100644 index 000000000..1b9c856fa --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartWasteEmptyingRequest.pb-c.c @@ -0,0 +1,72 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StartWasteEmptyingRequest.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StartWasteEmptyingRequest.pb-c.h" +void start_waste_emptying_request__init + (StartWasteEmptyingRequest *message) +{ + static const StartWasteEmptyingRequest init_value = START_WASTE_EMPTYING_REQUEST__INIT; + *message = init_value; +} +size_t start_waste_emptying_request__get_packed_size + (const StartWasteEmptyingRequest *message) +{ + assert(message->base.descriptor == &start_waste_emptying_request__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t start_waste_emptying_request__pack + (const StartWasteEmptyingRequest *message, + uint8_t *out) +{ + assert(message->base.descriptor == &start_waste_emptying_request__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t start_waste_emptying_request__pack_to_buffer + (const StartWasteEmptyingRequest *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &start_waste_emptying_request__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +StartWasteEmptyingRequest * + start_waste_emptying_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (StartWasteEmptyingRequest *) + protobuf_c_message_unpack (&start_waste_emptying_request__descriptor, + allocator, len, data); +} +void start_waste_emptying_request__free_unpacked + (StartWasteEmptyingRequest *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &start_waste_emptying_request__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +#define start_waste_emptying_request__field_descriptors NULL +#define start_waste_emptying_request__field_indices_by_name NULL +#define start_waste_emptying_request__number_ranges NULL +const ProtobufCMessageDescriptor start_waste_emptying_request__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "", + "", + "", + "", + sizeof(StartWasteEmptyingRequest), + 0, + start_waste_emptying_request__field_descriptors, + start_waste_emptying_request__field_indices_by_name, + 0, start_waste_emptying_request__number_ranges, + (ProtobufCMessageInit) start_waste_emptying_request__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartWasteEmptyingRequest.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartWasteEmptyingRequest.pb-c.h new file mode 100644 index 000000000..44a104321 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartWasteEmptyingRequest.pb-c.h @@ -0,0 +1,70 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StartWasteEmptyingRequest.proto */ + +#ifndef PROTOBUF_C_StartWasteEmptyingRequest_2eproto__INCLUDED +#define PROTOBUF_C_StartWasteEmptyingRequest_2eproto__INCLUDED + +#include + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _StartWasteEmptyingRequest StartWasteEmptyingRequest; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _StartWasteEmptyingRequest +{ + ProtobufCMessage base; +}; +#define START_WASTE_EMPTYING_REQUEST__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&start_waste_emptying_request__descriptor) \ + } + + +/* StartWasteEmptyingRequest methods */ +void start_waste_emptying_request__init + (StartWasteEmptyingRequest *message); +size_t start_waste_emptying_request__get_packed_size + (const StartWasteEmptyingRequest *message); +size_t start_waste_emptying_request__pack + (const StartWasteEmptyingRequest *message, + uint8_t *out); +size_t start_waste_emptying_request__pack_to_buffer + (const StartWasteEmptyingRequest *message, + ProtobufCBuffer *buffer); +StartWasteEmptyingRequest * + start_waste_emptying_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void start_waste_emptying_request__free_unpacked + (StartWasteEmptyingRequest *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*StartWasteEmptyingRequest_Closure) + (const StartWasteEmptyingRequest *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor start_waste_emptying_request__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StartWasteEmptyingRequest_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartWasteEmptyingResponse.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartWasteEmptyingResponse.pb-c.c new file mode 100644 index 000000000..55ca27102 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartWasteEmptyingResponse.pb-c.c @@ -0,0 +1,131 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StartWasteEmptyingResponse.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StartWasteEmptyingResponse.pb-c.h" +void start_waste_emptying_response__init + (StartWasteEmptyingResponse *message) +{ + static const StartWasteEmptyingResponse init_value = START_WASTE_EMPTYING_RESPONSE__INIT; + *message = init_value; +} +size_t start_waste_emptying_response__get_packed_size + (const StartWasteEmptyingResponse *message) +{ + assert(message->base.descriptor == &start_waste_emptying_response__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t start_waste_emptying_response__pack + (const StartWasteEmptyingResponse *message, + uint8_t *out) +{ + assert(message->base.descriptor == &start_waste_emptying_response__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t start_waste_emptying_response__pack_to_buffer + (const StartWasteEmptyingResponse *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &start_waste_emptying_response__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +StartWasteEmptyingResponse * + start_waste_emptying_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (StartWasteEmptyingResponse *) + protobuf_c_message_unpack (&start_waste_emptying_response__descriptor, + allocator, len, data); +} +void start_waste_emptying_response__free_unpacked + (StartWasteEmptyingResponse *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &start_waste_emptying_response__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor start_waste_emptying_response__field_descriptors[4] = +{ + { + "", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_MESSAGE, + 0, /* quantifier_offset */ + offsetof(StartWasteEmptyingResponse, cartridge), + &cartridge__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_ENUM, + offsetof(StartWasteEmptyingResponse, has_action), + offsetof(StartWasteEmptyingResponse, action), + &filling_action__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 3, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(StartWasteEmptyingResponse, has_progresspercentage), + offsetof(StartWasteEmptyingResponse, progresspercentage), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 4, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(StartWasteEmptyingResponse, message), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned start_waste_emptying_response__field_indices_by_name[] = { + 1, /* field[1] = Action */ + 0, /* field[0] = Cartridge */ + 3, /* field[3] = Message */ + 2, /* field[2] = ProgressPercentage */ +}; +static const ProtobufCIntRange start_waste_emptying_response__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 4 } +}; +const ProtobufCMessageDescriptor start_waste_emptying_response__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "", + "", + "", + "", + sizeof(StartWasteEmptyingResponse), + 4, + start_waste_emptying_response__field_descriptors, + start_waste_emptying_response__field_indices_by_name, + 1, start_waste_emptying_response__number_ranges, + (ProtobufCMessageInit) start_waste_emptying_response__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartWasteEmptyingResponse.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartWasteEmptyingResponse.pb-c.h new file mode 100644 index 000000000..11254b220 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartWasteEmptyingResponse.pb-c.h @@ -0,0 +1,78 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StartWasteEmptyingResponse.proto */ + +#ifndef PROTOBUF_C_StartWasteEmptyingResponse_2eproto__INCLUDED +#define PROTOBUF_C_StartWasteEmptyingResponse_2eproto__INCLUDED + +#include + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + +#include "Cartridge.pb-c.h" +#include "FillingAction.pb-c.h" + +typedef struct _StartWasteEmptyingResponse StartWasteEmptyingResponse; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _StartWasteEmptyingResponse +{ + ProtobufCMessage base; + Cartridge *cartridge; + protobuf_c_boolean has_action; + FillingAction action; + protobuf_c_boolean has_progresspercentage; + double progresspercentage; + char *message; +}; +#define START_WASTE_EMPTYING_RESPONSE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&start_waste_emptying_response__descriptor) \ + , NULL, 0, FILLING_ACTION__None, 0, 0, NULL } + + +/* StartWasteEmptyingResponse methods */ +void start_waste_emptying_response__init + (StartWasteEmptyingResponse *message); +size_t start_waste_emptying_response__get_packed_size + (const StartWasteEmptyingResponse *message); +size_t start_waste_emptying_response__pack + (const StartWasteEmptyingResponse *message, + uint8_t *out); +size_t start_waste_emptying_response__pack_to_buffer + (const StartWasteEmptyingResponse *message, + ProtobufCBuffer *buffer); +StartWasteEmptyingResponse * + start_waste_emptying_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void start_waste_emptying_response__free_unpacked + (StartWasteEmptyingResponse *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*StartWasteEmptyingResponse_Closure) + (const StartWasteEmptyingResponse *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor start_waste_emptying_response__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StartWasteEmptyingResponse_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/MachineStatus/MachineStatus.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/MachineStatus/MachineStatus.pb-c.c index ad257ca79..7b73b08b9 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/MachineStatus/MachineStatus.pb-c.c +++ b/Software/Embedded_SW/Embedded/Communication/PMR/MachineStatus/MachineStatus.pb-c.c @@ -52,7 +52,7 @@ void machine_status__free_unpacked assert(message->base.descriptor == &machine_status__descriptor); protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); } -static const ProtobufCFieldDescriptor machine_status__field_descriptors[4] = +static const ProtobufCFieldDescriptor machine_status__field_descriptors[6] = { { "", @@ -102,9 +102,35 @@ static const ProtobufCFieldDescriptor machine_status__field_descriptors[4] = 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, + { + "", + 5, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_ENUM, + offsetof(MachineStatus, has_middlecartridgestate), + offsetof(MachineStatus, middlecartridgestate), + &waste_cartridge_state__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 6, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_ENUM, + offsetof(MachineStatus, has_lowercartridgestate), + offsetof(MachineStatus, lowercartridgestate), + &waste_cartridge_state__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, }; static const unsigned machine_status__field_indices_by_name[] = { 1, /* field[1] = IDSPacksLevels */ + 5, /* field[5] = LowerCartridgeState */ + 4, /* field[4] = MiddleCartridgeState */ 2, /* field[2] = OverallTemperature */ 3, /* field[3] = SpoolState */ 0, /* field[0] = State */ @@ -112,7 +138,7 @@ static const unsigned machine_status__field_indices_by_name[] = { static const ProtobufCIntRange machine_status__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 4 } + { 0, 6 } }; const ProtobufCMessageDescriptor machine_status__descriptor = { @@ -122,7 +148,7 @@ const ProtobufCMessageDescriptor machine_status__descriptor = "", "", sizeof(MachineStatus), - 4, + 6, machine_status__field_descriptors, machine_status__field_indices_by_name, 1, machine_status__number_ranges, diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/MachineStatus/MachineStatus.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/MachineStatus/MachineStatus.pb-c.h index 003fcd09c..a8e12e87f 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/MachineStatus/MachineStatus.pb-c.h +++ b/Software/Embedded_SW/Embedded/Communication/PMR/MachineStatus/MachineStatus.pb-c.h @@ -17,6 +17,7 @@ PROTOBUF_C__BEGIN_DECLS #include "MachineState.pb-c.h" #include "IDSPackLevel.pb-c.h" #include "SpoolState.pb-c.h" +#include "WasteCartridgeState.pb-c.h" typedef struct _MachineStatus MachineStatus; @@ -37,10 +38,14 @@ struct _MachineStatus double overalltemperature; protobuf_c_boolean has_spoolstate; SpoolState spoolstate; + protobuf_c_boolean has_middlecartridgestate; + WasteCartridgeState middlecartridgestate; + protobuf_c_boolean has_lowercartridgestate; + WasteCartridgeState lowercartridgestate; }; #define MACHINE_STATUS__INIT \ { PROTOBUF_C_MESSAGE_INIT (&machine_status__descriptor) \ - , 0, MACHINE_STATE__PowerUp, 0,NULL, 0, 0, 0, SPOOL_STATE__Absent } + , 0, MACHINE_STATE__PowerUp, 0,NULL, 0, 0, 0, SPOOL_STATE__Absent, 0, WASTE_CARTRIDGE_STATE__CartAbsent, 0, WASTE_CARTRIDGE_STATE__CartAbsent } /* MachineStatus methods */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/MachineStatus/WasteCartridgeState.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/MachineStatus/WasteCartridgeState.pb-c.c new file mode 100644 index 000000000..f179ce199 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/MachineStatus/WasteCartridgeState.pb-c.c @@ -0,0 +1,43 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: WasteCartridgeState.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "WasteCartridgeState.pb-c.h" +static const ProtobufCEnumValue waste_cartridge_state__enum_values_by_number[5] = +{ + { "", "", 0 }, + { "", "", 1 }, + { "", "", 2 }, + { "", "", 3 }, + { "", "", 4 }, +}; +static const ProtobufCIntRange waste_cartridge_state__value_ranges[] = { +{0, 0},{0, 5} +}; +static const ProtobufCEnumValueIndex waste_cartridge_state__enum_values_by_name[5] = +{ + { "", 0 }, + { "", 1 }, + { "", 4 }, + { "", 2 }, + { "", 3 }, +}; +const ProtobufCEnumDescriptor waste_cartridge_state__descriptor = +{ + PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC, + "", + "", + "", + "", + 5, + waste_cartridge_state__enum_values_by_number, + 5, + waste_cartridge_state__enum_values_by_name, + 1, + waste_cartridge_state__value_ranges, + NULL,NULL,NULL,NULL /* reserved[1234] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/MachineStatus/WasteCartridgeState.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/MachineStatus/WasteCartridgeState.pb-c.h new file mode 100644 index 000000000..c100d36d8 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/MachineStatus/WasteCartridgeState.pb-c.h @@ -0,0 +1,46 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: WasteCartridgeState.proto */ + +#ifndef PROTOBUF_C_WasteCartridgeState_2eproto__INCLUDED +#define PROTOBUF_C_WasteCartridgeState_2eproto__INCLUDED + +#include + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + + + +/* --- enums --- */ + +typedef enum _WasteCartridgeState { + WASTE_CARTRIDGE_STATE__CartAbsent = 0, + WASTE_CARTRIDGE_STATE__CartEmpty = 1, + WASTE_CARTRIDGE_STATE__CartFilling = 2, + WASTE_CARTRIDGE_STATE__CartFull = 3, + WASTE_CARTRIDGE_STATE__CartError = 4 + PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(WASTE_CARTRIDGE_STATE) +} WasteCartridgeState; + +/* --- messages --- */ + +/* --- per-message closures --- */ + + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCEnumDescriptor waste_cartridge_state__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_WasteCartridgeState_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubAllHardwareRequest.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubAllHardwareRequest.pb-c.c new file mode 100644 index 000000000..5334c1193 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubAllHardwareRequest.pb-c.c @@ -0,0 +1,72 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubAllHardwareRequest.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StubAllHardwareRequest.pb-c.h" +void stub_all_hardware_request__init + (StubAllHardwareRequest *message) +{ + static const StubAllHardwareRequest init_value = STUB_ALL_HARDWARE_REQUEST__INIT; + *message = init_value; +} +size_t stub_all_hardware_request__get_packed_size + (const StubAllHardwareRequest *message) +{ + assert(message->base.descriptor == &stub_all_hardware_request__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t stub_all_hardware_request__pack + (const StubAllHardwareRequest *message, + uint8_t *out) +{ + assert(message->base.descriptor == &stub_all_hardware_request__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t stub_all_hardware_request__pack_to_buffer + (const StubAllHardwareRequest *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &stub_all_hardware_request__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +StubAllHardwareRequest * + stub_all_hardware_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (StubAllHardwareRequest *) + protobuf_c_message_unpack (&stub_all_hardware_request__descriptor, + allocator, len, data); +} +void stub_all_hardware_request__free_unpacked + (StubAllHardwareRequest *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &stub_all_hardware_request__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +#define stub_all_hardware_request__field_descriptors NULL +#define stub_all_hardware_request__field_indices_by_name NULL +#define stub_all_hardware_request__number_ranges NULL +const ProtobufCMessageDescriptor stub_all_hardware_request__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "", + "", + "", + "", + sizeof(StubAllHardwareRequest), + 0, + stub_all_hardware_request__field_descriptors, + stub_all_hardware_request__field_indices_by_name, + 0, stub_all_hardware_request__number_ranges, + (ProtobufCMessageInit) stub_all_hardware_request__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubAllHardwareRequest.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubAllHardwareRequest.pb-c.h new file mode 100644 index 000000000..d22bddaaf --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubAllHardwareRequest.pb-c.h @@ -0,0 +1,70 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubAllHardwareRequest.proto */ + +#ifndef PROTOBUF_C_StubAllHardwareRequest_2eproto__INCLUDED +#define PROTOBUF_C_StubAllHardwareRequest_2eproto__INCLUDED + +#include + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _StubAllHardwareRequest StubAllHardwareRequest; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _StubAllHardwareRequest +{ + ProtobufCMessage base; +}; +#define STUB_ALL_HARDWARE_REQUEST__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&stub_all_hardware_request__descriptor) \ + } + + +/* StubAllHardwareRequest methods */ +void stub_all_hardware_request__init + (StubAllHardwareRequest *message); +size_t stub_all_hardware_request__get_packed_size + (const StubAllHardwareRequest *message); +size_t stub_all_hardware_request__pack + (const StubAllHardwareRequest *message, + uint8_t *out); +size_t stub_all_hardware_request__pack_to_buffer + (const StubAllHardwareRequest *message, + ProtobufCBuffer *buffer); +StubAllHardwareRequest * + stub_all_hardware_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void stub_all_hardware_request__free_unpacked + (StubAllHardwareRequest *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*StubAllHardwareRequest_Closure) + (const StubAllHardwareRequest *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor stub_all_hardware_request__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StubAllHardwareRequest_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubAllHardwareResponse.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubAllHardwareResponse.pb-c.c new file mode 100644 index 000000000..898aea50b --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubAllHardwareResponse.pb-c.c @@ -0,0 +1,144 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubAllHardwareResponse.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StubAllHardwareResponse.pb-c.h" +void stub_all_hardware_response__init + (StubAllHardwareResponse *message) +{ + static const StubAllHardwareResponse init_value = STUB_ALL_HARDWARE_RESPONSE__INIT; + *message = init_value; +} +size_t stub_all_hardware_response__get_packed_size + (const StubAllHardwareResponse *message) +{ + assert(message->base.descriptor == &stub_all_hardware_response__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t stub_all_hardware_response__pack + (const StubAllHardwareResponse *message, + uint8_t *out) +{ + assert(message->base.descriptor == &stub_all_hardware_response__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t stub_all_hardware_response__pack_to_buffer + (const StubAllHardwareResponse *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &stub_all_hardware_response__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +StubAllHardwareResponse * + stub_all_hardware_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (StubAllHardwareResponse *) + protobuf_c_message_unpack (&stub_all_hardware_response__descriptor, + allocator, len, data); +} +void stub_all_hardware_response__free_unpacked + (StubAllHardwareResponse *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &stub_all_hardware_response__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor stub_all_hardware_response__field_descriptors[5] = +{ + { + "", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(StubAllHardwareResponse, mcu_serial), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_MESSAGE, + 0, /* quantifier_offset */ + offsetof(StubAllHardwareResponse, headeeprom), + &stub_head_eeprom_data__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 3, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_MESSAGE, + 0, /* quantifier_offset */ + offsetof(StubAllHardwareResponse, whseeprom), + &stub_whs_eeprom_data__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 4, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(StubAllHardwareResponse, n_maincardeepromdata), + offsetof(StubAllHardwareResponse, maincardeepromdata), + &stub_main_card_eeprom_read_response__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 5, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(StubAllHardwareResponse, n_dispensereepromdata), + offsetof(StubAllHardwareResponse, dispensereepromdata), + &stub_dispenser_eeprom_response__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned stub_all_hardware_response__field_indices_by_name[] = { + 4, /* field[4] = DispenserEEpromData */ + 1, /* field[1] = HeadEEprom */ + 0, /* field[0] = MCU_Serial */ + 3, /* field[3] = MainCardEEpromData */ + 2, /* field[2] = WhsEEprom */ +}; +static const ProtobufCIntRange stub_all_hardware_response__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 5 } +}; +const ProtobufCMessageDescriptor stub_all_hardware_response__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "", + "", + "", + "", + sizeof(StubAllHardwareResponse), + 5, + stub_all_hardware_response__field_descriptors, + stub_all_hardware_response__field_indices_by_name, + 1, stub_all_hardware_response__number_ranges, + (ProtobufCMessageInit) stub_all_hardware_response__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubAllHardwareResponse.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubAllHardwareResponse.pb-c.h new file mode 100644 index 000000000..2678952fa --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubAllHardwareResponse.pb-c.h @@ -0,0 +1,81 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubAllHardwareResponse.proto */ + +#ifndef PROTOBUF_C_StubAllHardwareResponse_2eproto__INCLUDED +#define PROTOBUF_C_StubAllHardwareResponse_2eproto__INCLUDED + +#include + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + +#include "StubHeadEEpromData.pb-c.h" +#include "StubWhsEEpromData.pb-c.h" +#include "StubDispenserEEpromResponse.pb-c.h" +#include "StubMainCardEEpromReadResponse.pb-c.h" + +typedef struct _StubAllHardwareResponse StubAllHardwareResponse; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _StubAllHardwareResponse +{ + ProtobufCMessage base; + char *mcu_serial; + StubHeadEEpromData *headeeprom; + StubWhsEEpromData *whseeprom; + size_t n_maincardeepromdata; + StubMainCardEEpromReadResponse **maincardeepromdata; + size_t n_dispensereepromdata; + StubDispenserEEpromResponse **dispensereepromdata; +}; +#define STUB_ALL_HARDWARE_RESPONSE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&stub_all_hardware_response__descriptor) \ + , NULL, NULL, NULL, 0,NULL, 0,NULL } + + +/* StubAllHardwareResponse methods */ +void stub_all_hardware_response__init + (StubAllHardwareResponse *message); +size_t stub_all_hardware_response__get_packed_size + (const StubAllHardwareResponse *message); +size_t stub_all_hardware_response__pack + (const StubAllHardwareResponse *message, + uint8_t *out); +size_t stub_all_hardware_response__pack_to_buffer + (const StubAllHardwareResponse *message, + ProtobufCBuffer *buffer); +StubAllHardwareResponse * + stub_all_hardware_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void stub_all_hardware_response__free_unpacked + (StubAllHardwareResponse *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*StubAllHardwareResponse_Closure) + (const StubAllHardwareResponse *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor stub_all_hardware_response__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StubAllHardwareResponse_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.c b/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.c index 2ae3da453..841a8d1da 100644 --- a/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.c +++ b/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.c @@ -148,6 +148,7 @@ uint32_t ValveCallback(uint32_t deviceID, uint32_t ReadValue) MidtankMitigationCounter[deviceID] = 0; } } + return OK; } void Valve_Command(Valves_t Valve_Id) //1 - OPEN, 0 - CLOSE diff --git a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c index 120df71df..de45cacaa 100644 --- a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c +++ b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c @@ -36,6 +36,7 @@ #include "modules/thread/thread_ex.h" #include "modules/heaters/heaters_ex.h" #include "modules/ids/ids_ex.h" +#include "modules/waste/waste_ex.h" #include #include #include diff --git a/Software/Embedded_SW/Embedded/Modules/General/MachineStatus.c b/Software/Embedded_SW/Embedded/Modules/General/MachineStatus.c index 9297d3bb8..b9bcc1624 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/MachineStatus.c +++ b/Software/Embedded_SW/Embedded/Modules/General/MachineStatus.c @@ -27,7 +27,9 @@ #include "StateMachines/Initialization/InitSequence.h" #include "Modules/General/MachineStatus.h" +#include "Modules/AlarmHandling/AlarmHandling.h" #include "Modules/Control/MillisecTask.h" +#include "modules/waste/waste_ex.h" #include "modules/ids/ids_ex.h" MachineState StoredMachineStatus = MACHINE_STATE__PowerUp; @@ -78,6 +80,7 @@ int MachineUpdateResponseFunc(void) int1valid = false; if((internaltemp2<=MINIMUM_HEATER_READ*100)||(MAXIMUM_HEATER_READ*100<=internaltemp2)) int2valid = false; + MachineStatus.has_overalltemperature = true; if ((int2valid == true)&&(int1valid == true)) { usetemp = (max(internaltemp1,internaltemp2))/100; @@ -89,17 +92,19 @@ int MachineUpdateResponseFunc(void) } else { - AlarmHandlingSetAlarm(EVENT_TYPE__TEMPERATURE_MEASUREMENT_ERROR, true); + //AlarmHandlingSetAlarm(EVENT_TYPE__TEMPERATURE_MEASUREMENT_ERROR, true); temp_measure_alarm = true; if ((int2valid == false)&&(int1valid == true)) usetemp = internaltemp1/100; else if ((int2valid == false)&&(int1valid == false)) + { + MachineStatus.has_overalltemperature = FALSE; usetemp = 0; + } else if ((int1valid == false)&&(int2valid == true)) usetemp = internaltemp2/100; } - MachineStatus.has_overalltemperature = true; if (FPGA_Read_limit_Switches(GPI_SW_SPOOL_EXISTS)==LIMIT) @@ -133,7 +138,47 @@ int MachineUpdateResponseFunc(void) } else return ERROR; - + MachineStatus.has_middlecartridgestate = true; + switch (cartGetState(WasteCartridge_middle)) + { + case CartridgeStateOUT: + MachineStatus.middlecartridgestate = WASTE_CARTRIDGE_STATE__CartAbsent; + break; + case CartridgeStateIN: + case CartridgeStateSELECTED: + MachineStatus.middlecartridgestate = WASTE_CARTRIDGE_STATE__CartEmpty; + break; + case CartridgeStateACTIVE: + MachineStatus.middlecartridgestate = WASTE_CARTRIDGE_STATE__CartFilling; + break; + case CartridgeStateFULL: + MachineStatus.middlecartridgestate = WASTE_CARTRIDGE_STATE__CartFull; + break; + default: + MachineStatus.middlecartridgestate = WASTE_CARTRIDGE_STATE__CartAbsent; + break; + } + MachineStatus.has_lowercartridgestate = true; + MachineStatus.lowercartridgestate = WASTE_CARTRIDGE_STATE__CartAbsent; + switch (cartGetState(WasteCartridge_lower)) + { + case CartridgeStateOUT: + MachineStatus.lowercartridgestate = WASTE_CARTRIDGE_STATE__CartAbsent; + break; + case CartridgeStateIN: + case CartridgeStateSELECTED: + MachineStatus.lowercartridgestate = WASTE_CARTRIDGE_STATE__CartEmpty; + break; + case CartridgeStateACTIVE: + MachineStatus.lowercartridgestate = WASTE_CARTRIDGE_STATE__CartFilling; + break; + case CartridgeStateFULL: + MachineStatus.lowercartridgestate = WASTE_CARTRIDGE_STATE__CartFull; + break; + default: + MachineStatus.lowercartridgestate = WASTE_CARTRIDGE_STATE__CartAbsent; + break; + } responseContainer = /*MachineUpdate*/createContainer(MESSAGE_TYPE__StartMachineStatusUpdateResponse, MachineUpdateToken, false, &response, &start_machine_status_update_response__pack, &start_machine_status_update_response__get_packed_size); diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_ex.h b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_ex.h index 6d50eb926..e85694c48 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_ex.h +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_ex.h @@ -47,6 +47,7 @@ double PressureSensorGetPressure(uint8_t SensorId); int HeadBlowersGetRPM(uint8_t fanId); double PressureSensorInit(); void HeadBlowersInit(); +uint32_t HeadBlowerPidRequestMessage(void* request, int BlowerId); void HeadBlowersCfg(); void HeadBlowersControlLoop (); uint32_t HeadBlowerCommandRequestMessage(int blowerId, float flow); diff --git a/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c b/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c index 747df1a61..abad051cb 100644 --- a/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c +++ b/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c @@ -11,10 +11,14 @@ #include #include "PMR/Diagnostics/CartridgeSlot.pb-c.h" #include "PMR/Diagnostics/CartridgeTagContent.pb-c.h" +#include "PMR/Diagnostics/StartInkFillingRequest.pb-c.h" +#include "PMR/Diagnostics/StartInkFillingResponse.pb-c.h" +#include "PMR/Diagnostics/FillingAction.pb-c.h" #include #include "drivers/FPGA/FPGA_GPIO/FPGA_GPIO.h"//#include "FPGA_GPIO.h" // use for FPGA IO #include "drivers/I2C_Communication/ADC_MUX/ADC_MUX.h" #include "StateMachines/Initialization/PowerOffSequence.h" +#include #include "include.h" #include "Modules/IDS/ids_ex.h" @@ -229,7 +233,54 @@ bool CartridgeValidationResponseFunc(MessageContainer* requestContainer) } return OK; } +char InkFillingToken[36+1] = {0}; +uint32_t InkFillingUpdate(POWER_OFF_STAGES_ENUM stage) +{ + uint32_t status = NOT_SUPPORTED; + MessageContainer responseContainer; + + StartInkFillingResponse response = START_INK_FILLING_RESPONSE__INIT; + Cartridge Cartridge = CARTRIDGE__INIT; + response.action = FILLING_ACTION__None; + response.has_action = true; + response.cartridge = LoadCartridgeData(CART_1,&Cartridge); + + response.cartridge = NULL; + response.has_progresspercentage = true; + response.progresspercentage = 0.0; + response.message = NULL; + + responseContainer = createContainer(MESSAGE_TYPE__StartInkFillingResponse, InkFillingToken, false, &response, &start_ink_filling_response__pack, &start_ink_filling_response__get_packed_size); + responseContainer.has_continuous = true; + responseContainer.continuous = true; + uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); + size_t container_size = message_container__pack(&responseContainer, container_buffer); + my_free(responseContainer.data.data); + //USBCDCD_sendData(container_buffer, container_size,10); + + SendChars((char*)container_buffer, container_size); + //MessageContainer responseContainer; + + return status; +} + +uint32_t StartInkFillingRequestFunc(MessageContainer* requestContainer) +{ + uint32_t status = NOT_SUPPORTED; + //MessageContainer responseContainer; +// MachineUpdateInitParams InitParams; + + Report("StartInkFillingRequestFunc",__FILE__,__LINE__,(int)0,RpWarning,(int)0,0); + StartInkFillingRequest* request = start_ink_filling_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data); + ustrncpy (InkFillingToken, requestContainer->token,36); + + InkFillingUpdate(POWER_OFF_INIT); + start_ink_filling_request__free_unpacked(request,NULL); + return status; +// case MESSAGE_TYPE__StartWasteEmptyingRequest: + +} void ResponseDemo(int MidtankId) { inkAuthenticationPass = true; diff --git a/Software/Embedded_SW/Embedded/Modules/IFS/ifs.h b/Software/Embedded_SW/Embedded/Modules/IFS/ifs.h index 0f95fb2e2..dec1544ec 100644 --- a/Software/Embedded_SW/Embedded/Modules/IFS/ifs.h +++ b/Software/Embedded_SW/Embedded/Modules/IFS/ifs.h @@ -28,5 +28,6 @@ bool IFS_MidTankFilling(void); MidTank_t IFS_MidTankIsActive(void); bool IFS_CartridgeLowerPresent(); bool CartridgeValidationResponseFunc(MessageContainer* requestContainer); +uint32_t StartInkFillingRequestFunc(MessageContainer* requestContainer); #endif /* MODULES_IFS_IFS_H_ */ diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c index 6edc5b3f2..d0d2c1ef7 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c @@ -16,7 +16,7 @@ #include "Modules/Control/control.h" #include "Modules/General/process.h" #include "Modules/control/pidalgo.h" - +#include "Modules/AlarmHandling/AlarmHandling.h" #include "Modules/heaters/heaters_ex.h" #include "Modules/General/buttons.h" #include "StateMachines/Initialization/InitSequence.h" diff --git a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_ex.h b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_ex.h index 0a7534635..38e3236cc 100644 --- a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_ex.h +++ b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_ex.h @@ -47,6 +47,8 @@ bool WHS_IsEmptying(); uint32_t Waste_CheckState(void); uint32_t Waste_Prepare(void); bool WHS_IsVocPpmOverAlarmLimit(); +uint32_t StartWasteEmptyingRequestFunc(MessageContainer* requestContainer); + extern bool ReadingVocEverySec; diff --git a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c index 84609035a..6d338cbf7 100644 --- a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c +++ b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c @@ -6,13 +6,17 @@ #include "drivers/Valves/Valve.h" #include "Common/report/report.h" #include "Modules/Waste/Waste_ex.h" +#include "modules/heaters/heaters_ex.h" #include #include "Drivers/I2C_Communication/RFID_NFC/logi-tag/LT_RFID.h" #include #include "Drivers/I2C_Communication/RFID_NFC/NFC.h" -//#include +#include #include +#include "PMR/Diagnostics/FillingAction.pb-c.h" +#include "PMR/Diagnostics/StartWasteEmptyingRequest.pb-c.h" +#include "PMR/Diagnostics/StartWasteEmptyingResponse.pb-c.h" #include "Modules/AlarmHandling/AlarmHandling.h" #include "StateMachines/Initialization/PowerOffSequence.h" #include "drivers/I2C_Communication/ADC_MUX/ADC_MUX.h" @@ -500,6 +504,53 @@ void Waste_StateMachine(void) Report("wrong state", __FILE__, WasteTankState, 0, RpMessage, SelectedCard, 0); break; } +} +char WasteEmptyingToken[36+1] = {0}; +uint32_t WasteEmptyingUpdate(POWER_OFF_STAGES_ENUM stage) +{ + uint32_t status = NOT_SUPPORTED; + MessageContainer responseContainer; + + StartWasteEmptyingResponse response = START_WASTE_EMPTYING_RESPONSE__INIT; + response.action = FILLING_ACTION__None; + response.has_action = true; + //response.cartridge = LoadCartridgeData(); response.cartridge = LoadCartridgeData(); + + response.cartridge = NULL; + response.has_progresspercentage = true; + response.progresspercentage = 0.0; + response.message = NULL; + + responseContainer = createContainer(MESSAGE_TYPE__StartWasteEmptyingResponse, WasteEmptyingToken, false, &response, &start_waste_emptying_response__pack, &start_waste_emptying_response__get_packed_size); + responseContainer.has_continuous = true; + responseContainer.continuous = true; + uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); + size_t container_size = message_container__pack(&responseContainer, container_buffer); + my_free(responseContainer.data.data); + //USBCDCD_sendData(container_buffer, container_size,10); + + SendChars((char*)container_buffer, container_size); + //MessageContainer responseContainer; + + return status; +} + +uint32_t StartWasteEmptyingRequestFunc(MessageContainer* requestContainer) +{ + uint32_t status = NOT_SUPPORTED; + //MessageContainer responseContainer; + +// MachineUpdateInitParams InitParams; + + Report("StartWasteEmptyingRequestFunc",__FILE__,__LINE__,(int)0,RpWarning,(int)0,0); + StartWasteEmptyingRequest* request = start_waste_emptying_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data); + ustrncpy (WasteEmptyingToken, requestContainer->token,36); + + WasteEmptyingUpdate(POWER_OFF_INIT); + start_waste_emptying_request__free_unpacked(request,NULL); + return status; +// case MESSAGE_TYPE__StartWasteEmptyingRequest: + } uint32_t Waste_CheckState(void) { @@ -572,6 +623,7 @@ uint32_t Waste_PrepareCallbak(uint32_t IfIndex, uint32_t ReadValue) PrepareReady(Module_Waste,ModuleDone); } Report("Module waste prepare", __FILE__, __LINE__, headready, RpMessage, whsready, 0); + return OK; } uint32_t Waste_Prepare(void) { @@ -581,6 +633,7 @@ uint32_t Waste_Prepare(void) //check that blowers are within 10% of designated flow: WHS, head blowers WasteReadyControlId = AddControlCallback("Cartridge Cover Door", Waste_PrepareCallbak, eOneSecond, TemplateDataReadCBFunction, 0, 0, 0); Report("Module waste prepare", __FILE__, __LINE__, Head_Type, RpMessage, WHS_Type, 0); + return OK; } bool WHS_IsVocPpmOverAlarmLimit() diff --git a/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c b/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c index 0a980159d..8f6f2a781 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c @@ -41,6 +41,7 @@ #include "InitSequence.h" #include "PowerOffSequence.h" #include "modules/waste/waste_ex.h" +#include "modules/ifs/ifs.h" /* typedef enum { diff --git a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c index 86c8ef7da..235854b7a 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c @@ -55,6 +55,7 @@ #include "Modules/General/process.h" #include "modules/Diagnostics/Diagnostics.h" +#include "modules/waste/waste_ex.h" #include "PMR/Stubs/StubJobRequest.pb-c.h" #include "PMR/Stubs/StubJobResponse.pb-c.h" diff --git a/Software/PMR/Messages/Common/MessageType.proto b/Software/PMR/Messages/Common/MessageType.proto index 4f2147b02..593dcf547 100644 --- a/Software/PMR/Messages/Common/MessageType.proto +++ b/Software/PMR/Messages/Common/MessageType.proto @@ -123,6 +123,8 @@ enum MessageType StubMainCardEEpromReadResponse = 110; StubMainCardEEpromWriteRequest = 111; StubMainCardEEpromWriteResponse = 112; + StubHeadEEpromRequest = 113; + StubHeadEEpromResponse = 114; //------------------------------------ @@ -198,7 +200,10 @@ enum MessageType StopCartridgesUpdateResponse = 2043; CartridgeValidationRequest = 2044; CartridgeValidationResponse = 2045; - + StartWasteEmptyingRequest = 2046; + StartWasteEmptyingResponse = 2047; + StartInkFillingRequest = 2048; + StartInkFillingResponse = 2049; //Printing JobRequest = 3000; diff --git a/Software/PMR/Messages/Diagnostics/StartInkFillingRequest.proto b/Software/PMR/Messages/Diagnostics/StartInkFillingRequest.proto index ddb174ca4..9e574bf7f 100644 --- a/Software/PMR/Messages/Diagnostics/StartInkFillingRequest.proto +++ b/Software/PMR/Messages/Diagnostics/StartInkFillingRequest.proto @@ -4,6 +4,6 @@ syntax = "proto3"; package Tango.PMR.Diagnostics; option java_package = "com.twine.tango.pmr.diagnostics"; -message InkFillingRequest +message StartInkFillingRequest { } \ No newline at end of file diff --git a/Software/PMR/Messages/Diagnostics/StartInkFillingResponse.proto b/Software/PMR/Messages/Diagnostics/StartInkFillingResponse.proto index 877d82036..735275bdd 100644 --- a/Software/PMR/Messages/Diagnostics/StartInkFillingResponse.proto +++ b/Software/PMR/Messages/Diagnostics/StartInkFillingResponse.proto @@ -6,7 +6,7 @@ import "FillingAction.proto"; package Tango.PMR.Diagnostics; option java_package = "com.twine.tango.pmr.diagnostics"; -message FillingActionResponse +message StartInkFillingResponse { Cartridge Cartridge = 1; FillingAction Action = 2; diff --git a/Software/PMR/Messages/Diagnostics/StartWasteEmptyingRequest.proto b/Software/PMR/Messages/Diagnostics/StartWasteEmptyingRequest.proto index 18b366e7c..e33afd08d 100644 --- a/Software/PMR/Messages/Diagnostics/StartWasteEmptyingRequest.proto +++ b/Software/PMR/Messages/Diagnostics/StartWasteEmptyingRequest.proto @@ -3,6 +3,6 @@ syntax = "proto3"; package Tango.PMR.Diagnostics; option java_package = "com.twine.tango.pmr.diagnostics"; -message WasteEmptyingRequest +message StartWasteEmptyingRequest { } \ No newline at end of file diff --git a/Software/PMR/Messages/Diagnostics/StartWasteEmptyingResponse.proto b/Software/PMR/Messages/Diagnostics/StartWasteEmptyingResponse.proto index 877d82036..caa7b0a4f 100644 --- a/Software/PMR/Messages/Diagnostics/StartWasteEmptyingResponse.proto +++ b/Software/PMR/Messages/Diagnostics/StartWasteEmptyingResponse.proto @@ -6,7 +6,7 @@ import "FillingAction.proto"; package Tango.PMR.Diagnostics; option java_package = "com.twine.tango.pmr.diagnostics"; -message FillingActionResponse +message StartWasteEmptyingResponse { Cartridge Cartridge = 1; FillingAction Action = 2; -- cgit v1.3.1 From a24721751785a8e99023ae85814f5126845d3c5f Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Mon, 12 Oct 2020 23:27:51 +0300 Subject: cartridges status --- Software/Embedded_SW/Embedded/DataDef.h | 6 +- .../Embedded/Modules/General/MachineStatus.c | 145 +++++++++++++++++++++ .../Embedded/Modules/General/MachineStatus.h | 1 + .../Embedded/Modules/Heaters/Heaters_print.c | 2 + Software/Embedded_SW/Embedded/Modules/IFS/ifs.c | 13 +- .../Embedded/Modules/Thread/Thread_print.c | 16 +-- .../Embedded_SW/Embedded/Modules/Waste/Waste_ex.h | 1 - .../Embedded/Modules/Waste/Waste_maint.c | 55 +------- 8 files changed, 176 insertions(+), 63 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Thread') diff --git a/Software/Embedded_SW/Embedded/DataDef.h b/Software/Embedded_SW/Embedded/DataDef.h index 99798cf3b..864df2aee 100644 --- a/Software/Embedded_SW/Embedded/DataDef.h +++ b/Software/Embedded_SW/Embedded/DataDef.h @@ -24,8 +24,10 @@ //#define DISPESER_TEST //#define FPGA_WATCHDOG_DISABLE -//#define FOUR_WINDERS - +#define FOUR_WINDERS +#ifdef FOUR_WINDERS +#define BTSR_NO_TFU +#endif //#define USE_POWERSTEP01 -NA //#define EMC_FORCE_MOT_CLOCK_INTERNAL diff --git a/Software/Embedded_SW/Embedded/Modules/General/MachineStatus.c b/Software/Embedded_SW/Embedded/Modules/General/MachineStatus.c index ef6482a4f..5c0e48054 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/MachineStatus.c +++ b/Software/Embedded_SW/Embedded/Modules/General/MachineStatus.c @@ -20,6 +20,11 @@ #include "PMR/MachineStatus/MachineState.pb-c.h" #include "PMR/MachineStatus/IDSPackLevel.pb-c.h" +#include "PMR/IFS/CartridgeStatus.pb-c.h" +#include "PMR/IFS/InkFillingStatus.pb-c.h" +#include "PMR/IFS/StartInkFillingStatusRequest.pb-c.h" +#include "PMR/IFS/StartInkFillingStatusResponse.pb-c.h" + #include "drivers/I2C_Communication/ADC_MUX/ADC_MUX.h" #include "Drivers/Heater/TemperatureSensor.h" #include "drivers/Motors/Motor.h" @@ -31,6 +36,7 @@ #include "Modules/Control/MillisecTask.h" #include "modules/waste/waste_ex.h" #include "modules/ids/ids_ex.h" +#include "modules/ifs/ifs.h" MachineState StoredMachineStatus = MACHINE_STATE__PowerUp; bool SetMAchineStateProblem = false; @@ -104,6 +110,7 @@ int MachineUpdateResponseFunc(void) else if ((int1valid == false)&&(int2valid == true)) usetemp = internaltemp2/100; } + MachineStatus.overalltemperature = usetemp; @@ -208,4 +215,142 @@ uint32_t StopMachineUpdateFunc(MessageContainer* requestContainer) return OK; } +typedef enum +{ + IFS_Cartridge, + Middle_Waste_Cartridge, + Lower_Waste_Cartridge +}; +extern CartridgeState IFS_State; +extern CartridgeState Middle_Cartridge_State; +extern CartridgeState Lower_Cartridge_State; + +char WasteEmptyingToken[36+1] = {0}; +uint32_t WasteEmptyingUpdate(void) +{ + uint32_t status = NOT_SUPPORTED,i; + MessageContainer responseContainer; + CartridgeStatus Cartridges[MAX_CARTRIDGES+1]; + StartInkFillingStatusResponse response = START_INK_FILLING_STATUS_RESPONSE__INIT; + response.status->n_cartridgesstatuses = MAX_CARTRIDGES; + for (i = 0;icartridgesstatuses[i] = &Cartridges[i]; + } + if (IFS_CartridgeLowerPresent()) + { + Cartridges[IFS_Cartridge].has_state = true; + Cartridges[IFS_Cartridge].state = IFS_State; + } + if (WHS_WasteCartridgeMiddlePresent()) + { + Cartridges[Middle_Waste_Cartridge].has_state = true; + switch (cartGetState(WasteCartridge_middle)) + { + case CartridgeStateOUT: + Cartridges[Middle_Waste_Cartridge].state = CARTRIDGE_STATE__Absent; + break; + case CartridgeStateIN: + Cartridges[Middle_Waste_Cartridge].state = CARTRIDGE_STATE__Inserted; + break; + case CartridgeStateSELECTED: + Cartridges[Middle_Waste_Cartridge].state = CARTRIDGE_STATE__Exists; + break; + case CartridgeStateACTIVE: + Cartridges[Middle_Waste_Cartridge].state = CARTRIDGE_STATE__Emptying; + break; + case CartridgeStateFULL: + Cartridges[Middle_Waste_Cartridge].state = CARTRIDGE_STATE__EmptyingCompleted; + break; + default: + break; + } + } + if (WHS_WasteCartridgeLowerPresent()) + { + Cartridges[Lower_Waste_Cartridge].has_state = true; + switch (cartGetState(WasteCartridge_lower)) + { + case CartridgeStateOUT: + Cartridges[Lower_Waste_Cartridge].state = CARTRIDGE_STATE__Absent; + break; + case CartridgeStateIN: + Cartridges[Lower_Waste_Cartridge].state = CARTRIDGE_STATE__Inserted; + break; + case CartridgeStateSELECTED: + Cartridges[Lower_Waste_Cartridge].state = CARTRIDGE_STATE__Exists; + break; + case CartridgeStateACTIVE: + Cartridges[Lower_Waste_Cartridge].state = CARTRIDGE_STATE__Emptying; + break; + case CartridgeStateFULL: + Cartridges[Lower_Waste_Cartridge].state = CARTRIDGE_STATE__EmptyingCompleted; + break; + default: + break; + } + } + + + /* +struct _CartridgeStatus +{ + ProtobufCMessage base; + Cartridge *cartridge; + protobuf_c_boolean has_state; + CartridgeState state; + protobuf_c_boolean has_progresspercentage; + double progresspercentage; + char *message; +}; + size_t n_cartridgesstatuses; + CartridgeStatus **cartridgesstatuses; +typedef enum _CartridgeState { + CARTRIDGE_STATE__None = 0, + CARTRIDGE_STATE__Absent = 1, + CARTRIDGE_STATE__Exists = 2, + CARTRIDGE_STATE__Inserted = 3, + CARTRIDGE_STATE__Filling = 4, + CARTRIDGE_STATE__FillingCompleted = 5, + CARTRIDGE_STATE__Emptying = 6, + CARTRIDGE_STATE__EmptyingCompleted = 7, + CARTRIDGE_STATE__Empty = 8, + CARTRIDGE_STATE__Full = 9, + CARTRIDGE_STATE__Error = 10 + PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(CARTRIDGE_STATE) +} CartridgeState; + */ + + responseContainer = createContainer(MESSAGE_TYPE__StartInkFillingStatusResponse, WasteEmptyingToken, false, &response, &start_ink_filling_status_response__pack, &start_ink_filling_status_response__get_packed_size); + responseContainer.has_continuous = true; + responseContainer.continuous = true; + uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); + size_t container_size = message_container__pack(&responseContainer, container_buffer); + my_free(responseContainer.data.data); + //USBCDCD_sendData(container_buffer, container_size,10); + + SendChars((char*)container_buffer, container_size); + //MessageContainer responseContainer; + + return status; +} + +uint32_t StartInkFillingStatusRequestFunc(MessageContainer* requestContainer) +{ + uint32_t status = NOT_SUPPORTED; + //MessageContainer responseContainer; + +// MachineUpdateInitParams InitParams; + + Report("StartInkFillingStatusRequestFunc",__FILE__,__LINE__,(int)0,RpWarning,(int)0,0); + StartInkFillingStatusRequest* request = start_ink_filling_status_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data); + ustrncpy (WasteEmptyingToken, requestContainer->token,36); + + WasteEmptyingUpdate(); + start_ink_filling_status_request__free_unpacked(request,NULL); + return status; +// case MESSAGE_TYPE__StartWasteEmptyingRequest: + +} diff --git a/Software/Embedded_SW/Embedded/Modules/General/MachineStatus.h b/Software/Embedded_SW/Embedded/Modules/General/MachineStatus.h index 489a8f638..a7c55ad9b 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/MachineStatus.h +++ b/Software/Embedded_SW/Embedded/Modules/General/MachineStatus.h @@ -14,6 +14,7 @@ uint32_t MachineUpdateInitFunc(MessageContainer* requestContainer); uint32_t StopMachineUpdateFunc(MessageContainer* requestContainer); void SetMachineStatus (MachineState State); int MachineUpdateResponseFunc(void); +uint32_t StartInkFillingStatusRequestFunc(MessageContainer* requestContainer); diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c index 8e78d7e7f..6c1dcb279 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c @@ -2121,10 +2121,12 @@ uint32_t HeadBlowerPidFunc(double setParam,double measuredParam, int blowerId) HeadBlowersCloseLoopTime[blowerId] = HeadBlowerControl[blowerId].m_params.dt; if (calculatedPwm < MIN_ALLOWED_PWM) { + ReportWithPackageFilter(HeatersFilter,"calculatedPwm < MIN_ALLOWED_PWM",__FILE__,__LINE__,calculatedPwm,RpError, MIN_ALLOWED_PWM,0); HeadBlowerControl[blowerId].m_integral = 0; calculatedPwm = MIN_ALLOWED_PWM; } if (calculatedPwm > MAX_ALLOWED_PWM) { + ReportWithPackageFilter(HeatersFilter,"calculatedPwm > MAX_ALLOWED_PWM",__FILE__,__LINE__,calculatedPwm,RpError, MAX_ALLOWED_PWM,0); HeadBlowerControl[blowerId].m_integral = 0; calculatedPwm = MAX_ALLOWED_PWM; } diff --git a/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c b/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c index 387d48d2b..fd8d2f9e0 100644 --- a/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c +++ b/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c @@ -11,6 +11,8 @@ #include #include "PMR/Diagnostics/CartridgeSlot.pb-c.h" #include "PMR/Diagnostics/CartridgeTagContent.pb-c.h" +#include +#include "PMR/IFS/CartridgeState.pb-c.h" #include #include "drivers/FPGA/FPGA_GPIO/FPGA_GPIO.h"//#include "FPGA_GPIO.h" // use for FPGA IO #include "drivers/I2C_Communication/ADC_MUX/ADC_MUX.h" @@ -23,7 +25,6 @@ #include "Modules/AlarmHandling/AlarmHandling.h" #include "CartridgeValidationRequest.pb-c.h" #include "CartridgeValidationResponse.pb-c.h" -#include #include "drivers/Valves/Valve.h" #include "../control/control.h" #include "Modules/General/buttons.h" @@ -46,6 +47,7 @@ uint32_t midTankTimeoutCounter = 0; double MidTankEmptyLimit = MidTank_Pressure_EMPTY; MidTankStateEnum midTankState = 0; +CartridgeState IFS_State = CARTRIDGE_STATE__None; char CartridgeRequestToken[36+1]; int CartridgeRequestId = 0x01010101; @@ -146,6 +148,7 @@ bool CartridgeInkFull() //currently sensor work properly only until 1.6 - 1.8 Liter (TBD) Report("DetectIfCartridgeFinished", __FILE__,__LINE__,int_MidTank_Pressure_1000, RpMessage, int_MidTank_Pressure_1000, 0); //return true; + IFS_State = CARTRIDGE_STATE__FillingCompleted; } } return false; @@ -274,6 +277,7 @@ void midTankStateMachine(void) break; } //check RFID? (TBD) + IFS_State = CARTRIDGE_STATE__Inserted; // send request for validation to ppc inkAuthenticationPass = 2; //not defined @@ -295,11 +299,13 @@ void midTankStateMachine(void) Report("MidTank Cartridge authentication wait...", __FILE__, __LINE__, authenticationTimeOutCounter, RpMessage, 0, 0); if (authenticationTimeOutCounter > 60) { midTankState = MidTankStateIdle; + IFS_State = CARTRIDGE_STATE__Error; } break; } if (inkAuthenticationPass == false) { Report("MidTank Cartridge authentication fail", __FILE__, __LINE__, 0, RpMessage, 0, 0); + IFS_State = CARTRIDGE_STATE__Error; midTankState = MidTankStateIdle; break; } @@ -311,11 +317,13 @@ void midTankStateMachine(void) cart1.color = fastBILNK; Report("Mid-tank not empty", __FILE__, __LINE__, midTankCapacity, RpMessage, MidTankEmptyLimit, 0); midTankState = MidTankStateIdle; + IFS_State = CARTRIDGE_STATE__Exists; break; } Report("Mid-tank filling in process", __FILE__,__LINE__,(int)(MidTankEmptyLimit*1000), RpMessage, (int)(midTankCapacity*1000), 0); Pannel_Leds(CART_1, MODE_ON); cart1.color = BLINK; + IFS_State = CARTRIDGE_STATE__Filling; if (midTankCartColor == MIDTANK_8) { @@ -340,6 +348,7 @@ void midTankStateMachine(void) Report("Cartridge extracted during filling!!!", __FILE__, __LINE__, midTankState, RpMessage, 0, 0); Report("Mid-tank # filling fail", __FILE__, __LINE__, midTankState, RpMessage, 0, 0); midTankState = MidTankStateIdle; + IFS_State = CARTRIDGE_STATE__Absent; } // if time out or emptying done - idle if (midTankTimeoutCounter++ > CartridgeInkTimeout) { @@ -349,6 +358,7 @@ void midTankStateMachine(void) MidTankValvesAction(Cartridge_MidTank_OFF); Report("Mid-tank # filling fail", __FILE__, __LINE__, midTankState, RpMessage, 0, 0); Report("Call customer support", __FILE__, __LINE__, midTankState, RpMessage, 0, 0); + IFS_State = CARTRIDGE_STATE__Error; midTankState = MidTankStateIdle; } else if (CartridgeInkFull()) { midTankTimeoutCounter = 0; @@ -357,6 +367,7 @@ void midTankStateMachine(void) MidTankValvesAction(Cartridge_MidTank_OFF); Report("Mid-tank # filling done", __FILE__, __LINE__, midTankState, RpMessage, 0, 0); midTankState = MidTankStateIdle; + IFS_State = CARTRIDGE_STATE__FillingCompleted; } break; default: diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c index f13f76cfb..25f322b2e 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c @@ -337,7 +337,7 @@ uint32_t PoolerThreadLengthCBFunction(uint32_t IfIndex, uint32_t ReadValue) }**/ //} -#ifdef FOUR_WINDERS +#ifdef BTSR_NO_TFU if (CurrentControlledSpeed[WINDER_MOTOR]>100) length = dyeingspeed/10; #endif @@ -914,7 +914,7 @@ uint32_t Release_Right_TFU_TensionCallback(uint32_t deviceID, uint32_t BusyFlag) uint32_t Release_Right_TFU_Tension() { uint32_t status = OK; -#ifndef FOUR_WINDERS +#ifndef BTSR_NO_TFU if (RTFU_Up == true) { Report("Release_Right_TFU_Tension",__FILE__,__LINE__,HARDWARE_MOTOR_TYPE__MOTO_RDANCER,RpMessage,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RDANCER].pulseperround/4,0); @@ -928,7 +928,7 @@ int SecondFeederCorrection = 4; int PrepareWaitCount = 0; uint32_t Adjust_Right_TFU_Tension_2nd_Callback(uint32_t MotorId, uint32_t ReadValue) { -#ifndef FOUR_WINDERS +#ifndef BTSR_NO_TFU MotorStop (HARDWARE_MOTOR_TYPE__MOTO_RDANCER,Soft_Stop); //per L6470 errata between mov and run commands Report("Adjust_Right_TFU_Tension_2ndCallback x more steps",__FILE__,__LINE__,MotorId,RpMessage,SecondFeederCorrection,0); if (JobIsActive()==false) @@ -952,7 +952,7 @@ uint32_t Adjust_Right_TFU_Tension_2nd_Callback(uint32_t MotorId, uint32_t ReadVa } uint32_t Adjust_Right_TFU_Tension_Callback(uint32_t MotorId, uint32_t ReadValue) { -#ifndef FOUR_WINDERS +#ifndef BTSR_NO_TFU Report("Adjust_Right_TFU_Tension_Callback",__FILE__,__LINE__,MotorId,RpMessage,0,0); MotorMoveWithCallback(HARDWARE_MOTOR_TYPE__MOTO_RDANCER, 1-MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RDANCER].directionthreadwize,SecondFeederCorrection* MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RDANCER].microstep, Adjust_Right_TFU_Tension_2nd_Callback,1000); RTFU_Up = true; @@ -963,7 +963,7 @@ uint32_t Adjust_Right_TFU_Tension_Callback(uint32_t MotorId, uint32_t ReadValue) uint32_t Adjust_Right_TFU_Tension(double tension) { uint32_t status = OK; -#ifndef FOUR_WINDERS +#ifndef BTSR_NO_TFU if (tension > 0.5) //0 = lower position, 1 = high position { if (FPGA_Read_limit_Switches(GPI_LS_RDANCER_UP) == NO_LIMIT) @@ -1090,7 +1090,7 @@ uint32_t ThreadPrepareState(void *JobDetails) IntersegmentLength = JobTicket->intersegmentlength; PrepareWaitCount = 0; -#ifndef FOUR_WINDERS +#ifndef BTSR_NO_TFU status = ThreadPrepare_Tension (HARDWARE_DANCER_TYPE__LeftDancer, windertension); ReportWithPackageFilter(ThreadFilter,"ThreadPrepare_Tension Winder",__FILE__,HARDWARE_DANCER_TYPE__LeftDancer,PrepareWaitCount,RpWarning,(int)windertension,0); status = ThreadPrepare_Tension (HARDWARE_DANCER_TYPE__MiddleDancer, pullertension); @@ -1212,7 +1212,7 @@ uint32_t ThreadPrepareState(void *JobDetails) ///////////////////////////////////////////////////// MotorSetDirection((TimerMotors_t)HW_Motor_Id,MotorsCfg[HW_Motor_Id].directionthreadwize); -#ifndef FOUR_WINDERS +#ifndef BTSR_NO_TFU if (Motor_i == FEEDER_MOTOR) // dryer motor is speed controlled. later a speed sensor will be utilized, but for now it will not be controlled { ReportWithPackageFilter(ThreadFilter,"Feeder Control",__FILE__,Motor_i,MotorControlConfig[Motor_i].m_params.Kp,RpWarning,MotorControlConfig[Motor_i].m_params.Ki,0); @@ -1239,7 +1239,7 @@ uint32_t ThreadPrepareState(void *JobDetails) PoolerLengthCalculationMultiplier = (MotorsCfg[ThreadMotorIdToMotorId[Motor_i]].pulleyradius*2*PI)/(MotorsCfg[ThreadMotorIdToMotorId[Motor_i]].pulseperround*MotorsCfg[ThreadMotorIdToMotorId[Motor_i]].microstep); PoolerSpeedControlId = AddControlCallback(NULL,PoolerThreadLengthCBFunction, eHundredMillisecond,MotorGetPositionFromFPGA,(IfTypeThread*0x100+Motor_i),ThreadMotorIdToMotorId[Motor_i],Motor_i); } -#ifndef FOUR_WINDERS +#ifndef BTSR_NO_TFU if (Motor_i == FEEDER_MOTOR) // dryer motor is speed controlled. later a speed sensor will be utilized, but for now it will not be controlled { if (ControlIdtoMotorId[Motor_i] != 0xFF) diff --git a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_ex.h b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_ex.h index 603e63ccc..cebfba762 100644 --- a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_ex.h +++ b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_ex.h @@ -47,7 +47,6 @@ bool WHS_IsEmptying(); uint32_t Waste_CheckState(void); uint32_t Waste_Prepare(void); bool WHS_IsVocPpmOverAlarmLimit(); -uint32_t StartInkFillingStatusRequestFunc(MessageContainer* requestContainer); extern bool ReadingVocEverySec; diff --git a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c index 1a4403f32..e1e2efa04 100644 --- a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c +++ b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c @@ -12,12 +12,9 @@ #include #include "Drivers/I2C_Communication/RFID_NFC/NFC.h" #include +#include "PMR/IFS/CartridgeState.pb-c.h" #include -#include "PMR/IFS/CartridgeStatus.pb-c.h" -#include "PMR/IFS/InkFillingStatus.pb-c.h" -#include "PMR/IFS/StartInkFillingStatusRequest.pb-c.h" -#include "PMR/IFS/StartInkFillingStatusResponse.pb-c.h" #include "Modules/AlarmHandling/AlarmHandling.h" #include "StateMachines/Initialization/PowerOffSequence.h" #include "drivers/I2C_Communication/ADC_MUX/ADC_MUX.h" @@ -44,6 +41,9 @@ uint32_t Cartridge_Cover_Control; button *CartLed[MaxWasteCartridges] = {0, &cart2, &cart3}; WasteTankStateEnum WasteTankState = WasteTankStateIdle; +CartridgeState Middle_Cartridge_State = CARTRIDGE_STATE__None; +CartridgeState Lower_Cartridge_State = CARTRIDGE_STATE__None; + int init = 1; bool setWasteValve (WasteCartridgeEnum WasteCartridge); @@ -505,53 +505,6 @@ void Waste_StateMachine(void) Report("wrong state", __FILE__, WasteTankState, 0, RpMessage, SelectedCard, 0); break; } -} -char WasteEmptyingToken[36+1] = {0}; -uint32_t WasteEmptyingUpdate(void) -{ - uint32_t status = NOT_SUPPORTED; - MessageContainer responseContainer; - - StartInkFillingStatusResponse response = START_INK_FILLING_STATUS_RESPONSE__INIT; - /*response.action = FILLING_ACTION__None; - response.has_action = true; - //response.cartridge = LoadCartridgeData(); response.cartridge = LoadCartridgeData(); - - response.cartridge = NULL; - response.has_progresspercentage = true; - response.progresspercentage = 0.0; - response.message = NULL;*/ - - responseContainer = createContainer(MESSAGE_TYPE__StartInkFillingStatusResponse, WasteEmptyingToken, false, &response, &start_ink_filling_status_response__pack, &start_ink_filling_status_response__get_packed_size); - responseContainer.has_continuous = true; - responseContainer.continuous = true; - uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); - size_t container_size = message_container__pack(&responseContainer, container_buffer); - my_free(responseContainer.data.data); - //USBCDCD_sendData(container_buffer, container_size,10); - - SendChars((char*)container_buffer, container_size); - //MessageContainer responseContainer; - - return status; -} - -uint32_t StartInkFillingStatusRequestFunc(MessageContainer* requestContainer) -{ - uint32_t status = NOT_SUPPORTED; - //MessageContainer responseContainer; - -// MachineUpdateInitParams InitParams; - - Report("StartInkFillingStatusRequestFunc",__FILE__,__LINE__,(int)0,RpWarning,(int)0,0); - StartInkFillingStatusRequest* request = start_ink_filling_status_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data); - ustrncpy (WasteEmptyingToken, requestContainer->token,36); - - WasteEmptyingUpdate(); - start_ink_filling_status_request__free_unpacked(request,NULL); - return status; -// case MESSAGE_TYPE__StartWasteEmptyingRequest: - } uint32_t Waste_CheckState(void) { -- cgit v1.3.1 From 4f6c4ab918bb92b91051633eab83c3b1b5e8b4dc Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Wed, 14 Oct 2020 14:50:51 +0300 Subject: winder prepare failure fix. cancel cleaning job on power down. --- .../Embedded/Common/Utilities/RFIDTagHandling.c | 104 ++++++++++----------- Software/Embedded_SW/Embedded/DataDef.h | 7 ++ .../I2C_Communication/RFID_NFC/RFIDTagInfo.h | 97 ++++++++++++------- Software/Embedded_SW/Embedded/Embedded.cfg | 2 +- .../Embedded/Modules/General/GeneralHardware.c | 8 +- .../Embedded/Modules/Thread/Thread_Winder.c | 3 +- .../Initialization/PowerOffSequence.c | 13 +++ .../Initialization/PowerOffSequence.h | 1 + .../Messages/Diagnostics/CartridgeTagContent.proto | 4 +- .../stubs/embeddedparametersbuild_w_cleaning.cs | 5 + 10 files changed, 153 insertions(+), 91 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Thread') diff --git a/Software/Embedded_SW/Embedded/Common/Utilities/RFIDTagHandling.c b/Software/Embedded_SW/Embedded/Common/Utilities/RFIDTagHandling.c index 2bb073bf8..7bc1c2e54 100644 --- a/Software/Embedded_SW/Embedded/Common/Utilities/RFIDTagHandling.c +++ b/Software/Embedded_SW/Embedded/Common/Utilities/RFIDTagHandling.c @@ -170,56 +170,56 @@ CartridgeTagContent * NFCTag_Tag2PPC(NFCTag_t *Tag) cartridge_tag_content__init(PpcTag); - strncpy(PpcTag->taguniqueid , Tag->TagUniqueID,sizeof(Tag->TagUniqueID)); - strncpy(PpcTag->cartsn , Tag->CartSN,sizeof(Tag->CartSN)); - strncpy(PpcTag->workorder , Tag->WorkOrder,sizeof(Tag->WorkOrder)); - strncpy(PpcTag->colorname , Tag->ColorName,sizeof(Tag->ColorName)); - strncpy(PpcTag->inkbatchno , Tag->InkBatchNo,sizeof(Tag->InkBatchNo)); - strncpy(PpcTag->inkmfgdate , Tag->InkMFGDate,sizeof(Tag->InkMFGDate)); - strncpy(PpcTag->inkeoldate , Tag->InkEOLDate,sizeof(Tag->InkEOLDate)); + strncpy(PpcTag->taguniqueid , Tag->tagId,sizeof(Tag->tagId)); + strncpy(PpcTag->cartsn , Tag->Serial,sizeof(Tag->Serial)); + strncpy(PpcTag->workorder , Tag->workOrder,sizeof(Tag->workOrder)); + strncpy(PpcTag->colorname , Tag->colorName,sizeof(Tag->colorName)); + strncpy(PpcTag->inkbatchno , Tag->inkBatch,sizeof(Tag->inkBatch)); + strncpy(PpcTag->inkmfgdate , Tag->inkMfgDate,sizeof(Tag->inkMfgDate)); + strncpy(PpcTag->inkeoldate , Tag->inkEolDate,sizeof(Tag->inkEolDate)); strncpy(PpcTag->cartfilldate , Tag->CartFillDate,sizeof(Tag->CartFillDate)); strncpy(PpcTag->wastefilldate , Tag->WasteFillDate,sizeof(Tag->WasteFillDate)); - strncpy(PpcTag->machineidinl , Tag->MachineIdINL,sizeof(Tag->MachineIdINL)); - strncpy(PpcTag->machineidwst , Tag->MachineIdWST,sizeof(Tag->MachineIdWST)); - strncpy(PpcTag->spare , Tag->Spare,sizeof(Tag->Spare)); + strncpy(PpcTag->machineidinl , Tag->MachineIdInl,sizeof(Tag->MachineIdInl)); + strncpy(PpcTag->machineidwst , Tag->MachineIdWst,sizeof(Tag->MachineIdWst)); + strncpy(PpcTag->spare , Tag->reserved,sizeof(Tag->reserved)); strncpy(PpcTag->hashvalue , Tag->HashValue,sizeof(Tag->HashValue)); PpcTag->has_inkfactoryid = true; - PpcTag->inkfactoryid = Tag->InkFactoryID; + PpcTag->inkfactoryid = (uint32_t)Tag->factoryID; PpcTag->has_fillsysid = true; - PpcTag->fillsysid = Tag->FillSysID; + PpcTag->fillsysid = Tag->fillingSystem; PpcTag->has_inkcategory = true; - PpcTag->inkcategory = Tag->InkCategory; + PpcTag->inkcategory = Tag->catagory; PpcTag->has_type_rev = true; - PpcTag->type_rev = Tag->Type_Rev; + PpcTag->type_rev = Tag->type; PpcTag->has_cartridgesize = true; - PpcTag->cartridgesize = Tag->CartridgeSize; + PpcTag->cartridgesize = Tag->cartSize; PpcTag->has_filedinkvol = true; - PpcTag->filedinkvol = Tag->FiledInkVol; + PpcTag->filedinkvol = Tag->inkVolume; PpcTag->has_misc = true; PpcTag->misc = Tag->Misc; PpcTag->has_plugincounter = true; - PpcTag->plugincounter = Tag->PluginCounter; + PpcTag->plugincounter = Tag->pluginCounter; PpcTag->has_inkfillstatus = true; - PpcTag->inkfillstatus = Tag->InkFillStatus; + PpcTag->inkfillstatus = Tag->inkFill; PpcTag->has_inkusedstatus = true; - PpcTag->inkusedstatus = Tag->InkUsedStatus; + PpcTag->inkusedstatus = Tag->inkUsed; PpcTag->has_inkemptystatus = true; - PpcTag->inkemptystatus = Tag->InkEmptyStatus; + PpcTag->inkemptystatus = Tag->inkEmpty; PpcTag->has_inkemptystatus = true; - PpcTag->inkemptystatus = Tag->WasteEmptyStatus; + PpcTag->inkemptystatus = Tag->wasteEmpty; PpcTag->has_wastefillingstatus = true; - PpcTag->wastefillingstatus = Tag->WasteFillingStatus; + PpcTag->wastefillingstatus = Tag->wasteFilling; PpcTag->has_wastefullstatus = true; - PpcTag->wastefullstatus = Tag->WasteFullStatus; + PpcTag->wastefullstatus = Tag->wasteFull; PpcTag->has_blocked = true; - PpcTag->blocked = Tag->Blocked; + PpcTag->blocked = Tag->blocked; PpcTag->has_fail = true; - PpcTag->fail = Tag->Fail; + PpcTag->fail = Tag->fail; PpcTag->has_wastecounter = true; - PpcTag->wastecounter = Tag->WasteCounter; + PpcTag->wastecounter = Tag->counter; return PpcTag; } @@ -230,50 +230,50 @@ CartridgeTagContent * NFCTag_Tag2PPC(NFCTag_t *Tag) return NULL; memset (Tag,0,sizeof(Tag)); - strncpy(Tag->TagUniqueID , PpcTag->taguniqueid,sizeof(Tag->TagUniqueID)); - strncpy(Tag->CartSN , PpcTag->cartsn,sizeof(Tag->CartSN)); + strncpy(Tag->tagId , PpcTag->taguniqueid,sizeof(Tag->tagId)); + strncpy(Tag->Serial , PpcTag->cartsn,sizeof(Tag->Serial)); if (PpcTag->has_inkfactoryid == true) - Tag->InkFactoryID = PpcTag->inkfactoryid; + memcpy(Tag->factoryID,PpcTag->inkfactoryid,3); if (PpcTag->has_fillsysid == true) - Tag->FillSysID = PpcTag->fillsysid; - strncpy(Tag->ColorName , PpcTag->colorname,sizeof(Tag->ColorName)); - strncpy(Tag->WorkOrder , PpcTag->workorder ,sizeof(Tag->WorkOrder)); + Tag->fillingSystem = PpcTag->fillsysid; + strncpy(Tag->colorName , PpcTag->colorname,sizeof(Tag->colorName)); + strncpy(Tag->workOrder , PpcTag->workorder ,sizeof(Tag->workOrder)); if (PpcTag->has_inkcategory == true) - Tag->InkCategory = PpcTag->inkcategory; + memcpy( Tag->catagory, PpcTag->inkcategory,sizeof(Tag->catagory)); if (PpcTag->has_type_rev == true) - Tag->Type_Rev = PpcTag->type_rev; + Tag->type = PpcTag->type_rev; if (PpcTag->has_cartridgesize == true) - Tag->CartridgeSize = PpcTag->cartridgesize; + Tag->cartSize = PpcTag->cartridgesize; if (PpcTag->has_filedinkvol == true) - Tag->FiledInkVol = PpcTag->filedinkvol; - strncpy(Tag->InkBatchNo , PpcTag->inkbatchno,sizeof(Tag->InkBatchNo)); - strncpy(Tag->InkMFGDate , PpcTag->inkmfgdate,sizeof(Tag->InkMFGDate)); - strncpy(Tag->InkEOLDate , PpcTag->inkeoldate,sizeof(Tag->InkEOLDate)); + Tag->inkVolume = PpcTag->filedinkvol; + strncpy(Tag->inkBatch , PpcTag->inkbatchno,sizeof(Tag->inkBatch)); + strncpy(Tag->inkMfgDate , PpcTag->inkmfgdate,sizeof(Tag->inkMfgDate)); + strncpy(Tag->inkEolDate , PpcTag->inkeoldate,sizeof(Tag->inkEolDate)); strncpy(Tag->CartFillDate , PpcTag->cartfilldate,sizeof(Tag->CartFillDate)); strncpy(Tag->WasteFillDate , PpcTag->wastefilldate,sizeof(Tag->WasteFillDate)); if (PpcTag->has_plugincounter == true) - Tag->PluginCounter = PpcTag->plugincounter; + Tag->pluginCounter = PpcTag->plugincounter; if (PpcTag->has_inkfillstatus == true) - Tag->InkFillStatus = PpcTag->inkfillstatus; + Tag->inkFill = PpcTag->inkfillstatus; if (PpcTag->has_inkusedstatus == true) - Tag->InkUsedStatus = PpcTag->inkusedstatus; + Tag->inkUsed = PpcTag->inkusedstatus; if (PpcTag->has_inkemptystatus == true) - Tag->InkEmptyStatus = PpcTag->inkemptystatus; + Tag->inkEmpty = PpcTag->inkemptystatus; if (PpcTag->has_wasteemptystatus == true) - Tag->WasteEmptyStatus = PpcTag->wasteemptystatus; + Tag->wasteEmpty = PpcTag->wasteemptystatus; if (PpcTag->has_wastefillingstatus == true) - Tag->WasteFillingStatus = PpcTag->wastefillingstatus; + Tag->wasteFilling = PpcTag->wastefillingstatus; if (PpcTag->has_wastefullstatus == true) - Tag->WasteFullStatus = PpcTag->wastefullstatus; + Tag->wasteFull = PpcTag->wastefullstatus; if (PpcTag->has_blocked == true) - Tag->Blocked = PpcTag->blocked; + Tag->blocked = PpcTag->blocked; if (PpcTag->has_fail == true) - Tag->Fail = PpcTag->fail; + Tag->fail = PpcTag->fail; if (PpcTag->has_wastecounter == true) - Tag->WasteCounter = PpcTag->wastecounter; - strncpy(Tag->MachineIdINL , PpcTag->machineidinl,sizeof(Tag->MachineIdINL)); - strncpy(Tag->MachineIdWST , PpcTag->machineidwst,sizeof(Tag->MachineIdWST)); - strncpy(Tag->Spare,PpcTag->spare ,sizeof(Tag->Spare)); + Tag->wasteCounter = PpcTag->wastecounter; + strncpy(Tag->MachineIdInl , PpcTag->machineidinl,sizeof(Tag->MachineIdInl)); + strncpy(Tag->MachineIdWst , PpcTag->machineidwst,sizeof(Tag->MachineIdWst)); + strncpy(Tag->reserved,PpcTag->spare ,sizeof(Tag->reserved)); strncpy(Tag->HashValue,PpcTag->hashvalue ,sizeof(Tag->HashValue)); return Tag; diff --git a/Software/Embedded_SW/Embedded/DataDef.h b/Software/Embedded_SW/Embedded/DataDef.h index e8410aaa6..cfd8660da 100644 --- a/Software/Embedded_SW/Embedded/DataDef.h +++ b/Software/Embedded_SW/Embedded/DataDef.h @@ -70,6 +70,13 @@ enum VERIFIED = 255 }; +typedef enum Status_Enum +{ + S_NA, + S_SUCCEEDED, + S_FAILED +}STATUS_ENUM; + #define OK 0 #define ERROR 1 diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/RFID_NFC/RFIDTagInfo.h b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/RFID_NFC/RFIDTagInfo.h index 1df9f3949..70e82cb39 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/RFID_NFC/RFIDTagInfo.h +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/RFID_NFC/RFIDTagInfo.h @@ -10,45 +10,74 @@ typedef struct { - char TagUniqueID[8]; //RFID Tag unique ID - char CartSN[16]; //Cartridge serial number - uint32_t InkFactoryID:24; //Ink factory ID - uint32_t FillSysID:16; //Filling system ID number - char WorkOrder[10]; //Color description / ID - char ColorName[12]; //Color description / ID - uint32_t InkCategory:16; //Ink category (TBD) - uint32_t Type_Rev; //TBD – can be formulation # - uint32_t CartridgeSize; //Size in cc - uint32_t FiledInkVol; //Size in cc - char InkBatchNo[10]; //MFG batch No’ - char InkMFGDate[8]; //Date Ink was manufactured (20L container bar-code) - char InkEOLDate[8]; //Ink end of life date - char CartFillDate[8]; //Date cartridge was filled with ink (CFS) - char WasteFillDate[8]; //Date cartridge was filled with waste (Machine) - uint32_t Misc; - uint32_t PluginCounter:16; //Number of times cartridge was plugged in INK Slot - char InkFillStatus; //State indicator - successful state change when starting to fill mid. tank - char InkUsedStatus; - char InkEmptyStatus; - char WasteEmptyStatus; - char WasteFillingStatus; - char WasteFullStatus; - char Blocked; - char Fail; - uint32_t WasteCounter:16; - char MachineIdINL[16]; - char MachineIdWST[16]; - char Spare[13]; - uint32_t Counter; - char TagValid; - char HashValue[32]; - uint32_t Checksum_CRC16:16; + uint8_t tagId[8]; //RFID Tag unique ID + uint8_t Serial[16]; //Cartridge serial number + uint8_t factoryID[3]; //Ink factory ID + uint8_t Padding_1_8bit; //** NA ** Union Padding for 32 bit + //---------------------- + uint16_t fillingSystem; //Filling system ID number + uint8_t workOrder[10]; //Color description / ID + //---------------------- + uint8_t colorName[12]; //Color description / ID + //---------------------- + uint8_t catagory[2]; //Ink category (TBD) + uint16_t Paddind_1_16bit; //** NA ** Union Padding for 32 bit + //---------------------- + uint32_t type; //TBD – can be formulation # + //---------------------- + uint32_t cartSize; //Size in cc + //---------------------- + uint32_t inkVolume; //Size in cc + //---------------------- + uint8_t inkBatch[10]; //MFG batch No’ + uint16_t Paddind_2_16bit; //** NA ** Union Padding for 32 bit + //---------------------- + uint8_t inkMfgDate[8]; //Date Ink was manufactured (20L container bar-code) + //---------------------- + uint8_t inkEolDate[8]; //Ink end of life date + //---------------------- + uint8_t CartFillDate[8]; //Date cartridge was filled with ink (CFS) + //---------------------- + uint8_t WasteFillDate[8];//Date cartridge was filled with waste (Machine) + //---------------------- + uint32_t Misc; + //---------------------- + uint16_t pluginCounter; //Number of times cartridge was plugged in INK Slot + uint8_t inkFill; //State indicator - successful state change when starting to fill mid. tank + uint8_t inkUsed; + //---------------------- + uint8_t inkEmpty; + uint8_t wasteEmpty; + uint8_t wasteFilling; + uint8_t wasteFull; + //---------------------- + uint8_t blocked; + uint8_t fail; + uint16_t wasteCounter; + //---------------------- + uint8_t MachineIdInl[16]; + //---------------------- + uint8_t MachineIdWst[16]; + //---------------------- + uint8_t reserved[13]; + uint8_t Paddind_2_8bit; //** NA ** Union Padding for 32 bit + uint16_t Paddind_3_16bit; //** NA ** Union Padding for 32 bit + //---------------------- + uint32_t counter; + //---------------------- + uint8_t tagValid; + uint8_t Paddind_3_8bit; //** NA ** Union Padding for 32 bit + uint16_t Paddind_4_16bit; //** NA ** Union Padding for 32 bit + //---------------------- + uint8_t HashValue[16]; + //---------------------- + uint64_t Checksum_CRC16; //16 bit? }NFCTag_t; typedef union { NFCTag_t Struct; - char Buf[sizeof(NFCTag_t)]; + uint8_t Buf[sizeof(NFCTag_t)]; }NFC_Tag; #endif /* DRIVERS_I2C_COMMUNICATION_RFID_NFC_RFIDTAGINFO_H_ */ diff --git a/Software/Embedded_SW/Embedded/Embedded.cfg b/Software/Embedded_SW/Embedded/Embedded.cfg index f41e56966..f79d85b99 100644 --- a/Software/Embedded_SW/Embedded/Embedded.cfg +++ b/Software/Embedded_SW/Embedded/Embedded.cfg @@ -171,7 +171,7 @@ Program.global.Diagnostics = Task.create("&DiagnosticsTask", DiagnosticsTaskPara var MillisecLowTaskParams = new Task.Params(); MillisecLowTaskParams.instance.name = "MilliSecondLow"; -MillisecLowTaskParams.stackSize = 2048; +MillisecLowTaskParams.stackSize = 4096; MillisecLowTaskParams.priority = 3; Program.global.millisecLow = Task.create("&MillisecLowTask", MillisecLowTaskParams); diff --git a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c index 3f5e4f5b2..774fd105b 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c +++ b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c @@ -243,7 +243,7 @@ void LoadConfigurationParameters(ConfigurationParameters *Params) EmbeddedParameters->has_startheatingoninitsequence = true; EmbeddedParameters->startheatingoninitsequence = true; //set to true shlomo 14/5/2019 - EmbeddedParameters->n_generalparameters = 8; + EmbeddedParameters->n_generalparameters = 9; EmbeddedParameters->generalparameters = malloc (sizeof(double)*10); if (EmbeddedParameters->generalparameters) { @@ -255,6 +255,7 @@ void LoadConfigurationParameters(ConfigurationParameters *Params) EmbeddedParameters->generalparameters[5] = 1000.0; //Dispenser initial pressure speed EmbeddedParameters->generalparameters[6] = Diagnostic_Extended_Mode; //Diagnostic Mode SetDiagnosticMode EmbeddedParameters->generalparameters[7] = AutoHoming_JobEnd_PowerOn_off; // + EmbeddedParameters->generalparameters[8] = false; // } EmbeddedParameters->has_currentalarmlowlimit = true; @@ -394,6 +395,11 @@ uint32_t EmbeddedParametersInit(void) else if (EmbeddedParameters->generalparameters[7]< 3.5) IDS_Dispenser_SetAutoHoming_Config(AutoHoming_JobEnd_PowerOn_off); else Report("SetAutoHoming_Config error", __FILE__,__LINE__,(int)(EmbeddedParameters->generalparameters[7]*100), RpMessage, 0, 0); } + if (EmbeddedParameters->n_generalparameters >= 9) + { + if (EmbeddedParameters->generalparameters[9]< 0.5) setPowerOffDisableCleaning(false); + else setPowerOffDisableCleaning(true); + } PowerIdleSetParameters(EmbeddedParameters->switchtoidletimeinseconds,EmbeddedParameters->idledriertemperature,EmbeddedParameters->idleheadtemperature,EmbeddedParameters->idlemixertemperature); return Fresult; diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c index c37617037..0440d2241 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c @@ -120,7 +120,7 @@ uint32_t InternalWindingConfigMessage(JobSpool* request) InternalWinderCfg.SpoolBottomBackingRate = request->bottombackingrate; InternalWinderCfg.NumberOfRotationPerPassage = 3.1415926*3;//request->rotationsperpassage; - if (request->rotationsperpassage > 6.1) + if (request->rotationsperpassage > 5.1) InternalWinderCfg.NumberOfRotationPerPassage = request->rotationsperpassage; if (NumberOfRotationPerPassage > 1) { @@ -248,6 +248,7 @@ uint32_t Winder_PrepareStage2(uint32_t deviceID, uint32_t ReadValue) LOG_ERROR(deviceID,"Screw failed to reach the limit switch!!"); //returned with a timeout Winder_ScrewAtOffsetCallback(0,0); + PrepareReady(Module_Winder, ModuleFail); } else //short jog, etc { diff --git a/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c b/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c index 8f6f2a781..d3ef81a50 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c @@ -71,6 +71,12 @@ bool PowerOffInProcess = false; #define POWER_OFF_TEMP_THRESHOLD 5000 //50 celsious int32_t PowerOffTemperatureThreshold = POWER_OFF_TEMP_THRESHOLD; +bool PowerOffDisableCleaning = false; +void setPowerOffDisableCleaning (bool value) +{ + PowerOffDisableCleaning = value; + REPORT_MSG(PowerOffDisableCleaning, "Set PowerOffDisableCleaning"); +} bool PowerOffInProcessGetState(void) { return PowerOffInProcess; @@ -140,6 +146,13 @@ uint32_t PowerOffHeadClean(void) //TBD if (AutoHoming_Config >= AutoHoming_PowerOff ) AutoHoming_Config = AutoHoming_JobEnd_PowerOn_off; + if (PowerOffDisableCleaning == true) + { + LOG_ERROR(0,"Clean job skipped!!!!!!!"); + PowerOffMachineState++; + SetMachineStatus(MACHINE_STATE__PowerOff); + return OK; + } if (ThreadCleaningJob(50) == OK) { if (PowerOffHeadCleanControlId != 0xFF) diff --git a/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.h b/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.h index 5f347c5ba..10dd4c71e 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.h +++ b/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.h @@ -35,6 +35,7 @@ void PowerOffSetTemperatureThreshold (int32_t temperature); //celsius temperatur bool PowerOffInProcessGetState(void); uint32_t PowerOffHeatersOff(void); +void setPowerOffDisableCleaning (bool value); uint32_t PowerDownUpdateFunc(MessageContainer* requestContainer); uint32_t AbortPowerDownFunc(MessageContainer* requestContainer); diff --git a/Software/PMR/Messages/Diagnostics/CartridgeTagContent.proto b/Software/PMR/Messages/Diagnostics/CartridgeTagContent.proto index 37931ae0c..3ed18713c 100644 --- a/Software/PMR/Messages/Diagnostics/CartridgeTagContent.proto +++ b/Software/PMR/Messages/Diagnostics/CartridgeTagContent.proto @@ -12,10 +12,10 @@ message CartridgeTagContent string WorkOrder = 5; //Color description / ID string ColorName = 6; //Color description / ID uint32 InkCategory = 7; //Ink category (TBD) - uint32 Type_Rev = 8; //TBD – can be formulation # + uint32 Type_Rev = 8; //TBD – can be formulation # uint32 CartridgeSize = 9; //Size in cc uint32 FiledInkVol = 10; //Size in cc - string InkBatchNo = 11; //MFG batch No’ + string InkBatchNo = 11; //MFG batch No’ string InkMFGDate = 12; //Date Ink was manufactured (20L container bar-code) string InkEOLDate = 13; //Ink end of life date string CartFillDate = 14; //Date cartridge was filled with ink (CFS) diff --git a/Software/Stubs Collection/stubs/embeddedparametersbuild_w_cleaning.cs b/Software/Stubs Collection/stubs/embeddedparametersbuild_w_cleaning.cs index 0f8794799..d0d78f61e 100644 --- a/Software/Stubs Collection/stubs/embeddedparametersbuild_w_cleaning.cs +++ b/Software/Stubs Collection/stubs/embeddedparametersbuild_w_cleaning.cs @@ -136,6 +136,11 @@ Double SetAutoFill = new Double(); SetAutoFill = 3.0; configurationParameters.GeneralParameters.Add(SetAutoFill); +double PowerOffDisableCleaning = new Double(); +PowerOffDisableCleaning = 0.0 +configurationParameters.GeneralParameters.Add(PowerOffDisableCleaning); + + File.WriteAllBytes("C:/temp/EmbParam.cfg",configurationParameters.ToBytes()); byte[] fileBytes = File.ReadAllBytes("C:/temp/EmbParam.cfg"); -- cgit v1.3.1