⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ftankvolume.h

📁 这是一个潜入式开发的c语言代码
💻 H
字号:
/*#########################################################################

  ftankvolume.h - definitions/declarations of tank volume calculation.

		Copyright (c) 2005-2006, RICHISLAND All rights reserved.
  
  Purpose		:
  Version       :1.00
  Author        :
  Complete Date :

  Function List :
  History       :
  _________________________________________________________________________
  DATE          AUTHOR    VERSION    DESCRIBE
  -------------------------------------------------------------------------
  2006-07-26              Ver1.00    Create

#########################################################################*/
#ifndef __F_TANKVOLUME_H__
#define __F_TANKVOLUME_H__
#include "stadx.h"
#include <stdio.h>
#include <fcntl.h>
#include "fcalculate.h"

#ifdef __cplusplus
extern "C" {
#endif

#define FVOL_FILENAME_SIZE	 20			/* file name size in byte */
#define FVOL_TANKBUFFER_SIZE (1024*50)	/* tank data buffer size */


/* configuation */
typedef struct tag_VolumeCfg
{
	/* number of tanks */
	UINT8 u8TankNum;
	/* file handle */
	REGINT fd;
	/* config file list */
	CHAR*  cfgFiles[MAX_TANK_NUM];
	CHAR  _cfgFiles[MAX_TANK_NUM][FVOL_FILENAME_SIZE];
}VolumeCfg;

/* volume table type. */
typedef enum tag_VolumeTableType
{
	/* index table */
	Index,
	/* cm,mm volume table */
	Ratable0
}VolumeTableType;

/* volume table */
typedef struct tag_VolumeTable
{
	/* type */
	VolumeTableType Type;
	/* number of item */
	UINT16 u16ItemNum;
	/* start offset from buffer */
	INT32 n32Offset;
}VolumeTable;

/* tank volume data */
typedef struct tag_TankVolCfg
{
	/* tank name */
	BYTE Name[20];
	/* tank index */
	INT32 u32TankIndex;
	/* file handle */
	REGINT fd;
	/* meter-decimeter volume table */
	VolumeTable DM_TABLE;
	/* centimeter-millimeter volume offset */
	VolumeTable MM_TABLE;
	/* amendation table */
	VolumeTable AMEND_TABLE;
	/* fund amount table */
	VolumeTable FUND_TABLE;
	
}TankVolCfg;

/* index item. */
typedef struct tag_IndexItem
{
	INT32 n32Index;
	INT32 n32Value;
}IndexItem;

/* ratable item. */
typedef struct tag_RatableItem
{
	INT32 n32LiquidLevel_Min;
	INT32 n32LiquidLevel_Max;
	INT32 unitage_cm[9];
	INT32 unitage_mm[9];
}RatableItem;

/* define struct for match detail */
typedef struct tag_MatchValue
{
	Boolean isExactValue;
	INT32 n32RangeA;
	INT32 n32RangeB;
}MatchValue;

/* init */
Boolean fvol_init(CHAR* cfgFileName);
/* calculate volume(litre) */
INT32 fvol_getVolume(REGINT tankIndex, TankCoefficient* pTankData);

#ifdef __cplusplus
}
#endif

#endif // __F_TANKVOLUME_H__

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -