Commit b4a0eb23 LN

界面调整

1 个父辈 3faecd08
......@@ -82,7 +82,9 @@ namespace TSA_V.Common
[MyConfigComment("侧挡气缸是否先移动")]
public static MyConfig<bool> Device_SideCylinderMoveFirst =true;
[MyConfigComment("离线编程模式,自动进入过板模式")]
public static MyConfig<bool> Device_AutoGuoBan = false ;
public static MyConfig<bool> Device_AutoGuoBan = false;
[MyConfigComment("是否启用手势监控")]
public static MyConfig<bool> Device_HandsVideo= false ;
......
......@@ -2176,7 +2176,7 @@
<value>元器件数量不足,请及时补充</value>
</data>
<data name="FrmDeviceConfig_groupBox3_Text" xml:space="preserve">
<value>数据上传测试</value>
<value>HTTP接口测试</value>
</data>
<data name="FrmDeviceConfig_btnTest_Text" xml:space="preserve">
<value>发送数据测试</value>
......@@ -2644,11 +2644,11 @@
<data name = "Type13" xml:space = "preserve"> <value> 极性_左下方 </value> </data>
<data name = "Type14" xml:space = "preserve"> <value> 极性_右下方 </value> </data>
<data name = "FrmBoardInfo_btnColorChange_Text" xml:space = "preserve"> <value> 投影颜色 </value> </data>
<data name = "FrmBoardInfo_btnCalibrate_Text" xml:space = "preserve"> <value> 投影标定 </value> </data>
<data name = "FrmBoardInfo_btnCalibrate_Text" xml:space = "preserve"> <value> 校准 </value> </data>
<data name = "CalMsg1" xml:space = "preserve"> <value> 第一步:请将光标移动至如图示电路板左上角位置,确认后点击设置按钮 </value> </data>
<data name = "FrmCalibrate_Text" xml:space = "preserve"> <value> 投影标定 </value> </data>
<data name = "FrmCalibrate_Text" xml:space = "preserve"> <value> 校准 </value> </data>
<data name = "FrmCalibrate_groupBox2_Text" xml:space = "preserve"> <value> 图示 </value> </data>
<data name = "FrmCalibrate_groupBox1_Text" xml:space = "preserve"> <value> 投影标定 </value> </data>
<data name = "FrmCalibrate_groupBox1_Text" xml:space = "preserve"> <value> 校准 </value> </data>
<data name = "FrmCalibrate_btnExit_Text" xml:space = "preserve"> <value> 退出 </value> </data>
<data name = "FrmCalibrate_btnCal_Text" xml:space = "preserve"> <value> 开始校准 </value> </data>
<data name = "FrmCalibrate_btnRightBottom_Text" xml:space = "preserve"> <value> 设置为右下角位置 </value> </data>
......@@ -2700,7 +2700,7 @@
<data name = "FrmDeviceConfig_chbDisBottomCylinder_Text" xml:space = "preserve"> <value> 禁用底部气缸 </value> </data>
<data name = "FrmAddBoard_chbShowText_Text" xml:space = "preserve"> <value> 默认设置位号为投影文字 </value> </data>
<data name = "FrmAddBoard_groupBox4_Text" xml:space = "preserve"> <value> 点位默认设置 </value> </data>
<data name = "FrmAddBoard_label10_Text" xml:space = "preserve"> <value> 宽→: </value> </data>
<data name = "FrmAddBoard_label10_Text" xml:space = "preserve"> <value> 宽→: </value> </data>
<data name = "FrmAddBoard_rdbData_Text" xml:space = "preserve"> <value> 数据表上传 </value> </data>
<data name = "FrmBoardInfo_linkDis_Text" xml:space = "preserve"> <value> 批量禁用 </value> </data>
<data name = "FrmBoardInfo_linkEnable_Text" xml:space = "preserve"> <value> 批量启用 </value> </data>
......
using System;
using System.Drawing;
using System.Windows.Forms;
using MetroFramework.Forms;
using System.Windows.Forms;
using TSA_V.DeviceLibrary;
using TSA_V.Common;
using System.Timers;
using log4net;
using System.Reflection;
using TSA_V.Common;
using System.IO;
using System.Threading;
using System.Collections.Generic;
using TSA_V.LoadCSVLibrary;
using PUSICANLibrary;
using System.Runtime.InteropServices;
using AOI;
using System.Threading.Tasks;
using System.Net.Http;
using System.Linq;
using System.Configuration;
using TSA_V.LoadCSVLibrary;
using AOI;
using System.Linq;
namespace TSA_V
{
......@@ -35,9 +26,12 @@ namespace TSA_V
private BoardInfo board = BoardManager.CurrBoard;
private PointDisplay display = new PointDisplay();
private List<SMTPointInfo> workSmtList = new List<SMTPointInfo>();
private string needShowMsg = "";
private void FrmWelding_Load(object sender, EventArgs e)
{
FormProcess();
btnCamera.Visible = TSAVBean.IsNeedAOI;
TSAVBean.Work.WorkType = 1;
LanguageProcess();
......@@ -113,7 +107,8 @@ namespace TSA_V
if (CurrProject == null)
{
LogUtil.info("没有读取到AOI,结束,IsNeedAOI=true!");
MessageBox.Show(ResourceCulture.GetString("加载AOI失败"));
needShowMsg+= ResourceCulture.GetString("加载AOI失败")+"\r\n";
//MessageBox.Show(ResourceCulture.GetString("加载AOI失败"));
//this.Close();
}
}
......@@ -142,6 +137,26 @@ namespace TSA_V
// StatusClient.instance.SendNew(Color.Green, TSAVBean.Name + "进入待机状态");
}
private void FormProcess()
{
if (Setting_NInit.Device_HandsVideo)
{
groupHand.Visible = true;
groupBoard.Visible = true;
}
else
{
groupHand.Visible = false;
groupBoard.Visible = true;
groupBoard.Location = new Point(groupHand.Location.X, groupHand.Location.Y);
groupBoard.Size = new Size(groupHand.Width, groupHand.Height);
this.groupBoard.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
}
}
private AOI.AoiProject CurrProject = null;
private void LoadAoi()
{
......@@ -234,7 +249,8 @@ namespace TSA_V
{
lblMsg.Text = ResourceCulture.GetString(ResourceCulture.StartError, "启动失败") + ":" + str;
LogUtil.error("启动失败:" + str);
MessageBox.Show(ResourceCulture.GetString(ResourceCulture.StartError, "启动失败:") + str);
needShowMsg += ResourceCulture.GetString(ResourceCulture.StartError, "启动失败:") + str;
//MessageBox.Show(ResourceCulture.GetString(ResourceCulture.StartError, "启动失败:") + str);
}
}
timer.Start();
......@@ -244,6 +260,7 @@ namespace TSA_V
private Dictionary<int, double> pointXMap = new Dictionary<int, double>();
private Dictionary<int, double> pointYMap = new Dictionary<int, double>();
private Bitmap bitmap = null;
private bool isFirstLoad = true ;
private void loadPictureBoxSize(BoardInfo board)
{
display.LoadWorkFromPoint(board, smtPoint, true);
......@@ -395,7 +412,7 @@ namespace TSA_V
}
private void FormStatus()
{
btnSave.Visible = true;
btnSave.Visible = false ;
btnGoHome.Visible = true;
if (TSAVBean.Status <= (TSAVStatus.Wait))
{
......@@ -481,6 +498,12 @@ namespace TSA_V
display.SetPic(picBoard, panBoard);
if (board != null)
{
if (isFirstLoad&&Setting_NInit.Device_HandsVideo)
{
display.SetPicSize(board);
updateGroupSize();
isFirstLoad = false;
}
loadPictureBoxSize(board);
StartRun();
}
......@@ -489,6 +512,11 @@ namespace TSA_V
LogUtil.info(Name + " Shown end ");
WriteStateStr();
if (needShowMsg != "")
{
MessageBox.Show(needShowMsg);
}
}
catch (Exception ex)
{
......@@ -1079,14 +1107,15 @@ namespace TSA_V
private void WriteStateStr()
{
return;
//全局图(粉色表示已完成;橘色表示未开始;红色表示实时位置) 12, 327
//Graphics g = e.Graphics;
Graphics g= gbBoardInfo.CreateGraphics();
Graphics g= groupBoard.CreateGraphics();
Font f = new Font("微软雅黑", 10.5F);
string end = ResourceCulture.GetString(ResourceCulture.State_End, "已完成");
string notStart = ResourceCulture.GetString(ResourceCulture.State_NotStart, "未开始");
string postion = ResourceCulture.GetString(ResourceCulture.State_Postiion, "实时位置");
int width = gbBoardInfo.Size.Width;
int width = groupBoard.Size.Width;
g.DrawString(end, f, Brushes.HotPink, width-260, 0);
g.DrawString(notStart, f, Brushes.Orange, width-160, 0);
g.DrawString(postion, f, Brushes.Red, width-80, 0);
......@@ -1108,5 +1137,19 @@ namespace TSA_V
ShowUpdateCount(true);
}
}
private void picBoard_SizeChanged(object sender, EventArgs e)
{
}
private void updateGroupSize()
{
if (groupBoard.Size.Width > picBoard.Width && groupBoard.Size.Height > picBoard.Height)
{
groupBoard.Size = new Size(picBoard.Width + 6, picBoard.Height + 6);
groupBoard.Location = new Point(groupBox2.Location.X + groupBox2.Width - groupBoard.Width, groupBox2.Location.Y + groupBox2.Height - groupBoard.Height);
}
}
}
}
......@@ -42,8 +42,13 @@ namespace TSA_V
// picBoard.MouseWheel += picBoard_MouseWheel;
}
private void SetPicSize()
public void SetPicSize(BoardInfo board = null)
{
if (board != null)
{
this.Width = board.boardWidth;
this.Height = board.boardLength;
}
int xishu = 100;
picBoard.Width = Width * xishu;
picBoard.Height = Height * xishu;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!