def clear_form(self):
        # For undo/redo
        old_ma_unit, old_table = self._save_ma_unit_and_table_state(
                                table = self.two_by_two_table,
                                ma_unit = self.ma_unit, 
                                use_old_value=False)
        old_prevalence = self._get_prevalence_str()
        
        keys = ["c11", "c12", "r1sum", "c21", "c22", "r2sum", "c1sum", "c2sum", "total"]
        blank_vals = dict( zip(keys, [""]*len(keys)) )

        self._set_vals(blank_vals)
        self._update_ma_unit()
        
        # clear out effects stuff
        for metric in DIAGNOSTIC_METRICS:
            self.ma_unit.set_effect_and_ci(metric, self.group_str, None, None, None, mult=self.mult)
            
        # clear line edits
        self.set_current_effect()
        self.prevalence_txt_box.blockSignals(True)
        self.prevalence_txt_box.setText("")
        self.prevalence_txt_box.blockSignals(False)

        calc_fncs.reset_table_item_flags(self.two_by_two_table)
        #self.enable_txt_box_input()
        
        new_ma_unit, new_table = self._save_ma_unit_and_table_state(
                        table = self.two_by_two_table, ma_unit = self.ma_unit,
                        use_old_value=False)
        new_prevalence = self._get_prevalence_str()
        restore_old_f = lambda: self.restore_ma_unit_and_table(old_ma_unit, old_table, old_prevalence)
        restore_new_f = lambda: self.restore_ma_unit_and_table(new_ma_unit, new_table, new_prevalence)
        command = calc_fncs.CommandFieldChanged(restore_new_f=restore_new_f, restore_old_f=restore_old_f, parent=self)
        self.undoStack.push(command)
    def clear_form(self):
        # For undo/redo
        old_ma_unit, old_table = self._save_ma_unit_and_table_state(
            table=self.raw_data_table,
            ma_unit=self.ma_unit,
            use_old_value=False)

        blank_vals = {
            "c11": "",
            "c12": "",
            "r1sum": "",
            "c21": "",
            "c22": "",
            "r2sum": "",
            "c1sum": "",
            "c2sum": "",
            "total": ""
        }

        self._set_vals(blank_vals)
        self._update_ma_unit()

        # clear out effects stuff
        for metric in BINARY_ONE_ARM_METRICS + BINARY_TWO_ARM_METRICS:
            if ((self.cur_effect in BINARY_TWO_ARM_METRICS
                 and metric in BINARY_TWO_ARM_METRICS)
                    or (self.cur_effect in BINARY_ONE_ARM_METRICS
                        and metric in BINARY_ONE_ARM_METRICS)):
                self.ma_unit.set_effect_and_ci(metric,
                                               self.group_str,
                                               None,
                                               None,
                                               None,
                                               mult=self.mult)
            else:
                # TODO: Do nothing for now..... treat the case where we have to switch group strings down the line
                pass

        # clear line edits
        self.set_current_effect()
        calc_fncs.reset_table_item_flags(self.raw_data_table)
        ####self.enable_txt_box_input()

        new_ma_unit, new_table = self._save_ma_unit_and_table_state(
            table=self.raw_data_table,
            ma_unit=self.ma_unit,
            use_old_value=False)
        restore_old_f = lambda: self.restore_ma_unit_and_table(
            old_ma_unit, old_table)
        restore_new_f = lambda: self.restore_ma_unit_and_table(
            new_ma_unit, new_table)
        command = calc_fncs.CommandFieldChanged(restore_new_f=restore_new_f,
                                                restore_old_f=restore_old_f,
                                                parent=self)
        self.undoStack.push(command)
    def clear_form(self):
        # For undo/redo
        old_ma_unit, old_table = self._save_ma_unit_and_table_state(
                        table = self.raw_data_table,
                        ma_unit = self.ma_unit, 
                        use_old_value=False)
        
        blank_vals = {"c11"  : "",
                      "c12"  : "",
                      "r1sum": "",
                      "c21"  : "",
                      "c22"  : "",
                      "r2sum": "",
                      "c1sum": "",
                      "c2sum": "",
                      "total": ""}

        self._set_vals(blank_vals)
        self._update_ma_unit()
        
        # clear out effects stuff
        for metric in BINARY_ONE_ARM_METRICS + BINARY_TWO_ARM_METRICS:
            if ((self.cur_effect in BINARY_TWO_ARM_METRICS and metric in BINARY_TWO_ARM_METRICS) or
                (self.cur_effect in BINARY_ONE_ARM_METRICS and metric in BINARY_ONE_ARM_METRICS)):
                self.ma_unit.set_effect_and_ci(metric, self.group_str, None, None, None, mult=self.mult)
            else:
                # TODO: Do nothing for now..... treat the case where we have to switch group strings down the line
                pass
            
        # clear line edits
        self.set_current_effect()
        calc_fncs.reset_table_item_flags(self.raw_data_table)
        ####self.enable_txt_box_input()
        
        
        new_ma_unit, new_table = self._save_ma_unit_and_table_state(
                table = self.raw_data_table, ma_unit = self.ma_unit,
                use_old_value=False)
        restore_old_f = lambda: self.restore_ma_unit_and_table(old_ma_unit, old_table)
        restore_new_f = lambda: self.restore_ma_unit_and_table(new_ma_unit, new_table)
        command = calc_fncs.CommandFieldChanged(restore_new_f=restore_new_f, restore_old_f=restore_old_f, parent=self)
        self.undoStack.push(command)