Commit 458e9dcd 张东亮

confighelper更新最新、料串到位滚筒减少2秒转、库位状态加载失败不重新加载

1 个父辈 e33d2e64
此文件类型无法预览
...@@ -322,6 +322,11 @@ ...@@ -322,6 +322,11 @@
</summary> </summary>
<param name="action"></param> <param name="action"></param>
</member> </member>
<member name="M:CommonLib.DeleteWithRemainingCapacity">
<summary>
空间不足5G时自动删除文件
</summary>
</member>
<member name="M:CommonLib.DeleteOverDayFile(System.String,System.String,System.Int32)"> <member name="M:CommonLib.DeleteOverDayFile(System.String,System.String,System.Int32)">
<summary> <summary>
删除超过指定天数的文件 删除超过指定天数的文件
......
此文件类型无法预览
此文件的差异太大,无法显示。
...@@ -161,8 +161,8 @@ namespace DeviceLibrary ...@@ -161,8 +161,8 @@ namespace DeviceLibrary
StringMoveInfo.NextMoveStep(MoveStep.StringLoad_02); StringMoveInfo.NextMoveStep(MoveStep.StringLoad_02);
if (IOValue(IO_Type.StringBack_Check).Equals(IO_VALUE.HIGH)) if (IOValue(IO_Type.StringBack_Check).Equals(IO_VALUE.HIGH))
{ {
Line.LineRun("n", false, 2); // Line.LineRun("n", false, 2);
StringMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000)); StringMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
} }
break; break;
case MoveStep.StringLoad_02: case MoveStep.StringLoad_02:
......
...@@ -35,11 +35,12 @@ namespace TheMachine ...@@ -35,11 +35,12 @@ namespace TheMachine
Init(); Init();
} }
} }
Dictionary<string,PosState> posState = new Dictionary<string, PosState>(); Dictionary<string, PosState> posState = new Dictionary<string, PosState>();
//如果总配置文件存在,保存到总的配置文件 //如果总配置文件存在,保存到总的配置文件
static string appPath = Application.StartupPath; static string appPath = Application.StartupPath;
static string positionConfigFile = Path.Combine(appPath, "StoreConfig\\linePositions.csv"); static string positionConfigFile = Path.Combine(appPath, "StoreConfig\\linePositions.csv");
class PosState { class PosState
{
public int InStoreCheck = 0; public int InStoreCheck = 0;
public int OutStoreCheck = 0; public int OutStoreCheck = 0;
...@@ -79,7 +80,8 @@ namespace TheMachine ...@@ -79,7 +80,8 @@ namespace TheMachine
} }
checkVerify(); checkVerify();
} }
DataGridViewCellStyle GetStyle(string posid) { DataGridViewCellStyle GetStyle(string posid)
{
if (htpp.ContainsKey(posid) && posState.ContainsKey(posid)) if (htpp.ContainsKey(posid) && posState.ContainsKey(posid))
{ {
var pp = (PosPos)htpp[posid]; var pp = (PosPos)htpp[posid];
...@@ -114,13 +116,15 @@ namespace TheMachine ...@@ -114,13 +116,15 @@ namespace TheMachine
label_verify.Text = s.ToString("0.0") + "%"; label_verify.Text = s.ToString("0.0") + "%";
} }
Hashtable htpp = new Hashtable(); Hashtable htpp = new Hashtable();
class PosPos { class PosPos
{
public string Posid; public string Posid;
public int index; public int index;
public int row; public int row;
public int col; public int col;
} }
int PosCompare(string a, string b) { int PosCompare(string a, string b)
{
if (a.StartsWith("fix")) if (a.StartsWith("fix"))
return -1; return -1;
if (b.StartsWith("fix")) if (b.StartsWith("fix"))
...@@ -174,7 +178,8 @@ namespace TheMachine ...@@ -174,7 +178,8 @@ namespace TheMachine
else else
return -1; return -1;
} }
void LoadPosCheck() { void LoadPosCheck()
{
var poscheckfile = positionConfigFile + ".check"; var poscheckfile = positionConfigFile + ".check";
if (File.Exists(poscheckfile)) if (File.Exists(poscheckfile))
{ {
...@@ -183,12 +188,12 @@ namespace TheMachine ...@@ -183,12 +188,12 @@ namespace TheMachine
posState = JsonHelper.DeserializeJsonToObject<Dictionary<string, PosState>>(File.ReadAllText(poscheckfile)); posState = JsonHelper.DeserializeJsonToObject<Dictionary<string, PosState>>(File.ReadAllText(poscheckfile));
File.Copy(poscheckfile, poscheckfile + ".backup", true); File.Copy(poscheckfile, poscheckfile + ".backup", true);
} }
catch { catch
{
if (File.Exists(poscheckfile + ".backup")) if (File.Exists(poscheckfile + ".backup"))
{ {
File.Copy(poscheckfile + ".backup", poscheckfile, true); File.Copy(poscheckfile + ".backup", poscheckfile, true);
File.Delete(poscheckfile + ".backup"); File.Delete(poscheckfile + ".backup");
LoadPosCheck();
} }
} }
} }
...@@ -197,11 +202,12 @@ namespace TheMachine ...@@ -197,11 +202,12 @@ namespace TheMachine
File.WriteAllText(poscheckfile, JsonHelper.SerializeObject(posState)); File.WriteAllText(poscheckfile, JsonHelper.SerializeObject(posState));
} }
} }
PosState SavePosCheck(string posid,int inStoreCheck,int outStoreCheck) { PosState SavePosCheck(string posid, int inStoreCheck, int outStoreCheck)
{
if (!posState.ContainsKey(posid)) if (!posState.ContainsKey(posid))
posState.Add(posid, new PosState()); posState.Add(posid, new PosState());
if (inStoreCheck>0) if (inStoreCheck > 0)
posState[posid].InStoreCheck = inStoreCheck; posState[posid].InStoreCheck = inStoreCheck;
if (outStoreCheck > 0) if (outStoreCheck > 0)
posState[posid].OutStoreCheck = outStoreCheck; posState[posid].OutStoreCheck = outStoreCheck;
...@@ -209,12 +215,13 @@ namespace TheMachine ...@@ -209,12 +215,13 @@ namespace TheMachine
File.WriteAllText(poscheckfile, JsonHelper.SerializeObject(posState)); File.WriteAllText(poscheckfile, JsonHelper.SerializeObject(posState));
return posState[posid]; return posState[posid];
} }
static Font font = new Font("宋体",10); static Font font = new Font("宋体", 10);
DataGridViewCellStyle dgv_ok = new DataGridViewCellStyle() { BackColor = Color.LightGreen, Font = font }; DataGridViewCellStyle dgv_ok = new DataGridViewCellStyle() { BackColor = Color.LightGreen, Font = font };
DataGridViewCellStyle dgv_oin = new DataGridViewCellStyle() { BackColor = Color.LightGray, Font = font }; DataGridViewCellStyle dgv_oin = new DataGridViewCellStyle() { BackColor = Color.LightGray, Font = font };
DataGridViewCellStyle dgv_oout = new DataGridViewCellStyle() { BackColor = Color.LightSeaGreen, Font = font }; DataGridViewCellStyle dgv_oout = new DataGridViewCellStyle() { BackColor = Color.LightSeaGreen, Font = font };
DataGridViewCellStyle dgv_none = new DataGridViewCellStyle() { BackColor = Color.White,Font= font }; DataGridViewCellStyle dgv_none = new DataGridViewCellStyle() { BackColor = Color.White, Font = font };
void FillBoxPos() { void FillBoxPos()
{
if (RobotManage.PositionNumList.Count == 0) if (RobotManage.PositionNumList.Count == 0)
return; return;
htpp.Clear(); htpp.Clear();
...@@ -225,7 +232,7 @@ namespace TheMachine ...@@ -225,7 +232,7 @@ namespace TheMachine
RobotManage.PositionNumList.Sort(comparison); RobotManage.PositionNumList.Sort(comparison);
string[] posstr = RobotManage.PositionNumList[RobotManage.PositionNumList.Count-1].Split('_'); string[] posstr = RobotManage.PositionNumList[RobotManage.PositionNumList.Count - 1].Split('_');
int colcount = 0; int colcount = 0;
if (!int.TryParse(posstr[1], out colcount)) if (!int.TryParse(posstr[1], out colcount))
colcount = int.Parse(posstr[1][0].ToString()); colcount = int.Parse(posstr[1][0].ToString());
...@@ -249,7 +256,7 @@ namespace TheMachine ...@@ -249,7 +256,7 @@ namespace TheMachine
for (int i = 0; i < RobotManage.PositionNumList.Count; i++) for (int i = 0; i < RobotManage.PositionNumList.Count; i++)
{ {
int ci = RobotManage.PositionNumList.Count-1 - i; int ci = RobotManage.PositionNumList.Count - 1 - i;
string posname = RobotManage.PositionNumList[ci]; string posname = RobotManage.PositionNumList[ci];
if (posname.StartsWith("fix")) if (posname.StartsWith("fix"))
{ {
...@@ -277,7 +284,7 @@ namespace TheMachine ...@@ -277,7 +284,7 @@ namespace TheMachine
lastcol = col; lastcol = col;
lastAB = ab; lastAB = ab;
if (currentRowIndex >= dataGridView1.Rows.Count-1) if (currentRowIndex >= dataGridView1.Rows.Count - 1)
{ {
int x = dataGridView1.Rows.Add(); int x = dataGridView1.Rows.Add();
} }
...@@ -296,7 +303,8 @@ namespace TheMachine ...@@ -296,7 +303,8 @@ namespace TheMachine
} }
for (int i = 0; i < dataGridView1.Columns.Count; i++) for (int i = 0; i < dataGridView1.Columns.Count; i++)
{ {
if (dataGridView1.Rows[0].Cells[i].Value==null) { if (dataGridView1.Rows[0].Cells[i].Value == null)
{
dataGridView1.Columns[i].Width = 0; dataGridView1.Columns[i].Width = 0;
} }
} }
...@@ -309,14 +317,15 @@ namespace TheMachine ...@@ -309,14 +317,15 @@ namespace TheMachine
dataGridView1.Rows[0].Cells[dataGridView1.Columns.Count - 2].Selected = true; dataGridView1.Rows[0].Cells[dataGridView1.Columns.Count - 2].Selected = true;
} }
dataGridView1.Rows.RemoveAt(dataGridView1.Rows.Count - 1); dataGridView1.Rows.RemoveAt(dataGridView1.Rows.Count - 1);
if (dataGridView1.SelectedCells.Count>0) if (dataGridView1.SelectedCells.Count > 0)
setData(dataGridView1.SelectedCells[0].Tag.ToString()); setData(dataGridView1.SelectedCells[0].Tag.ToString());
else else
setData(RobotManage.PositionNumList.Last()); setData(RobotManage.PositionNumList.Last());
checkVerify(); checkVerify();
} }
void setData(string posid) { void setData(string posid)
{
ACStorePosition ktkPosition = CSVPositionReader<ACStorePosition>.GetPositon(posid); ACStorePosition ktkPosition = CSVPositionReader<ACStorePosition>.GetPositon(posid);
cmbPosition.Text = posid; cmbPosition.Text = posid;
label_size.Text = $"[{ktkPosition.BagWidth}x{ktkPosition.BagHigh}]"; label_size.Text = $"[{ktkPosition.BagWidth}x{ktkPosition.BagHigh}]";
...@@ -332,7 +341,8 @@ namespace TheMachine ...@@ -332,7 +341,8 @@ namespace TheMachine
string selectPositionNum = cmbPosition.Text; string selectPositionNum = cmbPosition.Text;
ACStorePosition ktkPosition = CSVPositionReader<ACStorePosition>.GetPositon(selectPositionNum); ACStorePosition ktkPosition = CSVPositionReader<ACStorePosition>.GetPositon(selectPositionNum);
JobInfo jobInfo = new JobInfo("IN_TEST", selectPositionNum, ktkPosition.BagWidth, ktkPosition.BagHigh); JobInfo jobInfo = new JobInfo("IN_TEST", selectPositionNum, ktkPosition.BagWidth, ktkPosition.BagHigh);
if (!RobotManage.mainMachine.StartInStore(jobInfo)) { if (!RobotManage.mainMachine.StartInStore(jobInfo))
{
MessageBox.Show(crc.GetString(L.reel_not_onposition_cant_manual_in, "料盘没有到位,无法手动入库")); MessageBox.Show(crc.GetString(L.reel_not_onposition_cant_manual_in, "料盘没有到位,无法手动入库"));
return; return;
} }
...@@ -340,7 +350,7 @@ namespace TheMachine ...@@ -340,7 +350,7 @@ namespace TheMachine
} }
else else
{ {
MessageBox.Show(crc.GetString(L.start_device_first,"请先启动料仓!")); MessageBox.Show(crc.GetString(L.start_device_first, "请先启动料仓!"));
} }
} }
...@@ -350,7 +360,8 @@ namespace TheMachine ...@@ -350,7 +360,8 @@ namespace TheMachine
{ {
string selectPositionNum = cmbPosition.Text; string selectPositionNum = cmbPosition.Text;
ACStorePosition position = CSVPositionReader<ACStorePosition>.GetPositon(selectPositionNum); ACStorePosition position = CSVPositionReader<ACStorePosition>.GetPositon(selectPositionNum);
if (RobotManage.mainMachine.boxTransportIsFree) { if (RobotManage.mainMachine.boxTransportIsFree)
{
LogUtil.info($"手动出库:{selectPositionNum}"); LogUtil.info($"手动出库:{selectPositionNum}");
RobotManage.mainMachine.AddSingleStoreTask(selectPositionNum, position.BagWidth, position.BagHigh); RobotManage.mainMachine.AddSingleStoreTask(selectPositionNum, position.BagWidth, position.BagHigh);
} }
...@@ -401,7 +412,7 @@ namespace TheMachine ...@@ -401,7 +412,7 @@ namespace TheMachine
} }
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{ {
if (e.RowIndex<0 || dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Tag == null) if (e.RowIndex < 0 || dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Tag == null)
return; return;
var posid = dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Tag.ToString(); var posid = dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Tag.ToString();
setData(posid); setData(posid);
...@@ -422,9 +433,9 @@ namespace TheMachine ...@@ -422,9 +433,9 @@ namespace TheMachine
RobotManage.mainMachine.AutoInOutTest = false; RobotManage.mainMachine.AutoInOutTest = false;
//RobotManage.mainMachine.StopAutoInOut = false; //RobotManage.mainMachine.StopAutoInOut = false;
} }
btnInStore.Enabled= cb_inoutdebugmode.Checked; btnInStore.Enabled = cb_inoutdebugmode.Checked;
btnOutStore.Enabled= cb_inoutdebugmode.Checked; btnOutStore.Enabled = cb_inoutdebugmode.Checked;
btn_autoinout.Enabled=cb_inoutdebugmode.Checked; btn_autoinout.Enabled = cb_inoutdebugmode.Checked;
cb_plateheight.Enabled = cb_inoutdebugmode.Checked; cb_plateheight.Enabled = cb_inoutdebugmode.Checked;
} }
...@@ -466,7 +477,7 @@ namespace TheMachine ...@@ -466,7 +477,7 @@ namespace TheMachine
private void cb_fixpos_SelectedIndexChanged(object sender, EventArgs e) private void cb_fixpos_SelectedIndexChanged(object sender, EventArgs e)
{ {
if (cb_fixpos.SelectedItem!=null) if (cb_fixpos.SelectedItem != null)
setData(cb_fixpos.SelectedItem.ToString()); setData(cb_fixpos.SelectedItem.ToString());
} }
} }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!