Fix lista stati HALT

This commit is contained in:
Samuele E. Locatelli
2016-04-04 18:43:37 +02:00
parent 78e840fdb2
commit 877b53e1db
7 changed files with 73 additions and 18 deletions
Binary file not shown.
+2 -2
View File
@@ -146,11 +146,11 @@ namespace MTC_Sim
/// <summary>
/// D.D1.P1.PATH_MODE - modalità esecuzione
/// </summary>
public Event mMode = new Event("mode");
public Event mMode = new Event("PATH_MODE");
/// <summary>
/// D.D1.P1.PATH_STATUS - status macchina
/// </summary>
public Event mExec = new Event("exec");
public Event mExec = new Event("PATH_STATUS");
/// <summary>
/// M_CODE
+5 -14
View File
@@ -323,28 +323,19 @@
// functionalMode
//
this.functionalMode.FormattingEnabled = true;
this.functionalMode.Items.AddRange(new object[] {
"MACCHINA_DISPONIBILE",
"MANUTENZIONE",
"PRODUZIONE",
"PULIZIA",
"REGOLAZIONI",
"SETUP",
"TEARDOWN"});
this.functionalMode.Location = new System.Drawing.Point(252, 71);
this.functionalMode.Location = new System.Drawing.Point(80, 71);
this.functionalMode.Name = "functionalMode";
this.functionalMode.Size = new System.Drawing.Size(121, 21);
this.functionalMode.Size = new System.Drawing.Size(293, 21);
this.functionalMode.TabIndex = 47;
this.functionalMode.Text = "SETUP";
//
// label12
//
this.label12.AutoSize = true;
this.label12.Location = new System.Drawing.Point(164, 74);
this.label12.Location = new System.Drawing.Point(15, 74);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(86, 13);
this.label12.Size = new System.Drawing.Size(53, 13);
this.label12.TabIndex = 46;
this.label12.Text = "Functional Mode";
this.label12.Text = "Halt Type";
//
// commonVariables
//
+26 -1
View File
@@ -20,6 +20,7 @@ namespace MTC_Sim
using MTConnect;
using System.Configuration;
using System.Diagnostics;
using System.IO;
public partial class CMS_MachineSim : Form
{
@@ -86,6 +87,29 @@ namespace MTC_Sim
MainProgrBar.Value = 0;
MainProgrBar.Step = 1;
// compilo combobox causali fermo...
string[] contenuto = File.ReadAllLines("HaltTypeList.txt");
System.Collections.Generic.Dictionary<string,string> comboSource = new Dictionary<string,string>();
foreach (var line in contenuto)
{
// se la linea non è commento e non è vuota...
if (line.Length > 0 && line[0] != '#')
{
string[] tokens = line.Split(':');
comboSource.Add(tokens[0], tokens[1]);
//riga.value = tokens[0];
//riga.label = tokens[1];
//functionalMode.Items.Add(new { Value = riga.label, Key = riga.value });
//functionalMode.Items.Add(new { label = tokens[1], value = tokens[0] });
}
}
functionalMode.DataSource = new BindingSource(comboSource, null);
functionalMode.DisplayMember = "Value";
functionalMode.ValueMember = "Key";
string[] row = { "1", "2", "3", "4" };
commonVariables.Rows.Add(row);
}
@@ -173,7 +197,7 @@ namespace MTC_Sim
else if (stopped.Checked) answ.ExeMode = "STOPPED";
else if (ready.Checked) answ.ExeMode = "READY";
answ.FuncMode = functionalMode.Text;
answ.FuncMode = ((KeyValuePair<string,string>)functionalMode.SelectedItem).Key;
answ.MessageCode = messageCode.Text;
answ.MessageText = messageText.Text;
@@ -472,5 +496,6 @@ namespace MTC_Sim
#endregion
}
}
+8
View File
@@ -0,0 +1,8 @@
# Commenti con "#", elenco tipo codice:valore delle causali di HALT
001:[COD 001] - PRODUZIONE
002:[COD 002] - SETUP
003:[COD 003] - MACCHINA_DISPONIBILE
004:[COD 004] - MANUTENZIONE
005:[COD 005] - PULIZIA
006:[COD 006] - REGOLAZIONI
+5
View File
@@ -92,6 +92,11 @@
<Name>DotNetAdapterSDK</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="HaltTypeList.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
+27 -1
View File
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@@ -78,8 +79,32 @@ namespace MTC_Sim
{ }
return answ;
}
}
#if false
public DataSet DS_lists
{
get
{
DataTable tbl = new DataTable("HaltType");
tbl.Columns.Add("label");
tbl.Columns.Add("value");
tbl.Rows.Add("COD001", 001);
tbl.Rows.Add("COD002", 002);
tbl.Rows.Add("COD003", 003);
// Create a DataSet.
DataSet set = new DataSet("MTC-ADAPT");
set.Tables.Add(tbl);
set.Namespace = "adapt";
set.Prefix = "mtc";
return set;
}
}
#endif
}
public enum tipoAdapter
{
@@ -131,6 +156,7 @@ namespace MTC_Sim
public bool err_06;
}
/// <summary>
/// Strobe: contiene il set di strobe di comunicazione
///