Commit 5bc9fae6 LN

1.门口料盘状态发送给服务器doorReelSignal。

2.合并墨西哥料仓机器人对接功能。
3.光栅被遮挡时不扫码.
4.循环点位测试功能。
1 个父辈 86f90bf4
......@@ -50,13 +50,8 @@ namespace OnlineStore.ACSingleStore
foreach (ConfigIO ioValue in boxBean.Config.StoreDIList.Values)
{
this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 28));
IOTextControl control = new IOTextControl();
control.IOName = ioValue.ElectricalDefinition + "_" + ResourceCulture.GetString(ioValue.ElectricalDefinition, ioValue.Explain);
control.IOValue = 0;
control.isCanClick = false;
control.Name = "IO_" + ioValue.ProName;
control.Size = new System.Drawing.Size(200, 25);
control.TabIndex = 0;
IOTextControl control = new IOTextControl(ioValue.DisplayName, ioValue.ProName);
control.Click += Control_Click;
this.tableLayoutPanel1.Controls.Add(control, 0, roleindex);
roleindex++;
DIControlList.Add(ioValue.ProName, control);
......@@ -68,14 +63,8 @@ namespace OnlineStore.ACSingleStore
foreach (ConfigIO ioValue in boxBean.Config.StoreDOList.Values)
{
this.tableLayoutPanel2.RowStyles.Add(new RowStyle(SizeType.Absolute, 28));
IOTextControl control = new IOTextControl();
control.IOName = ioValue.ElectricalDefinition + "_" + ResourceCulture.GetString(ioValue.ElectricalDefinition, ioValue.Explain);
control.IOValue = 0;
control.isCanClick = true;
//control.Location = new System.Drawing.Point(0, 25*roleindex);
control.Name = "IO_" + ioValue.ProName;
control.Size = new System.Drawing.Size(200, 25);
control.TabIndex = 0;
IOTextControl control = new IOTextControl(ioValue.DisplayName, ioValue.ProName);
control.Click += Control_Click;
this.tableLayoutPanel2.Controls.Add(control, 0, roleindex);
roleindex++;
DOControlList.Add(ioValue.ProName, control);
......@@ -87,6 +76,17 @@ namespace OnlineStore.ACSingleStore
cmbWriteIO.DisplayMember = "DisplayStr";
cmbWriteValue.SelectedIndex = 0;
}
private void Control_Click(object sender, EventArgs e)
{
IOTextControl control = (IOTextControl)sender;
string name = control.Name.Substring(3, control.Name.Length - 3);
List<string> keyList = new List<string>(DOControlList.Keys);
int index = keyList.IndexOf(name);
if (index >= 0)
{
cmbWriteIO.SelectedIndex = index;
}
}
private void timer1_Tick(object sender, EventArgs e)
{
......@@ -149,10 +149,12 @@ namespace OnlineStore.ACSingleStore
{
// txtIp.Text = io.DeviceName;
txtDOIndex.Text = io.GetIOAddr().ToString();
txtDoName.Text = io.DeviceName;
txtSlaveId.Text = io.SlaveID.ToString();
txtDoName.Text = io.IO_IP;
IOTextControl newControl = DOControlList[io.ProName];
if (selectControl != null) { selectControl.BackColor = Color.White; }
newControl.BackColor = Color.SkyBlue;
selectControl = newControl;
}
}
}
......@@ -160,6 +162,16 @@ namespace OnlineStore.ACSingleStore
private void FrmStoreIOStatus_Load(object sender, EventArgs e)
{
AIManager.Instance.NeedShow = true;
if (boxBean.Config.StoreDOList.ContainsKey(IO_Type.Device_Led))
{
btnDevideLed.Visible = true;
btnCDLed.Visible = true;
}
else
{
btnDevideLed.Visible = false;
btnCDLed.Visible = false;
}
}
private void cmbWriteIO_DrawItem(object sender, DrawItemEventArgs e)
......@@ -259,11 +271,13 @@ namespace OnlineStore.ACSingleStore
}
private void btnOpenDoor_Click(object sender, EventArgs e)
{
LogUtil.info("点击按钮:" + btnOpenDoor.Text);
IOManager.IOMove(IO_Type.Door_Up, IO_VALUE.HIGH);
IOManager.IOMove(IO_Type.Door_Down, IO_VALUE.LOW);
}
private void btnCloseDoor_Click(object sender, EventArgs e)
{
LogUtil.info("点击按钮:" + btnCloseDoor.Text);
IOManager.IOMove(IO_Type.Door_Down, IO_VALUE.HIGH);
IOManager.IOMove(IO_Type.Door_Up, IO_VALUE.LOW);
}
......@@ -297,5 +311,22 @@ namespace OnlineStore.ACSingleStore
{
IOManager.IOMove(IO_Type.Camera_Led, IO_VALUE.LOW);
}
private void btnDevideLed_Click(object sender, EventArgs e)
{
IOManager.IOMove(IO_Type.Device_Led, IO_VALUE.HIGH);
}
private void btnCDLed_Click(object sender, EventArgs e)
{
IOManager.IOMove(IO_Type.Device_Led, IO_VALUE.LOW);
}
private void groupBox1_Enter(object sender, EventArgs e)
{
}
}
}
......@@ -78,7 +78,6 @@
this.txtPwd.PasswordChar = '*';
this.txtPwd.Size = new System.Drawing.Size(215, 33);
this.txtPwd.TabIndex = 276;
this.txtPwd.Text = "123456";
this.txtPwd.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtPwd_KeyDown);
//
// FrmPwd
......
......@@ -161,6 +161,9 @@ namespace OnlineStore.ACSingleStore
}
this.tabControl1.TabPages.Remove(tabPage3);
groupCode.Visible = false;
loadTest();
tabControl1.TabPages.Remove(tabPage7);
}
private string WaitStart = ResourceCulture.GetString("等待启动");
private string dooropen = ResourceCulture.GetString("前门未关");
......@@ -183,6 +186,7 @@ namespace OnlineStore.ACSingleStore
{
return;
}
showTestMsg();
lblTempStr.Text = store.currTempStr;
ShowMsg();
//ReadPosistion();
......@@ -952,7 +956,8 @@ namespace OnlineStore.ACSingleStore
{
this.ShowInTaskbar = false;
this.notifyIcon1.Visible = true;
this.Hide();
//this.Hide();
this.WindowState = FormWindowState.Minimized ;
DebugStatus(false);
}
private void FrmStoreBox_FormClosed(object sender, FormClosedEventArgs e)
......@@ -1096,6 +1101,7 @@ namespace OnlineStore.ACSingleStore
ConfigAppSettings.SaveValue(Setting_Init.UseBuzzer, 0);
store.UseBuzzer = false;
LogUtil.info("去掉:启用蜂鸣器");
IOManager.IOMove(IO_Type.Alarm_Buzzer, IO_VALUE.LOW);
}
}
......@@ -1190,5 +1196,151 @@ namespace OnlineStore.ACSingleStore
StoreManager.UpdateBoxConfig(store.Config);
}
}
private void loadTest()
{
List<ConfigMoveAxis> axisList = new List<ConfigMoveAxis>(store.moveAxisList);
if (axisList.Count > 0)
{
cmbTest.Items.Clear();
foreach (ConfigMoveAxis a in axisList)
{
cmbTest.Items.Add(a.DisplayStr);
}
cmbTest.SelectedIndex = 0;
PortName = axisList[0].DeviceName;
SlvAddr = axisList[0].GetAxisValue();
}
}
private string PortName = "";
private int SlvAddr = 0;
private bool StartTest = false;
private string testInfo = "";
private string currInfo = "";
private int moveCount = 0;
private int speed = 1000;
private int A;
private int B;
private void btnTStart_Click(object sender, EventArgs e)
{
if (cmbTest.SelectedIndex >= 0)
{
DialogResult result=MessageBox.Show("确定开始循环测试?","确定提示",MessageBoxButtons.YesNo,MessageBoxIcon.Question);
if (!result.Equals(DialogResult.Yes))
{
return;
}
ConfigMoveAxis axis = store.moveAxisList[cmbTest.SelectedIndex];
PortName = axis.DeviceName;
SlvAddr = axis.GetAxisValue();
A = FormUtil.GetIntValue(txtA);
B=FormUtil.GetIntValue(txtB);
speed = FormUtil.GetIntValue(txtTSpeed);
moveCount = 0;
testInfo = DateTime.Now.ToString()+" "+ axis.DisplayStr + " 循环中:从 [" + A + "] 到 [" +B + "] " ;
LogUtil.info($"{cmbTest.Text} 开始测试:" + testInfo);
StartTest = true;
System.Threading.Tasks.Task.Run(() =>
{
TestRun();
});
FromStart(StartTest);
}
else
{
MessageBox.Show("请选择运动轴");
}
}
private void btnTStop_Click(object sender, EventArgs e)
{
StartTest = false;
FromStart(StartTest);
LogUtil.info($"{cmbTest.Text} 停止测试:" );
ACServerManager.SuddenStop(PortName, SlvAddr);
Thread.Sleep(200);
testInfo = "已停止测试";
currInfo = "";
}
private void TestRun()
{
while(StartTest)
{
try
{
Thread.Sleep(200);
if (!ACServerManager.ServerOnStatus(PortName, SlvAddr))
{
currInfo = DateTime.Now.ToString() + " " + $"第{moveCount}次移动,伺服还未打开,请先打开伺服";
}
else if (ACServerManager.GetAlarmStatus(PortName, SlvAddr) > 0)
{
currInfo = DateTime.Now.ToString() + " " + $"第{moveCount}次移动,伺服报警,请检查";
}
else
{
bool isOk = ACServerManager.GetBusyStatus(PortName, SlvAddr).Equals(0);
if (isOk)
{
bool useA = (moveCount % 2 == 0);
if (useA)
{
ACServerManager.AbsMove(PortName, SlvAddr, A, speed);
currInfo = DateTime.Now.ToString() + " " + $"第{moveCount}次移动,目标A点:{A}";
}
else
{
ACServerManager.AbsMove(PortName, SlvAddr, B, speed);
currInfo = DateTime.Now.ToString() + " " + $"第{moveCount}次移动,目标B点:{B}";
}
moveCount++;
LogUtil.info($"循环测试:{cmbTest.Text} " + currInfo);
}
}
}
catch(Exception ex)
{
LogUtil.error(" testRun 出错:" + ex.ToString());
}
}
}
private void FromStart(bool start)
{
cmbTest.Enabled = !start;
txtA.Enabled = !start;
txtB.Enabled = !start;
txtTSpeed.Enabled = !start;
btnTStart.Enabled = !start;
btnTStop.Enabled = start;
}
private void cmbTest_SelectedIndexChanged(object sender, EventArgs e)
{
if (cmbTest.SelectedIndex >= 0)
{
ConfigMoveAxis axis = store.moveAxisList[cmbTest.SelectedIndex];
PortName = axis.DeviceName;
SlvAddr = axis.GetAxisValue();
txtTSpeed.Text = axis.TargetSpeed / 2+"";
}
}
private void showTestMsg()
{
lblTmsg.Text = testInfo + "\r\n" + currInfo;
}
}
}
......@@ -56,7 +56,7 @@ namespace OnlineStore
//string chinaPath = Application.StartupPath + @"\resource\zh-CN.resource";
//Dictionary<string, string> ChinaMap = LoadDataMap(chinaPath);
//Dictionary<string, string> EnglishMap = LoadDataMap(englishPath);
string rPath = Application.StartupPath + @"\resource\language.resource";
string rPath= Application.StartupPath + @"\resource\language.resource";
ResourceMap = new Dictionary<string, Dictionary<string, string>>();
Dictionary<string, string> ChinaMap = new Dictionary<string, string>();
Dictionary<string, string> EnglishMap = new Dictionary<string, string>();
......@@ -103,10 +103,9 @@ namespace OnlineStore
// EnglishMap.Add(key, eng);
}
}
}
catch (Exception ex)
}catch(Exception ex)
{
LogUtil.error("读取文件【" + rPath + "】【" + line + "】出错:" + ex.ToString());
LogUtil.error("读取文件【"+ rPath + "】【"+ line + "】出错:" + ex.ToString());
}
}
}
......@@ -139,7 +138,7 @@ namespace OnlineStore
EnglishMap.Add(key, englistr);
}
}
string str = key + spilt + chinastr.Replace(spilt, '&') + spilt + englistr.Replace(spilt, '&');
string str = key + spilt + chinastr.Replace( spilt, '&') + spilt + englistr.Replace( spilt, '&');
allList.Add(str);
}
if (isNeedUpE)
......@@ -164,7 +163,7 @@ namespace OnlineStore
//FileUtil.SaveListToFile(allList.ToArray(), Application.StartupPath + "\\a.txt");
}
private static Dictionary<string, string> LoadRMap()
private static Dictionary<string,string> LoadRMap()
{
string path = Application.StartupPath + @"\resource\ResourceMap.csv";
Dictionary<string, string> map = new Dictionary<string, string>();
......@@ -203,7 +202,7 @@ namespace OnlineStore
}
catch (Exception ex)
{
LogUtil.error("加载 " + path + " 出错:" + ex.ToString());
LogUtil.error("加载 "+ path + " 出错:" + ex.ToString());
}
return map;
}
......@@ -273,7 +272,7 @@ namespace OnlineStore
string strCurLanguage = gets(English, id);
return String.Format(strCurLanguage, param);
}
private static string gets(string language, string id, string defaultStr = "")
private static string gets(string language,string id,string defaultStr="")
{
if (String.IsNullOrEmpty(defaultStr))
{
......@@ -287,7 +286,7 @@ namespace OnlineStore
{
if (ShowMsg)
{
LogUtil.error("No Language Resources:[" + id + "], please add");
LogUtil.debug ("No Language Resources:[" + id + "], please add");
}
return defaultStr;
}
......@@ -307,10 +306,9 @@ namespace OnlineStore
catch (Exception ex)
{
NoIdLog(id, defaultStr);
}return defaultStr;
}
return defaultStr;
}
public static string GetString(string id, string defaultStr = "")
public static string GetString(string id, string defaultStr="")
{
string strCurLanguage = defaultStr;
if (string.IsNullOrEmpty(defaultStr))
......@@ -325,7 +323,7 @@ namespace OnlineStore
{
if (ShowMsg)
{
LogUtil.error("No Language Resources:[" + id + "], please add");
LogUtil.debug("No Language Resources:[" + id + "], please add");
}
return defaultStr;
}
......@@ -361,9 +359,9 @@ namespace OnlineStore
{
return;
}
if (ShowMsg)
// if (ShowMsg)
{
LogUtil.info("No id:[" + id + "], please add,use default string :" + defaultStr);
LogUtil.debug("No id:[" + id + "], please add,use default string :" + defaultStr);
}
if (!defaultMap.ContainsKey(id))
{
......@@ -379,8 +377,8 @@ namespace OnlineStore
foreach (string key in defaultMap.Keys)
{
string value = defaultMap[key];
LogUtil.info("" + key + spilt + value + spilt + "");
LogUtil.RLog("" + key + spilt + value.Replace(spilt, '&') + spilt + "");
LogUtil.info("" + key + spilt + value +spilt +"");
LogUtil.RLog("" + key + spilt + value.Replace(spilt,'&') + spilt+"");
}
LogUtil.info("结束打印缺少的文字配置");
......@@ -417,7 +415,7 @@ namespace OnlineStore
string showMsg = ResourceCulture.GetString(msg, msg, param);
string showTitle = ResourceCulture.GetString("提示");
return MessageBox.Show(showMsg, showTitle);
return MessageBox.Show( showMsg,showTitle);
}
public static DialogResult Show(string msg, string title, MessageBoxButtons but, params object[] param)
{
......
......@@ -207,5 +207,9 @@ namespace OnlineStore.Common
/// 温度报警值
/// </summary>
public static string maxTemperature = "temp";
/// <summary>
/// 门口料盘检测信号,1或者0
/// </summary>
public static string doorReelSignal = "doorReelSignal";
}
}
......@@ -135,19 +135,26 @@ namespace OnlineStore.DeviceLibrary
public override double GetAIValue(string ioiP, int index)
{
for (int i = 1; i <= 3; i++)
{
try
{
if (AIValList != null && index >= 0 && AIValList.Count > index)
{
return AIValList[index];
}
}
catch (Exception ex)
{
if (i > 1)
{
LogUtil.error("GetAIValue第【" + i + "】次获取 " + ioiP + "_" + index + "出错:" + ex.ToString());
}
}
Thread.Sleep(1);
}
return 0;
}
//public override double ConvertAI(double aiValue, double defaultValue)
//{
// double xishu = (double)ConfigAppSettings.GetNumValue(Setting_Init.AI_ConvertPosition);
// double result = Math.Round((aiValue - defaultValue) / xishu, 2);
// return result;
//}
}
}
......@@ -9,19 +9,17 @@ using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System.Threading.Tasks;
using Asa.IOModule;
using System.Collections.Concurrent;
namespace OnlineStore.DeviceLibrary
{
public class AIOBOXManager : IOManager
{
//public static uint DefaultDICount = 16;
//public static uint DefaultDOCount = 16;
public readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public Dictionary<string, AIOBOX> AIOMap = new Dictionary<string, AIOBOX>();
public Dictionary<string, List<Box_Sta>> DIValueMap = new Dictionary<string, List<Box_Sta>>();
public Dictionary<string, List<Box_Sta>> DOValueMap = new Dictionary<string, List<Box_Sta>>();
public ConcurrentDictionary<string, List<Box_Sta>> DIValueMap = new ConcurrentDictionary<string, List<Box_Sta>>();
public ConcurrentDictionary<string, List<Box_Sta>> DOValueMap = new ConcurrentDictionary<string, List<Box_Sta>>();
private object DIMapLock = "";
private object DOMapLock = "";
......@@ -87,13 +85,14 @@ namespace OnlineStore.DeviceLibrary
}
AIOMap.Remove(ioIp);
}
List<Box_Sta> list = new List<Box_Sta>();
if (DIValueMap.ContainsKey(ioIp))
{
DIValueMap.Remove(ioIp);
DIValueMap.TryRemove(ioIp,out list);
}
if (DOValueMap.ContainsKey(ioIp))
{
DOValueMap.Remove(ioIp);
DOValueMap.TryRemove(ioIp, out list);
}
int DIMS = ConfigAppSettings.GetIntValue("DIMS");
if (DIMS < 20)
......@@ -221,14 +220,6 @@ namespace OnlineStore.DeviceLibrary
}
else
{
//foreach(Box_Sta s in sta)
//{
// updateDi += s.ToString() + ",";
//}
//if (ip.Equals("192.168.201.61"))
//{
// LogUtil.info(updateDi);
//}
for (int i = 0; i < newList.Count; i++)
{
if (!(oldList[i].Equals(newList[i])))
......@@ -240,13 +231,15 @@ namespace OnlineStore.DeviceLibrary
}
if (needUpdate)
{
lock (DILock)
// lock (DILock)
{
if (DIValueMap.ContainsKey(ip))
{
DIValueMap.Remove(ip);
List<Box_Sta> s = new List<Box_Sta>();
DIValueMap.TryRemove(ip,out s);
}
DIValueMap.Add(ip, newList);
DIValueMap.TryAdd(ip, newList);
}
}
}
......@@ -261,12 +254,7 @@ namespace OnlineStore.DeviceLibrary
newList.AddRange(sta);
List<Box_Sta> oldList = null;
DOValueMap.TryGetValue(ip, out oldList);
//string result = "UpdateAllDO ip[" + ip + "], sta :";
//for (int i = 0; i < newList.Count; i++)
//{
// result += newList[i] + ",";
//}
//LogUtil.info(result);
if (oldList == null || oldList.Count.Equals(newList.Count).Equals(false))
{
needUpdate = true;
......@@ -284,27 +272,17 @@ namespace OnlineStore.DeviceLibrary
}
if (needUpdate)
{
lock (DOLock)
// lock (DOLock)
{
if (DOValueMap.ContainsKey(ip))
{
DOValueMap.Remove(ip);
List<Box_Sta> list = new List<Box_Sta>();
DOValueMap.TryRemove(ip,out list);
}
DOValueMap.Add(ip, newList);
DOValueMap.TryAdd(ip, newList);
}
}
}
//else
//{
// if (sta == null)
// {
// LogUtil.error("UpdateAllDO ip[" + ip + "], sta=null");
// }
// else
// {
// LogUtil.error(" UpdateAllDO ip[" + ip + "], sta.Length=" + sta.Length);
// }
//}
}
......@@ -331,12 +309,19 @@ namespace OnlineStore.DeviceLibrary
public override void CloseAllConnection()
{
try
{
foreach (AIOBOX aio in AIOMap.Values)
{
aio.Close();
}
AIOMap.Clear();
}
catch (Exception ex)
{
LogUtil.error("CloseAllConnection 出错:" + ex.ToString());
}
}
public override void WriteSingleDO(string ioIp, byte slaveId, ushort StartAddress, IO_VALUE onOff)
{
try
......@@ -422,7 +407,7 @@ namespace OnlineStore.DeviceLibrary
}
catch (Exception ex)
{
LogUtil.error("ReadAllDI出错:" + ioIp);
LogUtil.error("ReadAllDI [" + ioIp + "] 出错:" + ex.ToString());
}
}
public override void ReadAllDO(string ioIp, byte slaveId)
......@@ -439,21 +424,20 @@ namespace OnlineStore.DeviceLibrary
}
catch (Exception ex)
{
LogUtil.error("ReadAllDO出错:" + ioIp);
LogUtil.error("ReadAllDO ["+ioIp+"] 出错:" + ex.ToString());
}
}
public override IO_VALUE GetDOValue(string ioIP, byte slaveId, ushort StartAddress)
{
IO_VALUE value = IO_VALUE.LOW;
for (int i = 1; i <= 3; i++)
{
try
{
AIOBOX aioBox = getAIO(ioIP);
if (aioBox != null)
{
Box_Sta sta = Box_Sta.Off;
// Box_Addr addr = GetAddr(StartAddress);
// int index = (int)StartAddress - (int)StoreManager.Config.GetDILength(ioIP);
if (DOValueMap.ContainsKey(ioIP) && DOValueMap[ioIP].Count > StartAddress)
{
sta = DOValueMap[ioIP][StartAddress];
......@@ -464,11 +448,13 @@ namespace OnlineStore.DeviceLibrary
{
value = IO_VALUE.HIGH;
}
break;
}
}
catch (Exception ex)
{
LogUtil.error("GetDOValue 出错:" + ex.ToString());
LogUtil.error("GetDOValue [" + ioIP + "] [" + StartAddress + "] [" + i + "] 出错:" + ex.ToString());
}
}
return value;
}
......@@ -476,6 +462,8 @@ namespace OnlineStore.DeviceLibrary
public override IO_VALUE GetDIValue(string ioIP, byte slaveId, ushort StartAddress)
{
IO_VALUE value = IO_VALUE.LOW;
for (int i = 1; i <= 3; i++)
{
try
{
AIOBOX aioBox = getAIO(ioIP);
......@@ -496,11 +484,13 @@ namespace OnlineStore.DeviceLibrary
{
value = IO_VALUE.HIGH;
}
break;
}
}
catch (Exception ex)
{
LogUtil.error("GetDIValue 出错:" + ex.ToString());
LogUtil.error("GetDIValue [" + ioIP + "] ["+StartAddress+"] [" + i+"] 出错:" + ex.ToString());
}
}
return value;
}
......
......@@ -68,7 +68,10 @@ namespace OnlineStore.DeviceLibrary
{
try
{
if (scannerSocket != null)
{
scannerSocket.close();
}
isScannerRun = false;
}
catch (Exception ex)
......
......@@ -89,7 +89,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
OutStoreExecute = 9,
/// <summary>
///10= 出仓位完成( 料盘已经放到Box门口)
///10= 出仓位完成 ,从仓位中拿走
/// </summary>
OutStoreBoxEnd = 10,
/// <summary>
......@@ -104,6 +104,10 @@ namespace OnlineStore.DeviceLibrary
/// 重置中(原点返回和重置都发此状态)
/// </summary>
ResetMove=13,
/// <summary>
/// 扫码入库失败
/// </summary>
InStoreError=14,
}
/// <summary>
......@@ -121,10 +125,10 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
BOX_H_LocationCylinderBack=010,
/// <summary>
/// 料仓原点返回和重置步骤,轴三先相对走3000
/// </summary>
BOX_H_InOutMove=011,
///// <summary>
///// 料仓原点返回和重置步骤,等待开始原点返回
///// </summary>
//BOX_H_InOutMove=011,
/// <summary>
/// 料仓原点返回和重置步骤,,轴三进出轴先返回原点
/// </summary>
......@@ -249,6 +253,11 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
SO_15_WaitTake=115,
/// <summary>
/// 料仓出库。。。等待200毫秒再次验证料盘是否拿走
/// </summary>
SO_16_CheckIsTake=116,
#endregion
#region 料仓内部入库步骤
......@@ -263,7 +272,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 入库。。进出轴(叉子)先返回P1
/// </summary>
SI_02_InOutAxisHome = 202,
SI_02_OpenDoor = 202,
/// <summary>
/// 入库。。所有轴先回到待机点,轴2、轴1 动作到P1,,轴4动作至P3
/// </summary>
......
......@@ -253,6 +253,16 @@ namespace OnlineStore.LoadCSVLibrary
{
}
}
public string DisplayName
{
get
{
return ElectricalDefinition + "_" + CSVResourceControl.GetString(ElectricalDefinition, Explain);
}
set
{
}
}
public override int GetValue()
{
return GetIOValue();
......
......@@ -560,6 +560,12 @@ namespace OnlineStore.LoadCSVLibrary
/// /// </summary>
[ConfigProAttribute("AI_ConvertPosition")]
public int AI_ConvertPosition { get; set; }
/// <summary>
/// PRO,大盘宽度(13寸或15寸),Big_TrayWidth,15,,,,,,,
/// /// </summary>
[ConfigProAttribute("Big_TrayWidth",false)]
public int Big_TrayWidth { get; set; }
private Dictionary<string, string> CodeSizeMap =null ;
private static char codeSpilt= '#';
......
......@@ -113,6 +113,10 @@ namespace OnlineStore.LoadCSVLibrary
/// DO 相机照明开 Camera_Led Y10
/// </summary>
public static string Camera_Led = "Camera_Led";
/// <summary>
/// DO 设备照明开 Device_Led Y11
/// </summary>
public static string Device_Led = "Device_Led";
}
public enum IO_VALUE
{
......
......@@ -45,6 +45,7 @@
this.label1.Size = new System.Drawing.Size(53, 12);
this.label1.TabIndex = 0;
this.label1.Text = "测试一下";
this.label1.Click += new System.EventHandler(this.label1_Click);
//
// pictureBox1
//
......@@ -57,6 +58,7 @@
this.pictureBox1.TabIndex = 1;
this.pictureBox1.TabStop = false;
this.pictureBox1.Click += new System.EventHandler(this.pictureBox1_Click);
this.pictureBox1.DoubleClick += new System.EventHandler(this.pictureBox1_DoubleClick);
//
// pictureBox2
//
......@@ -69,6 +71,7 @@
this.pictureBox2.TabIndex = 2;
this.pictureBox2.TabStop = false;
this.pictureBox2.Click += new System.EventHandler(this.pictureBox2_Click);
this.pictureBox2.DoubleClick += new System.EventHandler(this.pictureBox2_DoubleClick);
//
// IOTextControl
//
......
......@@ -21,7 +21,7 @@ namespace UserFromControl
public IOTextControl()
{
InitializeComponent();
if (ImageManager.IsInit==false)
if (ImageManager.IsInit == false)
{
ImageManager.Init();
}
......@@ -31,7 +31,26 @@ namespace UserFromControl
pictureBox2.Visible = false;
isCanClick = false;
}
public IOTextControl(string ioName, string name, int widht = 220, int height = 25, int ioValue = -1, bool canClick = false, int tabIndex = 0)
{
InitializeComponent();
if (ImageManager.IsInit == false)
{
ImageManager.Init();
}
this.pictureBox1.BackgroundImage = ImageManager.imgGrey;
this.pictureBox2.BackgroundImage = ImageManager.imgGreen;
pictureBox1.Visible = true;
pictureBox2.Visible = false;
isCanClick = false;
IOName = ioName;
IOValue = IOValue;
isCanClick = canClick;
Name = "IO_" + name;
Size = new System.Drawing.Size(widht, height);
TabIndex = tabIndex;
}
public void ShowData()
{
label1.Text = IOName;
......@@ -41,11 +60,17 @@ namespace UserFromControl
pictureBox1.Visible = true;
pictureBox2.Visible = false;
}
else
else if (IOValue == 1)
{
pictureBox1.Visible = false;
pictureBox2.Visible = true;
}
else
{
pictureBox1.Visible = false;
pictureBox2.Visible = false;
}
}
private void IOStatusControl_Load(object sender, EventArgs e)
......@@ -55,20 +80,36 @@ namespace UserFromControl
private void pictureBox2_Click(object sender, EventArgs e)
{
if (isCanClick)
this.OnClick(e);
}
private void pictureBox1_Click(object sender, EventArgs e)
{
pictureBox2.Visible = true;
pictureBox1.Visible = false;
this.OnClick(e);
}
private void label1_DoubleClick(object sender, EventArgs e)
{
this.OnDoubleClick(e);
}
private void pictureBox1_Click(object sender, EventArgs e)
private void pictureBox2_DoubleClick(object sender, EventArgs e)
{
if (isCanClick)
this.OnDoubleClick(e);
}
private void pictureBox1_DoubleClick(object sender, EventArgs e)
{
pictureBox2.Visible = false;
pictureBox1.Visible = true;
this.OnDoubleClick(e);
}
private void label1_Click(object sender, EventArgs e)
{
this.OnClick(e);
}
}
}
文件属性发生变化
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!