<commit_before>package org.csstudio.sds.components.epics;


import org.csstudio.platform.logging.CentralLogger;
import org.csstudio.sds.components.model.MeterModel;
import org.csstudio.sds.model.AbstractWidgetModel;
import org.csstudio.sds.model.DynamicsDescriptor;
import org.csstudio.sds.model.initializers.AbstractControlSystemSchema;
import org.csstudio.sds.model.initializers.IWidgetModelInitializer;
import org.csstudio.sds.model.logic.ParameterDescriptor;

/**
 * Initializes the Meter model with EPICS default values.
 * 
 * TODO sh: do some real initializations
 * 
 * @author <NAME>
 * @version $Revision$

 */
public class EpicsMeterInitializer implements IWidgetModelInitializer {

	/**
	 * {@inheritDoc}
	 */
	public void initialize(AbstractWidgetModel model, AbstractControlSystemSchema schema) {
		if (MeterModel.ID.equals(model.getTypeID())) {
			model.setPropertyValue(AbstractWidgetModel.PROP_COLOR_FOREGROUND, schema.getColorProperty(AbstractWidgetModel.PROP_COLOR_FOREGROUND));
			
			final DynamicsDescriptor dynamicsDescriptor = new DynamicsDescriptor("scriptedColor"); //$NON-NLS-1$
			dynamicsDescriptor.addInputChannel(new ParameterDescriptor("abc", Double.class)); //$NON-NLS-1$
			model.setDynamicsDescriptor(AbstractWidgetModel.PROP_COLOR_BACKGROUND, dynamicsDescriptor);
		} else {
			CentralLogger.getInstance().error(this, "The initialization schema of the type '" //$NON-NLS-1$
					+ schema.getTypeId() +"' cannot be applied to a model of type '" //$NON-NLS-1$
					+ model.getTypeID() + "'."); //$NON-NLS-1$
		}
		
	}
}
<commit_msg>Added some dummy initialization for the meter widget<commit_after>package org.csstudio.sds.components.epics;


import org.csstudio.platform.logging.CentralLogger;
import org.csstudio.sds.components.model.MeterModel;
import org.csstudio.sds.model.AbstractWidgetModel;
import org.csstudio.sds.model.AliasDescriptor;
import org.csstudio.sds.model.DynamicsDescriptor;
import org.csstudio.sds.model.initializers.AbstractControlSystemSchema;
import org.csstudio.sds.model.initializers.IWidgetModelInitializer;
import org.csstudio.sds.model.logic.ParameterDescriptor;

/**
 * Initializes the Meter model with EPICS default values.
 * 
 * TODO sh: do some real initializations
 * 
 * @author <NAME>
 * @version $Revision$

 */
public class EpicsMeterInitializer implements IWidgetModelInitializer {

	/**
	 * {@inheritDoc}
	 */
	public void initialize(AbstractWidgetModel model, AbstractControlSystemSchema schema) {
		if (MeterModel.ID.equals(model.getTypeID())) {
			model.setPropertyValue(AbstractWidgetModel.PROP_COLOR_FOREGROUND, schema.getColorProperty(AbstractWidgetModel.PROP_COLOR_FOREGROUND));
			
			AliasDescriptor aliasDescriptor = new AliasDescriptor("input", "", "Enter the record name into the 'value' column.");  //$NON-NLS-1$ //$NON-NLS-2$//$NON-NLS-3$
			model.addAliasDescriptor(aliasDescriptor);

			
			final DynamicsDescriptor dynamicsDescriptor = new DynamicsDescriptor("scriptedColor"); //$NON-NLS-1$
			dynamicsDescriptor.addInputChannel(new ParameterDescriptor("abc", Double.class)); //$NON-NLS-1$
			model.setDynamicsDescriptor(AbstractWidgetModel.PROP_COLOR_BACKGROUND, dynamicsDescriptor);
		} else {
			CentralLogger.getInstance().error(this, "The initialization schema of the type '" //$NON-NLS-1$
					+ schema.getTypeId() +"' cannot be applied to a model of type '" //$NON-NLS-1$
					+ model.getTypeID() + "'."); //$NON-NLS-1$
		}
		
	}
}

{'fraction_non_alphanumeric': 0.12062937062937062, 'fraction_numerical': 0.003787878787878788, 'mean_word_length': 5.253187613843352, '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': '6749808', 'n_tokens_mistral': 1123, 'n_tokens_neox': 1030, 'n_words': 192}