Cyber-Physical Systems : From Theory to Practice