Measuring two DC power sources (Solar Panel + Battery)

Is there any easy way to solve this?

Diodes?