Commit 33b5a61c 刘韬

修正库位配置不保存的问题

1 个父辈 32cfd620
...@@ -103,8 +103,8 @@ namespace DeviceLibrary ...@@ -103,8 +103,8 @@ namespace DeviceLibrary
{ {
operation.data.Add("singleIn", "false"); operation.data.Add("singleIn", "false");
} }
Operation resultOperation = HttpHelper.Post(GetPostApi(), operation, 5000, printlog); Operation resultOperation = HttpHelper.Post(GetPostApi(), operation, 15000, printlog);
if (operation.seq != resultOperation.seq) if (resultOperation==null || operation.seq != resultOperation.seq)
{ {
Thread.Sleep(1000); Thread.Sleep(1000);
SendInStoreRequest(codelist, reel, printlog); SendInStoreRequest(codelist, reel, printlog);
...@@ -126,7 +126,7 @@ namespace DeviceLibrary ...@@ -126,7 +126,7 @@ namespace DeviceLibrary
LogUtil.info(JsonHelper.SerializeObject(operation)); LogUtil.info(JsonHelper.SerializeObject(operation));
if (RobotManage.InoutDebugMode) if (RobotManage.InoutDebugMode)
return true; return true;
Operation resultOperation = HttpHelper.Post(GetPostApi(), operation, 5000); Operation resultOperation = HttpHelper.Post(GetPostApi(), operation, 15000);
if (resultOperation == null) if (resultOperation == null)
{ {
......
...@@ -147,6 +147,7 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -147,6 +147,7 @@ namespace OnlineStore.LoadCSVLibrary
this.DOList.Add(con.ProName, io); this.DOList.Add(con.ProName, io);
if (!AllDOlist.ContainsKey(con.ProName)) if (!AllDOlist.ContainsKey(con.ProName))
AllDOlist.Add(con.ProName, io); AllDOlist.Add(con.ProName, io);
if (!AllDOEleclist.ContainsKey(io.ElectricalDefinition))
AllDOEleclist.Add(io.ElectricalDefinition, io); AllDOEleclist.Add(io.ElectricalDefinition, io);
} }
if (!ioTypeList.Contains(con.ProName)) if (!ioTypeList.Contains(con.ProName))
......
...@@ -310,16 +310,16 @@ namespace TheMachine ...@@ -310,16 +310,16 @@ namespace TheMachine
} }
void SetMsg(List<Msg> msgs) void SetMsg(List<Msg> msgs)
{ {
//if (this.InvokeRequired)
//{
// this.Invoke((EventHandler)delegate {
// SetMsg(msgs);
// });
// return;
//}
this.SuspendLayout(); this.SuspendLayout();
listView1.Items.Clear(); listView1.Items.Clear();
msgs.Sort((a, b) =>
{
if (a.msgLevel == MsgLevel.alarm)
return -1;
if (a.msgLevel != MsgLevel.info)
return -1;
return 0;
});
foreach (Msg msg in msgs) foreach (Msg msg in msgs)
{ {
if (string.IsNullOrEmpty(msg.msgtxt) || msg.datetime==null) if (string.IsNullOrEmpty(msg.msgtxt) || msg.datetime==null)
......
...@@ -285,6 +285,9 @@ namespace TheMachine ...@@ -285,6 +285,9 @@ namespace TheMachine
} }
} }
CSVConfigReader.SaveConfig(Config.ConfigFilePath, Config); CSVConfigReader.SaveConfig(Config.ConfigFilePath, Config);
Config.DIList.Clear();
Config.DOList.Clear();
Config = (Robot_Config)CSVConfigReader.LoadConfig(Config);
} }
} }
} }
...@@ -99,9 +99,6 @@ namespace TheMachine ...@@ -99,9 +99,6 @@ namespace TheMachine
} }
Button button = new Button(); Button button = new Button();
button.FlatStyle = System.Windows.Forms.FlatStyle.Flat; button.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
button.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); button.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
...@@ -240,6 +237,27 @@ namespace TheMachine ...@@ -240,6 +237,27 @@ namespace TheMachine
private void btnSavePos_Click(object sender, EventArgs e) private void btnSavePos_Click(object sender, EventArgs e)
{ {
for (int i = 0; i < tableLayoutPanel1.Controls.Count; i++)
{
if (tableLayoutPanel1.Controls[i].GetType().Name != "TextBox")
continue;
TextBox textBox = (TextBox)tableLayoutPanel1.Controls[i];
PropertyInfo pi = _aCStorePosition.GetType().GetProperty(textBox.Name);
if (pi != null)
{
//var cc = Config.configList.Find(new Predicate<ConfigBase>((c) => { return c.ProName == textBox.Name; }));
//if (cc != null)
// cc.ProValue = textBox.Text;
if (pi.PropertyType.Name == "Int32")
pi.SetValue(_aCStorePosition, int.Parse(textBox.Text));
else if (pi.PropertyType.Name == "Double")
pi.SetValue(_aCStorePosition, double.Parse(textBox.Text));
else
pi.SetValue(_aCStorePosition, textBox.Text);
}
}
var positionConfigFile = Path.Combine(Application.StartupPath, "StoreConfig\\linePositions.csv"); var positionConfigFile = Path.Combine(Application.StartupPath, "StoreConfig\\linePositions.csv");
bool result = CSVPositionReader<ACStorePosition>.SavePostion(positionConfigFile, _aCStorePosition); bool result = CSVPositionReader<ACStorePosition>.SavePostion(positionConfigFile, _aCStorePosition);
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!