禾欣总汇
This commit is contained in:
parent
bf64c5a2f6
commit
f50cdeeb39
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
/LeatherProject/.vs
|
@ -13,6 +13,7 @@ using LeatherApp.Page;
|
||||
using System.Reflection;
|
||||
using Service;
|
||||
using LeatherApp.Utils;
|
||||
using HZH_Controls.Forms;
|
||||
|
||||
namespace LeatherApp
|
||||
{
|
||||
@ -188,6 +189,9 @@ namespace LeatherApp
|
||||
//HideProcessForm();//完成后关闭动画
|
||||
frm.TopLevel = true;
|
||||
frm.UserName = szUserCode;
|
||||
|
||||
//查询硬盘
|
||||
CheckDisk(this, 100);
|
||||
//frm.Password = "1";
|
||||
frm.ShowDialog();
|
||||
frm.Dispose();
|
||||
@ -269,6 +273,50 @@ namespace LeatherApp
|
||||
this.HideProcessForm();
|
||||
this.Visible = true;
|
||||
}
|
||||
|
||||
#region 硬盘检测
|
||||
public bool CheckDisk(IWin32Window owner, int max = 10)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(Config.ImagePath))
|
||||
{
|
||||
string path = Config.ImagePath;
|
||||
string volume = path.Substring(0, path.IndexOf(':'));
|
||||
long freespace = GetHardDiskSpace(volume);
|
||||
if (freespace < max)
|
||||
{
|
||||
string tip = $"当前{volume}硬盘容量:{freespace}GB,小于{max}GB。注意清理!!";
|
||||
FrmDialog.ShowDialog(owner, tip, "警告", true);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
//drive.TotalFreeSpace单位为bit,根据需要除以1024
|
||||
//drive同时可以可以获取磁盘分区容量等
|
||||
//单位GB
|
||||
public long GetHardDiskSpace(string str_HardDiskName)
|
||||
{
|
||||
long totalSize = 0;
|
||||
try
|
||||
{
|
||||
str_HardDiskName = str_HardDiskName + ":\\";
|
||||
System.IO.DriveInfo[] drives = System.IO.DriveInfo.GetDrives();
|
||||
foreach (System.IO.DriveInfo drive in drives)
|
||||
{
|
||||
if (drive.Name == str_HardDiskName)
|
||||
{
|
||||
totalSize = drive.TotalFreeSpace / (1024 * 1024 * 1024);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
totalSize = 0;
|
||||
}
|
||||
return totalSize;
|
||||
}
|
||||
#endregion
|
||||
|
||||
private void FrmManager_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
UILocalize.OK = "是";
|
||||
|
@ -5521,6 +5521,8 @@ namespace LeatherApp.Page
|
||||
DefectInfoList = deflist,
|
||||
UserName = model.UserName,
|
||||
WorkTeam = model.WorkTeam,
|
||||
PJXTBH = model.PJXTBH,
|
||||
DefectType = model.DefectType,
|
||||
};
|
||||
htTask.Add(currKey, record);
|
||||
|
||||
|
@ -300,6 +300,8 @@ namespace LeatherApp.Utils
|
||||
//幅宽
|
||||
double agvmf = 0;
|
||||
double mf1 = 0, mf2 = 0, mf3 = 0;
|
||||
if (records.FacePointList != null && records.FacePointList.Count > 0)
|
||||
{
|
||||
if (records.FacePointList.Count > 10)
|
||||
mf1 = records.FacePointList[10][1];
|
||||
else
|
||||
@ -309,9 +311,11 @@ namespace LeatherApp.Utils
|
||||
else
|
||||
mf3 = records.FacePointList[records.FacePointList.Count - 1][1];
|
||||
if (records.FacePointList.Count > 0)
|
||||
mf2 = records.FacePointList[records.FacePointList.Count/2][1];
|
||||
mf2 = records.FacePointList[records.FacePointList.Count / 2][1];
|
||||
|
||||
agvmf = (mf1 + mf2 + mf3)/3;
|
||||
agvmf = (mf1 + mf2 + mf3) / 3;
|
||||
agvmf = records.FacePointList.Select(x => x[1]).ToList().Average();
|
||||
}
|
||||
//新数据插入
|
||||
db.Insertable(new XCLErpUploadData()
|
||||
{
|
||||
@ -329,7 +333,7 @@ namespace LeatherApp.Utils
|
||||
MF1 = mf1,
|
||||
MF2 = mf2,
|
||||
MF3 = mf3,
|
||||
AvgMF = records.FacePointList.Select(x => x[1]).ToList().Average(),
|
||||
AvgMF = agvmf,
|
||||
|
||||
HD1= hd1,
|
||||
HD2= hd2,
|
||||
|
Loading…
Reference in New Issue
Block a user