gengby
2 years ago
11 changed files with 1680 additions and 44 deletions
@ -0,0 +1,62 @@ |
|||
package org.nl.acs.device_driver.hailiang.hailiang_flat; |
|||
|
|||
import org.nl.acs.device.device_driver.standard_inspect.ItemDto; |
|||
import org.nl.acs.device_driver.DeviceDriver; |
|||
import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination; |
|||
import org.nl.acs.opc.Device; |
|||
import org.nl.acs.opc.DeviceType; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.LinkedList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 直管包装平板 |
|||
* |
|||
*/ |
|||
@Service |
|||
public class HailiangFlatDefination implements OpcDeviceDriverDefination { |
|||
@Override |
|||
public String getDriverCode() { |
|||
return "hailiang_flat"; |
|||
} |
|||
|
|||
@Override |
|||
public String getDriverName() { |
|||
return "海亮平板特殊驱动"; |
|||
} |
|||
|
|||
@Override |
|||
public String getDriverDescription() { |
|||
return "海亮平板特殊驱动"; |
|||
} |
|||
|
|||
@Override |
|||
public DeviceDriver getDriverInstance(Device device) { |
|||
return (new HailiangFlatDeviceDriver()).setDevice(device).setDriverDefination(this); |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public Class<? extends DeviceDriver> getDeviceDriverType() { |
|||
return HailiangFlatDeviceDriver.class; |
|||
} |
|||
|
|||
@Override |
|||
public List<DeviceType> getFitDeviceTypes() { |
|||
List<DeviceType> types = new LinkedList(); |
|||
types.add(DeviceType.station); |
|||
return types; |
|||
} |
|||
|
|||
@Override |
|||
public List<ItemDto> getReadableItemDtos() { |
|||
return ItemProtocol.getReadableItemDtos(); |
|||
} |
|||
|
|||
@Override |
|||
public List<ItemDto> getWriteableItemDtos() { |
|||
return ItemProtocol.getWriteableItemDtos(); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,250 @@ |
|||
package org.nl.acs.device_driver.hailiang.hailiang_flat; |
|||
|
|||
import lombok.Data; |
|||
import lombok.RequiredArgsConstructor; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.nl.acs.device.device_driver.standard_inspect.ReadUtil; |
|||
import org.nl.acs.device_driver.DeviceDriver; |
|||
import org.nl.acs.device_driver.RouteableDeviceDriver; |
|||
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; |
|||
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; |
|||
import org.nl.acs.opc.Device; |
|||
import org.openscada.opc.lib.da.Server; |
|||
|
|||
import java.util.*; |
|||
|
|||
/** |
|||
* 宏丰双工位RGV |
|||
*/ |
|||
@Slf4j |
|||
@Data |
|||
@RequiredArgsConstructor |
|||
public class HailiangFlatDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver { |
|||
protected ItemProtocol itemProtocol = new ItemProtocol(this); |
|||
|
|||
int is_auto = 0; |
|||
int is_running = 0; |
|||
int mode = 0; |
|||
int a_pressure = 0; |
|||
int b_pressure = 0; |
|||
int outer_diameter = 0; |
|||
int length = 0; |
|||
int wall_thickness = 0; |
|||
int color = 0; |
|||
int jackup_num = 0; |
|||
int strap_number = 0; |
|||
int start = 0; |
|||
int stop = 0; |
|||
int main_convey1 = 0; |
|||
int main_convey1_seat1 = 0; |
|||
int main_convey1_seat2 = 0; |
|||
int ink_jet = 0; |
|||
int ink_jet_seat1 = 0; |
|||
int ink_jet_seat2 = 0; |
|||
int ink_jet_seat3 = 0; |
|||
int main_convey2 = 0; |
|||
int main_convey2_seat1 = 0; |
|||
int main_convey3_has_pass = 0; |
|||
int main_convey3_has_noPass = 0; |
|||
int main_convey3_seat1 = 0; |
|||
int main_convey3_seat2 = 0; |
|||
int cowl_a_cache = 0; |
|||
int cowl_a_cache_seat1 = 0; |
|||
int cowl_a_cache_seat2 = 0; |
|||
int cowl_a_cowl = 0; |
|||
int cowl_a_cowl_seat1 = 0; |
|||
int cowl_a_cowl_seat2 = 0; |
|||
int cowl_a_cowl_pass = 0; |
|||
int reverse_convey = 0; |
|||
int reverse_convey_seat1 = 0; |
|||
int reverse_convey_seat2 = 0; |
|||
int reverse_convey_seat3 = 0; |
|||
int reverse_convey_pass = 0; |
|||
int cowl_b_cache = 0; |
|||
int cowl_b_cache_seat1 = 0; |
|||
int cowl_b_cache_seat2 = 0; |
|||
int cowl_b_cache_pass = 0; |
|||
int cowl_b_cowl = 0; |
|||
int cowl_b_cowl_seat1 = 0; |
|||
int cowl_b_cowl_seat2 = 0; |
|||
int cowl_b_cowl_aPass = 0; |
|||
int cowl_b_cowl_bPass = 0; |
|||
int no_pass_convey_cache_num = 0; |
|||
int wrap_ago = 0; |
|||
int wrap_ago_seat1 = 0; |
|||
int wrap_ago_seat2 = 0; |
|||
int wrap_after = 0; |
|||
int wrap_after_seat1 = 0; |
|||
int wrap_after_seat2 = 0; |
|||
int strapping_current_step = 0; |
|||
int strapping_seat1 = 0; |
|||
int strapping_seat2 = 0; |
|||
int strapping_seat3 = 0; |
|||
int strapping_seat4 = 0; |
|||
int strapping_seat5 = 0; |
|||
int strapping_seat6 = 0; |
|||
int strapping_seat7 = 0; |
|||
int strapping_seat8 = 0; |
|||
int strapping_seat9 = 0; |
|||
int strapping_seat10 = 0; |
|||
int strapping_seat11 = 0; |
|||
int strapping_seat12 = 0; |
|||
int a_error1_clear = 0; |
|||
int b_error1_clear = 0; |
|||
int a_error2_clear = 0; |
|||
int b_error2_clear = 0; |
|||
int wrap_control = 0; |
|||
int strapping_finish = 0; |
|||
int error_clear = 0; |
|||
|
|||
String device_code; |
|||
|
|||
|
|||
@Override |
|||
public Device getDevice() { |
|||
return this.device; |
|||
} |
|||
|
|||
|
|||
@Override |
|||
public void execute() throws Exception { |
|||
String message = null; |
|||
try { |
|||
device_code = this.getDeviceCode(); |
|||
//mode = this.itemProtocol.getMode();
|
|||
is_auto = this.itemProtocol.getis_auto(); |
|||
is_running = this.itemProtocol.getis_running(); |
|||
mode = this.itemProtocol.getmode(); |
|||
a_pressure = this.itemProtocol.geta_pressure(); |
|||
b_pressure = this.itemProtocol.getb_pressure(); |
|||
outer_diameter = this.itemProtocol.getouter_diameter(); |
|||
length = this.itemProtocol.getlength(); |
|||
wall_thickness = this.itemProtocol.getwall_thickness(); |
|||
color = this.itemProtocol.getcolor(); |
|||
jackup_num = this.itemProtocol.getjackup_num(); |
|||
strap_number = this.itemProtocol.getstrap_number(); |
|||
start = this.itemProtocol.getstart(); |
|||
stop = this.itemProtocol.getstop(); |
|||
main_convey1 = this.itemProtocol.getmain_convey1(); |
|||
main_convey1_seat1 = this.itemProtocol.getmain_convey1_seat1(); |
|||
main_convey1_seat2 = this.itemProtocol.getmain_convey1_seat2(); |
|||
ink_jet = this.itemProtocol.getink_jet(); |
|||
ink_jet_seat1 = this.itemProtocol.getink_jet_seat1(); |
|||
ink_jet_seat2 = this.itemProtocol.getink_jet_seat2(); |
|||
ink_jet_seat3 = this.itemProtocol.getink_jet_seat3(); |
|||
main_convey2 = this.itemProtocol.getmain_convey2(); |
|||
main_convey2_seat1 = this.itemProtocol.getmain_convey2_seat1(); |
|||
main_convey3_has_pass = this.itemProtocol.getmain_convey3_has_pass(); |
|||
main_convey3_has_noPass = this.itemProtocol.getmain_convey3_has_noPass(); |
|||
main_convey3_seat1 = this.itemProtocol.getmain_convey3_seat1(); |
|||
main_convey3_seat2 = this.itemProtocol.getmain_convey3_seat2(); |
|||
cowl_a_cache = this.itemProtocol.getcowl_a_cache(); |
|||
cowl_a_cache_seat1 = this.itemProtocol.getcowl_a_cache_seat1(); |
|||
cowl_a_cache_seat2 = this.itemProtocol.getcowl_a_cache_seat2(); |
|||
cowl_a_cowl = this.itemProtocol.getcowl_a_cowl(); |
|||
cowl_a_cowl_seat1 = this.itemProtocol.getcowl_a_cowl_seat1(); |
|||
cowl_a_cowl_seat2 = this.itemProtocol.getcowl_a_cowl_seat2(); |
|||
cowl_a_cowl_pass = this.itemProtocol.getcowl_a_cowl_pass(); |
|||
reverse_convey = this.itemProtocol.getreverse_convey(); |
|||
reverse_convey_seat1 = this.itemProtocol.getreverse_convey_seat1(); |
|||
reverse_convey_seat2 = this.itemProtocol.getreverse_convey_seat2(); |
|||
reverse_convey_seat3 = this.itemProtocol.getreverse_convey_seat3(); |
|||
reverse_convey_pass = this.itemProtocol.getreverse_convey_pass(); |
|||
cowl_b_cache = this.itemProtocol.getcowl_b_cache(); |
|||
cowl_b_cache_seat1 = this.itemProtocol.getcowl_b_cache_seat1(); |
|||
cowl_b_cache_seat2 = this.itemProtocol.getcowl_b_cache_seat2(); |
|||
cowl_b_cache_pass = this.itemProtocol.getcowl_b_cache_pass(); |
|||
cowl_b_cowl = this.itemProtocol.getcowl_b_cowl(); |
|||
cowl_b_cowl_seat1 = this.itemProtocol.getcowl_b_cowl_seat1(); |
|||
cowl_b_cowl_seat2 = this.itemProtocol.getcowl_b_cowl_seat2(); |
|||
cowl_b_cowl_aPass = this.itemProtocol.getcowl_b_cowl_aPass(); |
|||
cowl_b_cowl_bPass = this.itemProtocol.getcowl_b_cowl_bPass(); |
|||
no_pass_convey_cache_num = this.itemProtocol.getno_pass_convey_cache_num(); |
|||
wrap_ago = this.itemProtocol.getwrap_ago(); |
|||
wrap_ago_seat1 = this.itemProtocol.getwrap_ago_seat1(); |
|||
wrap_ago_seat2 = this.itemProtocol.getwrap_ago_seat2(); |
|||
wrap_after = this.itemProtocol.getwrap_after(); |
|||
wrap_after_seat1 = this.itemProtocol.getwrap_after_seat1(); |
|||
wrap_after_seat2 = this.itemProtocol.getwrap_after_seat2(); |
|||
strapping_current_step = this.itemProtocol.getstrapping_current_step(); |
|||
strapping_seat1 = this.itemProtocol.getstrapping_seat1(); |
|||
strapping_seat2 = this.itemProtocol.getstrapping_seat2(); |
|||
strapping_seat3 = this.itemProtocol.getstrapping_seat3(); |
|||
strapping_seat4 = this.itemProtocol.getstrapping_seat4(); |
|||
strapping_seat5 = this.itemProtocol.getstrapping_seat5(); |
|||
strapping_seat6 = this.itemProtocol.getstrapping_seat6(); |
|||
strapping_seat7 = this.itemProtocol.getstrapping_seat7(); |
|||
strapping_seat8 = this.itemProtocol.getstrapping_seat8(); |
|||
strapping_seat9 = this.itemProtocol.getstrapping_seat9(); |
|||
strapping_seat10 = this.itemProtocol.getstrapping_seat10(); |
|||
strapping_seat11 = this.itemProtocol.getstrapping_seat11(); |
|||
strapping_seat12 = this.itemProtocol.getstrapping_seat12(); |
|||
a_error1_clear = this.itemProtocol.geta_error1_clear(); |
|||
b_error1_clear = this.itemProtocol.getb_error1_clear(); |
|||
a_error2_clear = this.itemProtocol.geta_error2_clear(); |
|||
b_error2_clear = this.itemProtocol.getb_error2_clear(); |
|||
wrap_control = this.itemProtocol.getwrap_control(); |
|||
strapping_finish = this.itemProtocol.getstrapping_finish(); |
|||
error_clear = this.itemProtocol.geterror_clear(); |
|||
} catch (Exception var17) { |
|||
return; |
|||
} |
|||
|
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
public void writing(String param, String value) { |
|||
|
|||
String to_param = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() |
|||
+ "." + param; |
|||
String opcservcerid = this.getDevice().getOpc_server_id(); |
|||
Server server = ReadUtil.getServer(opcservcerid); |
|||
Map<String, Object> itemMap = new HashMap<String, Object>(); |
|||
itemMap.put(to_param, value); |
|||
|
|||
ReadUtil.write(itemMap, server); |
|||
} |
|||
|
|||
public boolean exe_business() { |
|||
return true; |
|||
} |
|||
|
|||
|
|||
public void executing(Server server, Map<String, Object> itemMap) { |
|||
ReadUtil.write(itemMap, server); |
|||
} |
|||
|
|||
public void writing1(int command) { |
|||
// String to_command1 = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
|
|||
// + "." + ItemProtocol.item_to_command1;
|
|||
//
|
|||
// String opcservcerid = this.getDevice().getOpc_server_id();
|
|||
// Server server = ReadUtil.getServer(opcservcerid);
|
|||
// Map<String, Object> itemMap = new HashMap<String, Object>();
|
|||
// itemMap.put(to_command1, command);
|
|||
// ReadUtil.write(itemMap, server);
|
|||
|
|||
} |
|||
|
|||
public void writing2(int command) { |
|||
// String to_command2 = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
|
|||
// + "." + ItemProtocol.item_to_command2;
|
|||
//
|
|||
// String opcservcerid = this.getDevice().getOpc_server_id();
|
|||
// Server server = ReadUtil.getServer(opcservcerid);
|
|||
// Map<String, Object> itemMap = new HashMap<String, Object>();
|
|||
// itemMap.put(to_command2, command);
|
|||
// ReadUtil.write(itemMap, server);
|
|||
|
|||
} |
|||
|
|||
public void writing(int type, int command) { |
|||
String opcservcerid = this.getDevice().getOpc_server_id(); |
|||
Server server = ReadUtil.getServer(opcservcerid); |
|||
Map<String, Object> itemMap = new HashMap<String, Object>(); |
|||
ReadUtil.write(itemMap, server); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,633 @@ |
|||
package org.nl.acs.device_driver.hailiang.hailiang_flat; |
|||
|
|||
import cn.hutool.core.util.StrUtil; |
|||
import lombok.Data; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.nl.acs.device.device_driver.standard_inspect.ItemDto; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
@Slf4j |
|||
@Data |
|||
public class ItemProtocol { |
|||
|
|||
//手自动
|
|||
public static String item_is_auto = "is_auto"; |
|||
//系统运行
|
|||
public static String item_is_running = "is_running"; |
|||
//联机模式
|
|||
public static String item_mode = "mode"; |
|||
//a测档压力
|
|||
public static String item_a_pressure = "a_pressure"; |
|||
//b测档压力
|
|||
public static String item_b_pressure = "b_pressure"; |
|||
//管径(mm)
|
|||
public static String item_outer_diameter = "outer_diameter"; |
|||
//管长
|
|||
public static String item_length = "length"; |
|||
//壁厚
|
|||
public static String item_wall_thickness = "wall_thickness"; |
|||
//颜色
|
|||
public static String item_color = "color"; |
|||
//合格提升每次提升根数
|
|||
public static String item_jackup_num = "jackup_num"; |
|||
//每捆根数
|
|||
public static String item_strap_number = "strap_number"; |
|||
//启动
|
|||
public static String item_start = "start"; |
|||
//停止
|
|||
public static String item_stop = "stop"; |
|||
//主输送一段—-有料
|
|||
public static String item_main_convey1 = "main_convey1"; |
|||
//主输送一段—-有料 占位1 2
|
|||
public static String item_main_convey1_seat1 = "main_convey1_seat1"; |
|||
public static String item_main_convey1_seat2 = "main_convey1_seat2"; |
|||
//喷墨
|
|||
public static String item_ink_jet = "ink_jet"; |
|||
//喷墨-占位 1 2 3
|
|||
public static String item_ink_jet_seat1 = "ink_jet_seat1"; |
|||
public static String item_ink_jet_seat2 = "ink_jet_seat2"; |
|||
public static String item_ink_jet_seat3 = "ink_jet_seat3"; |
|||
//主输送二段
|
|||
public static String item_main_convey2 = "main_convey2"; |
|||
//主输送二段 占位 1
|
|||
public static String item_main_convey2_seat1 = "main_convey2_seat1"; |
|||
//主输送三段—-有料合格
|
|||
public static String item_main_convey3_has_pass = "main_convey3_has_pass"; |
|||
//主输送三段—-有料不合格
|
|||
public static String item_main_convey3_has_noPass = "main_convey3_has_noPass"; |
|||
//主输送三段—-占位1 2
|
|||
public static String item_main_convey3_seat1 = "main_convey3_seat1"; |
|||
public static String item_main_convey3_seat2 = "main_convey3_seat2"; |
|||
//套帽A缓存—-有料
|
|||
public static String item_cowl_a_cache = "cowl_a_cache"; |
|||
//套帽A缓存—-占位 1 2
|
|||
public static String item_cowl_a_cache_seat1 = "cowl_a_cache_seat1"; |
|||
public static String item_cowl_a_cache_seat2 = "cowl_a_cache_seat2"; |
|||
//套帽A套帽—-有料
|
|||
public static String item_cowl_a_cowl = "cowl_a_cowl"; |
|||
//套帽A套帽—-占位 1 2
|
|||
public static String item_cowl_a_cowl_seat1 = "cowl_a_cowl_seat1"; |
|||
public static String item_cowl_a_cowl_seat2 = "cowl_a_cowl_seat2"; |
|||
//套帽A套帽—-合格
|
|||
public static String item_cowl_a_cowl_pass = "cowl_a_cowl_pass"; |
|||
//反向输送—-有料
|
|||
public static String item_reverse_convey = "reverse_convey"; |
|||
//反向输送—-占位 1 2 3
|
|||
public static String item_reverse_convey_seat1 = "reverse_convey_seat1"; |
|||
public static String item_reverse_convey_seat2 = "reverse_convey_seat2"; |
|||
public static String item_reverse_convey_seat3 = "reverse_convey_seat3"; |
|||
//反向输送—-合格
|
|||
public static String item_reverse_convey_pass = "reverse_convey_pass"; |
|||
//套帽B缓存—-有料
|
|||
public static String item_cowl_b_cache = "cowl_b_cache"; |
|||
//套帽B缓存—-占位 1 2
|
|||
public static String item_cowl_b_cache_seat1 = "cowl_b_cache_seat1"; |
|||
public static String item_cowl_b_cache_seat2 = "cowl_b_cache_seat2"; |
|||
//套帽B缓存 合格
|
|||
public static String item_cowl_b_cache_pass = "cowl_b_cache_pass"; |
|||
//套帽B套帽—-有料
|
|||
public static String item_cowl_b_cowl = "cowl_b_cowl"; |
|||
//套帽B套帽—-占位 1 2
|
|||
public static String item_cowl_b_cowl_seat1 = "cowl_b_cowl_seat1"; |
|||
public static String item_cowl_b_cowl_seat2 = "cowl_b_cowl_seat2"; |
|||
//套帽B套帽—-套帽A合格
|
|||
public static String item_cowl_b_cowl_aPass = "cowl_b_cowl_aPass"; |
|||
//套帽B套帽—-套帽B合格
|
|||
public static String item_cowl_b_cowl_bPass = "cowl_b_cowl_bPass"; |
|||
//不合格输送辊缓存计数
|
|||
public static String item_no_pass_convey_cache_num = "no_pass_convey_cache_num"; |
|||
//裹膜前段—-有料
|
|||
public static String item_wrap_ago = "wrap_ago"; |
|||
//裹膜前段—-有料 占位1 2
|
|||
public static String item_wrap_ago_seat1 = "wrap_ago_seat1"; |
|||
public static String item_wrap_ago_seat2 = "wrap_ago_seat2"; |
|||
//裹膜后段—-有料
|
|||
public static String item_wrap_after = "wrap_after"; |
|||
//裹膜后段—-有料 占位1 2
|
|||
public static String item_wrap_after_seat1 = "wrap_after_seat1"; |
|||
public static String item_wrap_after_seat2 = "wrap_after_seat2"; |
|||
//捆扎当前步骤
|
|||
public static String item_strapping_current_step = "strapping_current_step"; |
|||
//捆扎段占位1---12
|
|||
public static String item_strapping_seat1 = "strapping_seat1"; |
|||
public static String item_strapping_seat2 = "strapping_seat2"; |
|||
public static String item_strapping_seat3 = "strapping_seat3"; |
|||
public static String item_strapping_seat4 = "strapping_seat4"; |
|||
public static String item_strapping_seat5 = "strapping_seat5"; |
|||
public static String item_strapping_seat6 = "strapping_seat6"; |
|||
public static String item_strapping_seat7 = "strapping_seat7"; |
|||
public static String item_strapping_seat8 = "strapping_seat8"; |
|||
public static String item_strapping_seat9 = "strapping_seat9"; |
|||
public static String item_strapping_seat10 = "strapping_seat10"; |
|||
public static String item_strapping_seat11 = "strapping_seat11"; |
|||
public static String item_strapping_seat12 = "strapping_seat12"; |
|||
//A侧摇杆出料异常复位
|
|||
public static String item_a_error1_clear = "a_error1_clear"; |
|||
//B侧摇杆出料异常复位
|
|||
public static String item_b_error1_clear = "b_error1_clear"; |
|||
//A侧皮带异常复位
|
|||
public static String item_a_error2_clear = "a_error2_clear"; |
|||
//B侧皮带异常复位
|
|||
public static String item_b_error2_clear = "b_error2_clear"; |
|||
//裹膜机控制权
|
|||
public static String item_wrap_control = "wrap_control"; |
|||
//捆扎完成
|
|||
public static String item_strapping_finish = "strapping_finish"; |
|||
//故障复位
|
|||
public static String item_error_clear = "error_clear"; |
|||
|
|||
private HailiangFlatDeviceDriver driver; |
|||
|
|||
public ItemProtocol(HailiangFlatDeviceDriver driver) { |
|||
this.driver = driver; |
|||
} |
|||
|
|||
public int getis_auto() { |
|||
return this.getOpcIntegerValue(item_is_auto); |
|||
} |
|||
|
|||
public int getis_running() { |
|||
return this.getOpcIntegerValue(item_is_running); |
|||
} |
|||
|
|||
public int getmode() { |
|||
return this.getOpcIntegerValue(item_mode); |
|||
} |
|||
|
|||
public int geta_pressure() { |
|||
return this.getOpcIntegerValue(item_a_pressure); |
|||
} |
|||
|
|||
public int getb_pressure() { |
|||
return this.getOpcIntegerValue(item_b_pressure); |
|||
} |
|||
|
|||
public int getouter_diameter() { |
|||
return this.getOpcIntegerValue(item_outer_diameter); |
|||
} |
|||
|
|||
public int getlength() { |
|||
return this.getOpcIntegerValue(item_length); |
|||
} |
|||
|
|||
public int getwall_thickness() { |
|||
return this.getOpcIntegerValue(item_wall_thickness); |
|||
} |
|||
|
|||
public int getcolor() { |
|||
return this.getOpcIntegerValue(item_color); |
|||
} |
|||
|
|||
public int getjackup_num() { |
|||
return this.getOpcIntegerValue(item_jackup_num); |
|||
} |
|||
|
|||
public int getstrap_number() { |
|||
return this.getOpcIntegerValue(item_strap_number); |
|||
} |
|||
|
|||
public int getstart() { |
|||
return this.getOpcIntegerValue(item_start); |
|||
} |
|||
|
|||
public int getstop() { |
|||
return this.getOpcIntegerValue(item_stop); |
|||
} |
|||
|
|||
public int getmain_convey1() { |
|||
return this.getOpcIntegerValue(item_main_convey1); |
|||
} |
|||
|
|||
public int getmain_convey1_seat1() { |
|||
return this.getOpcIntegerValue(item_main_convey1_seat1); |
|||
} |
|||
|
|||
public int getmain_convey1_seat2() { |
|||
return this.getOpcIntegerValue(item_main_convey1_seat2); |
|||
} |
|||
|
|||
public int getink_jet() { |
|||
return this.getOpcIntegerValue(item_ink_jet); |
|||
} |
|||
|
|||
public int getink_jet_seat1() { |
|||
return this.getOpcIntegerValue(item_ink_jet_seat1); |
|||
} |
|||
|
|||
public int getink_jet_seat2() { |
|||
return this.getOpcIntegerValue(item_ink_jet_seat2); |
|||
} |
|||
|
|||
public int getink_jet_seat3() { |
|||
return this.getOpcIntegerValue(item_ink_jet_seat3); |
|||
} |
|||
|
|||
public int getmain_convey2() { |
|||
return this.getOpcIntegerValue(item_main_convey2); |
|||
} |
|||
|
|||
public int getmain_convey2_seat1() { |
|||
return this.getOpcIntegerValue(item_main_convey2_seat1); |
|||
} |
|||
|
|||
public int getmain_convey3_has_pass() { |
|||
return this.getOpcIntegerValue(item_main_convey3_has_pass); |
|||
} |
|||
|
|||
public int getmain_convey3_has_noPass() { |
|||
return this.getOpcIntegerValue(item_main_convey3_has_noPass); |
|||
} |
|||
|
|||
public int getmain_convey3_seat1() { |
|||
return this.getOpcIntegerValue(item_main_convey3_seat1); |
|||
} |
|||
|
|||
public int getmain_convey3_seat2() { |
|||
return this.getOpcIntegerValue(item_main_convey3_seat2); |
|||
} |
|||
|
|||
public int getcowl_a_cache() { |
|||
return this.getOpcIntegerValue(item_cowl_a_cache); |
|||
} |
|||
|
|||
public int getcowl_a_cache_seat1() { |
|||
return this.getOpcIntegerValue(item_cowl_a_cache_seat1); |
|||
} |
|||
|
|||
public int getcowl_a_cache_seat2() { |
|||
return this.getOpcIntegerValue(item_cowl_a_cache_seat2); |
|||
} |
|||
|
|||
public int getcowl_a_cowl() { |
|||
return this.getOpcIntegerValue(item_cowl_a_cowl); |
|||
} |
|||
|
|||
public int getcowl_a_cowl_seat1() { |
|||
return this.getOpcIntegerValue(item_cowl_a_cowl_seat1); |
|||
} |
|||
|
|||
public int getcowl_a_cowl_seat2() { |
|||
return this.getOpcIntegerValue(item_cowl_a_cowl_seat2); |
|||
} |
|||
|
|||
public int getcowl_a_cowl_pass() { |
|||
return this.getOpcIntegerValue(item_cowl_a_cowl_pass); |
|||
} |
|||
|
|||
public int getreverse_convey() { |
|||
return this.getOpcIntegerValue(item_reverse_convey); |
|||
} |
|||
|
|||
public int getreverse_convey_seat1() { |
|||
return this.getOpcIntegerValue(item_reverse_convey_seat1); |
|||
} |
|||
|
|||
public int getreverse_convey_seat2() { |
|||
return this.getOpcIntegerValue(item_reverse_convey_seat2); |
|||
} |
|||
|
|||
public int getreverse_convey_seat3() { |
|||
return this.getOpcIntegerValue(item_reverse_convey_seat3); |
|||
} |
|||
|
|||
public int getreverse_convey_pass() { |
|||
return this.getOpcIntegerValue(item_reverse_convey_pass); |
|||
} |
|||
|
|||
public int getcowl_b_cache() { |
|||
return this.getOpcIntegerValue(item_cowl_b_cache); |
|||
} |
|||
|
|||
public int getcowl_b_cache_seat1() { |
|||
return this.getOpcIntegerValue(item_cowl_b_cache_seat1); |
|||
} |
|||
|
|||
public int getcowl_b_cache_seat2() { |
|||
return this.getOpcIntegerValue(item_cowl_b_cache_seat2); |
|||
} |
|||
|
|||
public int getcowl_b_cache_pass() { |
|||
return this.getOpcIntegerValue(item_cowl_b_cache_pass); |
|||
} |
|||
|
|||
public int getcowl_b_cowl() { |
|||
return this.getOpcIntegerValue(item_cowl_b_cowl); |
|||
} |
|||
|
|||
public int getcowl_b_cowl_seat1() { |
|||
return this.getOpcIntegerValue(item_cowl_b_cowl_seat1); |
|||
} |
|||
|
|||
public int getcowl_b_cowl_seat2() { |
|||
return this.getOpcIntegerValue(item_cowl_b_cowl_seat2); |
|||
} |
|||
|
|||
public int getcowl_b_cowl_aPass() { |
|||
return this.getOpcIntegerValue(item_cowl_b_cowl_aPass); |
|||
} |
|||
|
|||
public int getcowl_b_cowl_bPass() { |
|||
return this.getOpcIntegerValue(item_cowl_b_cowl_bPass); |
|||
} |
|||
|
|||
public int getno_pass_convey_cache_num() { |
|||
return this.getOpcIntegerValue(item_no_pass_convey_cache_num); |
|||
} |
|||
|
|||
public int getwrap_ago() { |
|||
return this.getOpcIntegerValue(item_wrap_ago); |
|||
} |
|||
|
|||
public int getwrap_ago_seat1() { |
|||
return this.getOpcIntegerValue(item_wrap_ago_seat1); |
|||
} |
|||
|
|||
public int getwrap_ago_seat2() { |
|||
return this.getOpcIntegerValue(item_wrap_ago_seat2); |
|||
} |
|||
|
|||
public int getwrap_after() { |
|||
return this.getOpcIntegerValue(item_wrap_after); |
|||
} |
|||
|
|||
public int getwrap_after_seat1() { |
|||
return this.getOpcIntegerValue(item_wrap_after_seat1); |
|||
} |
|||
|
|||
public int getwrap_after_seat2() { |
|||
return this.getOpcIntegerValue(item_wrap_after_seat2); |
|||
} |
|||
|
|||
public int getstrapping_current_step() { |
|||
return this.getOpcIntegerValue(item_strapping_current_step); |
|||
} |
|||
|
|||
public int getstrapping_seat1() { |
|||
return this.getOpcIntegerValue(item_strapping_seat1); |
|||
} |
|||
|
|||
public int getstrapping_seat2() { |
|||
return this.getOpcIntegerValue(item_strapping_seat2); |
|||
} |
|||
|
|||
public int getstrapping_seat3() { |
|||
return this.getOpcIntegerValue(item_strapping_seat3); |
|||
} |
|||
|
|||
public int getstrapping_seat4() { |
|||
return this.getOpcIntegerValue(item_strapping_seat4); |
|||
} |
|||
|
|||
public int getstrapping_seat5() { |
|||
return this.getOpcIntegerValue(item_strapping_seat5); |
|||
} |
|||
|
|||
public int getstrapping_seat6() { |
|||
return this.getOpcIntegerValue(item_strapping_seat6); |
|||
} |
|||
|
|||
public int getstrapping_seat7() { |
|||
return this.getOpcIntegerValue(item_strapping_seat7); |
|||
} |
|||
|
|||
public int getstrapping_seat8() { |
|||
return this.getOpcIntegerValue(item_strapping_seat8); |
|||
} |
|||
|
|||
public int getstrapping_seat9() { |
|||
return this.getOpcIntegerValue(item_strapping_seat9); |
|||
} |
|||
|
|||
public int getstrapping_seat10() { |
|||
return this.getOpcIntegerValue(item_strapping_seat10); |
|||
} |
|||
|
|||
public int getstrapping_seat11() { |
|||
return this.getOpcIntegerValue(item_strapping_seat11); |
|||
} |
|||
|
|||
public int getstrapping_seat12() { |
|||
return this.getOpcIntegerValue(item_strapping_seat12); |
|||
} |
|||
|
|||
public int geta_error1_clear() { |
|||
return this.getOpcIntegerValue(item_a_error1_clear); |
|||
} |
|||
|
|||
public int getb_error1_clear() { |
|||
return this.getOpcIntegerValue(item_b_error1_clear); |
|||
} |
|||
|
|||
public int geta_error2_clear() { |
|||
return this.getOpcIntegerValue(item_a_error2_clear); |
|||
} |
|||
|
|||
public int getb_error2_clear() { |
|||
return this.getOpcIntegerValue(item_b_error2_clear); |
|||
} |
|||
|
|||
public int getwrap_control() { |
|||
return this.getOpcIntegerValue(item_wrap_control); |
|||
} |
|||
|
|||
public int getstrapping_finish() { |
|||
return this.getOpcIntegerValue(item_strapping_finish); |
|||
} |
|||
|
|||
public int geterror_clear() { |
|||
return this.getOpcIntegerValue(item_error_clear); |
|||
} |
|||
|
|||
|
|||
//是否有货
|
|||
public int hasGoods(int move) { |
|||
return move; |
|||
} |
|||
|
|||
Boolean isonline; |
|||
|
|||
public int getOpcIntegerValue(String protocol) { |
|||
Integer value = this.driver.getIntegeregerValue(protocol); |
|||
if (value == null) { |
|||
log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!"); |
|||
setIsonline(false); |
|||
} else { |
|||
setIsonline(true); |
|||
return value; |
|||
} |
|||
return 0; |
|||
|
|||
} |
|||
|
|||
public String getOpcStringValue(String protocol) { |
|||
String value = this.driver.getStringValue(protocol); |
|||
if (StrUtil.isEmpty(value)) { |
|||
|
|||
} else { |
|||
return value; |
|||
} |
|||
return "0"; |
|||
} |
|||
|
|||
public static List<ItemDto> getReadableItemDtos() { |
|||
ArrayList list = new ArrayList(); |
|||
list.add(new ItemDto(item_is_auto, "手自动", "I18.1")); |
|||
list.add(new ItemDto(item_is_running, "系统运行", "M4.2")); |
|||
list.add(new ItemDto(item_mode, "联机模式", "DB1.X0.3")); |
|||
list.add(new ItemDto(item_a_pressure, "A侧挡压压力", "DB219.D20")); |
|||
list.add(new ItemDto(item_b_pressure, "B侧挡压压力", "DB239.D20")); |
|||
list.add(new ItemDto(item_outer_diameter, "管径(mm)", "DB1.D6")); |
|||
list.add(new ItemDto(item_length, "管长(mm)", "DB1.D2")); |
|||
list.add(new ItemDto(item_wall_thickness, "壁厚(mm)", "DB1.D10")); |
|||
list.add(new ItemDto(item_color, "颜色", "DB1.W14")); |
|||
list.add(new ItemDto(item_jackup_num, "合格每次提升根数", "DB2.W2")); |
|||
list.add(new ItemDto(item_strap_number, "每捆根数", "DB2.W4")); |
|||
list.add(new ItemDto(item_start, "启动", "M4.0")); |
|||
list.add(new ItemDto(item_stop, "停止", "M4.1")); |
|||
list.add(new ItemDto(item_main_convey1, "主输送一段-有料", "DB14.X4.0")); |
|||
list.add(new ItemDto(item_main_convey1_seat1, "主输送一段-占位1", "I22.4")); |
|||
list.add(new ItemDto(item_main_convey1_seat2, "主输送一段-占位2", "I22.5")); |
|||
list.add(new ItemDto(item_ink_jet, "喷墨-一段出料完成", "DB14.X3.6")); |
|||
list.add(new ItemDto(item_ink_jet_seat1, "喷墨-占位1", "I23.5")); |
|||
list.add(new ItemDto(item_ink_jet_seat2, "喷墨-占位2", "I23.4")); |
|||
list.add(new ItemDto(item_ink_jet_seat3, "喷墨-占位3", "I39.6")); |
|||
list.add(new ItemDto(item_main_convey2, "主输送二段—有料", "DB14.X4.1")); |
|||
list.add(new ItemDto(item_main_convey2_seat1, "主输送二段—占位1", "I22.6")); |
|||
list.add(new ItemDto(item_main_convey3_has_pass, "主输送三段-有料合格", "DB14.X4.2")); |
|||
list.add(new ItemDto(item_main_convey3_has_noPass, "主输送三段-有料不合格", "DB14.X4.3")); |
|||
list.add(new ItemDto(item_main_convey3_seat1, "主输送三段-占位1", "I23.0")); |
|||
list.add(new ItemDto(item_main_convey3_seat2, "主输送三段-占位2", "I22.7")); |
|||
list.add(new ItemDto(item_cowl_a_cache, "套帽A缓存-有料", "DB15.X2.0")); |
|||
list.add(new ItemDto(item_cowl_a_cache_seat1, "套帽A缓存-占位1", "I26.0")); |
|||
list.add(new ItemDto(item_cowl_a_cache_seat2, "套帽A缓存-占位2", "I26.1")); |
|||
list.add(new ItemDto(item_cowl_a_cowl, "套帽A套帽-有料", "DB15.X2.4")); |
|||
list.add(new ItemDto(item_cowl_a_cowl_seat1, "套帽A套帽-占位1", "I26.2")); |
|||
list.add(new ItemDto(item_cowl_a_cowl_seat2, "套帽A套帽-占位2", "I26.3")); |
|||
list.add(new ItemDto(item_cowl_a_cowl_pass, "套帽A套帽-合格", "DB254.X1.6")); |
|||
list.add(new ItemDto(item_reverse_convey, "反向输送-有料", "DB14.X4.4")); |
|||
list.add(new ItemDto(item_reverse_convey_seat1, "反向输送-占位1", "I23.3")); |
|||
list.add(new ItemDto(item_reverse_convey_seat2, "反向输送-占位2", "I23.2")); |
|||
list.add(new ItemDto(item_reverse_convey_seat3, "反向输送-占位3", "I23.1")); |
|||
list.add(new ItemDto(item_reverse_convey_pass, "反向输送-合格", "DB256.X1.6")); |
|||
list.add(new ItemDto(item_cowl_b_cache, "套帽B缓存-有料", "DB15.X2.1")); |
|||
list.add(new ItemDto(item_cowl_b_cache_seat1, "套帽B缓存-占位1", "I28.4")); |
|||
list.add(new ItemDto(item_cowl_b_cache_seat2, "套帽B缓存-占位2", "I28.5")); |
|||
list.add(new ItemDto(item_cowl_b_cache_pass, "套帽B缓存-合格", "DB256.X12.4")); |
|||
list.add(new ItemDto(item_cowl_b_cowl, "套帽B套帽-有料", "DB15.X2.5")); |
|||
list.add(new ItemDto(item_cowl_b_cowl_seat1, "套帽B套帽-占位1", "I28.6")); |
|||
list.add(new ItemDto(item_cowl_b_cowl_seat2, "套帽B套帽-占位2", "I28.7")); |
|||
list.add(new ItemDto(item_cowl_b_cowl_aPass, "套帽B套帽-套帽A合格", "DB15.X3.4")); |
|||
list.add(new ItemDto(item_cowl_b_cowl_bPass, "套帽B套帽-套帽B合格", "DB15.X3.5")); |
|||
list.add(new ItemDto(item_no_pass_convey_cache_num, "不合格输送辊缓存计数", "DB2.W12")); |
|||
list.add(new ItemDto(item_wrap_ago, "裹膜前段-有料", "DB3.X48.0")); |
|||
list.add(new ItemDto(item_wrap_ago_seat1, "裹膜前段-占位1", "I29.3")); |
|||
list.add(new ItemDto(item_wrap_ago_seat2, "裹膜前段-占位2", "I29.4")); |
|||
list.add(new ItemDto(item_wrap_after, "裹膜后段-有料", "DB3.X48.1")); |
|||
list.add(new ItemDto(item_wrap_after_seat1, "裹膜后段-占位1", "I29.5")); |
|||
list.add(new ItemDto(item_wrap_after_seat2, "裹膜后段-占位1", "I29.6")); |
|||
list.add(new ItemDto(item_strapping_current_step, "捆扎当前步骤", "DB3.W54")); |
|||
list.add(new ItemDto(item_strapping_seat1, "捆扎段占位1", "I32.7")); |
|||
list.add(new ItemDto(item_strapping_seat2, "捆扎段占位2", "I29.0")); |
|||
list.add(new ItemDto(item_strapping_seat3, "捆扎段占位3", "I33.1")); |
|||
list.add(new ItemDto(item_strapping_seat4, "捆扎段占位4", "I29.1")); |
|||
list.add(new ItemDto(item_strapping_seat5, "捆扎段占位5", "I34.7")); |
|||
list.add(new ItemDto(item_strapping_seat6, "捆扎段占位6", "I29.2")); |
|||
list.add(new ItemDto(item_strapping_seat7, "捆扎段占位7", "I29.3")); |
|||
list.add(new ItemDto(item_strapping_seat8, "捆扎段占位8", "I29.4")); |
|||
list.add(new ItemDto(item_strapping_seat9, "捆扎段占位9", "I29.5")); |
|||
list.add(new ItemDto(item_strapping_seat10, "捆扎段占位10", "I29.6")); |
|||
list.add(new ItemDto(item_strapping_seat10, "捆扎段占位11", "I35.5")); |
|||
list.add(new ItemDto(item_strapping_seat12, "捆扎段占位12", "I36.7")); |
|||
list.add(new ItemDto(item_a_error1_clear, "A侧摇杆出料异常复位", "DB214.X10.7")); |
|||
list.add(new ItemDto(item_b_error1_clear, "B侧摇杆出料异常复位", "DB234.X10.7")); |
|||
list.add(new ItemDto(item_a_error2_clear, "A侧皮带异常复位", "DB201.X14.7")); |
|||
list.add(new ItemDto(item_b_error2_clear, "B侧皮带异常复位", "DB221.X14.7")); |
|||
list.add(new ItemDto(item_wrap_control, "裹膜机控制权", "DB360.X2.3")); |
|||
list.add(new ItemDto(item_strapping_finish, "捆扎完成", "M4.5")); |
|||
list.add(new ItemDto(item_error_clear, "故障复位", "M5.2")); |
|||
return list; |
|||
} |
|||
|
|||
public static List<ItemDto> getWriteableItemDtos() { |
|||
ArrayList list = new ArrayList(); |
|||
///list.add(new ItemDto(item_is_auto, "手自动", "I18.1"));
|
|||
//list.add(new ItemDto(item_is_running, "系统运行", "M4.2"));
|
|||
// list.add(new ItemDto(item_mode, "联机模式", "DB1.DBX0.3"));
|
|||
// list.add(new ItemDto(item_a_pressure, "A侧挡压压力", "DB219.DBD20"));
|
|||
// list.add(new ItemDto(item_b_pressure, "B侧挡压压力", "DB239.DBD20"));
|
|||
list.add(new ItemDto(item_outer_diameter, "管径(mm)", "DB1.D6")); |
|||
list.add(new ItemDto(item_length, "管长(mm)", "DB1.D2")); |
|||
list.add(new ItemDto(item_wall_thickness, "壁厚(mm)", "DB1.D10")); |
|||
list.add(new ItemDto(item_color, "颜色", "DB1.W14")); |
|||
list.add(new ItemDto(item_jackup_num, "合格每次提升根数", "DB2.W2")); |
|||
list.add(new ItemDto(item_strap_number, "每捆根数", "DB2.W4")); |
|||
list.add(new ItemDto(item_start, "启动", "M4.0")); |
|||
list.add(new ItemDto(item_stop, "停止", "M4.1")); |
|||
list.add(new ItemDto(item_main_convey1, "主输送一段-有料", "DB14.X4.0")); |
|||
//list.add(new ItemDto(item_main_convey1_seat1, "主输送一段-占位1", "I22.4"));
|
|||
//list.add(new ItemDto(item_main_convey1_seat2, "主输送一段-占位2", "I22.5"));
|
|||
list.add(new ItemDto(item_ink_jet, "喷墨-一段出料完成", "DB14.X3.6")); |
|||
//list.add(new ItemDto(item_ink_jet_seat1, "喷墨-占位1", "I23.5"));
|
|||
//list.add(new ItemDto(item_ink_jet_seat2, "喷墨-占位2", "I23.4"));
|
|||
// list.add(new ItemDto(item_ink_jet_seat3, "喷墨-占位3", "I39.6"));
|
|||
list.add(new ItemDto(item_main_convey2, "主输送二段—有料", "DB14.X4.1")); |
|||
//list.add(new ItemDto(item_main_convey2_seat1, "主输送二段—占位1", "I22.6"));
|
|||
list.add(new ItemDto(item_main_convey3_has_pass, "主输送三段-有料合格", "DB14.X4.2")); |
|||
list.add(new ItemDto(item_main_convey3_has_noPass, "主输送三段-有料不合格", "DB14.X4.3")); |
|||
//list.add(new ItemDto(item_main_convey3_seat1, "主输送三段-占位1", "I23.0"));
|
|||
//list.add(new ItemDto(item_main_convey3_seat2, "主输送三段-占位2", "I22.7"));
|
|||
list.add(new ItemDto(item_cowl_a_cache, "套帽A缓存-有料", "DB15.X2.0")); |
|||
//list.add(new ItemDto(item_cowl_a_cache_seat1, "套帽A缓存-占位1", "I26.0"));
|
|||
//list.add(new ItemDto(item_cowl_a_cache_seat2, "套帽A缓存-占位2", "I26.1"));
|
|||
list.add(new ItemDto(item_cowl_a_cowl, "套帽A套帽-有料", "DB15.X2.4")); |
|||
//list.add(new ItemDto(item_cowl_a_cowl_seat1, "套帽A套帽-占位1", "I26.2"));
|
|||
//list.add(new ItemDto(item_cowl_a_cowl_seat2, "套帽A套帽-占位2", "I26.3"));
|
|||
list.add(new ItemDto(item_cowl_a_cowl_pass, "套帽A套帽-合格", "DB254.X1.6")); |
|||
list.add(new ItemDto(item_reverse_convey, "反向输送-有料", "DB14.X4.4")); |
|||
//list.add(new ItemDto(item_reverse_convey_seat1, "反向输送-占位1", "I23.3"));
|
|||
//list.add(new ItemDto(item_reverse_convey_seat2, "反向输送-占位2", "I23.2"));
|
|||
//list.add(new ItemDto(item_reverse_convey_seat3, "反向输送-占位3", "I23.1"));
|
|||
list.add(new ItemDto(item_reverse_convey_pass, "反向输送-合格", "DB256.X1.6")); |
|||
list.add(new ItemDto(item_cowl_b_cache, "套帽B缓存-有料", "DB15.X2.1")); |
|||
//list.add(new ItemDto(item_cowl_b_cache_seat1, "套帽B缓存-占位1", "I28.4"));
|
|||
//list.add(new ItemDto(item_cowl_b_cache_seat2, "套帽B缓存-占位2", "I28.5"));
|
|||
list.add(new ItemDto(item_cowl_b_cache_pass, "套帽B缓存-合格", "DB256.X12.4")); |
|||
list.add(new ItemDto(item_cowl_b_cowl, "套帽B套帽-有料", "DB15.X2.5")); |
|||
//list.add(new ItemDto(item_cowl_b_cowl_seat1, "套帽B套帽-占位1", "I28.6"));
|
|||
// list.add(new ItemDto(item_cowl_b_cowl_seat2, "套帽B套帽-占位2", "I28.7"));
|
|||
list.add(new ItemDto(item_cowl_b_cowl_aPass, "套帽B套帽-套帽A合格", "DB15.X3.4")); |
|||
list.add(new ItemDto(item_cowl_b_cowl_bPass, "套帽B套帽-套帽B合格", "DB15.X3.5")); |
|||
list.add(new ItemDto(item_no_pass_convey_cache_num, "不合格输送辊缓存计数", "DB2.W12")); |
|||
list.add(new ItemDto(item_wrap_ago, "裹膜前段-有料", "DB3.X48.0")); |
|||
//list.add(new ItemDto(item_wrap_ago_seat1, "裹膜前段-占位1", "I29.3"));
|
|||
//list.add(new ItemDto(item_wrap_ago_seat2, "裹膜前段-占位2", "I29.4"));
|
|||
list.add(new ItemDto(item_wrap_after, "裹膜后段-有料", "DB3.X48.1")); |
|||
//list.add(new ItemDto(item_wrap_after_seat1, "裹膜后段-占位1", "I29.5"));
|
|||
//list.add(new ItemDto(item_wrap_after_seat2, "裹膜后段-占位1", "I29.6"));
|
|||
list.add(new ItemDto(item_strapping_current_step, "捆扎当前步骤", "DB3.W54")); |
|||
//list.add(new ItemDto(item_strapping_seat1, "捆扎段占位1", "I32.7"));
|
|||
//list.add(new ItemDto(item_strapping_seat2, "捆扎段占位2", "I29.0"));
|
|||
//list.add(new ItemDto(item_strapping_seat3, "捆扎段占位3", "I33.1"));
|
|||
//list.add(new ItemDto(item_strapping_seat4, "捆扎段占位4", "I29.1"));
|
|||
//list.add(new ItemDto(item_strapping_seat5, "捆扎段占位5", "I34.7"));
|
|||
//list.add(new ItemDto(item_strapping_seat6, "捆扎段占位6", "I29.2"));
|
|||
// list.add(new ItemDto(item_strapping_seat7, "捆扎段占位7", "I29.3"));
|
|||
//list.add(new ItemDto(item_strapping_seat8, "捆扎段占位8", "I29.4"));
|
|||
//list.add(new ItemDto(item_strapping_seat9, "捆扎段占位9", "I29.5"));
|
|||
//list.add(new ItemDto(item_strapping_seat10, "捆扎段占位10", "I29.6"));
|
|||
//list.add(new ItemDto(item_strapping_seat10, "捆扎段占位11", "I35.5"));
|
|||
//list.add(new ItemDto(item_strapping_seat12, "捆扎段占位12", "I36.7"));
|
|||
list.add(new ItemDto(item_a_error1_clear, "A侧摇杆出料异常复位", "DB214.X10.7")); |
|||
list.add(new ItemDto(item_b_error1_clear, "B侧摇杆出料异常复位", "DB234.X10.7")); |
|||
list.add(new ItemDto(item_a_error2_clear, "A侧皮带异常复位", "DB201.X14.7")); |
|||
list.add(new ItemDto(item_b_error2_clear, "B侧皮带异常复位", "DB221.X14.7")); |
|||
list.add(new ItemDto(item_wrap_control, "裹膜机控制权", "DB360.X2.3")); |
|||
list.add(new ItemDto(item_strapping_finish, "捆扎完成", "M4.5")); |
|||
list.add(new ItemDto(item_error_clear, "故障复位", "M5.2")); |
|||
return list; |
|||
} |
|||
|
|||
} |
|||
|
@ -0,0 +1,458 @@ |
|||
<template> |
|||
<!--海亮-上料线体--> |
|||
<div> |
|||
|
|||
<el-card class="box-card" shadow="never"> |
|||
<div slot="header" class="clearfix"> |
|||
<span class="role-span">设备协议:</span> |
|||
</div> |
|||
|
|||
<el-row> |
|||
<el-col :span="12"> |
|||
OpcServer: |
|||
<el-select |
|||
v-model="opc_id" |
|||
placeholder="无" |
|||
clearable |
|||
@change="changeOpc" |
|||
> |
|||
<el-option |
|||
v-for="item in dataOpcservers" |
|||
:key="item.opc_id" |
|||
:label="item.opc_name" |
|||
:value="item.opc_id" |
|||
/> |
|||
</el-select> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
PLC: |
|||
<el-select |
|||
v-model="plc_id" |
|||
placeholder="无" |
|||
clearable |
|||
@change="changePlc" |
|||
> |
|||
<el-option |
|||
v-for="item in dataOpcPlcs" |
|||
:key="item.plc_id" |
|||
:label="item.plc_name" |
|||
:value="item.plc_id" |
|||
/> |
|||
</el-select> |
|||
</el-col> |
|||
</el-row> |
|||
|
|||
</el-card> |
|||
|
|||
<el-card class="box-card" shadow="never"> |
|||
<div slot="header" class="clearfix"> |
|||
<span class="role-span">输送系统:</span> |
|||
</div> |
|||
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="78px"> |
|||
<el-row> |
|||
<el-col :span="8"> |
|||
<el-form-item label="电气调度号" label-width="150px"> |
|||
<el-input v-model="form.OPCServer" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</el-form> |
|||
</el-card> |
|||
|
|||
<el-card class="box-card" shadow="never"> |
|||
<div slot="header" class="clearfix"> |
|||
<span class="role-span">指令相关:</span> |
|||
</div> |
|||
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="78px"> |
|||
<!-- <el-row>--> |
|||
<!-- <el-col :span="8">--> |
|||
<!-- <el-form-item label="检验有货">--> |
|||
<!-- <el-switch v-model="form.inspect_in_stocck" />--> |
|||
<!-- </el-form-item>--> |
|||
<!-- </el-col>--> |
|||
<!-- <el-col :span="8">--> |
|||
<!-- <el-form-item label="忽视取货校验" label-width="150px">--> |
|||
<!-- <el-switch v-model="form.ignore_pickup_check" />--> |
|||
<!-- </el-form-item>--> |
|||
<!-- </el-col>--> |
|||
<!-- <el-col :span="8">--> |
|||
<!-- <el-form-item label="忽视放货校验" label-width="150px">--> |
|||
<!-- <el-switch v-model="form.ignore_release_check" />--> |
|||
<!-- </el-form-item>--> |
|||
<!-- </el-col>--> |
|||
<!-- </el-row>--> |
|||
|
|||
<!-- <el-row>--> |
|||
<!-- <el-col :span="8">--> |
|||
<!-- <el-form-item label="申请任务">--> |
|||
<!-- <el-switch v-model="form.apply_task" />--> |
|||
<!-- </el-form-item>--> |
|||
<!-- </el-col>--> |
|||
<!-- <el-col :span="8">--> |
|||
<!-- <el-form-item label="手动生成任务" label-width="150px">--> |
|||
<!-- <el-switch v-model="form.manual_create_task" />--> |
|||
<!-- </el-form-item>--> |
|||
<!-- </el-col>--> |
|||
<!-- </el-row>--> |
|||
<!-- <el-row>--> |
|||
<!-- <el-col :span="8">--> |
|||
<!-- <el-form-item label="申请空盘" prop="device_code">--> |
|||
<!-- <el-select--> |
|||
<!-- v-model="form.apply_empty"--> |
|||
<!-- filterable--> |
|||
<!-- multiple--> |
|||
<!-- placeholder="请选择"--> |
|||
<!-- >--> |
|||
<!-- <el-option--> |
|||
<!-- v-for="item in deviceList"--> |
|||
<!-- :key="item.device_code"--> |
|||
<!-- :label="item.device_name"--> |
|||
<!-- :value="item.device_code"--> |
|||
<!-- />--> |
|||
<!-- </el-select>--> |
|||
<!-- </el-form-item>--> |
|||
<!-- </el-col>--> |
|||
<!-- </el-row>--> |
|||
</el-form> |
|||
</el-card> |
|||
|
|||
<el-card class="box-card" shadow="never"> |
|||
<div slot="header" class="clearfix"> |
|||
<span class="role-span">AGV相关:</span> |
|||
</div> |
|||
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="78px"> |
|||
<!-- <el-row>--> |
|||
<!-- <el-col :span="8">--> |
|||
<!-- <el-form-item label="取货">--> |
|||
<!-- <el-switch v-model="form.pickup" />--> |
|||
<!-- </el-form-item>--> |
|||
<!-- </el-col>--> |
|||
<!-- <el-col :span="8">--> |
|||
<!-- <el-form-item label="放货">--> |
|||
<!-- <el-switch v-model="form.is_release" />--> |
|||
<!-- </el-form-item>--> |
|||
<!-- </el-col>--> |
|||
<!-- </el-row>--> |
|||
</el-form> |
|||
</el-card> |
|||
|
|||
<el-card class="box-card" shadow="never"> |
|||
<div slot="header" class="clearfix"> |
|||
<span class="role-span">PLC读取字段:</span> |
|||
</div> |
|||
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="78px"> |
|||
<el-table |
|||
v-loading="false" |
|||
:data="data1" |
|||
:max-height="550" |
|||
size="small" |
|||
style="width: 100%;margin-bottom: 15px" |
|||
> |
|||
|
|||
<el-table-column prop="name" label="用途" /> |
|||
<el-table-column prop="code" label="别名要求" /> |
|||
<el-table-column prop="db" label="DB块"> |
|||
<template slot-scope="scope"> |
|||
<el-input v-model="data1[scope.$index].db" size="mini" class="edit-input" @input="finishReadEdit(data1[scope.$index])" /> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="dbr_value"> |
|||
<template slot="header"> |
|||
<el-link type="primary" :underline="false" @click.native="test_read1()">测试读</el-link> |
|||
</template> |
|||
<template slot-scope="scope"> |
|||
<el-input v-model="data1[scope.$index].dbr_value" size="mini" class="edit-input" /> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
</el-form> |
|||
</el-card> |
|||
|
|||
<el-card class="box-card" shadow="never"> |
|||
<div slot="header" class="clearfix"> |
|||
<span class="role-span">PLC写入字段:</span> |
|||
</div> |
|||
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="78px"> |
|||
<el-table |
|||
v-loading="false" |
|||
:data="data2" |
|||
:max-height="550" |
|||
size="small" |
|||
style="width: 100%;margin-bottom: 15px" |
|||
> |
|||
|
|||
<el-table-column prop="name" label="用途" /> |
|||
<el-table-column prop="code" label="别名要求" /> |
|||
<el-table-column prop="db" label="DB块"> |
|||
<template slot-scope="scope"> |
|||
<el-input v-model="data2[scope.$index].db" size="mini" class="edit-input" @input="finishWriteEdit(data2[scope.$index])" /> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="dbw_value"> |
|||
<template slot="header"> |
|||
<el-link type="primary" :underline="false" @click.native="test_write1()">测试写</el-link> |
|||
</template> |
|||
<template slot-scope="scope"> |
|||
<el-input v-model="data2[scope.$index].dbw_value" size="mini" class="edit-input" /> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
</el-form> |
|||
</el-card> |
|||
|
|||
<el-card class="box-card" shadow="never"> |
|||
<div slot="header" class="clearfix"> |
|||
<span class="role-span" /> |
|||
<el-button |
|||
:loading="false" |
|||
icon="el-icon-check" |
|||
size="mini" |
|||
style="float: right; padding: 6px 9px" |
|||
type="primary" |
|||
@click="doSubmit" |
|||
>保存 |
|||
</el-button> |
|||
</div> |
|||
</el-card> |
|||
|
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
queryDriverConfig, |
|||
updateConfig, |
|||
testRead, |
|||
testwrite |
|||
} from '@/api/acs/device/driverConfig' |
|||
import { selectOpcList } from '@/api/acs/device/opc' |
|||
import { selectPlcList } from '@/api/acs/device/opcPlc' |
|||
import { selectListByOpcID } from '@/api/acs/device/opcPlc' |
|||
|
|||
import crud from '@/mixins/crud' |
|||
import deviceCrud from '@/api/acs/device/device' |
|||
|
|||
export default { |
|||
name: 'StandardManipulatorInspectSite', |
|||
mixins: [crud], |
|||
props: { |
|||
parentForm: { |
|||
type: Object, |
|||
require: true |
|||
} |
|||
}, |
|||
data() { |
|||
return { |
|||
device_code: '', |
|||
device_id: '', |
|||
plc_id: '', |
|||
plc_code: '', |
|||
opc_id: '', |
|||
opc_code: '', |
|||
configLoading: false, |
|||
dataOpcservers: [], |
|||
dataOpcPlcs: [], |
|||
data1: [], |
|||
data2: [], |
|||
form: { |
|||
inspect_in_stocck: true, |
|||
ignore_pickup_check: true, |
|||
ignore_release_check: true, |
|||
apply_task: true, |
|||
apply_empty: [], |
|||
manual_create_task: true, |
|||
is_pickup: true, |
|||
is_release: true |
|||
}, |
|||
rules: {} |
|||
} |
|||
}, |
|||
created() { |
|||
this.$nextTick(() => { |
|||
// 从父表单获取设备编码 |
|||
this.device_id = this.$props.parentForm.device_id |
|||
this.device_code = this.$props.parentForm.device_code |
|||
queryDriverConfig(this.device_id, this.$props.parentForm.driver_code).then(data => { |
|||
// 给表单赋值,并且属性不能为空 |
|||
if (data.form) { |
|||
const arr = Object.keys(data.form) |
|||
// 不为空 |
|||
if (arr.length > 0) { |
|||
this.form = data.form |
|||
} |
|||
} |
|||
|
|||
// 给表单赋值,并且属性不能为空 |
|||
if (data.parentForm) { |
|||
const arr = Object.keys(data.parentForm) |
|||
// 不为空 |
|||
if (arr.length > 0) { |
|||
this.opc_code = data.parentForm.opc_code |
|||
this.plc_code = data.parentForm.plc_code |
|||
} |
|||
} |
|||
this.data1 = data.rs |
|||
this.data2 = data.ws |
|||
this.sliceItem() |
|||
}) |
|||
selectPlcList().then(data => { |
|||
this.dataOpcPlcs = data |
|||
this.plc_id = this.$props.parentForm.opc_plc_id |
|||
}) |
|||
selectOpcList().then(data => { |
|||
this.dataOpcservers = data |
|||
this.opc_id = this.$props.parentForm.opc_server_id |
|||
}) |
|||
deviceCrud.selectDeviceList().then(data => { |
|||
this.deviceList = data |
|||
}) |
|||
}) |
|||
}, |
|||
methods: { |
|||
finishReadEdit(data) { |
|||
// 编辑的是code列,并且值包含mode |
|||
if (data.code.indexOf('mode') !== -1) { |
|||
const dbValue = data.db |
|||
// .之前的字符串 |
|||
const beforeStr = dbValue.match(/(\S*)\./)[1] |
|||
// .之后的字符串 |
|||
const afterStr = dbValue.match(/\.(\S*)/)[1] |
|||
// 取最后数字 |
|||
const endNumber = afterStr.substring(1) |
|||
// 最后为非数字 |
|||
if (isNaN(parseInt(endNumber))) { |
|||
return |
|||
} |
|||
for (const val in this.data1) { |
|||
if (this.data1[val].code.indexOf('move') !== -1) { |
|||
this.data1[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 1) |
|||
} |
|||
if (this.data1[val].code.indexOf('action') !== -1) { |
|||
this.data1[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 2) |
|||
} |
|||
if (this.data1[val].code.indexOf('ioaction') !== -1) { |
|||
this.data1[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 3) |
|||
} |
|||
if (this.data1[val].code.indexOf('error') !== -1) { |
|||
this.data1[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 5) |
|||
} |
|||
if (this.data1[val].code.indexOf('task') !== -1) { |
|||
this.data1[val].db = beforeStr + '.' + 'D' + (parseInt(endNumber) + 7) |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
finishWriteEdit(data) { |
|||
// 编辑的是code列,并且值包含mode |
|||
if (data.code.indexOf('to_command') !== -1) { |
|||
const dbValue = data.db |
|||
// .之前的字符串 |
|||
const beforeStr = dbValue.match(/(\S*)\./)[1] |
|||
// .之后的字符串 |
|||
const afterStr = dbValue.match(/\.(\S*)/)[1] |
|||
// 取最后数字 |
|||
const endNumber = afterStr.substring(1) |
|||
// 最后为非数字 |
|||
if (isNaN(parseInt(endNumber))) { |
|||
return |
|||
} |
|||
for (const val in this.data2) { |
|||
if (this.data2[val].code.indexOf('to_target') !== -1) { |
|||
this.data2[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 2) |
|||
} |
|||
if (this.data2[val].code.indexOf('to_task') !== -1) { |
|||
this.data2[val].db = beforeStr + '.' + 'D' + (parseInt(endNumber) + 6) |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
changeOpc(val) { |
|||
this.dataOpcservers.forEach(item => { |
|||
if (item.opc_id === val) { |
|||
this.opc_code = item.opc_code |
|||
} |
|||
}) |
|||
|
|||
selectListByOpcID(val).then(data => { |
|||
this.dataOpcPlcs = data |
|||
this.plc_id = '' |
|||
this.plc_code = '' |
|||
if (this.dataOpcPlcs && this.dataOpcPlcs.length > 0) { |
|||
this.plc_id = this.dataOpcPlcs[0].plc_id |
|||
this.plc_code = this.dataOpcPlcs[0].plc_code |
|||
} |
|||
this.sliceItem() |
|||
}) |
|||
}, |
|||
changePlc(val) { |
|||
this.dataOpcPlcs.forEach(item => { |
|||
if (item.plc_id === val) { |
|||
this.plc_code = item.plc_code |
|||
this.sliceItem() |
|||
return |
|||
} |
|||
}) |
|||
}, |
|||
test_read1() { |
|||
testRead(this.data1, this.opc_id).then(data => { |
|||
this.data1 = data |
|||
this.notify('操作成功!', 'success') |
|||
}).catch(err => { |
|||
console.log(err.response.data.message) |
|||
}) |
|||
}, |
|||
test_write1() { |
|||
testwrite(this.data2, this.opc_id).then(data => { |
|||
this.notify('操作成功!', 'success') |
|||
}).catch(err => { |
|||
console.log(err.response.data.message) |
|||
}) |
|||
}, |
|||
doSubmit() { |
|||
this.$refs['form'].validate((valid) => { |
|||
if (valid) { |
|||
this.configLoading = true |
|||
// 根据驱动类型判断是否为路由设备 |
|||
const parentForm = this.parentForm |
|||
parentForm.is_route = true |
|||
parentForm.plc_id = this.plc_id |
|||
parentForm.opc_id = this.opc_id |
|||
updateConfig(parentForm, this.form, this.data1, this.data2).then(res => { |
|||
this.notify('保存成功', 'success') |
|||
this.configLoading = false |
|||
}).catch(err => { |
|||
this.configLoading = false |
|||
console.log(err.response.data.message) |
|||
}) |
|||
} |
|||
}) |
|||
}, |
|||
sliceItem() { // 拼接DB的Item值 |
|||
this.data1.forEach(item => { |
|||
const str = item.code |
|||
// 是否包含. |
|||
if (str.search('.') !== -1) { |
|||
// 截取最后一位 |
|||
item.code = this.opc_code + '.' + this.plc_code + '.' + this.device_code + '.' + str.slice(str.lastIndexOf('.') + 1) |
|||
} else { |
|||
item.code = this.opc_code + '.' + this.plc_code + '.' + this.device_code + '.' + item.code |
|||
} |
|||
}) |
|||
this.data2.forEach(item => { |
|||
const str = item.code |
|||
// 是否包含. |
|||
if (str.search('.') !== -1) { |
|||
// 截取最后一位 |
|||
item.code = this.opc_code + '.' + this.plc_code + '.' + this.device_code + '.' + str.slice(str.lastIndexOf('.') + 1) |
|||
} else { |
|||
item.code = this.opc_code + '.' + this.plc_code + '.' + this.device_code + '.' + item.code |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
|
|||
</style> |
Loading…
Reference in new issue