code: def refresh_existing_encodings(self):
          
          update = False
  
          for msg in self.proto_analyzer.messages:
              i = next((i for i, d in enumerate(self.decodings) if d.name == msg.decoder.name), 0)
              if msg.decoder != self.decodings[i]:
                  update = True
                  msg.decoder = self.decodings[i]
                  msg.clear_decoded_bits()
                  msg.clear_encoded_bits()
  
          if update:
              self.protocol_model.update()
              self.label_value_model.update()
docs: Refresh existing encodings for messages, when encoding was changed by user in dialog
  
          :return: