Adaptive Quality Diagnosis Framework for Production Lines in a Smart Manufacturing Environment