def __getstate__(self):
        state = {}
        state["name"] = self.name
        tmp_frgs = []
        for k, frg in self.fragments():
            tmp_frgs.append((k, frg.get_raw_data()))
        state["fragments"] = tmp_frgs
        state["charge"] = self.charge
        state["state"] = self._state
        state["cmds"] = self._cmds
        return state