package Frame;
|
import java.awt.BorderLayout;
|
import java.awt.Color;
|
import java.awt.Container;
|
import java.awt.Dimension;
|
import java.awt.Font;
|
import java.awt.Toolkit;
|
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionListener;
|
import java.awt.event.MouseEvent;
|
import java.awt.event.MouseListener;
|
import java.awt.event.WindowEvent;
|
import java.awt.event.WindowListener;
|
import java.util.Iterator;
|
import java.util.Vector;
|
import javax.swing.Box;
|
import javax.swing.ComboBoxModel;
|
import javax.swing.DefaultComboBoxModel;
|
import javax.swing.ImageIcon;
|
import javax.swing.JComboBox;
|
import javax.swing.JDialog;
|
import javax.swing.JPanel;
|
import javax.swing.JScrollPane;
|
import javax.swing.JTable;
|
import javax.swing.JTextArea;
|
import javax.swing.JTextField;
|
import javax.swing.event.InternalFrameEvent;
|
import javax.swing.event.InternalFrameListener;
|
import javax.swing.table.DefaultTableModel;
|
import BaoWen.Urt_7000_port;
|
import ColorAndFont.ChooseFont;
|
import ColorAndFont.NothJPanel;
|
import ColorAndFont.UIColor;
|
import Judge.JugeNumber;
|
import PbuliClass.JButtonModel;
|
import PbuliClass.JCheckBoxModel;
|
import PbuliClass.JlableModel;
|
import PbuliClass.ShowMessage;
|
import PbuliClass.Systems;
|
import PbuliClass.greateTables;
|
import PbuliClass.jinternalFrame;
|
import home.ChuShiHua;
|
import person.Person;
|
import person.person_Dell;
|
import tbDataModel.Tb_gps;
|
import urt.Control_urt;
|
import urt.Dell_gps;
|
import urt.lowgpscontral;
|
public class UtrSet extends jinternalFrame {
|
/**
|
*
|
*/
|
private static final long serialVersionUID = 1L;
|
NothJPanel northPanel=null;//Ãæ°å
|
NothJPanel northPanel1=null;//Ãæ°å
|
JButtonModel Shuaxing=null;//Ë¢ÐÂ
|
JButtonModel Send=null;//·¢ËÍ
|
JButtonModel Jbt_moreset=null;//·äÃù
|
JButtonModel Jbt_all=null;//·¢ËÍ
|
JButtonModel Jbt_updata=null;//Éý¼¶
|
JButtonModel Jbt_serch=null;//ËÑË÷
|
JButtonModel Jbt_openclose_uwb=null;//¿ØÖÆUWB¿ª¹Ø¹¦ÄÜ
|
JScrollPane gd=null;//¹ö¶¯Ãæ°å
|
JTable table=null;//ÉêÃ÷±í¸ñ
|
JTextField sendFile=null;//·¢ËÍÎı¾¿ò
|
JTextField endFile=null;//·¢ËÍÎı¾¿ò
|
|
//JlableModel Jl_bb=new JlableModel("±êÇ©Çø¼ä:");//²ã
|
JlableModel Jl_bb=new JlableModel("Éý¼¶°æ±¾:");//ÒªÉý¼¶µÄ¹Ì¼þ°æ±¾ 2023.07.21 zsh
|
JTextField Jt_tagids=null;//·¢ËÍÎı¾¿ò
|
JTextField Jt_banben=null;//·¢ËÍÎı¾¿ò
|
JTextField Jt_serch=null;
|
|
DefaultTableModel tableModel=null;//ÉùÃ÷±í¸ñÄ£ÐÍ
|
more_set_dialog moredialog=null;
|
boolean all=false;
|
JCheckBoxModel Jc_set=null;
|
JCheckBoxModel Jc_up=null;
|
JButtonModel jbt_clear=null;
|
|
//¿ªÆô×Ô¶¯Éý¼¶Ä£Ê½
|
static boolean updataurt=false;
|
static int tagid1=0;
|
static int tagid2=0;
|
static String version="0";
|
static String uptex="";
|
static boolean mosetisopen=false;
|
|
static String versionname="";
|
|
public UtrSet() {//¹¹Ôì·½·¨
|
String title="URTÅäÖÃ";
|
if(Systems.sys().getLanguage().equals("English")) {
|
title="URT SET";
|
}
|
this.setTitle(title);
|
Container rq=getContentPane();//»ñÈ¡ÈÝÆ÷
|
rq.setLayout(new BorderLayout());
|
rq.setBackground(Color.white);
|
rq.add(getGd(),BorderLayout.CENTER);
|
rq.add(getNorthPanel(),BorderLayout.SOUTH);
|
rq.add(getNorthPanel1(),BorderLayout.NORTH);
|
this.setFrameIcon(new ImageIcon("image/icon/gpsm.png"));//ÉèÖô°Ìåͼ±ê
|
this.addInternalFrameListener(new InternalFrameListener() {
|
public void internalFrameOpened(InternalFrameEvent e) {
|
}
|
|
public void internalFrameIconified(InternalFrameEvent e) {
|
|
}
|
|
public void internalFrameDeiconified(InternalFrameEvent e) {
|
|
}
|
|
public void internalFrameDeactivated(InternalFrameEvent e) {
|
}
|
|
public void internalFrameClosing(InternalFrameEvent e) {
|
|
}
|
|
public void internalFrameClosed(InternalFrameEvent e) {
|
updataurt=false;
|
}
|
|
public void internalFrameActivated(InternalFrameEvent e) {
|
|
}
|
});
|
this.setBounds(175, 0, 1000,500);
|
|
}
|
|
|
public NothJPanel getNorthPanel() {
|
if(northPanel==null) {
|
northPanel=new NothJPanel();
|
Box topicBox = Box.createHorizontalBox();// ´´½¨Ò»¸öˮƽÏäÈÝÆ÷
|
topicBox.add(Box.createHorizontalStrut(20));// Ìí¼ÓÒ»¸ö3ÏñËØ¿íµÄˮƽ֧Öù
|
topicBox.add(getSendFile() );//Ìí¼ÓËÑË÷Îı¾¿ò
|
topicBox.add(Box.createHorizontalStrut(5));// Ìí¼ÓÒ»¸ö3ÏñËØ¿íµÄˮƽ֧Öù
|
topicBox.add(getEndFile());
|
topicBox.add(Box.createHorizontalStrut(10));
|
topicBox.add(getSend());//Ìí¼ÓËÑË÷Îı¾¿ò
|
northPanel.add(topicBox);
|
northPanel.setBackground(UIColor.getNorth_color());
|
|
}
|
return northPanel;
|
}
|
|
|
public JButtonModel getShuaxing() {
|
if(Shuaxing==null) {
|
Shuaxing=new JButtonModel("Ë¢ÐÂ");
|
Shuaxing.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent e) {
|
updateTable(Dell_gps.getGps_vector());
|
}
|
});
|
}
|
return Shuaxing;
|
}
|
|
/**ˢбí¸ñ·½·¨*/
|
public void updateTable(Vector<Tb_gps> a) {
|
if(tableModel !=null) {
|
tableModel.getDataVector().clear();
|
getRowData(a);
|
gd.validate();
|
}
|
}
|
|
public JButtonModel getSend() {
|
if(Send==null) {
|
Send=new JButtonModel("·¢ËÍ");
|
Send.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent e) {
|
if(all) {
|
int selectedRows=table.getRowCount();//±»Ñ¡ÖÐÐеÄË÷Òý¼¯ºÏ
|
if(selectedRows !=0) {
|
for(int i=0;i<selectedRows;i++){
|
String ID=(String)table.getValueAt(i,0);
|
String port=(String)table.getValueAt(i,3);
|
String ip=(String)table.getValueAt(i, 2);
|
if(Jc_up.isSelected() && !Jc_set.isSelected()) {
|
sendFile.setText("$update,"+ID+",");
|
}
|
|
if(!Jc_up.isSelected() && Jc_set.isSelected()) {
|
sendFile.setText("$config,"+ID+",");
|
}
|
|
|
String data=sendFile.getText().trim()+endFile.getText().trim();
|
int size=data.getBytes().length;
|
if(port !=null) {
|
if(size !=0 && JugeNumber.isDigit(port)) {
|
Urt_7000_port.udp_out(data.getBytes(),size, ip, port,ID,data);
|
ShowMessage.zidingyi(ip+":"+port+"ÐÅÏ¢ÒÑ·¢ËÍ...");
|
}
|
}
|
}
|
}else {
|
ShowMessage.zidingyi("µ±Ç°ÐÐÊýΪ0...");
|
return;
|
}
|
}else {
|
int[] selectedRows=table.getSelectedRows();//±»Ñ¡ÖÐÐеÄË÷Òý¼¯ºÏ
|
if(selectedRows.length !=0) {
|
for(int i=0;i<selectedRows.length;i++){
|
String ID=(String)table.getValueAt(selectedRows[i],0);
|
String port=(String)table.getValueAt(selectedRows[i], 3);
|
String ip=(String)table.getValueAt(selectedRows[i], 2);
|
|
if(Jc_up.isSelected() && !Jc_set.isSelected()) {
|
sendFile.setText("$update,"+ID+",");
|
}
|
|
if(!Jc_up.isSelected() && Jc_set.isSelected()) {
|
sendFile.setText("$config,"+ID+",");
|
}
|
|
String data=sendFile.getText().trim()+endFile.getText().trim();
|
int size=data.getBytes().length;
|
if(port !=null) {
|
if(size !=0 && JugeNumber.isDigit(port)) {
|
Urt_7000_port.udp_out(data.getBytes(),size, ip, port,ID,data);
|
ShowMessage.zidingyi(ip+":"+port+"ÐÅÏ¢ÒÑ·¢ËÍ...");
|
}
|
}
|
}
|
}else {
|
ShowMessage.zidingyi("ÇëÑ¡ÖÐÐèÒª´¦ÀíµÄÐÐ...");
|
return;
|
}
|
|
}
|
|
}
|
});
|
}
|
return Send;
|
}
|
|
|
@SuppressWarnings({ "serial", "rawtypes" })
|
public JTable getTable() {
|
if(table==null) {
|
String name1="񅧏";
|
String name2="°æ±¾";
|
String name3="µØÖ·";
|
String name4="¶Ë¿Ú";
|
String name5="ʱ¼ä";
|
|
String[] columnNames= {name1,name2,name3,name4,name5};//±í¸ñÁÐÃû
|
//Ìí¼Ó±í¸ñÁÐÏòÁ¿
|
Vector<String> columnName=new Vector<>();
|
for(int i=0;i<columnNames.length;i++){
|
columnName.add(columnNames[i]);
|
}
|
Vector rowData=new Vector();
|
greateTables tables=new greateTables();
|
tableModel=new DefaultTableModel(rowData, columnName){ // ʵÏÖÈÃÕû¸ö±í¸ñ²»²»ÔÊÐí±»±à¼
|
public boolean isCellEditable(int row,int column){
|
return false;
|
}
|
};
|
table=tables.getTable(tableModel);
|
getRowData(Dell_gps.getGps_vector());
|
//¸ø±í¸ñÌí¼Ó¼àÌýʼþ
|
//¸øtable¼ÓÉÏÒ»¸öÊó±êʼþ¼àÌýÆ÷¶ÔÏó
|
table.addMouseListener(new MouseListener() {
|
public void mouseReleased(MouseEvent e) {
|
// TODO ×Ô¶¯Éú³ÉµÄ·½·¨´æ¸ù
|
int rows=table.getSelectedRowCount();
|
if(rows>1) {
|
sendFile.setText("ÒÑÑ¡ÖÐ"+rows+"ÐÐ");
|
}
|
}
|
|
@Override
|
public void mousePressed(MouseEvent e) {
|
// TODO ×Ô¶¯Éú³ÉµÄ·½·¨´æ¸ù
|
|
}
|
|
@Override
|
public void mouseExited(MouseEvent e) {
|
// TODO ×Ô¶¯Éú³ÉµÄ·½·¨´æ¸ù
|
|
}
|
|
@Override
|
public void mouseEntered(MouseEvent e) {
|
// TODO ×Ô¶¯Éú³ÉµÄ·½·¨´æ¸ù
|
|
}
|
|
@Override
|
public void mouseClicked(MouseEvent e) {
|
|
int row=table.getSelectedRow();
|
int rows=table.getSelectedRowCount();
|
if(row<0) {
|
ShowMessage.zidingyi("µ±Ç°Ñ¡ÖÐÐÐΪ£º"+row);
|
return;
|
}
|
|
if(rows ==1) {
|
String ID=(String) table.getValueAt(row,0);
|
if(Jc_up.isSelected()) {
|
sendFile.setText("$update,"+ID+",");
|
}else {
|
sendFile.setText("$config,"+ID+",");
|
}
|
}else {
|
ShowMessage.zidingyi("µ±Ç°Ñ¡ÖжàÐÐ");
|
}
|
|
|
}
|
});
|
|
}
|
return table;
|
}
|
|
public JScrollPane getGd() {
|
gd=new JScrollPane(getTable());
|
gd.getViewport().setBackground(UIColor.getNorth_color());
|
return gd;
|
}
|
|
|
/**Ìí¼Ó±í¸ñÐÐÏòÁ¿Êý¾Ý·½·¨*/
|
@SuppressWarnings({ "unchecked", "rawtypes" })
|
public void getRowData(Vector<Tb_gps> list ) {
|
Iterator<Tb_gps> iterator = list.iterator();//´´½¨µü´úÆ÷
|
while (iterator.hasNext()) {//µü´úÆ÷´æÔÚÔªËØ
|
Tb_gps tag = iterator.next();//½«µü´úÆ÷ÀïÃæµÄÔªËØ¸øµ½info¼¯ºÏ
|
Vector row = new Vector();
|
//"ÐòºÅ","É豸±àºÅ","γ¶È","¾¶È","GPS״̬","ÎÀÐÇÊý","º£°Î¸ß","²î·ÖÕ¾ID","µçÁ¿","¸üÐÂʱ¼ä"
|
row.add(tag.getTagid());
|
row.add(tag.getVersion());
|
row.add(tag.getIp());
|
row.add(tag.getPort());
|
row.add(tag.getAddtime());
|
tableModel.addRow(row);// Ïò±í¸ñ¶ÔÏóÌí¼ÓÐÐÊý¾Ý
|
}
|
|
}
|
|
|
public JTextField getSendFile() {
|
if(sendFile==null) {
|
sendFile=new JTextField(10);
|
sendFile.setFont(ChooseFont.getFont(14));
|
}
|
return sendFile;
|
}
|
|
|
public JButtonModel getJbt_all() {
|
if(Jbt_all==null) {
|
Jbt_all=new JButtonModel("È«²¿Ñ¡ÖÐ");
|
Jbt_all.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent e) {
|
if(all) {
|
Jbt_all.setBackground(UIColor.getButton_color());
|
all=false;
|
}else {
|
all=true;
|
Jbt_all.setBackground(Color.gray);
|
int a=table.getRowCount();
|
sendFile.setText("Ñ¡ÖÐËùÓÐ"+a+"ÐÐ");
|
}
|
|
}
|
});
|
}
|
return Jbt_all;
|
}
|
|
|
public NothJPanel getNorthPanel1() {
|
if(northPanel1==null) {
|
northPanel1=new NothJPanel();
|
Box topicBox = Box.createHorizontalBox();// ´´½¨Ò»¸öˮƽÏäÈÝÆ÷
|
|
topicBox.add(getJt_serch());
|
topicBox.add(Box.createHorizontalStrut(3));
|
topicBox.add(getJbt_serch());
|
topicBox.add(Box.createHorizontalStrut(10));
|
topicBox.add(getJc_set());
|
topicBox.add(Box.createHorizontalStrut(10));
|
topicBox.add(getJc_up());
|
topicBox.add(Box.createHorizontalStrut(10));
|
topicBox.add(Jl_bb);
|
topicBox.add(Box.createHorizontalStrut(4));
|
topicBox.add(getJt_tagids());
|
topicBox.add(Box.createHorizontalStrut(30));
|
topicBox.add(getJbt_updata());
|
topicBox.add(Box.createHorizontalStrut(10));
|
topicBox.add(getJbt_all());
|
topicBox.add(Box.createHorizontalStrut(10));
|
topicBox.add(getShuaxing());//Ìí¼ÓËÑË÷Îı¾¿ò
|
topicBox.add(Box.createHorizontalStrut(10));
|
topicBox.add(getJbt_moreset());
|
topicBox.add(Box.createHorizontalStrut(10));
|
northPanel1.add(topicBox);
|
northPanel1.setBackground(UIColor.getNorth_color());
|
}
|
return northPanel1;
|
}
|
|
|
public JCheckBoxModel getJc_set() {
|
if(Jc_set==null) {
|
Jc_set=new JCheckBoxModel("²ÎÊýÉèÖÃ","0");
|
Jc_set.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent e) {
|
if(Jc_set.isSelected() && !Jc_up.isSelected()) {
|
endFile.setText("GPSƵÂÊ,·þÎñÆ÷µØÖ·,¶Ë¿Ú");
|
}else {
|
endFile.setText("");
|
}
|
}
|
});
|
}
|
return Jc_set;
|
}
|
|
|
public JCheckBoxModel getJc_up() {
|
if(Jc_up==null) {
|
Jc_up=new JCheckBoxModel("¹Ì¼þÉý¼¶","0");
|
Jc_up.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent e) {
|
if(Jc_up.isSelected() && !Jc_set.isSelected()) {
|
endFile.setText("http://39.106.210.13:8080/hfs/Ìæ»»ÐèÒªµÄ¹Ì¼þ,V2021051001");
|
}else {
|
endFile.setText("");
|
}
|
}
|
});
|
}
|
return Jc_up;
|
}
|
|
|
public JTextField getEndFile() {
|
if(endFile==null) {
|
endFile=new JTextField(50);
|
endFile.setFont(ChooseFont.getFont(14));
|
}
|
return endFile;
|
}
|
|
|
public JButtonModel getJbt_moreset() {
|
if(Jbt_moreset==null) {
|
Jbt_moreset=new JButtonModel("ÉèÖÃ");
|
Jbt_moreset.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent e) {
|
if(moredialog==null) {
|
moredialog=new more_set_dialog("±êÇ©ÆäËûÉèÖÃ");
|
ChuShiHua.setSucc(1);
|
}
|
|
}
|
});
|
}
|
return Jbt_moreset;
|
}
|
|
|
/**¸ü¶àÉèÖöԻ°¿ò*/
|
class more_set_dialog extends JDialog implements WindowListener{
|
|
/**
|
*
|
*/
|
private static final long serialVersionUID = 1L;
|
|
|
JPanel mb=null;//ÉêÃ÷Ò»¸öÃæ°å
|
JlableModel jl_choosetag=new JlableModel ("Ñ¡Ôñ±êÇ©:");
|
JlableModel jl_fengming=new JlableModel ("ʱ¼äÃë:");
|
JlableModel jl_pinglv=new JlableModel ("ÐÞ¸ÄÆµÂÊ:");
|
JlableModel jl_dingwei=new JlableModel ("Á¬Ðø¶¨Î»:");
|
JlableModel jl_version=new JlableModel ("»ñÈ¡°æ±¾:");
|
JlableModel jl_fond=new JlableModel ("ѰÕÒÖÕ¶Ë:");
|
JlableModel jl_uwbenable=new JlableModel ("¿ª¹ØUWB:");
|
|
|
JTextField jf_fengming=new JTextField("10");
|
JTextField jf_pinglv=new JTextField("60");
|
JTextField jf_dingwei=new JTextField("180");
|
JTextField jf_version=new JTextField("");
|
JTextField jf_fond=new JTextField("60");
|
|
JButtonModel jbt_fengming=null;//·äÃù
|
JButtonModel jbt_pinglv=null;//ÐÞ¸ÄÆµÂÊ
|
JButtonModel jbt_dingwei=null;//Á¬Ðø¶¨Î»
|
JButtonModel jbt_version=null;//»ñÈ¡°æ±¾
|
JButtonModel jbt_fond=null;//ѰÕÒÉ豸
|
JScrollPane gd2=null;
|
JTextArea textArea;
|
|
JComboBox<String> tagAll=null;//ËùÓбêÇ©µÄ¼¯ºÏ
|
JComboBox<String> jcom_uwbenabe=null;//¿ª¹Ø±êÇ©¼¯ºÏ
|
String tagchoose="ËùÓбêÇ©";
|
|
|
|
/**»ñÈ¡¶Ô»°¿ò·½·¨*/
|
public more_set_dialog(String title) {
|
super();
|
//this.setModal(true);//´°Ìå×èÈû
|
this.setAlwaysOnTop(true);//×ÜÊÇÖö¥
|
this.setTitle(title);
|
Toolkit toolkit = getToolkit();// »ñµÃ´°Ì幤¾ß°ü
|
Dimension screenSize = toolkit.getScreenSize();// »ñÈ¡ÆÁÄ»´óС
|
int width = (int) (screenSize.width);// ¼ÆËã´°Ìåпí¶È
|
int height = (int) (screenSize.height);// ¼ÆËã´°Ìåпí¶È
|
int w=780;
|
int h=450;
|
int x0=(width-w)/2;//´°Ìåx0×ø±ê
|
int y0=(height-h)/2;//´°Ìåy0×ø±ê
|
Container rq=getContentPane();
|
rq.add(getMb());
|
this.setBounds(x0, y0,w ,h);
|
this.setVisible(true);
|
this.addWindowListener((WindowListener) this);
|
this.setIconImage(new ImageIcon("image/icon/tagicon.png").getImage());
|
mosetisopen=true;
|
|
}
|
|
/**¹Ø±Õ¶Ô»°¿ò·½·¨*/
|
public void closeTagDialog() {
|
this.dispose();
|
moredialog=null;
|
|
}
|
public JTextArea get_text_area() {
|
if(textArea==null) {
|
textArea=new JTextArea(10,10);
|
textArea.setBackground(UIColor.getNorth_color());
|
textArea.setForeground(UIColor.getTable_font());
|
textArea.setFont(ChooseFont.getFont(13));
|
}
|
return textArea;
|
}
|
|
/**»ñÈ¡¹ö¶¯Ãæ°å*/
|
public JScrollPane getGd2() {
|
if(gd2==null) {
|
gd2=new JScrollPane(get_text_area());
|
}
|
return gd2;
|
}
|
|
|
public JButtonModel getJbt_clear() {
|
if(jbt_clear==null) {
|
jbt_clear=new JButtonModel("Çå¿Õ");
|
jbt_clear.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent e) {
|
textArea.setText("");
|
}
|
});
|
}
|
return jbt_clear;
|
}
|
|
|
/**»ñÈ¡Ãæ°å*/
|
public JPanel getMb() {
|
|
if(mb==null){
|
mb=new JPanel();
|
mb.setLayout(null);
|
mb.add(jl_choosetag);
|
mb.add(getTagAll());
|
mb.add(jl_fengming);
|
mb.add(jf_fengming);
|
mb.add(getJbt_fengming());
|
mb.add(getJbt_pinglv());
|
mb.add(jl_pinglv);
|
mb.add(jf_pinglv);
|
mb.add(jl_dingwei);
|
mb.add(jf_dingwei);
|
mb.add(getJbt_dingwei());
|
mb.add(jl_version);
|
mb.add(jf_version);
|
mb.add(getJbt_version());
|
mb.add(getGd2());
|
mb.add(getJbt_clear());
|
mb.add(jl_fond);
|
mb.add(jf_fond);
|
mb.add(getJbt_fond());
|
mb.add(getjcom_uwbenabe());
|
mb.add(getJbt_openclose_uwb());
|
mb.add(jl_uwbenable);
|
|
int x=30;
|
int y=20;
|
int h=25;
|
int g=20;//ÊúÏò¼ä¸ô
|
|
//Ñ¡ÖбêÇ©
|
jl_choosetag.setBounds(x, y, 70,h);
|
getTagAll().setBounds(x+70,y, 250,h);
|
|
//¿ªÆôÐÝÃß
|
int y2=y+1*(h+g);
|
jl_fengming.setBounds(x,y2,70,h);
|
jf_fengming.setBounds(x+70,y2,130,h);
|
getJbt_fengming().setBounds(x+210,y2,110,h);
|
|
//ÐÞ¸ÄÆµÂÊ
|
int y3=y+2*(h+g);
|
jl_pinglv.setBounds(x,y3,70,h);
|
jf_pinglv.setBounds(x+70,y3,130,h);
|
jbt_pinglv.setBounds(x+210,y3,110,h);
|
|
//Á¬Ðø¶¨Î»
|
int y4=y+3*(h+g);
|
jl_dingwei.setBounds(x,y4,70,h);
|
jf_dingwei.setBounds(x+70,y4,130,h);
|
jbt_dingwei.setBounds(x+210,y4,110,h);
|
|
//»ñÈ¡°æ±¾ºÅ
|
int y5=y+4*(h+g);
|
jl_version.setBounds(x,y5,70,h);
|
jf_version.setBounds(x+70,y5,130,h);
|
jbt_version.setBounds(x+210,y5,110,h);
|
|
//ѰÕÒÉ豸
|
int y6=y+5*(h+g);
|
jl_fond.setBounds(x,y6,70,h);
|
jf_fond.setBounds(x+70,y6,130,h);
|
jbt_fond.setBounds(x+210,y6,110,h);
|
|
//¿ª¹ØUWB
|
int y7=y+6*(h+g);
|
jl_uwbenable.setBounds(x,y7,70,h);
|
jcom_uwbenabe.setBounds(x+70,y7,130,h);
|
Jbt_openclose_uwb.setBounds(x+210,y7,110,h);
|
|
//Îı¾ÏÔʾ¿ò
|
gd2.setBounds(x+340,y,350,330);
|
jbt_clear.setBounds(x+340,y+340,350,h);
|
|
}
|
|
return mb;
|
}
|
//¿ª¹ØUWBÏÂÀ¿ò
|
public JComboBox<String> getjcom_uwbenabe() {
|
if(jcom_uwbenabe==null) {
|
jcom_uwbenabe=new JComboBox<String>() ;
|
jcom_uwbenabe.setFont(new Font("΢ÈíÑźÚ", Font.PLAIN, 12));//ÉèÖÃ×ÖÌå
|
String[] a1= {"¿ªÆô","¹Ø±Õ"};
|
ComboBoxModel<String > coModel=new DefaultComboBoxModel<>(a1);//ÏÂÀÁбíÄ£ÐÍ
|
jcom_uwbenabe.setModel(coModel);
|
//ÏÂÀ¿ò¿ÉÒÔÊäÈë
|
jcom_uwbenabe.setEditable(true);
|
}
|
return jcom_uwbenabe;
|
}
|
|
//Ñ¡Ôñ±êÇ©ÏÂÀ¿ò
|
public JComboBox<String> getTagAll() {
|
if(tagAll==null) {
|
tagAll=new JComboBox<String>() ;
|
tagAll.setFont(new Font("΢ÈíÑźÚ", Font.PLAIN, 12));//ÉèÖÃ×ÖÌå
|
ComboBoxModel<String > coModel=new DefaultComboBoxModel<>(Dell_gps.gpstagids());//ÏÂÀÁбíÄ£ÐÍ
|
tagAll.setModel(coModel);
|
//ÏÂÀ¿ò¿ÉÒÔÊäÈë
|
tagAll.setEditable(true);
|
tagAll.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent e) {
|
if(tagAll.getSelectedIndex() ==0) {
|
tagchoose="ËùÓÐÖÕ¶Ë";
|
}else {
|
tagchoose=(String) tagAll.getSelectedItem();
|
Tb_gps gps=Dell_gps.get_tb_gps(tagchoose);
|
jf_version.setText(gps.getVersion());
|
}
|
}
|
});
|
}
|
return tagAll;
|
}
|
|
//¿ØÖÆUWB¿ª¹Ø
|
public JButtonModel getJbt_openclose_uwb() {
|
if(Jbt_openclose_uwb==null) {
|
Jbt_openclose_uwb=new JButtonModel("¿ª¹ØUWB");
|
Jbt_openclose_uwb.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent e) {
|
String uwbendable=(String) jcom_uwbenabe.getSelectedItem();
|
String enable="1";
|
if(uwbendable.equals("¹Ø±Õ")) {
|
enable="0";
|
}
|
|
if(tagchoose.equals("ËùÓÐÖÕ¶Ë")) {
|
Control_urt.all_open_or_close_uwb(enable);
|
textArea.setText("ËùÓÐÉ豸UWB¿ª¹ØÐÅÏ¢ÒÑÏ·¢:"+enable);
|
}else {
|
Tb_gps tg=Dell_gps.get_tb_gps(tagchoose);
|
if(tg !=null) {
|
String port=tg.getPort();
|
if(port==null) {
|
textArea.setText(tg.getTagid()+"ÖÕ¶ËδÉÏÏß");
|
return;
|
}else{
|
String tagid=tg.getTagid();
|
Person person=person_Dell.get_Person(tagid);
|
Control_urt.open_or_close_uwb(person,tagid, enable);
|
textArea.setText(tagid+"¿ª¹ØUWBÖ¸ÁîÒÑÏ·¢:"+enable);
|
}
|
}
|
}
|
}
|
});
|
}
|
return Jbt_openclose_uwb;
|
}
|
|
|
public JButtonModel getJbt_fengming() {
|
if(jbt_fengming==null) {
|
jbt_fengming=new JButtonModel("·äÃù¿ØÖÆ");
|
jbt_fengming.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent e) {
|
String time=jf_fengming.getText().trim();
|
if(time.equals("")) {
|
textArea.setText("·äÃùʱ¼ä²»ÄÜΪ¿Õ");
|
return;
|
}
|
|
if(tagchoose.equals("ËùÓÐÖÕ¶Ë")) {
|
Control_urt.all_beeiper(time);
|
textArea.setText("ËùÓÐÉ豸·äÃù¿ØÖÆÐÅÏ¢ÒÑÏ·¢:"+time);
|
}else {
|
Tb_gps tg=Dell_gps.get_tb_gps(tagchoose);
|
if(tg !=null) {
|
String port=tg.getPort();
|
if(port==null) {
|
textArea.setText(tg.getTagid()+"ÖÕ¶ËδÉÏÏß");
|
return;
|
}else{
|
String tagid=tg.getTagid();
|
String ip=tg.getIp();
|
Control_urt.beeper(ip, port,tagid, time,1);
|
textArea.setText(tagid+"·äÃù¿ØÖÆÐÅÏ¢ÒÑÏ·¢:"+time);
|
}
|
}
|
}
|
}
|
});
|
}
|
return jbt_fengming;
|
}
|
|
/**ÐÞ¸ÄÆµÂʰ´Å¥*/
|
public JButtonModel getJbt_pinglv() {
|
if(jbt_pinglv==null) {
|
jbt_pinglv=new JButtonModel("ÐÞ¸ÄÆµÂÊ");
|
jbt_pinglv.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent e) {
|
String tagid=tagchoose;
|
if(tagid.length()>6) {
|
String hz=jf_pinglv.getText().trim();
|
if(tagchoose.equals("ËùÓÐÖÕ¶Ë")) {
|
lowgpscontral.all_hz(hz);
|
textArea.setText(tagid+"ÐÞ¸ÄÆµÂÊÖ¸ÁîÒÑÏ·¢:"+hz);
|
}else {
|
lowgpscontral.alert_hz(tagid, hz);
|
textArea.setText(tagid+"ÐÞ¸ÄÆµÂÊÖ¸ÁîÒÑÏ·¢:"+hz);
|
}
|
}
|
}
|
});
|
}
|
return jbt_pinglv;
|
}
|
|
/**Á¬Ðø¶¨Î»°´¼ü*/
|
public JButtonModel getJbt_dingwei() {
|
if(jbt_dingwei==null) {
|
jbt_dingwei=new JButtonModel("¿ªÊ¼¶¨Î»");
|
jbt_dingwei.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent e) {
|
String tagid=tagchoose;
|
if(tagid.length()>6) {
|
lowgpscontral.lianxu_dingwei(tagid);
|
textArea.setText(tagid+"¿ªÊ¼¶¨Î»Ö¸ÁîÒÑÏ·¢");
|
}
|
}
|
});
|
}
|
return jbt_dingwei;
|
}
|
|
/**»ñÈ¡°æ±¾ºÅ*/
|
public JButtonModel getJbt_version() {
|
if(jbt_version==null) {
|
jbt_version=new JButtonModel("»ñÈ¡°æ±¾ºÅ");
|
jbt_version.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent e) {
|
String tagid=tagchoose;
|
if(tagid.length()>6) {
|
lowgpscontral.serch_version(tagid);
|
textArea.setText(tagid+"»ñÈ¡°æ±¾ºÅÖ¸ÁîÒÑÏ·¢");
|
}
|
}
|
});
|
}
|
return jbt_version;
|
}
|
|
/**ѰÕÒÉ豸*/
|
public JButtonModel getJbt_fond() {
|
if(jbt_fond==null) {
|
jbt_fond=new JButtonModel("ѰÕÒÉ豸");
|
jbt_fond.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent e) {
|
String tagid=tagchoose;
|
if(tagid.length()>6) {
|
lowgpscontral.fond_gps(tagid);
|
textArea.setText(tagid+"ѰÕÒÉ豸ָÁîÒÑÏ·¢");
|
}
|
}
|
});
|
}
|
return jbt_fond;
|
}
|
|
@Override
|
public void windowOpened(WindowEvent e) {
|
// TODO ×Ô¶¯Éú³ÉµÄ·½·¨´æ¸ù
|
|
}
|
|
@Override
|
public void windowClosing(WindowEvent e) {
|
// TODO ×Ô¶¯Éú³ÉµÄ·½·¨´æ¸ù
|
moredialog=null;
|
mosetisopen=false;
|
|
}
|
|
@Override
|
public void windowClosed(WindowEvent e) {
|
|
}
|
|
@Override
|
public void windowIconified(WindowEvent e) {
|
// TODO ×Ô¶¯Éú³ÉµÄ·½·¨´æ¸ù
|
|
}
|
|
@Override
|
public void windowDeiconified(WindowEvent e) {
|
// TODO ×Ô¶¯Éú³ÉµÄ·½·¨´æ¸ù
|
|
}
|
|
@Override
|
public void windowActivated(WindowEvent e) {
|
// TODO ×Ô¶¯Éú³ÉµÄ·½·¨´æ¸ù
|
|
}
|
|
@Override
|
public void windowDeactivated(WindowEvent e) {
|
// TODO ×Ô¶¯Éú³ÉµÄ·½·¨´æ¸ù
|
|
}
|
|
}
|
|
|
//ÐÞ¸Ä×Ô¶¯Éý¼¶Âß¼ 2023.07.21 zsh
|
public JButtonModel getJbt_updata() {
|
if(Jbt_updata==null) {
|
Jbt_updata=new JButtonModel("×Ô¶¯Éý¼¶");
|
Jbt_updata.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent e) {
|
if(updataurt) {
|
updataurt=false;
|
Jbt_updata.setText(" ×Ô¶¯Éý¼¶ ");
|
Jbt_updata.setBackground(UIColor.getButton_color());//Éý¼¶Ä£Ê½Ï°´Å¥ÑÕɫΪÂÌÉ« 2023.07.21 zsh
|
}else {
|
String tagids=Jt_tagids.getText().trim();
|
if(tagids.equals("")) {
|
ShowMessage.zidingyi(tagids+"ÊäÈëµÄ°æ±¾ÐÅÏ¢´íÎó"); //2023.07.21 zsh
|
return;
|
}
|
if(tagids.equals("°æ±¾ºÅ;¹Ì¼þÃû³Æ")) {
|
ShowMessage.zidingyi(tagids+"ÊäÈëµÄ°æ±¾ÐÅÏ¢´íÎó"); //2023.07.21 zsh
|
return;
|
}
|
String[] split = tagids.split(";");
|
if (split.length<2){
|
ShowMessage.zidingyi(tagids+":ÊäÈë¸ñʽÓÐÎó,ÕýÈ·¸ñʽ: ÒªÉý¼¶µÄ°æ±¾ºÅ;ÒªÉý¼¶µÄ¹Ì¼þÃû³Æ");
|
return;
|
}
|
version=split[0];//ÒªÉý¼¶µÄ°æ±¾ºÅ
|
versionname=split[1];//ÒªÉý¼¶µÄ¹Ì¼þÃû³Æ
|
updataurt=true;
|
Jbt_updata.setText(" ¹Ø±ÕÉý¼¶ ");
|
Jbt_updata.setBackground(Color.red);
|
|
}
|
|
}
|
});
|
|
}
|
return Jbt_updata;
|
}
|
|
|
public JTextField getJt_tagids() {
|
if(Jt_tagids==null) {
|
Jt_tagids=new JTextField(20);
|
Jt_tagids.setText("°æ±¾ºÅ;¹Ì¼þÃû³Æ");
|
}
|
return Jt_tagids;
|
}
|
|
|
public static boolean isUpdataurt() {
|
return updataurt;
|
}
|
|
|
public static int getTagid1() {
|
return tagid1;
|
}
|
|
|
public static int getTagid2() {
|
return tagid2;
|
}
|
|
|
|
|
|
public static String getVersion() {
|
return version;
|
}
|
|
|
public JButtonModel getJbt_serch() {
|
if(Jbt_serch==null) {
|
Jbt_serch=new JButtonModel("ËÑË÷");
|
Jbt_serch.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent e) {
|
String tagid=Jt_serch.getText().trim();
|
if(tagid.length()<2) {
|
ShowMessage.zidingyi("ÇëÊäÈëÕýÈ·µÄÉ豸ID");
|
return;
|
}
|
updateTable(Dell_gps.serch(tagid));
|
}
|
});
|
}
|
return Jbt_serch;
|
}
|
|
|
|
public JTextField getJt_serch() {
|
if(Jt_serch==null) {
|
Jt_serch=new JTextField(6);
|
}
|
return Jt_serch;
|
}
|
|
|
public static boolean isMosetisopen() {
|
return mosetisopen;
|
}
|
|
|
public static void setMosetisoen(boolean mosetisoen) {
|
UtrSet.mosetisopen = mosetisoen;
|
}
|
|
|
public static String getVersionname() {
|
return versionname;
|
}
|
|
|
}
|