Commit e38589d9 authored by James Hughes's avatar James Hughes
Browse files

Modified discovery to make sure the drive and the library and

compatible. Added IP address to strip chart. Cleaned up MyLogger.
parent 8d32bcee
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@ import java.util.logging.Logger;

import javax.swing.SwingWorker;

import kinetic.client.ClientConfiguration;

import org.codehaus.jackson.JsonNode;
import org.codehaus.jackson.map.ObjectMapper;

@@ -89,8 +91,15 @@ public class KineticDiscovery extends SwingWorker<Void, KineticDevice> {
			log.fine(new String(p.getData()));
			
			String protocolVersion = root.get("protocol_version").asText();
			if (!protocolVersion.startsWith("3"))
			
			// get the high level version information.
			// TODO don't like this code.
			String mypv = ClientConfiguration.getProtocolVersion().split("\\.")[0];
			String pv = protocolVersion.split("\\.")[0];
			if (!pv.equals(mypv)) {
				log.warning("Drive protocol version "+pv+" is not compatible with the library version "+mypv+", ignoring.");
				continue;
			}

			KineticDevice dev = new KineticDevice();
			dev.port = root.get("port").asInt();
+10 −5
Original line number Diff line number Diff line
@@ -23,19 +23,24 @@ public class MyLogger {
	}

	public static Logger get(Level thisClassLevel, Level rootLevel) {
		Logger log = Logger.getLogger(thisClass(2));
		String thisclass = thisClass(2);
		Logger log = Logger.getLogger(thisclass);
		log.setLevel(thisClassLevel);
		log.warning("SetLogLevel: "+thisClassLevel.getName());
		log.finest("SetLog: "+thisclass+" Level: "+thisClassLevel.getName());

		conHdlr.setLevel(rootLevel);
		root.setLevel(rootLevel);
		log.warning("SetRootLogLevel: "+rootLevel.getName());
		log.finest("SetRootLogLevel: "+rootLevel.getName());

		return log;
	}

	public static Logger get(Level thisClassLevel) {
		Logger log = Logger.getLogger(thisClass(2));
		String thisclass = thisClass(2);
		Logger log = Logger.getLogger(thisclass);
		log.setLevel(thisClassLevel);
		log.warning("SetLogLevel: "+thisClassLevel.getName());
		log.finest("SetLog: "+thisclass+" Level: "+thisClassLevel.getName());

		return log;
	}

+1 −1
Original line number Diff line number Diff line
@@ -90,7 +90,7 @@ public class StripChart extends JFrame implements WindowListener {
	
	
	public StripChart(KineticDevice device) {
		super(device.wwn+": "+device.model);
		super(device.wwn+": "+device.model+": "+device.inet4.get(0));
		this.stat = device.stat;
		this.device = device;
		demoPanel = new StripChartPanel();