..
This commit is contained in:
@@ -16,7 +16,6 @@ namespace Project.ViewForm
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
tblMain.SuspendLayout();
|
||||
|
||||
//이름설정 INput #1
|
||||
List<string> namearray = new List<string>(32);
|
||||
@@ -50,25 +49,17 @@ namespace Project.ViewForm
|
||||
}
|
||||
namearray.Add(flagName);
|
||||
}
|
||||
this.tblMain.setTitle(namearray.ToArray());
|
||||
this.tblMain.setTag(tagarray.ToArray());
|
||||
this.tblMain.setItemTextAlign(ContentAlignment.BottomLeft);
|
||||
|
||||
////값설정
|
||||
//List<Boolean> fgValueM = new List<bool>();
|
||||
//List<Boolean> fgValueS = new List<bool>();
|
||||
|
||||
////mainplc
|
||||
//for (byte i = 0; i < 16; i++)
|
||||
// fgValueM.Add(PUB.PLC.GetValueI(i));
|
||||
//for (byte i = 0; i < 16; i++)
|
||||
// fgValueM.Add(PUB.PLC.GetValueO(i));
|
||||
|
||||
//값설정
|
||||
List<Boolean> fgValueM = new List<bool>();
|
||||
List<Boolean> fgValueS = new List<bool>();
|
||||
|
||||
//mainplc
|
||||
for (byte i = 0; i < 16; i++)
|
||||
fgValueM.Add(PUB.PLC.GetValueI(i));
|
||||
for (byte i = 0; i < 16; i++)
|
||||
fgValueM.Add(PUB.PLC.GetValueO(i));
|
||||
|
||||
|
||||
|
||||
tblMain.setValue(fgValueM.ToArray());
|
||||
tblMain.ResumeLayout();
|
||||
|
||||
this.FormClosed += FIO_FormClosed;
|
||||
UpdateControl();
|
||||
@@ -85,8 +76,8 @@ namespace Project.ViewForm
|
||||
if (PUB.XBE.IsOpen == false) BlinkGridViewItem(HWState, rownum, colIdx++, 3, 4);
|
||||
else HWState.setValue(rownum, colIdx++, 2); //
|
||||
|
||||
if (PUB.PLC.IsOpen == false) BlinkGridViewItem(HWState, rownum, colIdx++, 3, 4);
|
||||
else HWState.setValue(rownum, colIdx++, 2); //
|
||||
//if (PUB.PLC.IsOpen == false) BlinkGridViewItem(HWState, rownum, colIdx++, 3, 4);
|
||||
//else HWState.setValue(rownum, colIdx++, 2); //
|
||||
|
||||
if (PUB.BMS.IsOpen == false) BlinkGridViewItem(HWState, rownum, colIdx++, 3, 4);
|
||||
else HWState.setValue(rownum, colIdx++, 2); //
|
||||
@@ -103,13 +94,13 @@ namespace Project.ViewForm
|
||||
var colIdx = 0;
|
||||
HWState.setTitle(0, colIdx++, "AGV");
|
||||
HWState.setTitle(0, colIdx++, "XBE");
|
||||
HWState.setTitle(0, colIdx++, "PLC");
|
||||
//HWState.setTitle(0, colIdx++, "PLC");
|
||||
HWState.setTitle(0, colIdx++, "BAT");
|
||||
|
||||
colIdx = 0;
|
||||
HWState.setTitle(rowNum, colIdx++, PUB.setting.Port_AGV);
|
||||
HWState.setTitle(rowNum, colIdx++, PUB.setting.Port_XBE);
|
||||
HWState.setTitle(rowNum, colIdx++, PUB.setting.Port_PLC);
|
||||
//HWState.setTitle(rowNum, colIdx++, PUB.setting.Port_PLC);
|
||||
HWState.setTitle(rowNum, colIdx++, PUB.setting.Port_BAT);
|
||||
|
||||
HWState.Invalidate();
|
||||
@@ -126,27 +117,7 @@ namespace Project.ViewForm
|
||||
}
|
||||
|
||||
|
||||
private void tblIn1_ItemClick(object sender, arFrame.Control.GridView.ItemClickEventArgs e)
|
||||
{
|
||||
var dataIndex = (byte)e.idx;
|
||||
if (dataIndex >= 16)
|
||||
{
|
||||
var ctl = sender as arFrame.Control.GridView;
|
||||
var pinNoStr = ctl.Tags[e.idx];
|
||||
if (pinNoStr.isEmpty() == true)
|
||||
{
|
||||
Util.MsgE("해당 포트는 핀번호가 설정되지 않았습니다", true);
|
||||
}
|
||||
else
|
||||
{
|
||||
var pinNo = byte.Parse(pinNoStr);
|
||||
var curVal = PUB.PLC.GetValueO((byte)(dataIndex - 16));
|
||||
PUB.PLC.SetOutput(pinNo, !curVal);// .Sendcommand(Device.PLC1.eCommand.SET_DOUTPUT, pinNo, newval);
|
||||
}
|
||||
}
|
||||
else Util.MsgE("해당 주소는 허용되지 않습니다.", true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
bool tmrun = false;
|
||||
@@ -156,24 +127,11 @@ namespace Project.ViewForm
|
||||
if (tmrun == true) return;
|
||||
tmrun = true;
|
||||
|
||||
label1.Text = string.Format("{0} / {1}",
|
||||
PUB.PLC.ioBinStr, PUB.PLC.SetupStr);
|
||||
label3.Text = PUB.PLC.LastMessage;
|
||||
|
||||
Update_HWStatus();
|
||||
|
||||
List<Boolean> fgValueM = new List<bool>();
|
||||
List<Boolean> fgValueS = new List<bool>();
|
||||
|
||||
//mainplc
|
||||
for (byte i = 0; i < 16; i++)
|
||||
this.tblMain.setValue(i, PUB.PLC.GetValueI(i));
|
||||
|
||||
for (byte i = 0; i < 16; i++)
|
||||
this.tblMain.setValue(i + 16, PUB.PLC.GetValueO(i));
|
||||
|
||||
|
||||
this.tblMain.Invalidate();
|
||||
|
||||
tmrun = false;
|
||||
}
|
||||
@@ -187,18 +145,28 @@ namespace Project.ViewForm
|
||||
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
PUB.PLC.ZMot(arDev.FakePLC.ZMotDirection.Up);
|
||||
PUB.AGV.LiftControl(arDev.Narumi.LiftCommand.UP);
|
||||
}
|
||||
|
||||
|
||||
private void button2_Click(object sender, EventArgs e)
|
||||
{
|
||||
PUB.PLC.ZMot(arDev.FakePLC.ZMotDirection.Stop);
|
||||
PUB.AGV.LiftControl(arDev.Narumi.LiftCommand.STP);
|
||||
}
|
||||
|
||||
private void button3_Click_1(object sender, EventArgs e)
|
||||
{
|
||||
PUB.PLC.ZMot(arDev.FakePLC.ZMotDirection.Down);
|
||||
PUB.AGV.LiftControl(arDev.Narumi.LiftCommand.DN);
|
||||
}
|
||||
|
||||
private void button4_Click(object sender, EventArgs e)
|
||||
{
|
||||
PUB.AGV.LiftControl(arDev.Narumi.LiftCommand.ON);
|
||||
}
|
||||
|
||||
private void button5_Click(object sender, EventArgs e)
|
||||
{
|
||||
PUB.AGV.LiftControl(arDev.Narumi.LiftCommand.OFF);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user