温湿度监控

cqm2099 2004-08-11 04:55:06
请问高手们有没有用JAVA做过温湿度监控仪方面的程序,具体问题是这样:
JAVA编译后的Class文件封装到了温湿度监控仪器内,我从里面下过来反编译得到JAVA源码,温湿度监控仪是通过DHCP分配的IP地址地址访问得到IE浏览数据图形得实时数据,主要通过JAVA的CLASS文件更新图形并显示图形,但不能保存备份到电脑,现想通过编写程序得到实时数据并实时记录作备份,还望高手们能提供一些方法或实例。。
  具体代码下贴部分:
import java.applet.Applet;
import java.awt.*;
import java.io.*;
import java.net.*;
import java.util.Date;

public class snsr extends Applet
implements Runnable
{

Choice choice1 = null;
Label temp = null;
Label humidity = null;
Label treading = null;
Label timescale = null;
Label hreading = null;
Label time = null;
Label period = null;
TextField maxField = null;
TextField minField = null;
Label div = null;
Label templabel = null;
Choice temp_degree = null;
Label humi_max = null;
Label humi_min = null;
Button button1 = null;
String s_time = null;
String item = null;
boolean needsClearing = false;
float h_value = 0;
float t_value = 0;
int data_number = 0;
int draw_number = 0;
int draw_start_number = 0;
boolean ready = false;
int timer_mode = 0;
boolean temp_mode = false;
int temp_max = 0;
int temp_min = 0;
int read_min_loop = 0;
int read_10min_loop = 0;
int read_1hr_loop = 0;
int read_12hr_loop = 0;
int read_loop = 0;
int index = 0;
int old_index = 0;
String cmd = null;
String val = null;
boolean archiveEnable = false;
boolean archiveBusy = false;
int skip_cmd = 0;
int n_index = 0;
int e_index = 0;
boolean update_time = false;
boolean sp_draw = false;
boolean alarm_done = false;
int sp_1 = 0;
int sp_2 = 0;
char sp_type = 0;
char sp_f_c = 0;
int temp_1hr[] = null;
int humi_1hr[] = null;
int temp_1day[] = null;
int humi_1day[] = null;
int data_number1 = 0;
boolean archive1 = false;
int temp_1week[] = null;
int humi_1week[] = null;
int data_number2 = 0;
boolean archive2 = false;
int temp_1mon[] = null;
int humi_1mon[] = null;
int data_number3 = 0;
boolean archive3 = false;
int temp_1year[] = null;
int humi_1year[] = null;
int data_number4 = 0;
boolean archive4 = false;
int temp_array[] = null;
int humi_array[] = null;
int data_div = 0;
private Thread m_serverThread = null;
Socket mnSocket = null;
PrintWriter out = null;
BufferedInputStream in = null;
int x0 = 0;
int y0 = 0;
int xn = 0;
int yn = 0;
int y_div = 0;
int x_div = 0;

public snsr()
{
choice1 = new Choice();
temp = new Label();
humidity = new Label();
treading = new Label();
timescale = new Label();
hreading = new Label();
time = new Label();
period = new Label();
maxField = new TextField();
minField = new TextField();
div = new Label();
templabel = new Label();
temp_degree = new Choice();
humi_max = new Label();
humi_min = new Label();
button1 = new Button();
item = "1 day";
needsClearing = false;
data_number = 0;
draw_number = 0;
draw_start_number = 0;
ready = false;
timer_mode = 0;
temp_mode = true;
temp_max = 50;
temp_min = 0;
read_min_loop = -1;
read_10min_loop = 0;
read_1hr_loop = 0;
read_12hr_loop = 0;
read_loop = -1;
index = 0;
old_index = 50;
archiveEnable = false;
archiveBusy = false;
skip_cmd = 0;
n_index = 0;
e_index = 0;
update_time = true;
sp_draw = false;
alarm_done = false;
temp_1hr = new int[1800];
humi_1hr = new int[1800];
temp_1day = new int[1440];
humi_1day = new int[1440];
data_number1 = 0;
archive1 = false;
temp_1week = new int[2016];
humi_1week = new int[2016];
data_number2 = 0;
archive2 = false;
temp_1mon = new int[1488];
humi_1mon = new int[1488];
data_number3 = 0;
archive3 = false;
temp_1year = new int[1460];
humi_1year = new int[1460];
data_number4 = 0;
archive4 = false;
temp_array = new int[2100];
humi_array = new int[2100];
data_div = 30;
m_serverThread = null;
mnSocket = null;
out = null;
in = null;
x0 = 60;
y0 = 40;
xn = 680;
yn = 340;
y_div = 10;
x_div = 30;
}
...全文
241 22 打赏 收藏 转发到动态 举报
写回复
用AI写文章
22 条回复
切换为时间正序
请发表友善的回复…
发表回复
cqm2099 2004-09-15
  • 打赏
  • 举报
回复
问题就是问题,总会得到解决,谢谢大家的帮忙!
每人十分!~
cqm2099 2004-09-08
  • 打赏
  • 举报
回复
大家快快回复哦!~(马上结帖!)

来者有分啦!~
minghuitian 2004-09-06
  • 打赏
  • 举报
回复
gz
cqm2099 2004-09-06
  • 打赏
  • 举报
回复
自己顶一下!~
csdnmile 2004-08-30
  • 打赏
  • 举报
回复
可以给我一份完整来好好看看好吗?谢谢~!:)
cqm2099 2004-08-28
  • 打赏
  • 举报
