Commit d1f6922e authored by wangwanxh@sina.com's avatar wangwanxh@sina.com

Merge branch 'wang_master' of https://gitee.com/wangwanxh/Vocs into wang_master

parents 75111627 5a2fce42
......@@ -123,13 +123,6 @@ namespace GcDevicePc
{
ret = mainclient.WtClientCopyfromServer(filename[i], getfile, foldername[i]);
Thread.Sleep(500);
//checkflag = filecheck.IsUse(getfile);
//while (checkflag != 0)
//{
// Thread.Sleep(200);
// checkflag = filecheck.IsUse(getfile);
//}
if (ret == 0)
{
Log.Info(filename[i].ToString() + " 同步成功");
......@@ -195,7 +188,7 @@ namespace GcDevicePc
NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces();
foreach (NetworkInterface adapter in nics)
{
// if (adapter.Name == "本地连接")
if (adapter.Name == "本地连接")
{
bool pd1 = (adapter.NetworkInterfaceType == NetworkInterfaceType.Ethernet ||
adapter.NetworkInterfaceType == NetworkInterfaceType.Wireless80211);
......@@ -271,10 +264,5 @@ namespace GcDevicePc
}
}
public void InitDB()
{
}
}
}
......@@ -27,6 +27,7 @@ namespace GcDevicePc
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.Controls.Add(curdisp);
CheckForIllegalCrossThreadCalls = false;
}
}
}
......@@ -31,15 +31,28 @@ namespace GcDevicePc.CK_UI
{
Island = false;
}
if(form!=null)
if (form != null)
{
form.Close();
if (!form.IsDisposed)
{
form.Dispose();
}
}
}
private void button2_Click(object sender, EventArgs e) //放弃
{
Island = false;
if (form != null)
{
form.Close();
if (!form.IsDisposed)
{
form.Dispose();
}
}
}
private void LandIn_Load(object sender, EventArgs e)
......@@ -50,7 +63,7 @@ namespace GcDevicePc.CK_UI
private void textBox2_Click(object sender, EventArgs e)
{
form = CKVocAnalyzer.NumForm.GetInstance((TextBox)sender);// new CKVocAnalyzer.NumForm((TextBox)sender);
form.Icon = this.Icon;
form.Show();
}
}
......
......@@ -31,7 +31,7 @@ namespace GcDevicePc.ConfigDlg
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MethodBase));
this.methodimgList = new System.Windows.Forms.ImageList(this.components);
this.methodimgList = new System.Windows.Forms.ImageList();
this.Methodtitle = new System.Windows.Forms.Panel();
this.mmixbtn = new System.Windows.Forms.Button();
this.mclose = new System.Windows.Forms.Button();
......
......@@ -47,7 +47,12 @@ namespace GcDevicePc.GCBuffer
public string ip;
public string mask;
public string gw;
}
public struct OutPutInfo
{
public byte port;
}
public struct ThreadInfo
......@@ -62,6 +67,8 @@ namespace GcDevicePc.GCBuffer
public WorkInfo pcworkinfo;
public ModuleInfo moduleinfo;
public ThreadInfo pcthreadinfo;
public OutPutInfo outputinfo;
}
public PCInfo gcpcinfo = new PCInfo();
......@@ -91,7 +98,9 @@ namespace GcDevicePc.GCBuffer
gcpcinfo.pcworkinfo.system_Statue = false;
gcpcinfo.pcworkinfo.work_Statue = 0;
gcpcinfo.moduleinfo.ip = "192.168.1.54";
gcpcinfo.moduleinfo.ip = "";
gcpcinfo.outputinfo.port = 0;
string file = System.Windows.Forms.Application.StartupPath + "\\startup.ini";
......@@ -106,6 +115,9 @@ namespace GcDevicePc.GCBuffer
string wtd624x_mask = test.INIGetStringValue("WTD624X", "MASK", null);
string wtd624x_gw = test.INIGetStringValue("WTD624X", "GW", null);
string gc485 = test.INIGetStringValue("GC485", "COM", null);
//string senddata = test.INIGetStringValue("StartUp", "SendData", null);
if (Convert.ToInt32(opensys) == 1)
......@@ -127,6 +139,11 @@ namespace GcDevicePc.GCBuffer
{
gcpcinfo.moduleinfo.gw = wtd624x_gw;
}
if (!String.IsNullOrEmpty(gc485))
{
gcpcinfo.outputinfo.port = Convert.ToByte(gc485);
}
}
// gcpcinfo.pcworkinfo.RunType = 0; //运行类型 0 打开运行 1 智能运行 2 批处理
......
......@@ -58,6 +58,8 @@ namespace GcDevicePc
/// </summary>
CKvocUpdata dataVOC = new CKvocUpdata();
private DataOutput wtd624xOutput = new DataOutput();
#region Author by zjx
/// <summary>
/// 组件初始化
......@@ -367,7 +369,7 @@ namespace GcDevicePc
if (i != 99)
{
worker.ReportProgress(i);
break;
//break;
}
}
......@@ -398,7 +400,7 @@ namespace GcDevicePc
public void WaitHMIFree()
{
if (globaldata.m_hmibuffer.gcinfo.hmistatus != 0)
// if (globaldata.m_hmibuffer.gcinfo.hmistatus != 0)
{
this.backgroundWorker1.RunWorkerAsync();
WaitForm form = new WaitForm(this.backgroundWorker1, "Free");
......@@ -463,7 +465,7 @@ namespace GcDevicePc
}
public void WaitHMIWork()
{
if (globaldata.m_hmibuffer.gcinfo.methodstatus < 0 || globaldata.m_hmibuffer.gcinfo.methodstatus > 5)
// if (globaldata.m_hmibuffer.gcinfo.methodstatus < 0 || globaldata.m_hmibuffer.gcinfo.methodstatus > 5)
{
this.backgroundWorker2.RunWorkerAsync();
WaitForm form = new WaitForm(this.backgroundWorker2, "Work");
......@@ -548,8 +550,12 @@ namespace GcDevicePc
Slavetest = new GCModbusSlave();
Slavetest.CModbusSlaveInit(1, 2, 3, 5);
Slave485test = new GCModbusSlave485(1, 9600);
if (globaldata.m_pcbuffer.gcpcinfo.outputinfo.port != 0)
{
Slave485test = new GCModbusSlave485(globaldata.m_pcbuffer.gcpcinfo.outputinfo.port, 9600);
Slave485test.CModbusSlave485Init(1, 2, 3, 5);
}
}
catch (Exception e)
......@@ -582,6 +588,9 @@ namespace GcDevicePc
dataVOC.CKvocUpdataStart();
mytcptest.DataRcvStart();
if (!String.IsNullOrEmpty(globaldata.m_pcbuffer.gcpcinfo.moduleinfo.ip))
wtd624xOutput.DataOutStart();
}
private void Stop_Thread()
......@@ -596,6 +605,9 @@ namespace GcDevicePc
mymodbus.HmiStatueStop();
mymodbus.ChannelDataStop();
}
if (!String.IsNullOrEmpty(globaldata.m_pcbuffer.gcpcinfo.moduleinfo.ip))
wtd624xOutput.DataOutStop();
}
/// <summary>
......@@ -992,7 +1004,7 @@ namespace GcDevicePc
conmre.Set();
globaldata.m_pcbuffer.gcpcinfo.pcthreadinfo.HMI_Monitor_TH = 1;
Thread.Sleep(1500);
Thread.Sleep(1000);
count = 0;
......@@ -1008,6 +1020,8 @@ namespace GcDevicePc
}
}
if (globaldata.m_pcbuffer.gcpcinfo.outputinfo.port != 0)
{
count = 0;
ret = Slave485test.CModbusSlave485Close();
while (ret != 0)
......@@ -1022,6 +1036,8 @@ namespace GcDevicePc
}
}
}
try
......@@ -1076,6 +1092,8 @@ namespace GcDevicePc
}
}
if (globaldata.m_pcbuffer.gcpcinfo.outputinfo.port != 0)
{
count = 0;
ret = Slave485test.CModbusSlave485Close();
while (ret != 0)
......@@ -1090,6 +1108,8 @@ namespace GcDevicePc
}
}
}
try
{
......
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using WeifenLuo.WinFormsUI.Docking;
using GcDevicePc.IniParam;
using System.IO;
using System.Runtime.InteropServices;
using GcDevicePc.ProThread;
using System.Security.Cryptography;
using System.Diagnostics;
using GcDevicePc.Common;
......
......@@ -101,7 +101,6 @@ namespace GcDevicePc.ProThread
NowTimeOld = globaldata.m_hmibuffer.gcinfo.NowStartTime;
CurveDisPlay.curdisp.cleardata();
}
else
{
......@@ -191,9 +190,6 @@ namespace GcDevicePc.ProThread
{
listPoint.Add(new double[] { Math.Round(time, 4), Math.Round(value, 6) });
listRaw.Add(new double[] {((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port[i]).ctimer, Math.Round(value, 6) });
}
......
......@@ -15,7 +15,7 @@ namespace GcDevicePc.ProThread
ManualResetEvent outputmre = new ManualResetEvent(false);
Thread t_DataOut;
private WTD624X wtd624x = new WTD624X(globaldata.m_pcbuffer.gcpcinfo.moduleinfo.ip, 502);
private WTD624X wtd624x;
private bool c6h6 = false;
private bool c7h8 = false;
......@@ -156,6 +156,13 @@ namespace GcDevicePc.ProThread
}
public void DataOutStart()
{
if (!String.IsNullOrEmpty(globaldata.m_pcbuffer.gcpcinfo.moduleinfo.ip))
{
wtd624x = new WTD624X(globaldata.m_pcbuffer.gcpcinfo.moduleinfo.ip, 502);
}
if (wtd624x!= null)
{
if (outputmre != null)
{
......@@ -172,13 +179,19 @@ namespace GcDevicePc.ProThread
}
}
}
public void DataOutStop()
{
if (wtd624x != null)
{
outputmre.Set();
if (wtd624x.GetWorkFlag())
{
wtd624x.WTD624X_Open();
}
}
}
}
......
......@@ -46,7 +46,7 @@ namespace GcDevicePc.ProThread
NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces();
foreach (NetworkInterface adapter in nics)
{
// if (adapter.Name == "本地连接")
if (adapter.Name == "本地连接")
{
bool pd1 = (adapter.NetworkInterfaceType == NetworkInterfaceType.Ethernet || adapter.NetworkInterfaceType == NetworkInterfaceType.Wireless80211); //判断是否是以太网连接
if (pd1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment