Commit c12788e5 LN

增加全开全关测试按钮。

1 个父辈 30aca5c0
......@@ -55,7 +55,6 @@ namespace TSA_V.DeviceLibrary
map.Add("des", des);
map.Add("notes", notes);
map.Add("styleid", 47);
//string ledrgb = openLed ? "ff00" : "0";
map.Add("边框", "");
map.Add("边框1", "");
map.Add("边框2", "");
......@@ -67,6 +66,8 @@ namespace TSA_V.DeviceLibrary
map.Add("边框8", "");
map.Add("边框9", "");
map.Add("mac", mac);
string ledrgb = openLed ? "ff00" : "0";
map.Add("ledrgb", ledrgb);
return map;
}
// {
......
......@@ -40,7 +40,7 @@ namespace TSA_V.DeviceLibrary
Post(url, json,(open ? "打开所有":"关闭所有"));
}
}
public static LabelInfo GetLabel(TSAVPosition position, ComponetInfo com, bool opendLed = false)
public static LabelInfo GetLabel(TSAVPosition position, ComponetInfo com, bool opendLed )
{
if (com == null)
{
......@@ -124,7 +124,7 @@ namespace TSA_V.DeviceLibrary
dic.Add("mac", label.mac.Trim());
dic.Add("mappingtype", "868");
dic.Add("styleid", 47);
dic.Add("ledrgb", "ff00");
//dic.Add("ledrgb", "ff00");
dic.Add("ledstate", "0");
dic.Add("outtime", "0");
......
......@@ -342,7 +342,7 @@ namespace TSA_V.DeviceLibrary
var smtPoint=TSAVBean.Work.currPoint;
ComponetInfo com = CSVBomManager.GetCom(BoardManager.CurrBoard.bomName, smtPoint);
LabelInfo label = LedLabelController.GetLabel(position, com, true);
LedLabelController.OpenLed(label.ip, label.mac);
//LedLabelController.OpenLed(label.ip, label.mac);
LedLabelController.UpdateScreen(label);
PreLabel = label;
//string count=null;
......
......@@ -37,6 +37,9 @@
this.label3 = new System.Windows.Forms.Label();
this.cmbList = new System.Windows.Forms.ComboBox();
this.groupInfo = new System.Windows.Forms.GroupBox();
this.linkCloseAll = new System.Windows.Forms.LinkLabel();
this.linkOpenAll = new System.Windows.Forms.LinkLabel();
this.linkUpdate = new System.Windows.Forms.LinkLabel();
this.linkLabel2 = new System.Windows.Forms.LinkLabel();
this.linkLabel1 = new System.Windows.Forms.LinkLabel();
this.txtId = new System.Windows.Forms.TextBox();
......@@ -169,6 +172,9 @@
//
this.groupInfo.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupInfo.Controls.Add(this.linkCloseAll);
this.groupInfo.Controls.Add(this.linkOpenAll);
this.groupInfo.Controls.Add(this.linkUpdate);
this.groupInfo.Controls.Add(this.linkLabel2);
this.groupInfo.Controls.Add(this.linkLabel1);
this.groupInfo.Controls.Add(this.txtId);
......@@ -193,26 +199,64 @@
this.groupInfo.TabStop = false;
this.groupInfo.Text = "元器件基本信息";
//
// linkCloseAll
//
this.linkCloseAll.AutoSize = true;
this.linkCloseAll.Location = new System.Drawing.Point(85, 349);
this.linkCloseAll.Name = "linkCloseAll";
this.linkCloseAll.Size = new System.Drawing.Size(32, 17);
this.linkCloseAll.TabIndex = 82;
this.linkCloseAll.TabStop = true;
this.linkCloseAll.Text = "全关";
this.linkCloseAll.Visible = false;
this.linkCloseAll.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel5_LinkClicked);
//
// linkOpenAll
//
this.linkOpenAll.AutoSize = true;
this.linkOpenAll.Location = new System.Drawing.Point(23, 349);
this.linkOpenAll.Name = "linkOpenAll";
this.linkOpenAll.Size = new System.Drawing.Size(32, 17);
this.linkOpenAll.TabIndex = 81;
this.linkOpenAll.TabStop = true;
this.linkOpenAll.Text = "全开";
this.linkOpenAll.Visible = false;
this.linkOpenAll.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel4_LinkClicked);
//
// linkUpdate
//
this.linkUpdate.AutoSize = true;
this.linkUpdate.Location = new System.Drawing.Point(147, 349);
this.linkUpdate.Name = "linkUpdate";
this.linkUpdate.Size = new System.Drawing.Size(56, 17);
this.linkUpdate.TabIndex = 80;
this.linkUpdate.TabStop = true;
this.linkUpdate.Text = "显示测试";
this.linkUpdate.Visible = false;
this.linkUpdate.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel3_LinkClicked);
//
// linkLabel2
//
this.linkLabel2.AutoSize = true;
this.linkLabel2.Location = new System.Drawing.Point(305, 308);
this.linkLabel2.Location = new System.Drawing.Point(319, 349);
this.linkLabel2.Name = "linkLabel2";
this.linkLabel2.Size = new System.Drawing.Size(56, 17);
this.linkLabel2.TabIndex = 79;
this.linkLabel2.TabStop = true;
this.linkLabel2.Text = "关灯测试";
this.linkLabel2.Visible = false;
this.linkLabel2.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel2_LinkClicked);
//
// linkLabel1
//
this.linkLabel1.AutoSize = true;
this.linkLabel1.Location = new System.Drawing.Point(243, 308);
this.linkLabel1.Location = new System.Drawing.Point(233, 349);
this.linkLabel1.Name = "linkLabel1";
this.linkLabel1.Size = new System.Drawing.Size(56, 17);
this.linkLabel1.TabIndex = 78;
this.linkLabel1.TabStop = true;
this.linkLabel1.Text = "亮灯测试";
this.linkLabel1.Visible = false;
this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
//
// txtId
......@@ -230,7 +274,7 @@
//
this.btnNewCom.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnNewCom.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnNewCom.Location = new System.Drawing.Point(108, 370);
this.btnNewCom.Location = new System.Drawing.Point(108, 393);
this.btnNewCom.Name = "btnNewCom";
this.btnNewCom.Size = new System.Drawing.Size(130, 45);
this.btnNewCom.TabIndex = 76;
......@@ -358,7 +402,7 @@
//
this.btnSave.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnSave.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnSave.Location = new System.Drawing.Point(246, 370);
this.btnSave.Location = new System.Drawing.Point(246, 393);
this.btnSave.Name = "btnSave";
this.btnSave.Size = new System.Drawing.Size(130, 45);
this.btnSave.TabIndex = 4;
......@@ -567,5 +611,8 @@
private System.Windows.Forms.LinkLabel linkLabel1;
private System.Windows.Forms.LinkLabel linkLabel2;
private System.Windows.Forms.Button btnExport;
private System.Windows.Forms.LinkLabel linkUpdate;
private System.Windows.Forms.LinkLabel linkCloseAll;
private System.Windows.Forms.LinkLabel linkOpenAll;
}
}
\ No newline at end of file
......@@ -347,51 +347,59 @@ namespace TSA_V
private ComponetInfo selCom = null;
private void showDetail(int rowIndex)
{
DataGridViewRow row = dgvList.Rows[rowIndex];
ComponetInfo obj = getRowPointInfo(row);
if (obj == null)
{
MessageBox.Show(ResourceCulture.GetString(ResourceCulture.ChoiceCom, "请选择元器件!"));
return;
}
selCom = obj;
IsNew = false;
txtPartNum.Tag = obj;
txtName.Text = obj.PN;
txtDes.Text = obj.ComponentDes;
txtCount.Text = obj.ComCount.ToString();
txtPartNum.Text = obj.TagNo;
txtNotes.Text = obj.Notes;
if (txtPartNum.Text == "")
{
txtPartNum.Enabled = true;
}
else
{
txtPartNum.Enabled = false;
}
btnNewCom.Visible = true;
txtId.Text = obj.Id.ToString();
//txtPosition.Text = obj.PositionNum;
int selPosIndex = -1;
int index = -1;
string[] posNum = CSVBomManager.GetPositionNum(obj.PositionNum);
foreach (TSAVPosition p in allPosition)
try
{
index++;
if (p.PositionNum.Equals(posNum[0]))
DataGridViewRow row = dgvList.Rows[rowIndex];
ComponetInfo obj = getRowPointInfo(row);
if (obj == null)
{
MessageBox.Show(ResourceCulture.GetString(ResourceCulture.ChoiceCom, "请选择元器件!"));
return;
}
selCom = obj;
IsNew = false;
txtPartNum.Tag = obj;
txtName.Text = obj.PN;
txtDes.Text = obj.ComponentDes;
txtCount.Text = obj.ComCount.ToString();
txtPartNum.Text = obj.TagNo;
txtNotes.Text = obj.Notes;
if (txtPartNum.Text == "")
{
txtPartNum.Enabled = true;
}
else
{
txtPartNum.Enabled = false;
}
btnNewCom.Visible = true;
txtId.Text = obj.Id.ToString();
//txtPosition.Text = obj.PositionNum;
int selPosIndex = -1;
int index = -1;
string[] posNum = CSVBomManager.GetPositionNum(obj.PositionNum);
foreach (TSAVPosition p in allPosition)
{
selPosIndex = index;
break;
index++;
if (p.PositionNum.Equals(posNum[0]))
{
selPosIndex = index;
break;
}
}
if (selPosIndex >= 0 && this.cmbPositionNumList.Items.Count > 0)
{
this.cmbPositionNumList.SelectedIndex = selPosIndex;
}
groupInfo.Text = ResourceCulture.GetString(ResourceCulture.ComInfo, "元器件【{ 0}】的基本信息", obj.TagNo + " " + obj.PN);
}
if (selPosIndex >= 0 && this.cmbPositionNumList.Items.Count > 0)
catch (Exception ex)
{
this.cmbPositionNumList.SelectedIndex = selPosIndex;
LogUtil.error("出错:" + ex.ToString());
}
groupInfo.Text = ResourceCulture.GetString(ResourceCulture.ComInfo, "元器件【{ 0}】的基本信息", obj.TagNo + " " + obj.PN);
}
private void DeleteCom(int rowIndex)
{
......@@ -582,49 +590,50 @@ namespace TSA_V
TSAVPosition position = CSVPositionReader<TSAVPosition>.GetPositonByNum(pNum);
if (position != null && position.PositionType.Equals(2))
{
linkLabel1.Visible = true;
linkLabel2.Visible = true;
LinkVisible(true );
}
else
{
linkLabel1.Visible = false;
linkLabel2.Visible = false;
LinkVisible(false);
}
}
private void LinkVisible(bool show)
{
linkLabel1.Visible = show;
linkLabel2.Visible = show;
linkCloseAll.Visible = show;
linkOpenAll.Visible = show;
linkUpdate.Visible = show;
}
private LabelInfo PreLabel = null;
private void CloseLed()
private void CloseLed(string pPnum)
{
if (PreLabel != null)
{
LedLabelController.CloseLed(PreLabel.ip, PreLabel.mac);
PreLabel = null;
if ( pPnum!=""&& PreLabel.pos != pPnum)
{
LedLabelController.CloseLed(PreLabel.ip, PreLabel.mac);
PreLabel = null;
}
}
}
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
CloseLed();
string pNum = cmbPositionNumList.Text;
CloseLed(pNum);
TSAVPosition position = CSVPositionReader<TSAVPosition>.GetPositonByNum(pNum);
if (position != null && position.PositionType.Equals(2))
{
LedLabelController.OpenLed(position.DeviceIP, position.Leds);
PreLabel = LedLabelController.GetLabel(position, selCom, true);
LedLabelController.UpdateScreen(PreLabel);
//ScanRequestLabel.RequestPost(position, txtCount.Text, txtPartNum.Text, txtDes.Text, out _);
LedLabelController.OpenLed(position.DeviceIP, position.Leds);
//LedLabelController.UpdateScreen(PreLabel);
}
}
private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
CloseLed();
//if (pairs.Count != 0)
//{
// ScanRequestLabel.Turnoffthelights(pairs);
// pairs.Clear();
//}
CloseLed("");
}
private void btnExport_Click(object sender, EventArgs e)
......@@ -691,5 +700,27 @@ namespace TSA_V
return line.ToArray();
}
private void linkLabel3_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
string pNum = cmbPositionNumList.Text;
CloseLed(pNum);
TSAVPosition position = CSVPositionReader<TSAVPosition>.GetPositonByNum(pNum);
if (position != null && position.PositionType.Equals(2))
{
PreLabel = LedLabelController.GetLabel(position, selCom, true);
LedLabelController.UpdateScreen(PreLabel);
}
}
private void linkLabel4_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
LedLabelController.OpenAll();
}
private void linkLabel5_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
LedLabelController.CloseAll();
}
}
}
......@@ -2623,4 +2623,7 @@
<data name="FrmComponentList_btnExport_Text" xml:space="preserve">
<value>Export</value>
</data>
<data name = "FrmComponentList_linkCloseAll_Text" xml:space = "preserve"> <value> Close All </value> </data>
<data name = "FrmComponentList_linkOpenAll_Text" xml:space = "preserve"> <value> Open All </value> </data>
<data name = "FrmComponentList_linkUpdate_Text" xml:space = "preserve"> <value> Display Test </value> </data>
</root>
\ No newline at end of file
......@@ -2595,4 +2595,8 @@
<value>关灯测试</value>
</data>
<data name = "FrmComponentList_btnExport_Text" xml:space = "preserve"> <value> EXPORT </value> </data>
<data name = "FrmComponentList_linkCloseAll_Text" xml:space = "preserve"> <value> 全关 </value> </data>
<data name = "FrmComponentList_linkOpenAll_Text" xml:space = "preserve"> <value> 全开 </value> </data>
<data name = "FrmComponentList_linkUpdate_Text" xml:space = "preserve"> <value> 显示测试 </value> </data>
</root>
\ No newline at end of file
......@@ -2622,4 +2622,7 @@
<data name="FrmComponentList_btnExport_Text" xml:space="preserve">
<value> 导出 </value>
</data>
<data name = "FrmComponentList_linkCloseAll_Text" xml:space = "preserve"> <value> 全关 </value> </data>
<data name = "FrmComponentList_linkOpenAll_Text" xml:space = "preserve"> <value> 全开 </value> </data>
<data name = "FrmComponentList_linkUpdate_Text" xml:space = "preserve"> <value> 显示测试 </value> </data>
</root>
\ No newline at end of file
......@@ -9,7 +9,7 @@
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>TSA_V</RootNamespace>
<AssemblyName>Neo Station</AssemblyName>
<AssemblyName>NW_Client</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!