回复
看来大家也说不出个所以然来,也许这个问题太空洞,大家没有切身体会!当然也宝贵意见或方法可以尽量提!来者有分!~~~
Alan 2004-08-26
  • 打赏
  • 举报
回复
把你的程序简单改改,写个servlet生成图片就可以保存了。不过实时交互还是还是需要applet。
no1rock 2004-08-26
  • 打赏
  • 举报
回复
use javax communication api, u can download it ,then read the samples e.g. serial read. then u can get contact with the serial port. then use thread to update the temperature. if u want to save the image on local, i can use the follow method:

public void createImage(String fileLocation) {
try {
FileOutputStream fos = new FileOutputStream(fileLocation);
BufferedOutputStream bos = new BufferedOutputStream(fos);
JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(bos);
encoder.encode(image);
bos.close();
} catch(Exception e) {
System.out.println(e);
}
}

then u can call the img or sth else ,it is very easy.
bluesky35 2004-08-25
  • 打赏
  • 举报
回复
可以通过java的io直接将数据导出到文件
cqm2099 2004-08-25
  • 打赏
  • 举报
回复
如何编写IO的程序呢?
望给出一些例程
seasonwinds 2004-08-24
  • 打赏
  • 举报
回复
我要一份,3q
mslf_dcb@hotmail.com
cqm2099 2004-08-23
  • 打赏
  • 举报
回复
高手哪去了???
cqm2099 2004-08-18
  • 打赏
  • 举报
回复
JAVA高手们有话请讲,分不够可以再加帖给分,我将尽快结帖!
zhufanamo 2004-08-16
  • 打赏
  • 举报
回复
真的是太长了,也看不明白


up一下
cqm2099 2004-08-14
  • 打赏
  • 举报
回复
JAVA高手们有话请讲,分不够可以再加帖给分,我将尽快结帖!
朋友别哭 2004-08-11
  • 打赏
  • 举报
回复
up
cqm2099 2004-08-11
  • 打赏
  • 举报
回复
除非授权?
请问如何才能获得授权?
本地文件系统又如何与Applet交互?还望能给予一定的解释。。
moke33 2004-08-11
  • 打赏
  • 举报
回复
Applet不可以和本地文件系统交互,除非授权
askgwf2004 2004-08-11
  • 打赏
  • 举报
回复
guanwenfang@RoyalStone.com.cn 给我一份看看.
cqm2099 2004-08-11
  • 打赏
  • 举报
回复
还有,,实在是太长了,有兴趣的话可留下E-mail,来者必复!
加载更多回复(2)

50,503

社区成员

发帖
与我相关
我的任务
社区描述
Java相关技术讨论
javaspring bootspring cloud 技术论坛(原bbs)
社区管理员
  • Java相关社区
  • 小虚竹
  • 谙忆
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