108 lines
4.0 KiB
C#
108 lines
4.0 KiB
C#
using COMM;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace Project
|
|
{
|
|
public partial class fMain
|
|
{
|
|
void gridView2_ItemClick(object sender, arFrame.Control.GridView.ItemClickEventArgs e)
|
|
{
|
|
//메인화면 하단의 플래그 상태창에서 클릭된 경우
|
|
//var gv = sender as arFrame.Control.GridView;
|
|
//var flagIndex = gv.getNameItem(e.idx);
|
|
//if(flagIndex != "")
|
|
//{
|
|
// var fidx = int.Parse(flagIndex);
|
|
// var flag = (eFlag)fidx;
|
|
// var curValue = Pub.flag.get(flag);
|
|
// Pub.flag.set(flag, !curValue);
|
|
//}
|
|
}
|
|
|
|
private void BOOL_PropertyChanged(object sender, PropertyChangedEventArgs e)
|
|
{
|
|
var buf = e.PropertyName.Split('|');
|
|
var flag = (COMM.eVarBool)int.Parse(buf[0]);
|
|
var NewValue = buf[1].ToUpper() == "TRUE";
|
|
if (flag == COMM.eVarBool.FLAG_AUTORUN)
|
|
{
|
|
//자동운전이 해제되면 현재위치값을 삭제한다
|
|
if (NewValue == false && PUB.setting.AutoModeOffAndClearPosition == true)
|
|
{
|
|
if (PUB.Result.CurrentPos != ePosition.NONE)
|
|
{
|
|
PUB.log.AddAT($"자동운전이 해제되어 현재 위치를 제거합니다");
|
|
PUB.Result.CurrentPos = ePosition.NONE;
|
|
PUB.Result.CurrentPosCW = "1";
|
|
}
|
|
}
|
|
// Pub.mplayer.Stop();
|
|
//if (NewValue == true)
|
|
//{
|
|
// btAutoRun.BackColor = Color.Lime;
|
|
// btAutoRun.BackColor2 = Color.Green;
|
|
// btAutoRun.Text = "자동 실행 상태";
|
|
|
|
// //if (Pub.sm.Step >= StateMachine.eSMStep.IDLE) Pub.Speak("자동 실행 모드");
|
|
//}
|
|
//else
|
|
//{
|
|
// btAutoRun.BackColor2 = Color.DimGray;
|
|
// btAutoRun.BackColor = Color.FromArgb(100, 100, 100);
|
|
// btAutoRun.Text = "수동 조작 상태";
|
|
// //if (Pub.sm.Step >= StateMachine.eSMStep.IDLE) Pub.Speak("수동 조작 모드");
|
|
//}
|
|
}
|
|
else if (flag == COMM.eVarBool.FLAG_CHARGEONA)
|
|
{
|
|
if (NewValue)
|
|
{
|
|
VAR.TIME.Set(eVarTime.ChargeStart);
|
|
PUB.counter.CountChargeA += 1;
|
|
PUB.counter.Save();
|
|
PUB.Speak(Lang.충전을시작합니다);
|
|
}
|
|
else
|
|
{
|
|
PUB.Speak(Lang.충전을해제합니다);
|
|
}
|
|
}
|
|
else if (flag == COMM.eVarBool.FLAG_CHARGEONM)
|
|
{
|
|
if (NewValue)
|
|
{
|
|
VAR.TIME.Set(eVarTime.ChargeStart);
|
|
PUB.counter.CountChargeM += 1;
|
|
PUB.counter.Save();
|
|
PUB.Speak(Lang.수동충전을시작합니다);
|
|
}
|
|
else
|
|
{
|
|
PUB.Speak(Lang.수동충전을해제합니다);
|
|
}
|
|
}
|
|
else if (flag == COMM.eVarBool.NEXTSTOP_MARK)
|
|
{
|
|
if (NewValue)
|
|
{
|
|
//PUB.Speak("다음 위치에서 멈춥니다");
|
|
PUB.log.Add($"마크인식시 멈춤 신호 변경 : {NewValue}");
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
void PLC_FlagChanged(object sender, arDev.Arduino.DIO.FlagValueEventArgs e)
|
|
{
|
|
//플래그 상태표시는 메인의 타이머를 이용한다
|
|
// var flag = (arDev.FakePLC.PLCFlag)e.ArrIDX;
|
|
PUB.log.Add($"PLC Flag Changed {e.ArrIDX} : {e.NewValue}");
|
|
}
|
|
}
|
|
}
|