#include "cpu.h"
#include "datadesc.h"
#include "journal.h"
#include "term_tsk.h"
#include "score_tsk.h"
#include "app_serv.h"


typedef struct
{
#if defined(BOARD_SOLARIUM_VLAD)
  SolarCounters solar_counters;
#endif
      
#if defined(BOARD_CENTRAL_CARWASH) || defined(BOARD_SOLARIUM_WEB) || defined(BOARD_SOLARIUM_VLAD)

  TChannelConfig ChannelConfig;

  TDeviceConfig DeviceConfig;

  // счетчики
  TCounters Counters;

  // длинные счетчики с CRC16 
  TCountersLong CountersLong;

  CPU_INT32U FRAM_AcceptedMoney;
  CPU_INT32U crc_AcceptedMoney;

  CPU_INT32U Pass;
  CPU_INT32U crc_Pass;

  CPU_INT32U LastEmailTime;

  CPU_INT32U IncasEmailFlag;
  CPU_INT32U IncasMoney;
  CPU_INT32U IncasTime;

  CPU_INT32U StartButtonName;

  CPU_INT32U DefferedStartEnabled[CHANNELS_NUM];
  
  CPU_INT16U keys_crc;

#endif

  CPU_INT08U  mac_addr[6];
  CPU_INT32U  ip;
  CPU_INT32U  netmask;
  CPU_INT32U  gateway;

  CPU_INT16U  port;

#ifdef BOARD_POST_CARWASH
  CPU_INT32U  signal;
#endif
 
  TerminalCurrInfo terminal_info;
  
#if defined(BOARD_CENTRAL_CARWASH) || defined(BOARD_SOLARIUM_VLAD)
  // текст для начала банковского чека (название фирмы и т.п.)
  char precheck_text[PRETEXT_LINE_COUNT][40];
  CPU_INT16U precheck_crc;
#endif

#if defined(BOARD_SOLARIUM_WEB)
  CPU_INT32U  SolariumType;
  CPU_INT32U  SolariumTimeout;
  CPU_INT32U  SolariumPause;
  CPU_INT32U  SolariumVentilationTime;
  CPU_INT32U  SolariumPriceSource;
  CPU_INT32U  SolariumPricePerMin;
  CPU_INT32U  SolariumMinTime;
  CPU_INT32U  SolariumMaxTime;
  CPU_INT32U  ZummerEnable;
#endif
  
#if defined(CONFIG_MUSIC_ENABLE)
  CPU_INT32U  SoundEnable;
  CPU_INT32U  SoundVolume;
#endif  
  
#if defined(BOARD_SOLARIUM_VLAD)
  CPU_INT32U  SolarLampsCount[CHANNELS_NUM * SOLAR_MODES_COUNT];
  CPU_INT32U  SolarPricePerMinute[CHANNELS_NUM * SOLAR_MODES_COUNT];
  CPU_INT32U  SolarMaximumTimeMinutes[CHANNELS_NUM * SOLAR_MODES_COUNT];
  CPU_INT32U  SolarMinimumTimeMinutes[CHANNELS_NUM];
  CPU_INT32U  SolarVentilationTimeMinutes[CHANNELS_NUM];
  CPU_INT32U  SolarTimeoutBeforeMinutes[CHANNELS_NUM];
  CPU_INT32U  DiscountHourBegin[4];
  CPU_INT32U  DiscountHourEnd[4];
  CPU_INT32U  DiscountHourValue[4];
  CPU_INT32U  DiscountDayValue[7];
  CPU_INT32U  DiscountMonthValue[12];
  CPU_INT32U  DiscountCustomValue[3];
  CPU_INT32U  DiscountBeginDateValue[3];
  CPU_INT32U  DiscountEndDateValue[3];
  CPU_INT32U  ScoreRs485Speed;
  CPU_INT32U  ScoreRs485Address[SCORE_COUNT];
  CPU_INT32U  ScoreColumn[SCORE_COUNT];
  CPU_INT32U  ScoreEnable[SCORE_COUNT];
  CPU_INT32U  SolariumTimePayed[CHANNELS_NUM];
  CPU_INT32U  SolariumMoneyPayed[CHANNELS_NUM];
  CPU_INT32U  SolariumTimePayedCrc16[CHANNELS_NUM];
  CPU_INT32U  SolarTimeoutAfterMinutes[CHANNELS_NUM];
  CPU_INT32U  SolarCurrentPricePerMinute[CHANNELS_NUM * SOLAR_MODES_COUNT];
      
  CPU_INT32U  SkinCollatenMaxTime[4];
  CPU_INT32U  SkinUFMaxTime[4];
  CPU_INT32U  SkinMaximalMaxTime[4];

  CPU_INT32U  AbonementMoney[4];
  CPU_INT32U  AbonementBonus[4];
  CPU_INT32U  AbonementBestBefore[4];

#endif

#if defined(CONFIG_RELAY_ENABLE)
  CPU_INT32U  RelayEnable[RELAY_COUNT];
  CPU_INT32U  RelayIpAddr[RELAY_COUNT];
  CPU_INT32U  RelayChannel[RELAY_COUNT];
  CPU_INT32U  RelayOpenTime[RELAY_COUNT];
#endif
      
#if defined(CONFIG_TERMINAL_ENABLE)
  CPU_INT32U  TerminalProtocol;
#endif
  
  CPU_INT32U  TaxFormat;
  CPU_INT32U  SubjSell;
  CPU_INT32U  CommandV2;
  CPU_INT32U  TaxSystem;

#if defined(BOARD_SOLARIUM_VLAD)
  CPU_INT32U  EnableGlobalPass;
#endif

  CPU_INT32U  CoinPulseLen;
  CPU_INT32U  CoinPauseLen;
  CPU_INT32U  CoinPulseDelta;

#ifdef CONFIG_FTP_CLIENT_ENABLE
  CPU_INT32U  FtpEnable;
  CPU_INT32U  FtpServerIpAddr;
  CPU_INT32U  FtpDeviceNumber;
  CPU_INT32U  FtpSendHourMin;
  CPU_INT32U  FtpSendIntervalIndex;
  CPU_INT32U  FtpLastTime;
  CPU_INT32U  FtpLastResult;
  char  FtpLogin[16];
  char  FtpPass[16];
#endif

#if defined(CONFIG_MUSIC_ENABLE)
  CPU_INT32U  SoundIpAddr;
#endif  

#if defined(BOARD_SOLARIUM_VLAD)
  CPU_INT32U PassCleaning;
  CPU_INT32U PassService;
  CPU_INT32U PassTestMode;
  CPU_INT32U PassModesCrc;
  CPU_INT32U  SolarCleaningTimeout;
  CPU_INT32U  SolarControlChannels[CHANNELS_NUM];
#endif
  
  // журнал событий+ошибок
  TEventRecord EventRecords[EVENT_RECORDS_COUNT];

}TFramMap;

