}
HashMap map = new HashMap();
map.put("a", "aaaa");
map.put("b", "bbbb");
map.put("c", "cccc");
map.put("d", "dddd");
Set set = map.keySet();
for (Iterator iter = set.iterator(); iter.hasNext();) {
String key = (String) iter.next();
if (key.equals("c")) {
String value = (String) map.get(key);
System.out.println(key + "====" + value);
break;
}
}
String s=(String)map.get("c");
System.out.println("查询值,根据Key; Key为c 值为" + s);
public HashMap GetRealTime()
{
HashMap mymap = new HashMap();
mymap.put("a", "aaaa");
mymap.put("b", "bbbb");
mymap.put("c", "cccc");
mymap.put("d", "dddd");
return mymap;
}
public HashMap GetStateBySysRunTime()
{
HashMap map=new HashMap();
map.put("0000","系统空闲");
map.put("0001","手动分析");
map.put("0002","自动分析");
map.put("0003","校正流程");
map.put("0004","灌注系统");
map.put("0005","灌注试剂A");
map.put("0006","灌注试剂B");
map.put("0007","灌注试剂C");
map.put("0008","灌注载液");
map.put("0009","灌注标液一");
map.put("000A","标注标液二");
map.put("000B","灌注水样");
map.put("000C","灌注稀释");
map.put("000D","清洗流程");
map.put("000E","排空反应池");
map.put("000F","错误状态");
map.put("0010","校正标液一");
map.put("0011","校正标液二");
map.put("0012","校正本底");
map.put("0013","灌注清洗剂");
map.put("0014","灌注试剂D");
map.put("0015","灌注核查液");
map.put("0016","核查进程");
return map;
}
/**
* 当前的进程
* @return
*/
public HashMap GetProcessByOnTime()
{ HashMap map=new HashMap();
map.put("0001","清洗预处理");
map.put("0002","稀释样本");
map.put("0003","清洗反应池");
map.put("0004","测试本底");
map.put("0005","流动抽样");
map.put("0006","加热消解");
map.put("0007","分析标一");
map.put("0008","分析标二");
map.put("0009","分析水样");
map.put("000A","排空反应池");
map.put("000B","灌注操作");
map.put("0012","恒温消解");
map.put("0013","风扇降温");
map.put("0014","吸样二");
map.put("0016","分析核查液");
return map;
}
public HashMap GetErrorCode()
{
HashMap map=new HashMap();
map.put("3200","取样指令超时");
map.put("3300","反应池液位错误");
map.put("3400","液位判断超时");
map.put("3500","本底测量超范围");
map.put("3600","反应时间未设置");
map.put("3700","方程K错误");
map.put("3800","方程B错误");
map.put("3900","校正量程未设置");
map.put("3A00","信号采集超时");
map.put("3B00","分析周期设置错误");
map.put("3C00","主板CAN发送错误");
map.put("3D00","主板CAN接收错误");
map.put("3E00","主板EEP缺页");
map.put("3F00","主板EEP写错误");
map.put("4000","测量值异常");
map.put("4100","任务创建异常");
map.put("4200","校正结果异常");
map.put("4300","信号采集异常");
map.put("4400","K 设定范围错误");
map.put("4500","K 值超设定范围");
map.put("5000","采集板CPU错误");
map.put("5100","采集板DA错误");
map.put("5200","采集板18B20错误");
map.put("5300","采集板SPI接收ERR");
map.put("5400","采集板SPI发送ERR");
map.put("5500","采集板CAN发送ERR");
map.put("5600","采集板CAN接收ERR");
map.put("5700","温度传感器断开");
map.put("5800","采集板EEP写ERR");
map.put("5900","采集板EEP读ERR");
map.put("5A00","消解温度错误");
map.put("5B00","消解过程错误");
map.put("5C00","ADC IC错误");
map.put("5D00","液位ADC错误");
map.put("5E00","LED功率设置ERR");
map.put("5F00","LED调节失败");
map.put("6400","驱动板CPU错误");
map.put("6500","驱动板DA错误");
map.put("6600","驱动板SPI接收ERR");
map.put("6700","驱动板SPI发送ERR");
map.put("6800","驱动板电磁阀错误");
map.put("6900","驱动板CAN发送ERR");
map.put("6A00","驱动板CAN接收ERR");
map.put("6B00","驱动板电机异常");
map.put("6C00","驱动板指示灯异常");
map.put("6D00","驱动板浮子异常");
map.put("6E00","浮子通讯异常");
map.put("6F00","试剂A不足");
map.put("7000","试剂B不足");
map.put("7100","清洗液不足");
map.put("7200","载液不足");
map.put("7300","标液一不足");
map.put("7400","标液二不足");
map.put("7500","水样不足");
map.put("7600","试剂C不足");
map.put("7700","试剂D不足");
map.put("7800","稀释板CPU错误");
map.put("7900","稀释板DA错误");
map.put("7A00","稀释板SPI接收错误");
map.put("7B00","稀释板SPI发送错误");
map.put("7C00","稀释板电磁阀 错误");
map.put("7D00","稀释板CAN发送ERR");
map.put("7E00","稀释板CAN接收ERR");
map.put("7F00","稀释板电机错误");
map.put("8000","稀释板状态错误");
map.put("8100","稀释板通讯超时");
map.put("8200","核查液不足");
map.put("8300","采集板室温读取ERR");
map.put("8400","驱动板电机光耦ERR");
map.put("8500","驱动板状态错误");
map.put("8600","反应池温度过高");
map.put("8700","反应池温度过低");
map.put("8800","驱动板运行超时");
map.put("8900","驱动板未知错误");
map.put("8A00","采集板未知错误");
return map;
}
public void GetTimeByHexString()
{
long l= Long.parseLong("802ea356",16);
Date dtNow = new Date(System.currentTimeMillis());
Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(Long.valueOf("2150544214000"));
//得到Date
System.out.println(cal.getTime());
//Tue Feb 23 21:23:34 格林尼治标准时间+0800 2038
}