<commit_before>package de.ptb.epics.eve.editor.gef.commands;

import org.eclipse.gef.commands.Command;

import de.ptb.epics.eve.data.scandescription.ScanModule;
import de.ptb.epics.eve.data.scandescription.ScanModuleTypes;

/**
 * Copies general properties of a scan module to another.
 * 
 * @author <NAME>
 * @since 1.19
 */
public class CopyScanModuleProperties extends Command {
	private ScanModule from;
	private ScanModule to;
	
	// old values
	private ScanModuleTypes type;
	private String name;
	private int valueCount;
	private double settleTime;
	private double triggerDelay;
	private boolean triggerConfirmAxis;
	private boolean triggerConfirmChannel;
	
	/**
	 * Constructor.
	 * 
	 * @param from scan module properties should be copied from
	 * @param to scan module properties should be copied to
	 */
	public CopyScanModuleProperties(ScanModule from, ScanModule to) {
		this.from = from;
		this.to = to;
		
		this.type = to.getType();
		this.name = to.getName();
		this.valueCount = to.getValueCount();
		this.settleTime = to.getSettleTime();
		this.triggerDelay = to.getTriggerDelay();
		this.triggerConfirmAxis = to.isTriggerConfirmAxis();
		this.triggerConfirmChannel = to.isTriggerConfirmChannel();
	}
	
	/**
	 * {@inheritDoc}
	 */
	@Override
	public void execute() {
		this.to.setType(this.from.getType());
		this.to.setName(this.from.getName() + " copy");
		this.to.setValueCount(this.from.getValueCount());
		this.to.setSettleTime(this.from.getSettleTime());
		this.to.setTriggerDelay(this.from.getTriggerDelay());
		this.to.setTriggerConfirmAxis(this.from.isTriggerConfirmAxis());
		this.to.setTriggerConfirmChannel(this.from.isTriggerConfirmChannel());
	}
	
	/**
	 * {@inheritDoc}
	 */
	@Override
	public void undo() {
		this.to.setType(this.type);
		this.to.setName(this.name);
		this.to.setValueCount(this.valueCount);
		this.to.setSettleTime(this.settleTime);
		this.to.setTriggerDelay(this.triggerDelay);
		this.to.setTriggerConfirmAxis(this.triggerConfirmAxis);
		this.to.setTriggerConfirmChannel(this.triggerConfirmChannel);
	}
	
	/**
	 * {@inheritDoc}
	 */
	@Override
	public void redo() {
		this.execute();
	}
}<commit_msg>pasting a scan module now only adds "copy" to the name for classic SMs<commit_after>package de.ptb.epics.eve.editor.gef.commands;

import org.eclipse.gef.commands.Command;

import de.ptb.epics.eve.data.scandescription.ScanModule;
import de.ptb.epics.eve.data.scandescription.ScanModuleTypes;

/**
 * Copies general properties of a scan module to another.
 * 
 * @author <NAME>
 * @since 1.19
 */
public class CopyScanModuleProperties extends Command {
	private ScanModule from;
	private ScanModule to;
	
	// old values
	private ScanModuleTypes type;
	private String name;
	private int valueCount;
	private double settleTime;
	private double triggerDelay;
	private boolean triggerConfirmAxis;
	private boolean triggerConfirmChannel;
	
	/**
	 * Constructor.
	 * 
	 * @param from scan module properties should be copied from
	 * @param to scan module properties should be copied to
	 */
	public CopyScanModuleProperties(ScanModule from, ScanModule to) {
		this.from = from;
		this.to = to;
		
		this.type = to.getType();
		this.name = to.getName();
		this.valueCount = to.getValueCount();
		this.settleTime = to.getSettleTime();
		this.triggerDelay = to.getTriggerDelay();
		this.triggerConfirmAxis = to.isTriggerConfirmAxis();
		this.triggerConfirmChannel = to.isTriggerConfirmChannel();
	}
	
	/**
	 * {@inheritDoc}
	 */
	@Override
	public void execute() {
		this.to.setType(this.from.getType());
		if (this.from.getType().equals(ScanModuleTypes.CLASSIC)) {
			this.to.setName(this.from.getName() + " copy");
		} else {
			this.to.setName(this.from.getName());
		}
		this.to.setValueCount(this.from.getValueCount());
		this.to.setSettleTime(this.from.getSettleTime());
		this.to.setTriggerDelay(this.from.getTriggerDelay());
		this.to.setTriggerConfirmAxis(this.from.isTriggerConfirmAxis());
		this.to.setTriggerConfirmChannel(this.from.isTriggerConfirmChannel());
	}
	
	/**
	 * {@inheritDoc}
	 */
	@Override
	public void undo() {
		this.to.setType(this.type);
		this.to.setName(this.name);
		this.to.setValueCount(this.valueCount);
		this.to.setSettleTime(this.settleTime);
		this.to.setTriggerDelay(this.triggerDelay);
		this.to.setTriggerConfirmAxis(this.triggerConfirmAxis);
		this.to.setTriggerConfirmChannel(this.triggerConfirmChannel);
	}
	
	/**
	 * {@inheritDoc}
	 */
	@Override
	public void redo() {
		this.execute();
	}
}
{'fraction_non_alphanumeric': 0.1287084541601606, 'fraction_numerical': 0.0013383894713361588, 'mean_word_length': 4.454987834549878, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '145934', 'n_tokens_mistral': 1541, 'n_tokens_neox': 1428, 'n_words': 273}