I've had a few GPS devices and cameras that had an option in the menus to tell it which battery type you had inserted. Based on the choice of battery chemistry, they would estimate battery life as a function of voltage (always an imperfect science, and harder with rechargable batteries than alkaline ones.)
I can't imagine any way to automatically detect battery type and calculate accordingly - I think you have to know the chemistry up front, then estimate battery charge state based on that.