<commit_before>//
// Created by <NAME> on 19.10.2016 г..
//
#include <Arduino.h>
#include "../MID.h"
#include "AmpTime.h"
#include "MainFunc.h"
//#define ECU_SENS_DEBUG
//
#ifndef ARDUINO_MID_CAR_SENS_H
#define ARDUINO_MID_CAR_SENS_H

// TODO this is test mode
#ifndef ADT_FUEL_SYSTEM_I2C
#define ADT_FUEL_SYSTEM_I2C
#endif
//#ifdef ADT_FUEL_SYSTEM_I2C
//
//#include "drivers/I2cSimpleListener.h"
//
//#endif
//
//

//#define DEBUG_ENG_TEMP
// Version of MID plug driver
#define MID_CAR_SENS_VERSION 0.1
//
// Show information from consumption
#define DEBUG_CONS_INFO
//
// Speeding alarm
#define VSS_ALARM_CITY_SPEED  60 // km
#define VSS_ALARM_VWAY_SPEED  100 // km
#define VSS_ALARM_HWAY_SPEED  140 // km
//#define VSS_ALARM_ENABLED // Comment to disable speeding alarms
#define VSS_ALARM_AWAITING 5
//
// --------------------------------------------------------------------------------------------------------------------
// ABOUT ECU signal
//      (actuated consumption signal)
//
//  On the GM hot film MAFs, you can also tap into the onboard computer data stream
//  with a scan tool to read the MAF sensor output in "grams per second" (GPS).
//  The reading might go from 3 to 5 GPS at idle up to 100 to 240 GPS at wide open throttle and 5000(+) RPM.
//  The frequency range varies from 30 to 150 Hz, with 30 Hz being average for idle and 150 Hz for wide open throttle.
//  Using as frequency MAF. Wide open throttle test reaches ~244 gps.
// --------------------------------------------------------------------------------------------------------------------
//
#ifndef CAR_SENS_CUSTOM_CORRECTION
/**
 * 92.23 * X = 22.5L  [full fill with 18.37L]
 * X = 2250 / 9223
 * X = 0.24396 [0.24395532906863276591130868480971  pulses given from signal]
 *
 * So ... 18.37 / 0.24396 = ~75.3
 * 75.3 * 0.24396 = 18.370188
 * ECU_CORRECTION = 75
 * 88.1
 *
 */
//
// 75.3 because there no LPG switch detection (engine runs in benzene to work temperature )...
// must be clear 75
// ECU Consumption correction
#define ECU_CORRECTION 75.3// 92.23  //  75 // 147.23 ///  346 /// to high 692
//
// Speed correction
#define VSS_CORRECTION 1.6  //    fast 3.767
//
// Revs correction
#define RPM_CORRECTION 75   //    fast 33.767
//
// Distance correction
#define DST_CORRECTION  30800.58  // Tested >30800.58 //  15383.29  //   <sens:200> 15383.29
//
#define TRS_CORRECTION 0 // 0.064444 a proximity  6(~6)%
//
//#define VSD_SENS_DEBUG;
#define SCREEN_DEF_LIGHT 75 // 22
//
// Screen default value
#define SCREEN_GO_TO_DEF 15

#endif


#ifndef CAR_SENS_CUSTOM_FUELS
//
// Default fuel state
#define DEFAULT_FUEL_STATE 1
/**************************/
/* GASOLINE ENGINE CONFIG */
/**************************/
// [CONFIRMED not tested over MID] For gas car use 3355 (1/14.7/730*3600)*10000
#define FUEL_BNZ_IFC 3355
#define FUEL_BNZ_CNS 10731 // 14.7*730 = 10731

/************************/
/* LPG ENGINE CONFIG    */
/************************/
//LPG mass/volume is 520-580gr/ltr depending on propane/butane mix

// LPG/air ratio:<commit_msg>Added information in carSens<commit_after>//
// Created by <NAME> on 19.10.2016 г..
//
#include <Arduino.h>
#include "../MID.h"
#include "AmpTime.h"
#include "MainFunc.h"
//#define ECU_SENS_DEBUG
//
#ifndef ARDUINO_MID_CAR_SENS_H
#define ARDUINO_MID_CAR_SENS_H

// TODO this is test mode
#ifndef ADT_FUEL_SYSTEM_I2C
#define ADT_FUEL_SYSTEM_I2C
#endif
//#ifdef ADT_FUEL_SYSTEM_I2C
//
//#include "drivers/I2cSimpleListener.h"
//
//#endif
//
//

//#define DEBUG_ENG_TEMP
// Version of MID plug driver
#define MID_CAR_SENS_VERSION 0.1
//
// Show information from consumption
#define DEBUG_CONS_INFO
//
// Speeding alarm
#define VSS_ALARM_CITY_SPEED  60 // km
#define VSS_ALARM_VWAY_SPEED  100 // km
#define VSS_ALARM_HWAY_SPEED  140 // km
//#define VSS_ALARM_ENABLED // Comment to disable speeding alarms
#define VSS_ALARM_AWAITING 5
//
// --------------------------------------------------------------------------------------------------------------------
// ABOUT ECU signal
//      (actuated consumption signal)
//
//  On the GM hot film MAFs, you can also tap into the onboard computer data stream
//  with a scan tool to read the MAF sensor output in "grams per second" (GPS).
//  The reading might go from 3 to 5 GPS at idle up to 100 to 240 GPS at wide open throttle and 5000(+) RPM.
//  The frequency range varies from 30 to 150 Hz, with 30 Hz being average for idle and 150 Hz for wide open throttle.
//  Using as frequency MAF. Wide open throttle test reaches ~244 gps.
// --------------------------------------------------------------------------------------------------------------------
//
#ifndef CAR_SENS_CUSTOM_CORRECTION
/**
 * 92.23 * X = 22.5L  [full fill with 18.37L]
 * X = 2250 / 9223
 * X = 0.24396 [0.24395532906863276591130868480971  pulses given from signal]
 *
 * So ... 18.37 / 0.24396 = ~75.3
 * 75.3 * 0.24396 = 18.370188
 * ECU_CORRECTION = 75
 * 88.1
 *
 */
//
// 75.3 because there no LPG switch detection (engine runs in benzene to work temperature )...
// must be clear 75
// ECU Consumption correction
#define ECU_CORRECTION 75.3// 92.23  //  75 // 147.23 ///  346 /// to high 692
//
// Speed correction
#define VSS_CORRECTION 1.6  //    fast 3.767
//
// Revs correction
#define RPM_CORRECTION 75   //    fast 33.767
//
// Distance correction
#define DST_CORRECTION  30800.58  //  //  15383.29  //   15385
//
#define TRS_CORRECTION 0 // 0.064444 a proximity  6(~6)%
//
//#define VSD_SENS_DEBUG;
#define SCREEN_DEF_LIGHT 75 // 22
//
// Screen default value
#define SCREEN_GO_TO_DEF 15

#endif


#ifndef CAR_SENS_CUSTOM_FUELS
//
// Default fuel state
#define DEFAULT_FUEL_STATE 1
/**************************/
/* GASOLINE ENGINE CONFIG */
/**************************/
// [CONFIRMED not tested over MID] For gas car use 3355 (1/14.7/730*3600)*10000
#define FUEL_BNZ_IFC 3355
#define FUEL_BNZ_CNS 10731 // 14.7*730 = 10731

/************************/
/* LPG ENGINE CONFIG    */
/************************/
//LPG mass/volume is 520-580gr/ltr depending on propane/butane mix

// LPG/air ratio:
{'fraction_non_alphanumeric': 0.21623408827905438, 'fraction_numerical': 0.08827905438915523, 'mean_word_length': 2.3241758241758244, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1728532', 'n_tokens_mistral': 2522, 'n_tokens_neox': 2052, 'n_words': 635}