Analysis of the planar field-emission diode