Commit bbf89a45 张东亮

1

1 个父辈 03cb63d7
{ {
"HIKIPCamera": [ "HIKIPCamera": [
{ {
"Name": "monitorA", "Name": "cam1",
"IP": "192.168.106.21", "IP": "192.168.105.25",
"User": "admin", "User": "admin",
"Password": "Acc123456", "Password": "Acc123456",
"Port": 8000 "Port": 8000
......
...@@ -35,17 +35,24 @@ namespace DeviceLibrary ...@@ -35,17 +35,24 @@ namespace DeviceLibrary
} }
} }
static string baseDir = ConfigHelper.Config.Get("IPCameraService_HttpServer", "http://localhost:8088"); static string baseDir = ConfigHelper.Config.Get("IPCameraService_HttpServer", "http://localhost:8088");
static string cameName= ConfigHelper.Config.Get("IPCameraService_CamName", "cam1");
public static void StartRecord(string fileName="") public static void StartRecord(string fileName="")
{ {
string url = $"{baseDir}/cam/startRecord?camName=cam1&filename={fileName}"; Task.Factory.StartNew(delegate {
string res=HttpHelper.Get(url); string url = $"{baseDir}/cam/startRecord?camName={cameName}&filename={fileName}";
LogUtil.info($"开始记录视频:{fileName},{res}"); string res = HttpHelper.Get(url);
LogUtil.info($"开始记录视频:{fileName},{res}");
});
} }
public static void StopRecord() public static void StopRecord()
{ {
string url = $"{baseDir}/cam/stopRecord?camName=cam1"; Task.Factory.StartNew(delegate
string res = HttpHelper.Get(url); {
LogUtil.info($"停止记录视频:{res}"); string url = $"{baseDir}/cam/stopRecord?camName={cameName}";
string res = HttpHelper.Get(url);
LogUtil.info($"停止记录视频:{res}");
});
} }
//判断服务是否存在 //判断服务是否存在
static bool IsServiceExisted(string serviceName) static bool IsServiceExisted(string serviceName)
......
...@@ -40,6 +40,10 @@ namespace DeviceLibrary ...@@ -40,6 +40,10 @@ namespace DeviceLibrary
} }
SafetyDevice.AddDevice(this); SafetyDevice.AddDevice(this);
} }
public void ClearAlarm()
{
}
public bool isAtTOP { public bool isAtTOP {
get { get {
return IOManager.IOValue(up.ToString()).Equals(IO_VALUE.HIGH); return IOManager.IOValue(up.ToString()).Equals(IO_VALUE.HIGH);
......
...@@ -85,12 +85,16 @@ namespace DeviceLibrary ...@@ -85,12 +85,16 @@ namespace DeviceLibrary
public string doCloseBatchDoor() public string doCloseBatchDoor()
{ {
LogUtil.info("请求关闭批量料门"); LogUtil.info("请求关闭批量料门");
if (IOValue(IO_Type.StringFront_Check).Equals(IO_VALUE.HIGH)) if (!ConfigHelper.Config.Get("Device_IO_X08IsStringDoor_SafetyLightCurtains", false))
{ {
LogUtil.info("料串尚未到位无法关门X09=High"); if (IOValue(IO_Type.StringFront_Check).Equals(IO_VALUE.HIGH))
return crc.GetString(L.string_not_onposition_01, "料串尚未到位无法关门X09=High"); {
LogUtil.info("料串尚未到位无法关门X09=High");
return crc.GetString(L.string_not_onposition_01, "料串尚未到位无法关门X09=High");
}
} }
//RobotManage.mainMachine.StringMoveInfo.NewMove(MoveStep.Wait); //RobotManage.mainMachine.StringMoveInfo.NewMove(MoveStep.Wait);
//RobotManage.mainMachine.StringMoveInfo.NextMoveStep(RobotManage.mainMachine.StringMoveInfo.MoveStep); //RobotManage.mainMachine.StringMoveInfo.NextMoveStep(RobotManage.mainMachine.StringMoveInfo.MoveStep);
StringMoveInfo.LastSetpTime = DateTime.Now; StringMoveInfo.LastSetpTime = DateTime.Now;
......
...@@ -138,6 +138,7 @@ namespace DeviceLibrary ...@@ -138,6 +138,7 @@ namespace DeviceLibrary
// StringDoorClose(StringMoveInfo); // StringDoorClose(StringMoveInfo);
CylinderMove(StringMoveInfo, IO_Type.StringFix_Bottom, IO_Type.StringFix_Top, IO_VALUE.HIGH); CylinderMove(StringMoveInfo, IO_Type.StringFix_Bottom, IO_Type.StringFix_Top, IO_VALUE.HIGH);
CylinderMove(StringMoveInfo, IO_Type.StringPosChecker_Home, IO_Type.StringPosChecker_Work, IO_VALUE.HIGH); CylinderMove(StringMoveInfo, IO_Type.StringPosChecker_Home, IO_Type.StringPosChecker_Work, IO_VALUE.HIGH);
Line.LineStop("n");
} }
else else
{ {
......
...@@ -79,6 +79,7 @@ namespace DeviceLibrary ...@@ -79,6 +79,7 @@ namespace DeviceLibrary
IsLoadOk = false; IsLoadOk = false;
msg += crc.GetString(L.iocard_init_fail, "IO板卡初始化失败")+ "\n"; msg += crc.GetString(L.iocard_init_fail, "IO板卡初始化失败")+ "\n";
} }
// IOManager.CloseAllConnection();
if (!CameraA.LoadCameraConfig("CameraA", out string errmsg)) if (!CameraA.LoadCameraConfig("CameraA", out string errmsg))
{ {
IsLoadOk = false; IsLoadOk = false;
...@@ -88,6 +89,12 @@ namespace DeviceLibrary ...@@ -88,6 +89,12 @@ namespace DeviceLibrary
IsLoadOk = false; IsLoadOk = false;
msg += crc.GetString(L.tempnhum_sensor_init_fail, $"温湿度传感器初始化失败,端口:")+ $"{ConfigHelper.Config.Get("Device_Humiture_Port")}\n"; msg += crc.GetString(L.tempnhum_sensor_init_fail, $"温湿度传感器初始化失败,端口:")+ $"{ConfigHelper.Config.Get("Device_Humiture_Port")}\n";
} }
//Thread.Sleep(1000);
//if (!IOManager.ConnectionIOList(new List<string>()))
//{
// IsLoadOk = false;
// msg += crc.GetString(L.iocard_init_fail, "IO板卡初始化失败") + "\n";
//}
IOManager.IOMove(IO_Type.Device_Led, IO_VALUE.HIGH); IOManager.IOMove(IO_Type.Device_Led, IO_VALUE.HIGH);
IOManager.IOMove(IO_Type.Camera_Led, IO_VALUE.HIGH); IOManager.IOMove(IO_Type.Camera_Led, IO_VALUE.HIGH);
...@@ -124,8 +131,6 @@ namespace DeviceLibrary ...@@ -124,8 +131,6 @@ namespace DeviceLibrary
GC.KeepAlive(mainThread); GC.KeepAlive(mainThread);
Task.Run(()=> { Task.Run(()=> {
AxisBean.List.ForEach((x) => { AxisManager.AlarmClear(x.Config.DeviceName, x.Config.GetAxisValue()); });
Task.Delay(1000).Wait(); Task.Delay(1000).Wait();
if (mainMachine.DeviceCheck()) if (mainMachine.DeviceCheck())
mainMachine.BeginHomeReset(true); mainMachine.BeginHomeReset(true);
......
...@@ -142,6 +142,7 @@ namespace TheMachine ...@@ -142,6 +142,7 @@ namespace TheMachine
// Thread.Sleep(100); // Thread.Sleep(100);
// Application.DoEvents(); // Application.DoEvents();
//} //}
this.DoubleBuffered = true;
pnl.Enabled = false; pnl.Enabled = false;
} }
...@@ -151,6 +152,7 @@ namespace TheMachine ...@@ -151,6 +152,7 @@ namespace TheMachine
{ {
pictureBox1.Visible = true; pictureBox1.Visible = true;
pictureBox1.Image = e; pictureBox1.Image = e;
Application.DoEvents();
}, sender, e); }, sender, e);
} }
private void CameraB_camera_event(object sender, Bitmap e) private void CameraB_camera_event(object sender, Bitmap e)
......
...@@ -40,8 +40,6 @@ namespace TheMachine ...@@ -40,8 +40,6 @@ namespace TheMachine
this.cb_usefixpos = new System.Windows.Forms.CheckBox(); this.cb_usefixpos = new System.Windows.Forms.CheckBox();
this.button1 = new System.Windows.Forms.Button(); this.button1 = new System.Windows.Forms.Button();
this.uC_SetUserPassword1 = new TheMachine.UC_SetUserPassword(); this.uC_SetUserPassword1 = new TheMachine.UC_SetUserPassword();
this.button2 = new System.Windows.Forms.Button();
this.button3 = new System.Windows.Forms.Button();
this.tp.SuspendLayout(); this.tp.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
...@@ -49,10 +47,10 @@ namespace TheMachine ...@@ -49,10 +47,10 @@ namespace TheMachine
// //
this.chbAutoRun.AutoSize = true; this.chbAutoRun.AutoSize = true;
this.tp.SetColumnSpan(this.chbAutoRun, 2); this.tp.SetColumnSpan(this.chbAutoRun, 2);
this.chbAutoRun.Location = new System.Drawing.Point(10, 175); this.chbAutoRun.Location = new System.Drawing.Point(10, 214);
this.chbAutoRun.Margin = new System.Windows.Forms.Padding(10); this.chbAutoRun.Margin = new System.Windows.Forms.Padding(10);
this.chbAutoRun.Name = "chbAutoRun"; this.chbAutoRun.Name = "chbAutoRun";
this.chbAutoRun.Size = new System.Drawing.Size(104, 19); this.chbAutoRun.Size = new System.Drawing.Size(174, 32);
this.chbAutoRun.TabIndex = 1; this.chbAutoRun.TabIndex = 1;
this.chbAutoRun.Text = "开机自启动"; this.chbAutoRun.Text = "开机自启动";
this.chbAutoRun.UseVisualStyleBackColor = true; this.chbAutoRun.UseVisualStyleBackColor = true;
...@@ -61,10 +59,10 @@ namespace TheMachine ...@@ -61,10 +59,10 @@ namespace TheMachine
// //
this.cb_tempsensorport.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cb_tempsensorport.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cb_tempsensorport.FormattingEnabled = true; this.cb_tempsensorport.FormattingEnabled = true;
this.cb_tempsensorport.Location = new System.Drawing.Point(161, 6); this.cb_tempsensorport.Location = new System.Drawing.Point(276, 6);
this.cb_tempsensorport.Margin = new System.Windows.Forms.Padding(6); this.cb_tempsensorport.Margin = new System.Windows.Forms.Padding(6);
this.cb_tempsensorport.Name = "cb_tempsensorport"; this.cb_tempsensorport.Name = "cb_tempsensorport";
this.cb_tempsensorport.Size = new System.Drawing.Size(121, 23); this.cb_tempsensorport.Size = new System.Drawing.Size(121, 35);
this.cb_tempsensorport.TabIndex = 2; this.cb_tempsensorport.TabIndex = 2;
this.cb_tempsensorport.Tag = "not"; this.cb_tempsensorport.Tag = "not";
// //
...@@ -75,7 +73,7 @@ namespace TheMachine ...@@ -75,7 +73,7 @@ namespace TheMachine
this.label_tempsensor.Location = new System.Drawing.Point(10, 10); this.label_tempsensor.Location = new System.Drawing.Point(10, 10);
this.label_tempsensor.Margin = new System.Windows.Forms.Padding(10); this.label_tempsensor.Margin = new System.Windows.Forms.Padding(10);
this.label_tempsensor.Name = "label_tempsensor"; this.label_tempsensor.Name = "label_tempsensor";
this.label_tempsensor.Size = new System.Drawing.Size(135, 15); this.label_tempsensor.Size = new System.Drawing.Size(250, 28);
this.label_tempsensor.TabIndex = 3; this.label_tempsensor.TabIndex = 3;
this.label_tempsensor.Text = "温湿度控制器端口:"; this.label_tempsensor.Text = "温湿度控制器端口:";
this.label_tempsensor.TextAlign = System.Drawing.ContentAlignment.TopRight; this.label_tempsensor.TextAlign = System.Drawing.ContentAlignment.TopRight;
...@@ -83,7 +81,7 @@ namespace TheMachine ...@@ -83,7 +81,7 @@ namespace TheMachine
// button_positiontool // button_positiontool
// //
this.tp.SetColumnSpan(this.button_positiontool, 2); this.tp.SetColumnSpan(this.button_positiontool, 2);
this.button_positiontool.Location = new System.Drawing.Point(10, 80); this.button_positiontool.Location = new System.Drawing.Point(10, 106);
this.button_positiontool.Margin = new System.Windows.Forms.Padding(10); this.button_positiontool.Margin = new System.Windows.Forms.Padding(10);
this.button_positiontool.Name = "button_positiontool"; this.button_positiontool.Name = "button_positiontool";
this.button_positiontool.Size = new System.Drawing.Size(181, 36); this.button_positiontool.Size = new System.Drawing.Size(181, 36);
...@@ -96,10 +94,10 @@ namespace TheMachine ...@@ -96,10 +94,10 @@ namespace TheMachine
// //
this.lbl_hmdstate.AutoSize = true; this.lbl_hmdstate.AutoSize = true;
this.tp.SetColumnSpan(this.lbl_hmdstate, 2); this.tp.SetColumnSpan(this.lbl_hmdstate, 2);
this.lbl_hmdstate.Location = new System.Drawing.Point(10, 45); this.lbl_hmdstate.Location = new System.Drawing.Point(10, 58);
this.lbl_hmdstate.Margin = new System.Windows.Forms.Padding(10); this.lbl_hmdstate.Margin = new System.Windows.Forms.Padding(10);
this.lbl_hmdstate.Name = "lbl_hmdstate"; this.lbl_hmdstate.Name = "lbl_hmdstate";
this.lbl_hmdstate.Size = new System.Drawing.Size(67, 15); this.lbl_hmdstate.Size = new System.Drawing.Size(124, 28);
this.lbl_hmdstate.TabIndex = 5; this.lbl_hmdstate.TabIndex = 5;
this.lbl_hmdstate.Tag = "not"; this.lbl_hmdstate.Tag = "not";
this.lbl_hmdstate.Text = "当前状态"; this.lbl_hmdstate.Text = "当前状态";
...@@ -134,21 +132,20 @@ namespace TheMachine ...@@ -134,21 +132,20 @@ 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.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(310, 204); this.tp.Size = new System.Drawing.Size(540, 256);
this.tp.TabIndex = 6; this.tp.TabIndex = 6;
// //
// cb_usefixpos // cb_usefixpos
// //
this.cb_usefixpos.AutoSize = true; this.cb_usefixpos.AutoSize = true;
this.tp.SetColumnSpan(this.cb_usefixpos, 2); this.tp.SetColumnSpan(this.cb_usefixpos, 2);
this.cb_usefixpos.Location = new System.Drawing.Point(10, 136); this.cb_usefixpos.Location = new System.Drawing.Point(10, 162);
this.cb_usefixpos.Margin = new System.Windows.Forms.Padding(10); this.cb_usefixpos.Margin = new System.Windows.Forms.Padding(10);
this.cb_usefixpos.Name = "cb_usefixpos"; this.cb_usefixpos.Name = "cb_usefixpos";
this.cb_usefixpos.Size = new System.Drawing.Size(119, 19); this.cb_usefixpos.Size = new System.Drawing.Size(202, 32);
this.cb_usefixpos.TabIndex = 6; this.cb_usefixpos.TabIndex = 6;
this.cb_usefixpos.Text = "启用校准库位"; this.cb_usefixpos.Text = "启用校准库位";
this.cb_usefixpos.UseVisualStyleBackColor = true; this.cb_usefixpos.UseVisualStyleBackColor = true;
this.cb_usefixpos.CheckedChanged += new System.EventHandler(this.cb_usefixpos_CheckedChanged);
// //
// button1 // button1
// //
...@@ -170,31 +167,9 @@ namespace TheMachine ...@@ -170,31 +167,9 @@ namespace TheMachine
this.uC_SetUserPassword1.Size = new System.Drawing.Size(405, 272); this.uC_SetUserPassword1.Size = new System.Drawing.Size(405, 272);
this.uC_SetUserPassword1.TabIndex = 8; this.uC_SetUserPassword1.TabIndex = 8;
// //
// button2
//
this.button2.Location = new System.Drawing.Point(50, 325);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(144, 41);
this.button2.TabIndex = 9;
this.button2.Text = "Start Recording";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// button3
//
this.button3.Location = new System.Drawing.Point(50, 403);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(144, 41);
this.button3.TabIndex = 10;
this.button3.Text = "Stop Recording";
this.button3.UseVisualStyleBackColor = true;
this.button3.Click += new System.EventHandler(this.button3_Click);
//
// SettingControl // SettingControl
// //
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.Controls.Add(this.button3);
this.Controls.Add(this.button2);
this.Controls.Add(this.uC_SetUserPassword1); this.Controls.Add(this.uC_SetUserPassword1);
this.Controls.Add(this.button1); this.Controls.Add(this.button1);
this.Controls.Add(this.tp); this.Controls.Add(this.tp);
...@@ -219,7 +194,5 @@ namespace TheMachine ...@@ -219,7 +194,5 @@ namespace TheMachine
private System.Windows.Forms.CheckBox cb_usefixpos; private System.Windows.Forms.CheckBox cb_usefixpos;
private System.Windows.Forms.Button button1; private System.Windows.Forms.Button button1;
private UC_SetUserPassword uC_SetUserPassword1; private UC_SetUserPassword uC_SetUserPassword1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button3;
} }
} }
...@@ -133,19 +133,14 @@ namespace TheMachine ...@@ -133,19 +133,14 @@ namespace TheMachine
Task.Run(()=>CodeManager.TestHasReel(CodeManager.hikNameList[0])); Task.Run(()=>CodeManager.TestHasReel(CodeManager.hikNameList[0]));
} }
private void button2_Click(object sender, EventArgs e) //private void button2_Click(object sender, EventArgs e)
{ //{
DeviceLibrary.IPCameraHelper.StartRecord("manual"); // DeviceLibrary.IPCameraHelper.StartRecord("manual");
} //}
private void button3_Click(object sender, EventArgs e) //private void button3_Click(object sender, EventArgs e)
{ //{
DeviceLibrary.IPCameraHelper.StopRecord(); // DeviceLibrary.IPCameraHelper.StopRecord();
} //}
private void cb_usefixpos_CheckedChanged(object sender, EventArgs e)
{
}
} }
} }
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!