package safeluck.drive.evaluation.platformMessage.utils;
|
|
import com.safeluck.aykj.decoder.BitStateCoder;
|
import com.safeluck.aykj.decoder.Int16Coder;
|
import com.safeluck.aykj.utils.BitState;
|
|
import safeluck.drive.evaluation.platformMessage.JK2019MessageBase;
|
|
|
public final class MessageManager {
|
|
public static JK2019MessageBase get(String cmd) {
|
String head = cmd.substring(4,8);
|
String classname = "safeluck.drive.evaluation.platformMessage.JKMessage"+head;
|
|
Class c = null;
|
try {
|
c = Class.forName(classname);
|
} catch (ClassNotFoundException e) {
|
|
}
|
try {
|
|
JK2019MessageBase ret = (JK2019MessageBase)c.newInstance();
|
ret.parse(cmd);
|
|
return ret;
|
} catch (InstantiationException e) {
|
throw new RuntimeException(e);
|
} catch (IllegalAccessException e) {
|
throw new RuntimeException(e);
|
}
|
}
|
}
|