// Path: ECF14/ecf14_files/step8-EngineWatcher/Alarm.java
// public class Alarm
// 	{
// 		private Date when; 	private String what; private int value;
// 
// 		public Alarm(String what, int value)
// 		{
// 			this.what = what;
// 			this.value = value;
// 			when = new Date();
// 		}
// 
// 		public Date getWhen() { return when; }
// 		public String getWhat() { return what; }
// 		public int getValue() { return value; 	}
// 
// 		@Override public String toString()
// 		{
// 			SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd HH:mm:ss");
// 			return "Alarm : " + sdf.format(when) + " " + what + " : " + value;
// 		}
// 	}
// 
// Path: ECF14/ecf14_files/step8-EngineWatcher/EngineWatcher.java
// public class EngineWatcher
// {
// 	// Define the sent topics
// 	public static final String ALARM_TOPIC = "Alarm/*";
// 	public static final String ALARM_RPM_TOO_HIGH = "Alarm/RpmTooHigh";
// 	public static final String ALARM_SPEED_TOO_HIGH = "Alarm/SpeedTooHigh";
// 
// 	// Get the event broker by injection
// 	@Inject
// 	IEventBroker ebroker;
// 
// 	@Optional
// 	@Inject
// 	public void checkRpmValue(final @Named(EngineSimulator.ECF2014_RPM_VALUE) int value)
// 	{
// 		if (value > 5000)
// 		{
// 			// Send an alarm
// 			Alarm a = new Alarm("rpm is too high (" + value + ")", value);
// 			ebroker.send(ALARM_RPM_TOO_HIGH, a);
// 		}
// 	}
// 
// 	@Optional
// 	@Inject
// 	public void checkSpeedValue(final @Named(EngineSimulator.ECF2014_SPEED_VALUE) int value)
// 	{
// 		System.out.println("Check speed value for alarm : " + value);
// 		if (value > 160)
// 		{
// 			// Send an alarm
// 			Alarm a = new Alarm("speed is too high (" + value + ")", value);
// 			ebroker.send(ALARM_SPEED_TOO_HIGH, a);
// 		}
// 	}
// 
// }


import java.text.SimpleDateFormat;
import java.util.Vector;
import javax.annotation.PostConstruct;
import javax.inject.Inject;
import org.eclipse.e4.core.di.annotations.Optional;
import org.eclipse.e4.ui.di.Focus;
import org.eclipse.e4.ui.di.UIEventTopic;
import org.eclipse.jface.viewers.ArrayContentProvider;
import org.eclipse.jface.viewers.ColumnLabelProvider;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.TableViewerColumn;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Table;
import com.opcoach.ecf2014.engine.core.Alarm;
import com.opcoach.ecf2014.engine.core.EngineWatcher;
package com.opcoach.ecf2014.engine.ui.parts;





public class AlarmPart
{
	@Optional
	@Inject
// Path: ECF14/ecf14_files/step8-EngineWatcher/Alarm.java
// public class Alarm
// 	{
// 		private Date when; 	private String what; private int value;
// 
// 		public Alarm(String what, int value)
// 		{
// 			this.what = what;
// 			this.value = value;
// 			when = new Date();
// 		}
// 
// 		public Date getWhen() { return when; }
// 		public String getWhat() { return what; }
// 		public int getValue() { return value; 	}
// 
// 		@Override public String toString()
// 		{
// 			SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd HH:mm:ss");
// 			return "Alarm : " + sdf.format(when) + " " + what + " : " + value;
// 		}
// 	}
// 
// Path: ECF14/ecf14_files/step8-EngineWatcher/EngineWatcher.java
// public class EngineWatcher
// {
// 	// Define the sent topics
// 	public static final String ALARM_TOPIC = "Alarm/*";
// 	public static final String ALARM_RPM_TOO_HIGH = "Alarm/RpmTooHigh";
// 	public static final String ALARM_SPEED_TOO_HIGH = "Alarm/SpeedTooHigh";
// 
// 	// Get the event broker by injection
// 	@Inject
// 	IEventBroker ebroker;
// 
// 	@Optional
// 	@Inject
// 	public void checkRpmValue(final @Named(EngineSimulator.ECF2014_RPM_VALUE) int value)
// 	{
// 		if (value > 5000)
// 		{
// 			// Send an alarm
// 			Alarm a = new Alarm("rpm is too high (" + value + ")", value);
// 			ebroker.send(ALARM_RPM_TOO_HIGH, a);
// 		}
// 	}
// 
// 	@Optional
// 	@Inject
// 	public void checkSpeedValue(final @Named(EngineSimulator.ECF2014_SPEED_VALUE) int value)
// 	{
// 		System.out.println("Check speed value for alarm : " + value);
// 		if (value > 160)
// 		{
// 			// Send an alarm
// 			Alarm a = new Alarm("speed is too high (" + value + ")", value);
// 			ebroker.send(ALARM_SPEED_TOO_HIGH, a);
// 		}
// 	}
// 
// }


// Path: ECF14/ecf14_files/step9-AlarmViewer/AlarmPart.java
import java.text.SimpleDateFormat;
import java.util.Vector;
import javax.annotation.PostConstruct;
import javax.inject.Inject;
import org.eclipse.e4.core.di.annotations.Optional;
import org.eclipse.e4.ui.di.Focus;
import org.eclipse.e4.ui.di.UIEventTopic;
import org.eclipse.jface.viewers.ArrayContentProvider;
import org.eclipse.jface.viewers.ColumnLabelProvider;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.TableViewerColumn;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Table;
import com.opcoach.ecf2014.engine.core.Alarm;
import com.opcoach.ecf2014.engine.core.EngineWatcher;

package com.opcoach.ecf2014.engine.ui.parts;





public class AlarmPart
{
	@Optional
	@Inject
	private EngineWatcher engineWatcher;