package com.motor.data;
|
|
import java.util.ArrayList;
|
import java.util.List;
|
|
import com.mchange.v1.util.Sublist;
|
import com.motor.alarm.Motor_Alarm;
|
|
public class Motor_inf {
|
|
public int motor_id; //µç»úid
|
public String motor_name; //µç»úÃû³Æ
|
public int motor_type; //µç»úÀàÐÍ
|
public String motor_ip; //µç»úip
|
public String note; //±¸ÓÃ
|
|
public Load_motor_state load_state; //¼ÓÔØµç»ú״̬
|
public Subject_motor_state subject_state; //ÊÜÊÔµç»ú״̬
|
|
public List<Motor_Alarm> alarms;
|
|
public Motor_inf(int motor_id) {
|
this.motor_id = motor_id;
|
alarms = new ArrayList<Motor_Alarm>();
|
load_state = new Load_motor_state(motor_id);
|
subject_state = new Subject_motor_state(motor_id);
|
}
|
|
public int getMotor_id() {
|
return motor_id;
|
}
|
public String getMotor_name() {
|
return motor_name;
|
}
|
public int getMotor_type() {
|
return motor_type;
|
}
|
public String getMotor_ip() {
|
return motor_ip;
|
}
|
public String getNote() {
|
return note;
|
}
|
public void setMotor_id(int motor_id) {
|
this.motor_id = motor_id;
|
}
|
public void setMotor_name(String motor_name) {
|
this.motor_name = motor_name;
|
}
|
public void setMotor_type(int motor_type) {
|
this.motor_type = motor_type;
|
}
|
public void setMotor_ip(String motor_ip) {
|
this.motor_ip = motor_ip;
|
}
|
public void setNote(String note) {
|
this.note = note;
|
}
|
|
/**
|
* »ñÈ¡µ±Ç°µç»ú¶ÔÏó
|
* @return
|
*/
|
public static Motor_inf getNowMotor(int motor_id,List<Motor_inf> motors) {
|
Motor_inf motor = null;
|
for(int i=0;i<motors.size();i++) {
|
if(motor_id == motors.get(i).motor_id) {
|
return motors.get(i);
|
}
|
}
|
return motor;
|
}
|
|
@Override
|
public String toString() {
|
return "Motor_inf [motor_id=" + motor_id + ", motor_name=" + motor_name + ", motor_type=" + motor_type
|
+ ", motor_ip=" + motor_ip + ", note=" + note + "]";
|
}
|
}
|