blob: a7e80a31e4d9a8fbd84f5a295edb3a8e1cee8b0b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
/**
* @file ifs.h
*
* @date Jul 8, 2019
* @author Shlomo
*
* @date 26.8.2019
* @author Shai
*/
#ifndef MODULES_IFS_IFS_H_
#define MODULES_IFS_IFS_H_
#include "Modules/Waste/Waste.h"
//void IFS_Init(void)
#define SECONDS_5 5 /**< 5seconds */
#define SECONDS_300 300 /**< 300 seconds = 5 minutes */
#define SECONDS_420 (7*60) /**< 420 seconds = 7 minutes */
#define SECONDS_600 600 /**< 600 seconds = 10 minutes */
#define SECONDS_2_DLY 0 /**< dly 0 seconds */
#define CARTRIDGE_INK_TIMEOUT (SECONDS_420 / SECONDS_5) /**< TimeOut (7 minutes) for finishing transfer the Ink from Ink cartridge to MidTank */
#define CARTRIDGE_INK_TIMEOUTx2 (CARTRIDGE_INK_TIMEOUT * 2) /**< TimeOut (7 minutes) for second try finishing transfer the Ink from Ink cartridge to MidTank */
#define CartridgeInkTimeOutCallBackTime (eOneSecond * SECONDS_5)
#define CartridgeInkCallBackTime eOneSecond
#define MidTank_Pressure_EMPTY 0.3 //todo get from Moti the correct number (Oleg -> 300cc)
#define CARTRIDGE_CAPATICY 1500 //todo get from Moti the correct number
#define FULL 1000 //todo get from Moti the correct number
/**
* A structure to represent IFS_information
*/
struct IFS_information
{
struct cartridge_params Ink; /**< cartridge_params */
CarteidgPrecenseSensorStatus IFS_Ink_precense_sensor; /**< INK cartridge presence(1) or not_precense(0) */
uint32_t Cartridge_Ink_device_Id; /**< INK device_Id number for callback */
uint32_t Cartridge_Ink_TimeOut_device_Id; /**< INK device_Id number for TimeOut callback */
uint32_t INK_isOK_flag ; /**< INK cartridge pass authentication (from PPC) */
double MidTank_capacity; /**< MidTank current capacity */
};
struct IFS_information IFS_info;
WHS_sensor CartridgeInkCallBackFunction();
WHS_sensor CartridgeInkTimeOutCallBackFunction();
uint32_t ReadCartridgeData(cartridge_name cart_name);
bool INKCartridgeAuthentication(cartridge_name cart_name);
bool MidTankValvesAction(bool action); //Cartridge_MidTank_ON of Cartridge_MidTank_OFF
bool ColorMatch();
bool IFS_TimeOutAlarm(bool status);
void ResponseDemo(int MidtankId);
bool CartridgeValidationResponseFunc(MessageContainer* requestContainer);
#endif /* MODULES_IFS_IFS_H_ */
|