Commit 33b5a61c 刘韬

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

1 个父辈 32cfd620
......@@ -103,8 +103,8 @@ namespace DeviceLibrary
{
operation.data.Add("singleIn", "false");
}
Operation resultOperation = HttpHelper.Post(GetPostApi(), operation, 5000, printlog);
if (operation.seq != resultOperation.seq)
Operation resultOperation = HttpHelper.Post(GetPostApi(), operation, 15000, printlog);
if (resultOperation==null || operation.seq != resultOperation.seq)
{
Thread.Sleep(1000);
SendInStoreRequest(codelist, reel, printlog);
......@@ -126,7 +126,7 @@ namespace DeviceLibrary
LogUtil.info(JsonHelper.SerializeObject(operation));
if (RobotManage.InoutDebugMode)
return true;
Operation resultOperation = HttpHelper.Post(GetPostApi(), operation, 5000);
Operation resultOperation = HttpHelper.Post(GetPostApi(), operation, 15000);
if (resultOperation == null)
{
......
......@@ -147,7 +147,8 @@ namespace OnlineStore.LoadCSVLibrary
this.DOList.Add(con.ProName, io);
if (!AllDOlist.ContainsKey(con.ProName))
AllDOlist.Add(con.ProName, io);
AllDOEleclist.Add(io.ElectricalDefinition, io);
if (!AllDOEleclist.ContainsKey(io.ElectricalDefinition))
AllDOEleclist.Add(io.ElectricalDefinition, io);
}
if (!ioTypeList.Contains(con.ProName))
{
......
......@@ -310,16 +310,16 @@ namespace TheMachine
}
void SetMsg(List<Msg> msgs)
{
//if (this.InvokeRequired)
//{
// this.Invoke((EventHandler)delegate {
// SetMsg(msgs);
// });
// return;
//}
this.SuspendLayout();
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)
{
if (string.IsNullOrEmpty(msg.msgtxt) || msg.datetime==null)
......
......@@ -285,6 +285,9 @@ namespace TheMachine
}
}
CSVConfigReader.SaveConfig(Config.ConfigFilePath, Config);
Config.DIList.Clear();
Config.DOList.Clear();
Config = (Robot_Config)CSVConfigReader.LoadConfig(Config);
}
}
}
......@@ -99,9 +99,6 @@ namespace TheMachine
}
Button button = new Button();
button.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
button.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
......@@ -240,6 +237,27 @@ namespace TheMachine
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");
bool result = CSVPositionReader<ACStorePosition>.SavePostion(positionConfigFile, _aCStorePosition);
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!