Commit 151f2723 刘韬

Merge branch 'master' of http://106.15.194.121:8083/liutao/MIMO

2 个父辈 6ff5dd32 ef39d8c7
......@@ -3,12 +3,14 @@ using OnlineStore.Common;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Windows.Forms.Layout;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.StartPanel;
namespace OnlineStore
{
......@@ -285,12 +287,6 @@ namespace OnlineStore
private static void PreControlLanaguage(Control partentControl, string className)
{
string newStr = "";
//Con_GetTxt(partentControl, out string title);
//string newStr = GetString(GetTextIdStr(className, partentControl.Name), title);
//if (!newStr.Equals(""))
//{
//Con_SetTxt(partentControl, newStr.Replace("\\n", "\n"));
//}
foreach (Control con in partentControl.Controls)
{
string txt = "";
......
......@@ -33,8 +33,9 @@
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="ConfigHelper">
<HintPath>..\..\ConfigHelper\ConfigHelper\bin\Debug\ConfigHelper.dll</HintPath>
<Reference Include="ConfigHelper, Version=1.0.0.2, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\DLL\ConfigHelper.dll</HintPath>
</Reference>
<Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
......
......@@ -89,7 +89,7 @@ namespace OnlineStore.Common
[MyConfigComment("摄像机名称列表#号分割")]
public static MyConfig<string> CameraScan_CameraName = "CameraName";
[MyConfigComment("扫码类型清单#号分割")]
public static MyConfig<string> CameraScan_CodeType = "QR Code#Data Matrix ECC 200";
public static MyConfig<string> CameraScan_CodeType = "QR Code#Data Matrix ECC 200#eyem";
[MyConfigComment("扫码学习文件保存目录")]
public static MyConfig<string> CameraScan_CodeParamPath = "CodeParam";
[MyConfigComment("二维码扫码最大数量")]
......@@ -98,5 +98,7 @@ namespace OnlineStore.Common
public static MyConfig<int> CameraScan_CodeTimeOut = 3000;
[MyConfigComment("校准库位料盘缓存")]
public static MyConfig<string> FixBuffInfo = "";
[MyConfigComment("校准库位升降轴速度")]
public static MyConfig<int> Updown_FixSpeed = 3000;
}
}
......@@ -59,8 +59,10 @@
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration.Install" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.ServiceProcess" />
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
......@@ -79,6 +81,7 @@
<Compile Include="DeviceLibrary\Camera.cs" />
<Compile Include="DeviceLibrary\CylinderManger.cs" />
<Compile Include="DeviceLibrary\IOMonitor.cs" />
<Compile Include="DeviceLibrary\IPCameraHelper.cs" />
<Compile Include="DeviceLibrary\I_SafetyDevice.cs" />
<Compile Include="DeviceLibrary\LiftMonitor.cs" />
<Compile Include="DeviceLibrary\LineRunMonitor.cs" />
......
using OnlineStore.Common;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Configuration.Install;
using System.IO;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.Threading.Tasks;
namespace DeviceLibrary
{
public class IPCameraHelper
{
//"E:\\Codes\\CSharp-Workspace\\MyProject\\WindowsService\\IPCamService\\bin\\Debug\\IPCamService.exe"
static string appPath = AppDomain.CurrentDomain.BaseDirectory;
static string serviceFilePath = ConfigHelper.Config.Get("IPCamService_FilePath", $"{appPath}IPCamService\\IPCamService.exe");
static string serviceName = ConfigHelper.Config.Get("IPCamService_ServiceName", "IPCamService");
/// <summary>
/// 安装服务
/// </summary>
public static void InstallService()
{
if (!File.Exists(serviceFilePath))
{
return;
}
if (!IsServiceExisted(serviceName))
{
InstallService(serviceFilePath);
LogUtil.info("安装监控相机服务");
ServiceStart(serviceName);
LogUtil.info("启动监控相机服务");
}
else
{
ServiceStart(serviceName);
LogUtil.info("启动监控相机服务");
}
}
static string baseDir = ConfigHelper.Config.Get("IPCameraService_HttpServer", "http://localhost:8088");
static string camName = ConfigHelper.Config.Get("IPCameraService_CamName", "cam1");
public static void StartRecord(string fileName = "")
{
if (!IsServiceExisted(serviceName)) return;
Task.Factory.StartNew(delegate
{
string url = $"{baseDir}/cam/startRecord?camName={camName}&filename={fileName}";
string res = HttpHelper.Get(url);
LogUtil.info($"开始记录视频:{fileName},{res}");
});
}
public static void StopRecord()
{
if (!IsServiceExisted(serviceName)) return;
Task.Factory.StartNew(delegate
{
string url = $"{baseDir}/cam/stopRecord?camName={camName}";
string res = HttpHelper.Get(url);
LogUtil.info($"停止记录视频:{res}");
});
}
//判断服务是否存在
static bool IsServiceExisted(string serviceName)
{
ServiceController[] services = ServiceController.GetServices();
foreach (ServiceController sc in services)
{
if (sc.ServiceName.ToLower() == serviceName.ToLower())
{
return true;
}
}
return false;
}
//安装服务
static void InstallService(string serviceFilePath)
{
try
{
using (AssemblyInstaller installer = new AssemblyInstaller())
{
installer.UseNewContext = true;
installer.Path = serviceFilePath;
IDictionary savedState = new Hashtable();
installer.Install(savedState);
installer.Commit(savedState);
}
}
catch (Exception ex)
{
LogUtil.error("安装监控相机服务失败", ex);
}
}
//卸载服务
static void UninstallService(string serviceFilePath)
{
using (AssemblyInstaller installer = new AssemblyInstaller())
{
installer.UseNewContext = true;
installer.Path = serviceFilePath;
installer.Uninstall(null);
}
}
//启动服务
static void ServiceStart(string serviceName)
{
try
{
using (ServiceController control = new ServiceController(serviceName))
{
if (control.Status == ServiceControllerStatus.Stopped)
{
control.Start();
}
}
}
catch (Exception ex)
{
LogUtil.error($"启动监控相机服务失败", ex);
}
}
//停止服务
static void ServiceStop(string serviceName)
{
using (ServiceController control = new ServiceController(serviceName))
{
if (control.Status == ServiceControllerStatus.Running)
{
control.Stop();
}
}
}
}
}
......@@ -8,16 +8,19 @@ using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using static DeviceLibrary.MainMachine;
namespace DeviceLibrary
{
public class ServerCommunication
{
volatile StoreStatus _storeStatus = StoreStatus.Debugging;
public StoreStatus storeStatus {
public StoreStatus storeStatus
{
get => _storeStatus;
set {
if (_storeStatus!= value)
set
{
if (_storeStatus != value)
LogUtil.info($"set storeStatus to {value}");
_storeStatus = value;
}
......@@ -25,13 +28,14 @@ namespace DeviceLibrary
static string server = Setting_Init.Device_Server_Address;
static string CID = Setting_Init.Device_CID;
int StoreID = 1;
string StoreName="";
string StoreName = "";
string WarnMsg = "";
private System.Timers.Timer serverConnectTimer = new System.Timers.Timer();
object serverclock = new object();
public ServerCommunication() {
public ServerCommunication()
{
serverConnectTimer.Interval = 1000;
serverConnectTimer.AutoReset = true;
serverConnectTimer.Enabled = true;
......@@ -62,17 +66,22 @@ namespace DeviceLibrary
{
LogUtil.info($"ServerConnectTimer_Elapsed:{ex}");
}
finally {
finally
{
//Monitor.Exit(serverConnectTimer);
}
}
public void StartConnectServer() {
public void StartConnectServer()
{
//serverConnectTimer.Enabled = true;
}public void StopConnectServer() {
}
public void StopConnectServer()
{
//serverConnectTimer.Enabled = false;
}
public void ProcessMsg(List<Msg> msg) {
public void ProcessMsg(List<Msg> msg)
{
WarnMsg = string.Join(",", msg.Select(x =>
{
if (x.msgLevel == MsgLevel.warning || x.msgLevel == MsgLevel.alarm)
......@@ -81,9 +90,10 @@ namespace DeviceLibrary
}
return null;
}
).Where(x=>!string.IsNullOrEmpty(x)));
).Where(x => !string.IsNullOrEmpty(x)));
}
public void SendInStoreRequest(string[] codelist, ReelParam reel,bool printlog=false) {
public void SendInStoreRequest(string[] codelist, ReelParam reel, bool printlog = false)
{
if (RobotManage.InoutDebugMode)
return;
......@@ -94,7 +104,7 @@ namespace DeviceLibrary
operation.op = 1;
operation.data = new Dictionary<string, string>() { { "code", code }, { "boxId", StoreID.ToString() }, { "doorReelSignal", "1" } };
if (reel.PlateH==100 && Setting_Init.Device_SingleInSingleOut)
if (reel.PlateH == 100 && Setting_Init.Device_SingleInSingleOut)
{
//singleIn 单盘入库
operation.data.Add("singleIn", "true");
......@@ -104,9 +114,9 @@ namespace DeviceLibrary
operation.data.Add("singleIn", "false");
}
int retrytimes = 0;
retry:
retry:
Operation resultOperation = HttpHelper.Post(GetPostApi(), operation, 15000, printlog);
if (RobotManage.isRunning &&( resultOperation==null || operation.seq != resultOperation.seq))
if (RobotManage.isRunning && (resultOperation == null || operation.seq != resultOperation.seq))
{
Thread.Sleep(1000);
//SendInStoreRequest(codelist, reel, printlog);
......@@ -124,15 +134,7 @@ namespace DeviceLibrary
Operation operation = getLineBoxStatus();
if (!string.IsNullOrEmpty(posid))
operation.boxStatus[StoreID].data.Add(ParamDefine.posId, posid);
if (storeStatus == StoreStatus.OutStoreEnd ||
storeStatus == StoreStatus.OutStoreBoxEnd ||
storeStatus == StoreStatus.InStoreEnd)
{
}
else
operation.boxStatus[StoreID].status = (int)storeStatus;
operation.boxStatus[StoreID].status = (int)storeStatus;
LogUtil.info(JsonHelper.SerializeObject(operation));
if (RobotManage.InoutDebugMode)
return true;
......@@ -143,7 +145,8 @@ namespace DeviceLibrary
LogUtil.info($"SendStoreState error,posid:{posid}, storeStatus:{storeStatus}");
return false;
}
if (operation.seq != resultOperation.seq) {
if (operation.seq != resultOperation.seq)
{
LogUtil.info($"SendStoreState seq error,posid:{posid}, storeStatus:{storeStatus}");
return false;
}
......@@ -157,15 +160,17 @@ namespace DeviceLibrary
//{
// this.storeStatus = StoreStatus.StoreOnline;
//}
if (RobotManage.mainMachine.StringMoveInfo.MoveStep == MoveStep.StringOut_Released)
{
this.storeStatus = StoreStatus.StoreOnline;
}
//if (RobotManage.mainMachine.StringMoveInfo.MoveStep == MoveStep.StringOut_Released
// || RobotManage.mainMachine.StringMoveInfo.MoveStep == MoveStep.Wait)
//{
// this.storeStatus = StoreStatus.StoreOnline;
// LogUtil.info($"StringOut_Released StoreState change,storeStatus:{storeStatus}");
//}
}
return true;
}
public string spiltStr = "##";
private string ProcessCode(string[] codeList,int reelw,int reelh)
private string ProcessCode(string[] codeList, int reelw, int reelh)
{
string message = "";
......@@ -183,7 +188,8 @@ namespace DeviceLibrary
message = message + "=" + "1+0x0-" + codeSize + "=" + code + spiltStr;
LogUtil.info($"加载到fixcode,{w}x{h},remove:{rcode}");
}else
}
else
message = message + "=" + "1+0x0-" + codeSize + "=" + code + spiltStr;
}
return message;
......@@ -235,7 +241,8 @@ namespace DeviceLibrary
{
sendmsg = string.Join(",", new string[] { WarnMsg });
}
else if (!RobotManage.isRunning){
else if (!RobotManage.isRunning)
{
sendmsg = "设备未启动";
}
......@@ -287,13 +294,14 @@ namespace DeviceLibrary
}
}
if (lineOperation.status != laststatus) {
if (lineOperation.status != laststatus)
{
laststatus = lineOperation.status;
printlog = true;
}
Operation resultOperation = HttpHelper.Post(GetPostApi(), lineOperation,700, printlog);
Operation resultOperation = HttpHelper.Post(GetPostApi(), lineOperation, 700, printlog);
if (resultOperation != null)
getthtime = 0;
//LogUtil.info(JsonHelper.SerializeObject(resultOperation.data));
......@@ -305,7 +313,7 @@ namespace DeviceLibrary
}
}
}
public int queueTaskCount=-1;
public int queueTaskCount = -1;
ConcurrentQueue<string> commandResultMsg = new ConcurrentQueue<string>();
void ResultProcess(Operation resultOperation)
{
......@@ -407,19 +415,19 @@ namespace DeviceLibrary
map.Add(ParamDefine.confirmReelOut, ParamDefine.disable);
map.Add(ParamDefine.singleReelIn, ParamDefine.disable);
if (storeStatus == StoreStatus.ResetMove
if (storeStatus == StoreStatus.ResetMove
|| storeStatus == StoreStatus.SuddenStop
|| storeStatus == StoreStatus.Debugging
)
return map;
if (IOManager.IOValue(IO_Type.DoorClose_LoadMaterial).Equals(IO_VALUE.HIGH)
if (IOManager.IOValue(IO_Type.DoorClose_LoadMaterial).Equals(IO_VALUE.HIGH)
&& RobotManage.mainMachine.StringMoveInfo.MoveStep == MoveStep.Wait)
{
map[ParamDefine.startBatchIn] = ParamDefine.enable;
}
if (RobotManage.mainMachine.StringMoveInfo.MoveStep == MoveStep.Wait
if (RobotManage.mainMachine.StringMoveInfo.MoveStep == MoveStep.Wait
&& IOManager.IOValue(IO_Type.BatchDoor_Open).Equals(IO_VALUE.LOW))
{
//map.Add(ParamDefine.doorStatus, "料串门关闭");
......@@ -427,27 +435,28 @@ namespace DeviceLibrary
}
if (!Setting_Init.Device_Allow_SingleIn)
map[ParamDefine.singleReelIn] = ParamDefine.hide;
else
else
if (Setting_Init.Device_Allow_SingleIn && IOManager.IOValue(IO_Type.NGDoor_Close).Equals(IO_VALUE.HIGH))
{
map[ParamDefine.singleReelIn] = ParamDefine.enable;
}
if (IOManager.IOValue(IO_Type.BatchDoor_Close).Equals(IO_VALUE.LOW)
if (IOManager.IOValue(IO_Type.BatchDoor_Close).Equals(IO_VALUE.LOW)
&& IOManager.IOValue(IO_Type.DoorClose_LoadMaterial).Equals(IO_VALUE.HIGH))
{
map[ParamDefine.closeLock] = ParamDefine.enable;
}
if (RobotManage.mainMachine.StringMoveInfo.MoveStep >= MoveStep.StringLoad_04
&& RobotManage.mainMachine.StringMoveInfo.MoveStep < MoveStep.StringOut_01)
var step = RobotManage.mainMachine.StringMoveInfo.MoveStep;
if ((step >= MoveStep.StringLoad_04 && step < MoveStep.StringOut_01))
{
map[ParamDefine.takeOutReel] = ParamDefine.enable;
}
if (RobotManage.mainMachine.IOValue(IO_Type.NGDoor_Open).Equals(IO_VALUE.HIGH))
{
map[ParamDefine.confirmReelOut] = ParamDefine.enable;
}
return map;
}
......@@ -482,7 +491,7 @@ namespace DeviceLibrary
{
//出入库没有找到服务器发送的库位,需要打印日志方便查询原因
//SetWarnMsg(ResourceControl.InStoreNoPosition, message, posId);
WarnMsg = crc.GetString(L.in_store_nothave_position,"入库未找到库位:") + posId;//0505
WarnMsg = crc.GetString(L.in_store_nothave_position, "入库未找到库位:") + posId;//0505
LogUtil.info("收到服务器入库命令:入库未找到库位:二维码【" + message + "】库位【" + posId + "】");
return;
}
......@@ -510,10 +519,11 @@ namespace DeviceLibrary
RobotManage.mainMachine.ClampMoveInfo.MoveParam.NgMsg = msg;
RobotManage.mainMachine.ClampMoveInfo.NextMoveStep(MoveStep.WaitInStore);
//RobotManage.mainMachine.NGPuted(msg);
LogUtil.info("服务器没有正确返回库位. msg="+ msg);
LogUtil.info("服务器没有正确返回库位. msg=" + msg);
}
else {
else
{
}
}
......@@ -533,13 +543,13 @@ namespace DeviceLibrary
{
string maxHumidity = data[ParamDefine.maxHumidity];
string maxTemp = data[ParamDefine.maxTemperature];
LogUtil.info( "收到服务器温湿度预警值:maxHumidity=" + maxHumidity + ",maxTemperature=" + maxTemp);
LogUtil.info("收到服务器温湿度预警值:maxHumidity=" + maxHumidity + ",maxTemperature=" + maxTemp);
try
{
this.Max_Humidity = (float)Convert.ToDouble(maxHumidity);
this.Max_Temperature = (float)Convert.ToDouble(maxTemp);
LogUtil.info( "保存温湿度预警值:Max_Humidity=" + Max_Humidity + ",Max_Temperature=" + Max_Temperature);
LogUtil.info("保存温湿度预警值:Max_Humidity=" + Max_Humidity + ",Max_Temperature=" + Max_Temperature);
}
catch (Exception ex)
{
......@@ -585,7 +595,7 @@ namespace DeviceLibrary
{
//出入库没有找到服务器发送的库位,需要打印日志方便查询原因
WarnMsg = StoreName + "出库未找库位:【" + posId + "】";
LogUtil.error( "收到服务器出库命令:未找到【" + posId + "】的库位信息");
LogUtil.error("收到服务器出库命令:未找到【" + posId + "】的库位信息");
continue;
}
else
......@@ -764,6 +774,6 @@ namespace DeviceLibrary
/// 扫码入库失败
/// </summary>
InStoreError = 14,
}
}
......@@ -30,13 +30,13 @@ namespace DeviceLibrary
public event Action<string, StoreMoveType, bool> InOutEndProcessEvent;
public bool IsComplateOrFree { get => MoveInfo.MoveStep == MoveStep.Wait && !movelock; }
public bool IsTakedReel { get => MoveInfo.MoveStep >= MoveStep.StoreTS10; }
public bool IsPutOnOut {get=> MoveInfo.MoveStep >= MoveStep.StoreTS16; }
public bool IsPutOnOut { get => MoveInfo.MoveStep >= MoveStep.StoreTS16; }
public ReelTransport(Robot_Config _Config, MainMachine _mainMachine)
{
Config = _Config;
mainMachine = _mainMachine;
MoveInfo = new MoveInfo(crc.GetString(L.transfer_equipment, "出入库机构"),false);
MoveInfo = new MoveInfo(crc.GetString(L.transfer_equipment, "出入库机构"), false);
To = null;
From = null;
#region 初始化伺服轴
......@@ -47,18 +47,19 @@ namespace DeviceLibrary
#endregion
}
public void Reset() {
public void Reset()
{
MoveInfo.NewMove(MoveStep.Wait);
MoveInfo.log("执行重置");
To = null;
From = null;
}
StoreMoveType storeMoveType = StoreMoveType.None;
string WareCode="";
string WareCode = "";
int plateH = 0;
bool PreMove = false;
bool ignoreFixtureCheck = false;
public bool Start(BoxStorePosition from, BoxStorePosition to, StoreMoveType _storeMoveType, bool premove=false)
public bool Start(BoxStorePosition from, BoxStorePosition to, StoreMoveType _storeMoveType, bool premove = false)
{
if (MoveInfo.MoveStep != MoveStep.Wait)
......@@ -72,9 +73,11 @@ namespace DeviceLibrary
WareCode = "NG";
plateH = 56;
To = to.clone();
MoveInfo.NewMove(MoveStep.StoreTS10);
MoveInfo.log($"{storeMoveType}:开始运输料盘,直接到:{to.posid}");
MoveInfo.MoveParam.PosID = $"NA=>{To.posid}";
{
MoveInfo.NewMove(MoveStep.StoreTS10);
MoveInfo.log($"{storeMoveType}:开始运输料盘,直接到:{to.posid}");
MoveInfo.MoveParam.PosID = $"NA=>{To.posid}";
}
}
else
{
......@@ -93,15 +96,16 @@ namespace DeviceLibrary
Fix = BoxStorePosition.GetFixPos(Config, To.Reel);
}
MoveInfo.MoveParam.WareCode = WareCode;
IPCameraHelper.StartRecord($"{WareCode}-{From?.posid}-{To?.posid}");
ErrMsgTxt = "";
return true;
//thread = new Thread(new ThreadStart(Run));
//thread.Start();
}
public bool ReadyToTakeBox() {
if (MoveInfo.MoveStep != MoveStep.StoreTS05)
public bool ReadyToTakeBox()
{
if (MoveInfo.MoveStep != MoveStep.StoreTS05)
return false;
MoveInfo.NextMoveStep(MoveStep.StoreTS06);
......@@ -130,8 +134,9 @@ namespace DeviceLibrary
MoveInfo.log($"{storeMoveType}:检查安全状态");
}
break;
case MoveStep.StoreTS02:
if (MoveInfo.MoveParam.ReelOnFixture) {
case MoveStep.StoreTS02:
if (MoveInfo.MoveParam.ReelOnFixture)
{
MoveInfo.NextMoveStep(MoveStep.StoreTS08);
MoveInfo.log($"{storeMoveType}:料盘已在料叉上,压紧轴压紧,Comp_PL:{From.Comp_PL}");
Comp_Axis.AbsMove(MoveInfo, From.Comp_PL, Config.Comp_P2_speed);
......@@ -173,11 +178,12 @@ namespace DeviceLibrary
{
RobotManage.mainMachine.CylinderMove(MoveInfo, IO_Type.Clamping_Relax, IO_Type.Clamping_Work, IO_VALUE.LOW);
}
else {
else
{
MoveInfo.NextMoveStep(MoveStep.StoreTS08);
UpDown_Axis.AbsMove(MoveInfo, From.UpDown_PH, Config.UpDown_P4_speed);
MoveInfo.log($"{storeMoveType}:上下轴到达取料高点");
}
}
break;
case MoveStep.StoreTS07:
MoveInfo.NextMoveStep(MoveStep.StoreTS08);
......@@ -196,7 +202,7 @@ namespace DeviceLibrary
InOut_Axis.AbsMove(MoveInfo, Config.InOut_P1, Config.InOut_P1_speed);
}
IgnoreX09 = false;
break;
case MoveStep.StoreTS09:
RobotManage.CameraA.CameraGrabOne(RobotManage.CameraA.GetFixtureStateFilename(From.posid, WareCode, storeMoveType, FixtureState.FromOut));
......@@ -204,11 +210,12 @@ namespace DeviceLibrary
{
Msg.add(crc.GetString(L.out_store_not_detect_material, "出库时料叉X23没有检测到有物料无法继续,请检查."), MsgLevel.alarm, ErrInfo.X09_BoxNotDetect);
MoveInfo.log($"出库时料叉X23没有检测到有物料无法继续,请检查.");
//RobotManage.UserPause("出库时料叉X23没有检测到有物料无法继续,请检查");
RobotManage.UserPause("出库时料叉X23没有检测到有物料无法继续,请检查");
}
else
{
if (!ignoreFixtureCheck && IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.LOW)) {
if (!ignoreFixtureCheck && IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.LOW))
{
MoveInfo.log($"忽略物料:Device_DisableStorePosition:{Setting_Init.Device_DisableStorePosition.Val},库位:{From.posid},{WareCode}");
if (Setting_Init.Device_DisableStorePosition && From.posid != BoxStorePosition.strings && From.posid != BoxStorePosition.ngdoor && From.posid != BoxStorePosition.clamp)
{
......@@ -228,6 +235,7 @@ namespace DeviceLibrary
break;
case MoveStep.StoreFIX01:
MoveInfo.NextMoveStep(MoveStep.StoreFIX02);
RobotManage.PutReelInFixPos(To.Reel);
Middle_Axis.AbsMove(MoveInfo, Fix.Middle_P2, Config.Middle_P2_speed);
MoveInfo.log($"{storeMoveType}:行走机构到达目的地:{Fix.Middle_P2}");
UpDown_Axis.AbsMove(MoveInfo, Fix.UpDown_PH, Config.UpDown_P1_speed);
......@@ -241,16 +249,15 @@ namespace DeviceLibrary
case MoveStep.StoreFIX03:
RobotManage.CameraA.CameraGrabOne(RobotManage.CameraA.GetFixtureStateFilename(To.posid, WareCode, storeMoveType, FixtureState.ToFix));
MoveInfo.NextMoveStep(MoveStep.StoreFIX04);
UpDown_Axis.AbsMove(MoveInfo, Fix.UpDown_PL, Config.UpDown_P3_speed);
Comp_Axis.AbsMove(MoveInfo, Fix.Comp_PH, Config.Comp_P2_speed);
MoveInfo.log($"{storeMoveType}:压紧轴高点:{Fix.Comp_PH}");
UpDown_Axis.AbsMove(MoveInfo, Fix.UpDown_PL, Setting_Init.Updown_FixSpeed);
Comp_Axis.AbsMove(MoveInfo,Config.Comp_P1 , Config.Comp_P1_speed);//Fix.Comp_PH
MoveInfo.log($"{storeMoveType}:压紧轴高点:{Config.Comp_P1}");
MoveInfo.log($"{storeMoveType}:上下轴到达目的地低点:{Fix.UpDown_PL}");
break;
case MoveStep.StoreFIX04:
MoveInfo.NextMoveStep(MoveStep.StoreFIX05);
RobotManage.PutReelInFixPos(MoveInfo.MoveParam);
Comp_Axis.AbsMove(MoveInfo, Fix.Comp_PL, Config.Comp_P2_speed);
UpDown_Axis.AbsMove(MoveInfo, Fix.UpDown_PH, Config.UpDown_P3_speed/2);
UpDown_Axis.AbsMove(MoveInfo, Fix.UpDown_PH, Setting_Init.Updown_FixSpeed);
MoveInfo.log($"{storeMoveType}:压紧轴压紧点:{Fix.Comp_PL}");
MoveInfo.log($"{storeMoveType}:上下轴到达目的高点:{Fix.UpDown_PH}");
break;
......@@ -268,7 +275,8 @@ namespace DeviceLibrary
MoveInfo.log($"{storeMoveType}:上下轴到达目的地高点:{To.UpDown_PH}");
break;
case MoveStep.StoreTS11:
if (To.posid==BoxStorePosition.strings) {
if (To.posid == BoxStorePosition.strings)
{
if (!mainMachine.IsPutReelReady)
{
//if (MoveInfo.IsTimeOut(20))
......@@ -276,31 +284,33 @@ namespace DeviceLibrary
MoveInfo.log($"等待料串准备好放料");
return false;
}
}else if (To.posid == BoxStorePosition.ngdoor)
}
else if (To.posid == BoxStorePosition.ngdoor)
{
if (mainMachine.ClampMoveInfo.MoveStep!=MoveStep.Wait)
if (mainMachine.ClampMoveInfo.MoveStep != MoveStep.Wait)
{
//if (MoveInfo.IsTimeOut(20))
Msg.add(crc.GetString(L.out_store_wait_ngdoor_ready,"等待单料口空闲."), MsgLevel.warning);
Msg.add(crc.GetString(L.out_store_wait_ngdoor_ready, "等待单料口空闲."), MsgLevel.warning);
MoveInfo.log($"等待单料口空闲");
return false;
}
}
MoveInfo.NextMoveStep(MoveStep.StoreTS12);
MoveInfo.NextMoveStep(MoveStep.StoreTS12);
break;
case MoveStep.StoreTS12:
MoveInfo.NextMoveStep(MoveStep.StoreTS13);
MoveInfo.log($"{storeMoveType}:进出轴到达目的地");
InOut_Axis.AbsMove(MoveInfo, To.InOut_P2, Config.InOut_P2_speed);
InOut_Axis.AbsMove(MoveInfo, To.InOut_P2, Config.InOut_P2_speed);
break;
case MoveStep.StoreTS13:
RobotManage.CameraA.CameraGrabOne(RobotManage.CameraA.GetFixtureStateFilename(To.posid, WareCode, storeMoveType, FixtureState.ToIn));
MoveInfo.NextMoveStep(MoveStep.StoreTS14);
MoveInfo.NextMoveStep(MoveStep.StoreTS14);
UpDown_Axis.AbsMove(MoveInfo, To.UpDown_PL, Config.UpDown_P3_speed);
Comp_Axis.AbsMove(MoveInfo, To.Comp_PH, Config.Comp_P2_speed);
MoveInfo.log($"{storeMoveType}:压紧轴压紧点:{To.Comp_PH}");
MoveInfo.log($"{storeMoveType}:上下轴到达目的地低点:{To.UpDown_PL}");
if (To.posid == BoxStorePosition.ngdoor) {
if (To.posid == BoxStorePosition.ngdoor)
{
MoveInfo.NextMoveStep(MoveStep.StoreTS_WaitOutProcess);
MoveInfo.log($"{storeMoveType}:目的地为单料口,转运后等待处理");
}
......@@ -336,35 +346,38 @@ namespace DeviceLibrary
)
{
MoveInfo.log($"{storeMoveType}:库位测试模式,上下轴,旋转不返回待机点");
break;
break;
}
//if (To.posid==BoxStorePosition.strings)
// UpDown_Axis.AbsMove(MoveInfo, Config.UpDown_P5, Config.UpDown_P1_speed);
//else
// UpDown_Axis.AbsMove(MoveInfo, Config.UpDown_P2, Config.UpDown_P1_speed);
if (!RobotManage.mainMachine.HasJob) {
if (!RobotManage.mainMachine.HasJob)
{
UpDown_Axis.AbsMove(MoveInfo, Config.UpDown_P1, Config.UpDown_P1_speed);
Middle_Axis.AbsMove(MoveInfo, Config.Middle_P1, Config.Middle_P1_speed);
MoveInfo.log($"{storeMoveType}:上下轴,旋转返回待机点P1");
}else
}
else
MoveInfo.log($"{storeMoveType}:后续还有任务不返回待机点");
ErrMsgTxt = "";
break;
case MoveStep.StoreTS17:
//MoveInfo.NextMoveStep(MoveStep.StoreTS16);
MoveInfo.log($"{storeMoveType}:转移料盘完成");
MoveInfo.EndMove();
ErrMsgTxt = "";
MoveInfo.EndMove();
ErrMsgTxt = "";
To.posid = "";
storeMoveType = StoreMoveType.None;
IPCameraHelper.StopRecord();
break;
case MoveStep.StoreTS_WaitOutProcess:
break;
case MoveStep.StoreTS_Continue:
MoveInfo.NextMoveStep(MoveStep.StoreTS17);
MoveInfo.log($"{storeMoveType}:继续运行进出轴到达待机点");
InOut_Axis.AbsMove(MoveInfo, Config.InOut_P1, Config.InOut_P1_speed);
InOut_Axis.AbsMove(MoveInfo, Config.InOut_P1, Config.InOut_P1_speed);
break;
default:
MoveInfo.log($"{storeMoveType}:未找到对应步骤:{MoveInfo.MoveStep}");
......@@ -374,13 +387,15 @@ namespace DeviceLibrary
return false;
}
public void Continue() {
public void Continue()
{
if (MoveInfo.MoveStep == MoveStep.StoreTS_WaitOutProcess)
{
MoveInfo.NextMoveStep(MoveStep.StoreTS_Continue);
MoveInfo.log($"{storeMoveType}:外部处理完成,继续");
}
else {
else
{
MoveInfo.log($"{storeMoveType}:当前不在外部处理状态");
}
}
......@@ -399,7 +414,8 @@ namespace DeviceLibrary
InOutEndProcessEvent?.Invoke(posid, storeMoveType, true);
}
HIKCamera GetCamera(int pos) {
HIKCamera GetCamera(int pos)
{
//return pos > 0 ? RobotManage.CameraA : RobotManage.CameraB;
return RobotManage.CameraA;
}
......
......@@ -24,6 +24,7 @@ namespace DeviceLibrary
if ((StringState >= StringStateE.OutStore) && IOValue(IO_Type.DoorClose_LoadMaterial).Equals(IO_VALUE.LOW))
{
MaterialDoorOpen = true;
RequestTakeOutReel = false;
StringState = StringStateE.None;
}
else if (IOValue(IO_Type.DoorClose_LoadMaterial).Equals(IO_VALUE.HIGH) && StringMoveInfo.MoveStep == MoveStep.Wait)
......
......@@ -116,6 +116,7 @@ namespace DeviceLibrary
IOMonitor.RegisterIO(IO_Type.Reset_BTN, Config, IO_VALUE.HIGH, Reset_BTN, 2500, 100);
IOMonitor.RegisterIO(IO_Type.AutoRun_Single, Config, IO_VALUE.HIGH, Run_BTN, 2500, 100);
LedProcessInit();
IPCameraHelper.InstallService();
}
......@@ -248,6 +249,7 @@ namespace DeviceLibrary
ServerCM.storeStatus = currnetstoreStatus;
}
}
IPCameraHelper.StopRecord();
LogUtil.info("主线程已退出.");
}
public void Start()
......@@ -459,16 +461,15 @@ namespace DeviceLibrary
boxTransport.Reset();
ResetMoveInfo.log("回原完成");
ResetMoveInfo.EndMove();
if ((RobotManage.HasReelInFixPos(out ReelParam reelParam)) && boxTransport.IsComplateOrFree && ClampMoveInfo.MoveStep == MoveStep.Wait && ConfigHelper.Config.Get("Device_Use_Fixpos", false))
if ((RobotManage.HasReelInFixPos(out ReelParam reelParam))
&& boxTransport.IsComplateOrFree &&
ClampMoveInfo.MoveStep == MoveStep.Wait && ConfigHelper.Config.Get("Device_Use_Fixpos", false)
&& IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.LOW))
{
StoreMoveInfo.NewMove(MoveStep.StoreOut_NGPre);
StoreMoveInfo.MoveParam = reelParam.clone();
StoreMoveInfo.MoveParam.PosID = "NG";
StoreMoveInfo.MoveParam.IsNg = true;
StoreMoveInfo.MoveParam.NgMsg = "检测到校准库位有料盘信息,请人工确认";
StoreMoveInfo.log($"开始校准库位料盘出库");
ServerCM.storeStatus = StoreStatus.OutStoreExecute;
//CloseFlipDoor(StoreMoveInfo);
var pos = BoxStorePosition.GetFixPos(Config, reelParam);
LogUtil.info($"复位完成,校准库位出库:{pos.posid}");
RobotManage.mainMachine.AddSingleStoreTask("", pos.posid, reelParam.PlateW, reelParam.PlateH);
RobotManage.ClearReelInFixPos();
}
runStatus = RunStatus.Running;
ServerCM.storeStatus = StoreStatus.StoreOnline;
......@@ -646,7 +647,8 @@ namespace DeviceLibrary
public void IgnoreX09()
{
boxTransport.IgnoreX09 = true;
LogUtil.info("按下X09忽略");
RobotManage.UserPause("按下X09忽略",false);
//LogUtil.info("按下X09忽略");
}
}
}
......@@ -28,18 +28,17 @@ namespace DeviceLibrary
public string doTakeOutReel()
{
LogUtil.info("请求下降出库料串");
var step = RobotManage.mainMachine.StringMoveInfo.MoveStep;
var stringStep = RobotManage.mainMachine.StringMoveInfo.MoveStep;
var clampstep = RobotManage.mainMachine.ClampMoveInfo.MoveStep;
if (step == MoveStep.StringReadyGet && clampstep >= MoveStep.ReelClamp_GetHeight)
if (stringStep == MoveStep.StringReadyGet && clampstep >= MoveStep.ReelClamp_GetHeight)
{
RobotManage.mainMachine.StringMoveInfo.NextMoveStep(MoveStep.StringOut_01);
StringState = StringStateE.ManualOut;
return crc.GetString(L.string_begin_release, "开始释放料串");
}
if (step == MoveStep.StringReadyPut)
if (stringStep == MoveStep.StringReadyPut)
{
RobotManage.mainMachine.StringMoveInfo.NextMoveStep(MoveStep.StringOut_01);
StringState = StringStateE.ManualOut;
RequestTakeOutReel = true;
return crc.GetString(L.string_begin_release, "开始释放料串");
}
LogUtil.info($"料串无法释放,料仓正在出入库中:{StringMoveInfo.MoveStep}");
......
......@@ -15,17 +15,18 @@ namespace DeviceLibrary
{
StoreJobList OutStoreJobList = new StoreJobList("批量");
StoreJobList OutSingleJobList = new StoreJobList("单盘");
public bool HasJob { get => OutStoreJobList.Count > 0 || OutSingleJobList.Count>0; }
public void AddOutStoreTask(string warecode, string posId,int plateW,int plateH) {
JobInfo jobInfo = new JobInfo(warecode, posId,plateW,plateH);
public bool HasJob { get => OutStoreJobList.Count > 0 || OutSingleJobList.Count > 0; }
public void AddOutStoreTask(string warecode, string posId, int plateW, int plateH)
{
JobInfo jobInfo = new JobInfo(warecode, posId, plateW, plateH);
OutStoreJobList.Enqueue(jobInfo);
LogUtil.info($"添加出库任务队列: {posId},当前任务数量: {OutStoreJobList.Count}");
}
public void AddSingleStoreTask(string warecode,string posId, int plateW, int plateH)
public void AddSingleStoreTask(string warecode, string posId, int plateW, int plateH)
{
JobInfo jobInfo = new JobInfo(warecode, posId, plateW, plateH);
OutSingleJobList.Enqueue(jobInfo);
LogUtil.info($"添加单盘出库任务队列: {posId},当前任务数量: {OutStoreJobList.Count}");
LogUtil.info($"添加单盘出库任务队列: {posId},当前任务数量: {OutSingleJobList.Count}");
}
void StoreProcess()
{
......@@ -85,7 +86,8 @@ namespace DeviceLibrary
ServerCM.storeStatus = StoreStatus.OutStoreExecute;
}
}
else if (OutStoreJobList.Count > 0 && !IsBatchDoorClosed) {
else if (OutStoreJobList.Count > 0 && !IsBatchDoorClosed)
{
Msg.add("出库任务等待关闭批量舱门", MsgLevel.warning);
}
//判断有没有出库任务, 需要入库空闲, 出口空闲
......@@ -96,7 +98,7 @@ namespace DeviceLibrary
if (!boxTransport.IgnoreX09 && IOMonitor.IODebound(IO_Type.TrayCheck_Fixture, Config, IO_VALUE.HIGH, 5000))
{
Msg.add("收到出库任务,但料叉上有料,无法启动,请检查", MsgLevel.alarm, ErrInfo.X09_BoxNotDetect);
}
else
Msg.add("收到出库任务,但料叉上有料,无法启动,请检查", MsgLevel.warning);
......@@ -105,7 +107,7 @@ namespace DeviceLibrary
else
boxTransport.IgnoreX09 = false;
TurnToOut();
if (IsPutReelReady && OutStoreJobList.Dequeue(out JobInfo jobInfo))
if (IsPutReelReady && !RequestTakeOutReel && OutStoreJobList.Dequeue(out JobInfo jobInfo))
{
StoreMoveInfo.NewMove(MoveStep.StoreOut10);
StoreMoveInfo.MoveParam.PosID = jobInfo.PosId;
......@@ -120,9 +122,10 @@ namespace DeviceLibrary
case MoveStep.StoreIn01:
if (!StoreMoveInfo.MoveParam.IsNg && !ServerCM.SendStoreState(StoreMoveInfo.MoveParam.PosID, StoreStatus.InStoreExecute))
{
Msg.add("服务器连接异常",MsgLevel.warning);
Msg.add("服务器连接异常", MsgLevel.warning);
return;
}
ServerCM.storeStatus = StoreStatus.InStoreExecute;
StoreMoveInfo.NextMoveStep(MoveStep.StoreIn03);
if (StoreMoveInfo.MoveParam.IsNg)
......@@ -131,9 +134,9 @@ namespace DeviceLibrary
{
var ac = CSVPositionReader<ACStorePosition>.GetPositon(StoreMoveInfo.MoveParam.PosID);
boxTransport.Start(new BoxStorePosition(Config, StoreMoveInfo.MoveParam.ReelOnFixture? StoreSide.NGDoor:StoreSide.Clamp, StoreMoveInfo.MoveParam), new BoxStorePosition(Config, ac, StoreMoveInfo.MoveParam), StoreMoveType.InStore, true);
boxTransport.Start(new BoxStorePosition(Config, StoreMoveInfo.MoveParam.ReelOnFixture ? StoreSide.NGDoor : StoreSide.Clamp, StoreMoveInfo.MoveParam), new BoxStorePosition(Config, ac, StoreMoveInfo.MoveParam), StoreMoveType.InStore, true);
}
StoreMoveInfo.log($"开始转运料盘");
StoreMoveInfo.log($"开始转运料盘");
break;
case MoveStep.StoreIn02:
break;
......@@ -160,7 +163,7 @@ namespace DeviceLibrary
StoreMoveInfo.log($"料盘已到达目的地");
if (StoreMoveInfo.MoveParam.IsNg)
{
NGPuted(StoreMoveInfo.MoveParam.NgMsg);
NGPuted(StoreMoveInfo.MoveParam.NgMsg);
}
StoreMoveInfo.NextMoveStep(MoveStep.StoreIn05);
}
......@@ -185,15 +188,16 @@ namespace DeviceLibrary
Msg.add("服务器连接异常", MsgLevel.warning);
return;
}
ServerCM.storeStatus = StoreStatus.OutStoreExecute;
StoreMoveInfo.NextMoveStep(MoveStep.StoreOut11);
var outFrom = CSVPositionReader<ACStorePosition>.GetPositon(StoreMoveInfo.MoveParam.PosID);
BoxStorePosition outTo;
if (StoreMoveInfo.MoveParam.IsNg)
outTo = new BoxStorePosition(Config, StoreSide.NGDoor, StoreMoveInfo.MoveParam);
else
outTo = new BoxStorePosition(Config, StoreSide.String, StoreMoveInfo.MoveParam);
boxTransport.Start(outFrom == null ? null : new BoxStorePosition(Config, outFrom, StoreMoveInfo.MoveParam), outTo, StoreMoveType.OutStore);
StoreMoveInfo.log($"开始转运料盘{(StoreMoveInfo.MoveParam.IsNg ? "单料口" : "料串")}");
var outFrom = CSVPositionReader<ACStorePosition>.GetPositon(StoreMoveInfo.MoveParam.PosID);
BoxStorePosition outTo;
if (StoreMoveInfo.MoveParam.IsNg)
outTo = new BoxStorePosition(Config, StoreSide.NGDoor, StoreMoveInfo.MoveParam);
else
outTo = new BoxStorePosition(Config, StoreSide.String, StoreMoveInfo.MoveParam);
boxTransport.Start(outFrom == null ? null : new BoxStorePosition(Config, outFrom, StoreMoveInfo.MoveParam), outTo, StoreMoveType.OutStore);
StoreMoveInfo.log($"开始转运料盘{(StoreMoveInfo.MoveParam.IsNg ? "单料口" : "料串")}");
break;
case MoveStep.StoreOut11:
......@@ -220,10 +224,10 @@ namespace DeviceLibrary
Msg.add("服务器连接异常", MsgLevel.warning);
return;
}
StoreMoveInfo.log($"料盘已到达目的地");
StoreMoveInfo.log($"料盘已到达目的地");
if (StoreMoveInfo.MoveParam.IsNg)
{
NGPuted(StoreMoveInfo.MoveParam.NgMsg);
OutSingleJobList.ClearLastPosid(StoreMoveInfo.MoveParam.PosID);
}
......@@ -232,7 +236,7 @@ namespace DeviceLibrary
ReelPutted(StoreMoveInfo.MoveParam.PlateH);
OutStoreJobList.ClearLastPosid(StoreMoveInfo.MoveParam.PosID);
}
StoreMoveInfo.EndMove();
}
break;
......@@ -241,8 +245,9 @@ namespace DeviceLibrary
break;
}
}
string StoreState() {
string state = crc.GetString(L.free,"空闲中");
string StoreState()
{
string state = crc.GetString(L.free, "空闲中");
if (StoreMoveInfo.MoveStep >= MoveStep.StoreOut10)
{
state = $"{crc.GetString(L.reel_outting, "出库中")},{crc.GetString(L.posnum, "出库中")}:{StoreMoveInfo.MoveParam.PosID}";
......
......@@ -30,6 +30,11 @@ namespace DeviceLibrary
get => StringMoveInfo.MoveStep == MoveStep.StringReadyPut;
}
/// <summary>
/// 请求取出出库料盘
/// 当前出库料盘出完,不出下一盘
/// </summary>
public bool RequestTakeOutReel = false;
/// <summary>
/// 通知料盘已取走
/// </summary>
void ReelGetted(bool success = true)
......@@ -58,12 +63,14 @@ namespace DeviceLibrary
/// <summary>
/// 强制转换料串为出库模式
/// </summary>
public bool TurnToOut() {
public bool TurnToOut()
{
if (!IsBatchDoorClosed) {
if (!IsBatchDoorClosed)
{
return false;
}
if (StringState>= StringStateE.Full)
if (StringState >= StringStateE.Full)
{
return false;
}
......@@ -72,7 +79,7 @@ namespace DeviceLibrary
StringMoveInfo.log($"升起待机料串1");
StringState = StringStateE.OutStore;
StringMoveInfo.NextMoveStep(MoveStep.StringLoad_04);
BatchAxisToP2(StringMoveInfo,true);
BatchAxisToP2(StringMoveInfo, true);
StringMoveInfo.WaitList.Add(WaitResultInfo.WaitMsg("料串正在上升", MsgLevel.warning));
newreel = true;
return true;
......@@ -115,7 +122,7 @@ namespace DeviceLibrary
{
if (CheckWait(StringMoveInfo))
return;
switch (StringMoveInfo.MoveStep)
{
case MoveStep.Wait:
......@@ -127,7 +134,7 @@ namespace DeviceLibrary
{
Msg.add(crc.GetString(L.out_store_free, "舱内有出库料盘"), MsgLevel.warning);//0704
}
if (StringState < StringStateE.Full && StoreMoveInfo.MoveStep >= MoveStep.StoreOut10 && !StoreMoveInfo.MoveParam.IsNg && IsBatchDoorClosed)
{
StringMoveInfo.NextMoveStep(MoveStep.StringLoad_01);
......@@ -141,6 +148,14 @@ namespace DeviceLibrary
Batch_Axis.AbsMove(StringMoveInfo, Config.Batch_P1, Config.Batch_P1_speed);
break;
case MoveStep.StringLoad_01:
if (StringState == StringStateE.OutStore)
{
ServerCM.storeStatus = StoreStatus.OutStoreExecute;
}
else if (StringState == StringStateE.InStore)
{
ServerCM.storeStatus = StoreStatus.InStoreExecute;
}
StringMoveInfo.NextMoveStep(MoveStep.StringLoad_01a);
StringMoveInfo.log($"批量轴到待机点");
Batch_Axis.AbsMove(StringMoveInfo, Config.Batch_P1, Config.Batch_P1_speed);
......@@ -167,7 +182,7 @@ namespace DeviceLibrary
if (tpos1 < 0)
tpos1 = 0;
Batch_Axis.AbsMove(StringMoveInfo, tpos1, Config.Batch_P1_speed);
StringMoveInfo.log($"批量轴下降1cm: {Batch_Axis.GetAclPosition()}-{Config.Batch_PoToMM}*10="+ tpos1);
StringMoveInfo.log($"批量轴下降1cm: {Batch_Axis.GetAclPosition()}-{Config.Batch_PoToMM}*10=" + tpos1);
break;
case MoveStep.StringLoad_03:
StringMoveInfo.NextMoveStep(MoveStep.StringLoad_04);
......@@ -177,32 +192,38 @@ namespace DeviceLibrary
BatchAxisToP2(StringMoveInfo);
TestHeightTask = null;
}
else {
else
{
TestHeightTask = TestReelHeight();
}
StringMoveInfo.WaitList.Add(WaitResultInfo.WaitMsg("料串正在上升",MsgLevel.warning));
StringMoveInfo.WaitList.Add(WaitResultInfo.WaitMsg("料串正在上升", MsgLevel.warning));
break;
case MoveStep.StringLoad_04:
case MoveStep.StringLoad_04:
if (oldtestheight)
{
StringMoveInfo.NextMoveStep(MoveStep.StringLoad_05);
if (Batch_Axis.IsInPosition(Config.Batch_P2) && IOValue(IO_Type.TrayCheck).Equals(IO_VALUE.LOW))
{
StringMoveInfo.log($"料串检测为空");
if (ConfigHelper.Config.Get("Device_String_StandbyAtBottom", true) && OutStoreJobList.Count == 0 && StoreMoveInfo.MoveStep < MoveStep.StoreOut10)
{
StringMoveInfo.log($"当前空料串, 并且没有出库任务, 料串下降待机");
StringMoveInfo.NextMoveStep(MoveStep.StringOut_01);
}
else
{
StringState = StringStateE.OutStore;
StringMoveInfo.log($"料串检测为空,当前有出库任务,料串变为出库料串");
}
}
if (!newreel)
SetReelHeight(GetHeight(StringMoveInfo));
newreel = false;
}
else if (TestHeightTask.IsCompleted){
else if (TestHeightTask.IsCompleted)
{
StringMoveInfo.NextMoveStep(MoveStep.StringLoad_05);
}
}
break;
case MoveStep.StringLoad_05:
StringMoveInfo.NextMoveStep(MoveStep.StringLoad_06);
......@@ -212,7 +233,8 @@ namespace DeviceLibrary
{
if (ClampMoveInfo.MoveStep == MoveStep.Wait && (!Middle_Axis.IsInPosition(Config.Middle_P2) || InOut_Axis.IsInPosition(Config.InOut_P1)))
{
if (RobotManage.InoutDebugMode) {
if (RobotManage.InoutDebugMode)
{
StringMoveInfo.NextMoveStep(MoveStep.StringReadyGet);
StringMoveInfo.log($"出入库测试模式跳过拍照扫码");
}
......@@ -246,7 +268,7 @@ namespace DeviceLibrary
Batch_Axis.AbsMove(StringMoveInfo, tpos4, Config.Batch_P1_speed);
}
break;
case MoveStep.StringLoad_07:
case MoveStep.StringLoad_07:
if (ScanTask.IsCompleted)
{
StringMoveInfo.NextMoveStep(MoveStep.StringReadyGet);
......@@ -259,7 +281,7 @@ namespace DeviceLibrary
return;
}
else
{
{
StringMoveInfo.log($"已完成扫码,等待等待测高 Count={x.Count}");
StringMoveInfo.MoveParam.IsNg = false;
StringMoveInfo.MoveParam.codeInfos = x;
......@@ -316,17 +338,32 @@ namespace DeviceLibrary
StringMoveInfo.log($"当前服务器反馈没有出库任务, 料串下降待机");
StringMoveInfo.NextMoveStep(MoveStep.StringOut_01);
}
else if (RequestTakeOutReel && StoreMoveInfo.IsStep(MoveStep.Wait))
{
StringMoveInfo.log($"请求取出出库料盘,料串下降");
RobotManage.mainMachine.StringMoveInfo.NextMoveStep(MoveStep.StringOut_01);
StringState = StringStateE.ManualOut;
}
else if (ServerCM.queueTaskCount != 0)
{
StringMoveInfo.log($"当前服务器反馈有出库任务:{ServerCM.queueTaskCount}");
}
else if (!boxTransport.IsComplateOrFree)
{
StringMoveInfo.log($"等待料盘转移完成");
}
break;
case MoveStep.StringReelPut:
if (Setting_Init.Device_OutStoreStringReelCheck) {
if (Setting_Init.Device_OutStoreStringReelCheck)
{
StringMoveInfo.NextMoveStep(MoveStep.StringReelPut_03);
BatchAxisToP2(StringMoveInfo,true);
BatchAxisToP2(StringMoveInfo, true);
return;
}
var tpos = Batch_Axis.GetAclPosition() - Config.Batch_PoToMM * (StringMoveInfo.MoveParam.PlateH+Config.Batch_OutPlateDownMM);
if (tpos < 0)
tpos = 0;
var tpos = Batch_Axis.GetAclPosition() - Config.Batch_PoToMM * (StringMoveInfo.MoveParam.PlateH + Config.Batch_OutPlateDownMM);
//if (tpos < 0)
// tpos = 0;
if (tpos < Config.Batch_P2 * 0.3 && !downCheck1)
{
StringMoveInfo.log($"料串下降到30%位置,重新上升");
......@@ -342,7 +379,7 @@ namespace DeviceLibrary
else if (tpos > Config.Batch_P1 + Config.Batch_PoToMM * 12)
{
StringMoveInfo.NextMoveStep(MoveStep.StringReadyPut);
StringMoveInfo.log($"料盘放入料串,下降{StringMoveInfo.MoveParam.PlateH}+{3}cm");
StringMoveInfo.log($"料盘放入料串,下降{StringMoveInfo.MoveParam.PlateH}+{Config.Batch_OutPlateDownMM}mm,目标位置{tpos}");
Batch_Axis.AbsMove(StringMoveInfo, tpos, Config.Batch_P1_speed);
}
else if (!downCheck3)
......@@ -360,18 +397,19 @@ namespace DeviceLibrary
break;
case MoveStep.StringReelPut_01:
StringMoveInfo.NextMoveStep(MoveStep.StringReelPut_02);
break;
case MoveStep.StringReelPut_02:
StringMoveInfo.NextMoveStep(MoveStep.StringLoad_05);
StringMoveInfo.log($"批量轴到顶部检测点");
BatchAxisToP2(StringMoveInfo,true);
BatchAxisToP2(StringMoveInfo, true);
break;
case MoveStep.StringReelPut_03:
StringMoveInfo.NextMoveStep(MoveStep.StringReelPut_04);
var heightcheck = (LastOutDownPosition - Batch_Axis.GetAclPosition()) / Config.Batch_PoToMM;
StringMoveInfo.log($"LastOutDownPosition={LastOutDownPosition},CurrentPosition={Batch_Axis.GetAclPosition()},heightcheck={heightcheck}");
if (heightcheck <= 5) {
if (heightcheck <= 5)
{
Msg.add("出库时料盘未成功放入料串,请检查", MsgLevel.alarm);
RobotManage.UserPause("出库时料盘未成功放入料串,请检查");
}
......@@ -396,8 +434,9 @@ namespace DeviceLibrary
break;
case MoveStep.StringOut_01:
StringMoveInfo.NextMoveStep(MoveStep.StringOut_Released);
RequestTakeOutReel = false;
StringMoveInfo.log($"料串下降到P1点");
Batch_Axis.AbsMove(StringMoveInfo, Config.Batch_P1, Config.Batch_P1_speed);
Batch_Axis.AbsMove(StringMoveInfo, Config.Batch_P1, Config.Batch_P1_speed);
StringMoveInfo.WaitList.Add(WaitResultInfo.WaitMsg("料串正在下降", MsgLevel.warning));
break;
case MoveStep.StringOut_02:
......@@ -408,7 +447,8 @@ namespace DeviceLibrary
case MoveStep.StringOut_Released:
StringMoveInfo.log($"料串已回到待机点");
StringMoveInfo.NewMove(MoveStep.Wait);
ServerCM.storeStatus = StoreStatus.StoreOnline;
StringMoveInfo.NewMove(MoveStep.Wait);
break;
case MoveStep.StringOut_07:
//StringMoveInfo.log($"关闭折叠门");
......@@ -421,13 +461,14 @@ namespace DeviceLibrary
}
}
string StringProcessState() {
string StringProcessState()
{
string state = "";
if (StringState == StringStateE.OutStore)
state = crc.GetString(L.out_string, "出库料串");
else if (StringState >= StringStateE.Full)
{
{
state = crc.GetString(L.full_reel, "满料串");
}
else if (StringState == StringStateE.InStore)
......@@ -465,7 +506,7 @@ namespace DeviceLibrary
{
targetSpeed = Config.Batch_P1_speed;
}
moveInfo.log("BatchAxisToP2 目标P2: " + targetP2+",speed:"+targetSpeed);
moveInfo.log("BatchAxisToP2 目标P2: " + targetP2 + ",speed:" + targetSpeed);
moveInfo.TimeOutSeconds = 200;
moveInfo.CanWhileCount = 0;
// 需要增加定时器,获取验证信号并停止伺服
......@@ -475,12 +516,15 @@ namespace DeviceLibrary
Batch_Axis.AbsMove(null, targetP2, targetSpeed);
//开始检测信号
Batch_Axis.BatchAxisStartCheck(IO_Type.TrayCheck, IO_VALUE.HIGH);
}
Task TestReelHeight() {
return Task.Run(()=> {
}
Task TestReelHeight()
{
return Task.Run(() =>
{
int upmm = 0;
for (int i = 0; i < 56 / 2; i++) {
for (int i = 0; i < 56 / 2; i++)
{
upmm += 2;
LogUtil.info($"上升:{2}mm,累计:{upmm}mm");
var r = TestUp(2);
......@@ -498,7 +542,8 @@ namespace DeviceLibrary
}
});
}
int TestUp(int mm) {
int TestUp(int mm)
{
int currPosition = Batch_Axis.GetAclPosition();
if (currPosition + Config.Batch_PoToMM * mm >= Config.Batch_P2)
{
......@@ -509,7 +554,7 @@ namespace DeviceLibrary
Task.Delay(20).Wait();
}
Task.Delay(160).Wait();
if (IOValue(IO_Type.TrayCheck).Equals(IO_VALUE.HIGH))
if (IOValue(IO_Type.TrayCheck).Equals(IO_VALUE.HIGH))
return 1;
else
return -1;
......
......@@ -186,7 +186,7 @@ namespace DeviceLibrary
reelParam = null;
try
{
string fix = ConfigHelper.Config.Get(Setting_Init.FixBuffInfo, "");
string fix = Setting_Init.FixBuffInfo;
if (!string.IsNullOrEmpty(fix))
{
reelParam = JsonHelper.DeserializeJsonToObject<ReelParam>(fix);
......@@ -201,11 +201,13 @@ namespace DeviceLibrary
}
public static void PutReelInFixPos(ReelParam reelParam)
{
ConfigHelper.Config.Set(Setting_Init.FixBuffInfo, JsonHelper.SerializeObject(reelParam));
string buff= JsonHelper.SerializeObject(reelParam);
Setting_Init.FixBuffInfo=buff;
LogUtil.info(buff);
}
public static void ClearReelInFixPos()
{
ConfigHelper.Config.Set(Setting_Init.FixBuffInfo, "");
Setting_Init.FixBuffInfo = "";
}
#endregion
}
......
......@@ -50,7 +50,8 @@ namespace TheMachine
this.tableLayoutPanel.Controls.Add(this.textBoxDescription, 1, 4);
this.tableLayoutPanel.Controls.Add(this.okButton, 1, 5);
this.tableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel.Location = new System.Drawing.Point(9, 8);
this.tableLayoutPanel.Location = new System.Drawing.Point(21, 18);
this.tableLayoutPanel.Margin = new System.Windows.Forms.Padding(7, 7, 7, 7);
this.tableLayoutPanel.Name = "tableLayoutPanel";
this.tableLayoutPanel.RowCount = 6;
this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F));
......@@ -59,17 +60,17 @@ namespace TheMachine
this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.tableLayoutPanel.Size = new System.Drawing.Size(417, 245);
this.tableLayoutPanel.Size = new System.Drawing.Size(973, 551);
this.tableLayoutPanel.TabIndex = 0;
//
// labelProductName
//
this.labelProductName.Dock = System.Windows.Forms.DockStyle.Fill;
this.labelProductName.Location = new System.Drawing.Point(60, 0);
this.labelProductName.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0);
this.labelProductName.MaximumSize = new System.Drawing.Size(0, 16);
this.labelProductName.Location = new System.Drawing.Point(140, 0);
this.labelProductName.Margin = new System.Windows.Forms.Padding(14, 0, 7, 0);
this.labelProductName.MaximumSize = new System.Drawing.Size(0, 36);
this.labelProductName.Name = "labelProductName";
this.labelProductName.Size = new System.Drawing.Size(354, 16);
this.labelProductName.Size = new System.Drawing.Size(826, 36);
this.labelProductName.TabIndex = 19;
this.labelProductName.Tag = "not";
this.labelProductName.Text = "产品名称";
......@@ -78,11 +79,11 @@ namespace TheMachine
// labelVersion
//
this.labelVersion.Dock = System.Windows.Forms.DockStyle.Fill;
this.labelVersion.Location = new System.Drawing.Point(60, 24);
this.labelVersion.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0);
this.labelVersion.MaximumSize = new System.Drawing.Size(0, 16);
this.labelVersion.Location = new System.Drawing.Point(140, 55);
this.labelVersion.Margin = new System.Windows.Forms.Padding(14, 0, 7, 0);
this.labelVersion.MaximumSize = new System.Drawing.Size(0, 36);
this.labelVersion.Name = "labelVersion";
this.labelVersion.Size = new System.Drawing.Size(354, 16);
this.labelVersion.Size = new System.Drawing.Size(826, 36);
this.labelVersion.TabIndex = 0;
this.labelVersion.Tag = "not";
this.labelVersion.Text = "版本";
......@@ -92,11 +93,11 @@ namespace TheMachine
// labelCopyright
//
this.labelCopyright.Dock = System.Windows.Forms.DockStyle.Fill;
this.labelCopyright.Location = new System.Drawing.Point(60, 48);
this.labelCopyright.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0);
this.labelCopyright.MaximumSize = new System.Drawing.Size(0, 16);
this.labelCopyright.Location = new System.Drawing.Point(140, 110);
this.labelCopyright.Margin = new System.Windows.Forms.Padding(14, 0, 7, 0);
this.labelCopyright.MaximumSize = new System.Drawing.Size(0, 36);
this.labelCopyright.Name = "labelCopyright";
this.labelCopyright.Size = new System.Drawing.Size(354, 16);
this.labelCopyright.Size = new System.Drawing.Size(826, 36);
this.labelCopyright.TabIndex = 21;
this.labelCopyright.Tag = "not";
this.labelCopyright.Text = "版权";
......@@ -105,11 +106,11 @@ namespace TheMachine
// labelCompanyName
//
this.labelCompanyName.Dock = System.Windows.Forms.DockStyle.Fill;
this.labelCompanyName.Location = new System.Drawing.Point(60, 72);
this.labelCompanyName.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0);
this.labelCompanyName.MaximumSize = new System.Drawing.Size(0, 16);
this.labelCompanyName.Location = new System.Drawing.Point(140, 165);
this.labelCompanyName.Margin = new System.Windows.Forms.Padding(14, 0, 7, 0);
this.labelCompanyName.MaximumSize = new System.Drawing.Size(0, 36);
this.labelCompanyName.Name = "labelCompanyName";
this.labelCompanyName.Size = new System.Drawing.Size(354, 16);
this.labelCompanyName.Size = new System.Drawing.Size(826, 36);
this.labelCompanyName.TabIndex = 22;
this.labelCompanyName.Text = "公司名称";
this.labelCompanyName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
......@@ -117,13 +118,13 @@ namespace TheMachine
// textBoxDescription
//
this.textBoxDescription.Dock = System.Windows.Forms.DockStyle.Fill;
this.textBoxDescription.Location = new System.Drawing.Point(60, 99);
this.textBoxDescription.Margin = new System.Windows.Forms.Padding(6, 3, 3, 3);
this.textBoxDescription.Location = new System.Drawing.Point(140, 227);
this.textBoxDescription.Margin = new System.Windows.Forms.Padding(14, 7, 7, 7);
this.textBoxDescription.Multiline = true;
this.textBoxDescription.Name = "textBoxDescription";
this.textBoxDescription.ReadOnly = true;
this.textBoxDescription.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.textBoxDescription.Size = new System.Drawing.Size(354, 116);
this.textBoxDescription.Size = new System.Drawing.Size(826, 261);
this.textBoxDescription.TabIndex = 23;
this.textBoxDescription.TabStop = false;
this.textBoxDescription.Tag = "not";
......@@ -133,9 +134,10 @@ namespace TheMachine
//
this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.okButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.okButton.Location = new System.Drawing.Point(339, 222);
this.okButton.Location = new System.Drawing.Point(791, 502);
this.okButton.Margin = new System.Windows.Forms.Padding(7, 7, 7, 7);
this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(75, 20);
this.okButton.Size = new System.Drawing.Size(175, 42);
this.okButton.TabIndex = 24;
this.okButton.Text = "确定";
this.okButton.Click += new System.EventHandler(this.okButton_Click);
......@@ -143,15 +145,16 @@ namespace TheMachine
// AboutBox1
//
this.AcceptButton = this.okButton;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleDimensions = new System.Drawing.SizeF(14F, 27F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(435, 261);
this.ClientSize = new System.Drawing.Size(1015, 587);
this.Controls.Add(this.tableLayoutPanel);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Margin = new System.Windows.Forms.Padding(7, 7, 7, 7);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "AboutBox1";
this.Padding = new System.Windows.Forms.Padding(9, 8, 9, 8);
this.Padding = new System.Windows.Forms.Padding(21, 18, 21, 18);
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
......
......@@ -3,7 +3,9 @@ using OnlineStore.Common;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
......@@ -53,7 +55,11 @@ namespace TheMachine
{
get
{
return Assembly.GetExecutingAssembly().GetName().Version.ToString();
Process current = Process.GetCurrentProcess();
FileInfo fileInfo = new FileInfo(current.MainModule.FileName);
DateTime dateTime = fileInfo.LastWriteTime;
string version = $"{dateTime.Year % 10}.{dateTime.Month}.{dateTime.Day.ToString("00")}{dateTime.Hour.ToString("00")}";
return version;
}
}
......
......@@ -41,10 +41,12 @@ namespace TheMachine
this.uC_LedConfig1 = new TheMachine.UC.UC_LedConfig();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage_set = new System.Windows.Forms.TabPage();
this.button2 = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();
this.uC_SetUserPassword1 = new TheMachine.UC_SetUserPassword();
this.tabPage_ledtower = new System.Windows.Forms.TabPage();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.fixtureSizeConfigControl1 = new DeviceLibrary.FixtureSizeConfigControl();
this.uC_SetUserPassword1 = new TheMachine.UC_SetUserPassword();
this.tp.SuspendLayout();
this.tabControl1.SuspendLayout();
this.tabPage_set.SuspendLayout();
......@@ -56,10 +58,10 @@ namespace TheMachine
//
this.chbAutoRun.AutoSize = true;
this.tp.SetColumnSpan(this.chbAutoRun, 2);
this.chbAutoRun.Location = new System.Drawing.Point(10, 166);
this.chbAutoRun.Location = new System.Drawing.Point(10, 169);
this.chbAutoRun.Margin = new System.Windows.Forms.Padding(10);
this.chbAutoRun.Name = "chbAutoRun";
this.chbAutoRun.Size = new System.Drawing.Size(84, 16);
this.chbAutoRun.Size = new System.Drawing.Size(94, 17);
this.chbAutoRun.TabIndex = 1;
this.chbAutoRun.Text = "开机自启动";
this.chbAutoRun.UseVisualStyleBackColor = true;
......@@ -68,7 +70,7 @@ namespace TheMachine
//
this.cb_tempsensorport.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cb_tempsensorport.FormattingEnabled = true;
this.cb_tempsensorport.Location = new System.Drawing.Point(139, 6);
this.cb_tempsensorport.Location = new System.Drawing.Point(144, 6);
this.cb_tempsensorport.Margin = new System.Windows.Forms.Padding(6);
this.cb_tempsensorport.Name = "cb_tempsensorport";
this.cb_tempsensorport.Size = new System.Drawing.Size(121, 20);
......@@ -82,7 +84,7 @@ namespace TheMachine
this.label_tempsensor.Location = new System.Drawing.Point(10, 10);
this.label_tempsensor.Margin = new System.Windows.Forms.Padding(10);
this.label_tempsensor.Name = "label_tempsensor";
this.label_tempsensor.Size = new System.Drawing.Size(107, 12);
this.label_tempsensor.Size = new System.Drawing.Size(118, 13);
this.label_tempsensor.TabIndex = 3;
this.label_tempsensor.Text = "温湿度控制器端口:";
this.label_tempsensor.TextAlign = System.Drawing.ContentAlignment.TopRight;
......@@ -90,7 +92,7 @@ namespace TheMachine
// button_positiontool
//
this.tp.SetColumnSpan(this.button_positiontool, 2);
this.button_positiontool.Location = new System.Drawing.Point(10, 74);
this.button_positiontool.Location = new System.Drawing.Point(10, 76);
this.button_positiontool.Margin = new System.Windows.Forms.Padding(10);
this.button_positiontool.Name = "button_positiontool";
this.button_positiontool.Size = new System.Drawing.Size(181, 36);
......@@ -103,10 +105,10 @@ namespace TheMachine
//
this.lbl_hmdstate.AutoSize = true;
this.tp.SetColumnSpan(this.lbl_hmdstate, 2);
this.lbl_hmdstate.Location = new System.Drawing.Point(10, 42);
this.lbl_hmdstate.Location = new System.Drawing.Point(10, 43);
this.lbl_hmdstate.Margin = new System.Windows.Forms.Padding(10);
this.lbl_hmdstate.Name = "lbl_hmdstate";
this.lbl_hmdstate.Size = new System.Drawing.Size(53, 12);
this.lbl_hmdstate.Size = new System.Drawing.Size(59, 13);
this.lbl_hmdstate.TabIndex = 5;
this.lbl_hmdstate.Tag = "not";
this.lbl_hmdstate.Text = "当前状态";
......@@ -141,17 +143,17 @@ namespace TheMachine
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.Size = new System.Drawing.Size(266, 192);
this.tp.Size = new System.Drawing.Size(276, 196);
this.tp.TabIndex = 6;
//
// cb_usefixpos
//
this.cb_usefixpos.AutoSize = true;
this.tp.SetColumnSpan(this.cb_usefixpos, 2);
this.cb_usefixpos.Location = new System.Drawing.Point(10, 130);
this.cb_usefixpos.Location = new System.Drawing.Point(10, 132);
this.cb_usefixpos.Margin = new System.Windows.Forms.Padding(10);
this.cb_usefixpos.Name = "cb_usefixpos";
this.cb_usefixpos.Size = new System.Drawing.Size(96, 16);
this.cb_usefixpos.Size = new System.Drawing.Size(107, 17);
this.cb_usefixpos.TabIndex = 6;
this.cb_usefixpos.Text = "启用校准库位";
this.cb_usefixpos.UseVisualStyleBackColor = true;
......@@ -180,6 +182,8 @@ namespace TheMachine
//
// tabPage_set
//
this.tabPage_set.Controls.Add(this.button2);
this.tabPage_set.Controls.Add(this.button1);
this.tabPage_set.Controls.Add(this.uC_SetUserPassword1);
this.tabPage_set.Controls.Add(this.tp);
this.tabPage_set.Location = new System.Drawing.Point(4, 22);
......@@ -190,6 +194,35 @@ namespace TheMachine
this.tabPage_set.Text = "常规设置";
this.tabPage_set.UseVisualStyleBackColor = true;
//
// button2
//
this.button2.Location = new System.Drawing.Point(53, 365);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(156, 59);
this.button2.TabIndex = 9;
this.button2.Text = "Stop Recording";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// button1
//
this.button1.Location = new System.Drawing.Point(53, 270);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(156, 59);
this.button1.TabIndex = 8;
this.button1.Text = "Start Recording";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click_2);
//
// uC_SetUserPassword1
//
this.uC_SetUserPassword1.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uC_SetUserPassword1.Location = new System.Drawing.Point(335, 8);
this.uC_SetUserPassword1.Margin = new System.Windows.Forms.Padding(5);
this.uC_SetUserPassword1.Name = "uC_SetUserPassword1";
this.uC_SetUserPassword1.Size = new System.Drawing.Size(533, 596);
this.uC_SetUserPassword1.TabIndex = 7;
//
// tabPage_ledtower
//
this.tabPage_ledtower.Controls.Add(this.uC_LedConfig1);
......@@ -220,15 +253,6 @@ namespace TheMachine
this.fixtureSizeConfigControl1.Size = new System.Drawing.Size(1010, 708);
this.fixtureSizeConfigControl1.TabIndex = 0;
//
// uC_SetUserPassword1
//
this.uC_SetUserPassword1.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uC_SetUserPassword1.Location = new System.Drawing.Point(335, 8);
this.uC_SetUserPassword1.Margin = new System.Windows.Forms.Padding(5);
this.uC_SetUserPassword1.Name = "uC_SetUserPassword1";
this.uC_SetUserPassword1.Size = new System.Drawing.Size(533, 596);
this.uC_SetUserPassword1.TabIndex = 7;
//
// SettingControl
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
......@@ -263,5 +287,7 @@ namespace TheMachine
private System.Windows.Forms.TabPage tabPage1;
private DeviceLibrary.FixtureSizeConfigControl fixtureSizeConfigControl1;
private UC_SetUserPassword uC_SetUserPassword1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button1;
}
}
......@@ -120,9 +120,14 @@ namespace TheMachine
lbl_hmdstate.Text += $"{crc.GetString(L.temperature, "温度")}:{t.Temperate}℃, {crc.GetString(L.humidity, "湿度")}:{t.Humidity}%";
}
private void button1_Click_1(object sender, EventArgs e)
private void button1_Click_2(object sender, EventArgs e)
{
DeviceLibrary.IPCameraHelper.StartRecord("manual");
}
private void button2_Click(object sender, EventArgs e)
{
DeviceLibrary.IPCameraHelper.StopRecord();
}
}
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!