initial commit

This commit is contained in:
2025-11-25 20:14:41 +09:00
commit 5cb1ff372c
559 changed files with 149800 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{14E8C9A5-013E-49BA-B435-EFEFC77DD623}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>VarData</RootNamespace>
<AssemblyName>VarData</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Enum.cs" />
<Compile Include="Enum_IO.cs" />
<Compile Include="Enum_Mot.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RS232.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@@ -0,0 +1,474 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace AR
{
public enum eswPLCAddr
{
Ready = 0,
Spare1,
Spare2,
/// <summary>
/// 1=Limit Down
/// 2=Detect
/// 3=Limit Up
/// </summary>
LPort,
CPort,
RPort,
/// <summary>
/// 1 = Down,
/// 2 = Up
/// 3 = stop
/// </summary>
LMotor,
CMotor,
RMotor,
/// <summary>
/// 시퀀스값 0~
/// 0 : nothing
/// 1 : ~ running
/// </summary>
LSts,
CSts,
RSts,
/// <summary>
/// 1=down,
/// 2=up,
/// 3=stop,
/// 4=refresh
/// </summary>
LCmd,
CCmd,
RCmd,
}
//public enum eVarUInt32
//{
//}
//public enum eVarByte
//{
// None = 0,
//}
public enum eVarBool
{
None = 0,
NeedUserTouchAfterHome,
BarcodeHook,
NeedTopJigUnloaderPosition,
Use_Conveyor,
LEFT_ITEM_PICKOFF,
RIGT_ITEM_PICKOFF,
//Option_vname,
Opt_UserConfim,
Opt_ServerQty,
Opt_UserQtyRQ,
Option_partUpdate,
Opt_NewReelID,
Option_AutoConf,
Opt_SIDConvert,
Opt_ApplySIDConv,
Opt_ApplyWMSInfo,
Opt_ApplySIDInfo,
Opt_ApplyJobInfo,
Opt_CheckSIDExist,
Opt_WMS_Apply_PartNo,
Opt_WMS_Apply_CustCode,
Opt_WMS_Apply_SID,
Opt_WMS_Apply_VenderName,
Opt_WMS_Apply_batch,
Opt_WMS_Apply_qty,
Opt_WMS_Apply_MFG,
Opt_WMS_Where_PartNo,
Opt_WMS_Where_CustCode,
Opt_WMS_Where_SID,
Opt_WMS_Where_VLOT,
Opt_WMS_Where_MC,
Opt_WMS_Where_MFG,
Opt_WMS_WriteServer,
Opt_SID_Apply_PartNo,
Opt_SID_Apply_CustCode,
Opt_SID_Apply_SID,
Opt_SID_Apply_VenderName,
Opt_SID_Apply_PrintPos,
Opt_SID_Apply_batch,
Opt_SID_Apply_qty,
Opt_SID_Where_PartNo,
Opt_SID_Where_CustCode,
Opt_SID_Where_SID,
Opt_SID_Where_VLOT,
Opt_SID_Where_MC,
Opt_SID_WriteServer,
Opt_Job_Apply_PartNo,
Opt_Job_Apply_CustCode,
Opt_Job_Apply_SID,
Opt_Job_Apply_VenderName,
Opt_Job_Apply_PrintPos,
Opt_Job_Where_PartNo,
Opt_Job_Where_CustCode,
Opt_Job_Where_SID,
Opt_Job_Where_VLOT,
Opt_Conv_Apply_PartNo,
Opt_Conv_Apply_CustCode,
Opt_Conv_Apply_SID,
Opt_Conv_Apply_VenderName,
Opt_Conv_Apply_PrintPos,
Opt_Conv_Apply_Batch,
Opt_Conv_Apply_QtyMax,
Opt_Conv_Where_PartNo,
Opt_Conv_Where_CustCode,
Opt_Conv_Where_SID,
Opt_Conv_Where_VLOT,
Opt_Conv_WriteServer,
/// <summary>
/// 카메라 사용안함
/// </summary>
Opt_DisableCamera,
/// <summary>
/// 프린터사용안함
/// </summary>
Opt_DisablePrinter,
Enable_PickerMoveX,
VisionL_Retry,
VisionR_Retry,
Need_UserConfirm_Data,
/// <summary>
/// 키엔스바코드의 수신을 확인합니다
/// </summary>
wait_for_keyence,
wait_for_keyenceL,
wait_for_keyenceR,
/// <summary>
/// 피커 키엔스 인식 실패로 재시도를 하고 있습니다.
/// </summary>
JOB_PickON_Retry,
JOB_Empty_SIDConvertInfo,
// JOB_BYPASS_LEFT,
// JOB_BYPASS_RIGHT,
FG_RDY_CAMERA_L,
FG_RDY_CAMERA_R,
FG_INIT_MOTIO,
FG_DOORSAFTY,
FG_AREASAFTY,
FG_INIT_PRINTER,
FG_KEYENCE_READOK_L,
FG_KEYENCE_READOK_R,
FG_KEYENCE_TRIGGER,
FG_KEYENCE_OFFF,
FG_KEYENCE_OFFR,
FG_RUN_LEFT,
FG_RUN_RIGHT,
FG_BUSY_LEFT,
FG_BUSY_RIGHT,
FG_PORT0_ENDDOWN,
FG_PORT1_ENDDOWN,
FG_PORT2_ENDDOWN,
FG_WAIT_PAPERDETECTL,
FG_WAIT_PAPERDETECTR,
FG_RUN_PLZ_PICKON,
FG_RUN_PRZ_PICKON,
FG_RUN_PLZ_PICKOF,
FG_RUN_PRZ_PICKOF,
FG_RUN_PLM_PICKON,
FG_RUN_PLM_PICKOF,
FG_RUN_PRM_PICKON,
FG_RUN_PRM_PICKOF,
FG_WAT_MAGNET0,
FG_WAT_MAGNET1,
FG_WAT_MAGNET2,
FG_PRC_VISIONL,
FG_PRC_VISIONR,
FG_END_VISIONL,
FG_END_VISIONR,
FG_MOVE_PICKER,
FG_JOYSTICK,
/// <summary>
/// Y축이 Front로 가지러 가기로 함
/// </summary>
FG_CMD_YP_LPICKON,
FG_CMD_YP_LPICKOF,
FG_CMD_YP_RPICKON,
FG_CMD_YP_RPICKOF,
//피커의 X축이 일을 하러 갔는가?
FG_RDY_PX_PICKON,
FG_RDY_PX_PICKONWAITL,
FG_RDY_PX_PICKONWAITR,
FG_RDY_PX_LPICKOF,
FG_RDY_PX_RPICKOF,
//X축이 이동한후 해당 언로더에 자료를 셋팅했는가?
FG_SET_DATA_PORT0,
FG_SET_DATA_PORT2,
FG_RDY_PZ_PICKON,
FG_RDY_PZ_LPICKOF,
FG_RDY_PZ_RPICKOF,
FG_RUN_PRINTL,
FG_RUN_PRINTR,
FG_OK_PRINTL,
FG_OK_PRINTR,
/// <summary>
/// 해당 포트의 자재 준비여부
/// </summary>
FG_RDY_PORT_PL,
FG_RDY_PORT_PC,
FG_RDY_PORT_PR,
FG_ENABLE_LEFT,
FG_ENABLE_RIGHT,
/// <summary>
/// 자재를 PICK 했다
/// </summary>
FG_PK_ITEMON,
FG_PL_ITEMON,
FG_PR_ITEMON,
FG_KEYENCE_IMAGEPROGRESS,
/// <summary>
/// 포트에 아이템이 있는가?
/// 1번의 경우 Detect 센서가 들어오면 ItemON 설정을 한다.
/// 0,2번의 경우 피커가 아이템을 놓을때 설정한다
/// 실제로는 ITEMON 과 Align =1, 일때 촬영이가능하게한다
/// </summary>
FG_PORTL_ITEMON,
FG_PORTR_ITEMON,
/// <summary>
/// 사용자가 바코드 확인 또는 정보를 편집하는 창
/// </summary>
FG_WAIT_LOADERINFO,
/// <summary>
/// SID정보가 복수가 검출되었을때 사용자가 선택하는 창
/// </summary>
FG_WAIT_INFOSELECT,
FG_WAIT_INFOSELECTCLOSE,
/// <summary>
/// 작업시작화면
/// </summary>
FG_SCR_JOBSELECT,
/// <summary>
/// 작업종료화면
/// </summary>
//SCR_JOBFINISH,
/// <summary>
/// 작업완료
/// </summary>
FG_JOB_END,
FG_USERSTEP,
FG_MINSPACE,
FG_DEBUG,
FG_AUTOOUTCONVL,
FG_AUTOOUTCONVR,
VS_DETECT_REEL_L,
VS_DETECT_REEL_R,
VS_DETECT_CONV_L,
VS_DETECT_CONV_R,
}
public enum eVarString
{
Vision_Select_command,
Vision_Trig_command,
PrePick_ReelIDNew,
PrePick_ReelIDOld,
PrePick_ReelIDTarget,
JOB_CUSTOMER_CODE,
MULTISID_QUERY,
MULTISID_FIELDS,
}
public enum eVarTime
{
DET5ON,
DET4ON,
PORT0,
PORT1,
PORT2,
MAGNET2,
MAGNET1,
MAGNET0,
QRCHECK0,
QRCHECK2,
KEYENCEWAIT,
LIVEVIEW0,
LIVEVIEW1,
LIVEVIEW2,
CHK_POSRSTCONVTIME,
PRINTL,
PRINTR,
CMDTIME_MOTYP,
CMDTIME_MOTZL,
CMDTIME_MOTZR,
JOB_END,
SMRUNERROR,
LOG_NEWIDERROR,
StatusReporttime,
JOBEVENT,
REFRESHLIST,
LEFT_ITEM_PICKOFF,
RIGT_ITEM_PICKOFF,
lastRecvWSL,
lastRecvWSR,
CONVL_START,
CONVR_START,
}
public enum eVarInt32
{
PickOnCount = 0,
PickOfCount,
LPickOnCount,
RPickOnCount,
LPickOfCount,
RPickOfCount,
LEFT_ITEM_COUNT,
RIGT_ITEM_COUNT,
Front_Brush_Cleaning,
Rear_Brush_Cleaning,
Front_Laser_Cleaning,
Rear_Laser_Cleaning,
/// <summary>
/// 2번축, 3번축 각 축번호가 들어있다
/// </summary>
PreBrushTargetF,
PreBrushTargetR,
/// <summary>
/// 2번축, 3번축 각 축번호가 들어있다
/// </summary>
PostBrushTargetF,
PostBrushTargetR,
TopjigUnloadPort,
TopJigLoadPort,
DevConnectSeq,
BitmapCompatErr,
PickOnRetry,
}
public enum eVarDBL
{
ThetaPosition = 0,
ThetaPositionL,
ThetaPositionR,
LEFT_ITEM_PICKOFF,
RIGT_ITEM_PICKOFF,
CONVL_RUNTIME,
CONVR_RUNTIME,
}
public enum eECode : byte
{
NOERROR = 0,
EMERGENCY = 1,
NOMODELV = 2,//작업모델
NOMODELM = 3,//모션모델
HOME_TIMEOUT = 9,
NOFUNCTION = 11,
DOOFF = 27,//출력 off
DOON = 28,//출력 on
DIOFF = 29,//입력off
DION = 30,//입력 on
MESSAGE_INFO = 32,
MESSAGE_ERROR = 33,
AZJINIT = 39, //DIO 혹은 모션카드 초기화 X
//MOT_HSET = 41,
MOT_SVOFF = 42,
MOT_CMD = 71,
USER_STOP = 72,
USER_STEP = 73,
POSITION_ERROR = 86,
MOTIONMODEL_MISSMATCH = 96,
//여기서부터는 전용코드로한다(소켓은 조금 섞여 있음)
VISCONF = 100,
UNSUPPORT,
NOJOBMODE,
PRINT,
SELECTNEXTREEL,
BCD_LEFT,
BCD_LEFT_TEMP,
BCD_LEFT_NEW,
BCD_RIGHT,
BCD_RIGHT_TEMP,
BCD_RIGHT_NEW,
BARCODEVALIDERR,
PRINTER,
QRDATAMISSMATCHL,
QRDATAMISSMATCHR,
MOTX_SAFETY,
CHANGEALERTLEFT,
CHANGEALERTRIGHT,
SIDVALIDATION,
}
}

View File

@@ -0,0 +1,82 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
namespace AR
{
public enum eDIPin : byte
{
X00, X01, X02, X03, X04, X05, X06, X07,
X08, X09, X0A, X0B, X0C, X0D, X0E, X0F,
X10, X11, X12, X13, X14, X15, X16, X17,
X18, X19, X1A, X1B, X1C, X1D, X1E, X1F,
X20, X21, X22, X23, X24, X25, X26, X27,
X28, X29, X2A, X2B, X2C, X2D, X2E, X2F,
X30, X31, X32, X33, X34, X35, X36, X37,
X38, X39, X3A, X3B, X3C, X3D, X3E, X3F
}
public enum eDIName : byte
{
BUT_STARTF = 0x00, BUT_STOPF, BUT_RESETF, BUT_EMGF, BUT_AIRF,
AIR_DETECT = 0x05, PICKER_SAFE = 0x08,
DOORF1 = 0x0A, DOORF2, DOORF3,
DOORR1 = 0x0D, DOORR2, DOORR3,
PORT0_SIZE_07 = 0x1A, PORT0_SIZE_13, PORTL_LIM_UP, PORTL_LIM_DN, PORTL_DET_UP,
PORT1_SIZE_07 = 0x10, PORT1_SIZE_13, PORTC_LIM_UP, PORTC_LIM_DN, PORTC_DET_UP,
PORT2_SIZE_07 = 0x15, PORT2_SIZE_13, PORTR_LIM_UP, PORTR_LIM_DN, PORTR_DET_UP,
R_PICK_BW = 0x20, R_PICK_FW, R_PICK_VAC,
L_PICK_BW = 0x24, L_PICK_FW, L_PICK_VAC,
L_CONV1 = 0x30, L_CONV4 = 0x33,
R_CONV1 = 0x34, R_CONV4 = 0x37,
R_CYLUP = 0x38, R_CYLDN,
L_CYLDN = 0x3A, L_CYLUP,
L_EXT_READY = 0x3E,
R_EXT_READY = 0x3F,
}
public enum eDOPin : byte
{
Y00, Y01, Y02, Y03, Y04, Y05, Y06, Y07,
Y08, Y09, Y0A, Y0B, Y0C, Y0D, Y0E, Y0F,
Y10, Y11, Y12, Y13, Y14, Y15, Y16, Y17,
Y18, Y19, Y1A, Y1B, Y1C, Y1D, Y1E, Y1F,
Y20, Y21, Y22, Y23, Y24, Y25, Y26, Y27,
Y28, Y29, Y2A, Y2B, Y2C, Y2D, Y2E, Y2F,
Y30, Y31, Y32, Y33, Y34, Y35, Y36, Y37,
Y38, Y39, Y3A, Y3B, Y3C, Y3D, Y3E, Y3F
}
public enum eDOName : byte
{
BUT_STARTF = 0x00, BUT_STOPF, BUT_RESETF, BUT_EMGF, BUT_AIRF,
SOL_AIR = 0x07, BUZZER,
ROOMLIGHT = 0x0A,
TWR_GRNF = 0x0D, TWR_YELF, TWR_REDF,
PORTL_MOT_RUN = 0x1A, PORTL_MOT_DIR, PORTL_MAGNET,
PORTC_MOT_RUN = 0x10, PORTC_MOT_DIR, PORTC_MAGNET,
PORTR_MOT_RUN = 0x14, PORTR_MOT_DIR, PORTR_MAGNET,
PRINTL_VACO = 0x1E, PRINTL_VACI,
PRINTR_VACO = 0x18, PRINTR_VACI,
PRINTL_AIRON = 0x20, PRINTR_AIRON,
PICK_VAC1 = 0x23, PICK_VAC2, PICK_VAC3, PICK_VAC4,
SVR_PWR_0 = 0x28, SVR_PWR_1, SVR_PWR_2, SVR_PWR_3, SVR_PWR_4, SVR_PWR_5, SVR_PWR_6,
PRINTL_FWD = 0x38, R_CYLDN = 0x39,
LEFT_CONV = 0x3A, RIGHT_CONV = 0x3B,
PRINTR_FWD = 0x3C, L_CYLDN = 0x3D,
}
}

View File

@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AR
{
/// <summary>
/// 모션 축 정보
/// </summary>
public enum eAxis : byte
{
PX_PICK = 0,
PZ_PICK,
PL_MOVE,
PL_UPDN,
PR_MOVE,
PR_UPDN,
Z_THETA,
}
public enum eAxisName : byte
{
Picker_X = 0,
Picker_Z ,
PrinterL_Move,
PrinterL_UpDn,
PrinterR_Move,
PrinterR_UpDn,
Theta,
}
}

View File

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 어셈블리에 대한 일반 정보는 다음 특성 집합을 통해
// 제어됩니다. 어셈블리와 관련된 정보를 수정하려면
// 이러한 특성 값을 변경하세요.
[assembly: AssemblyTitle("VarData")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("VarData")]
[assembly: AssemblyCopyright("Copyright © 2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// ComVisible을 false로 설정하면 이 어셈블리의 형식이 COM 구성 요소에
// 표시되지 않습니다. COM에서 이 어셈블리의 형식에 액세스하려면
// 해당 형식에 대해 ComVisible 특성을 true로 설정하세요.
[assembly: ComVisible(false)]
// 이 프로젝트가 COM에 노출되는 경우 다음 GUID는 typelib의 ID를 나타냅니다.
[assembly: Guid("14e8c9a5-013e-49ba-b435-efefc77dd623")]
// 어셈블리의 버전 정보는 다음 네 가지 값으로 구성됩니다.
//
// 주 버전
// 부 버전
// 빌드 번호
// 수정 버전
//
// 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 번호를
// 기본값으로 할 수 있습니다.
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

File diff suppressed because it is too large Load Diff

1
Handler/Sub/CommSM Submodule

Submodule Handler/Sub/CommSM added at 3edfe1c9df

View File

@@ -0,0 +1,36 @@
using System;
using System.IO.MemoryMappedFiles;
using System.Threading;
namespace AR.MemoryMap
{
public class Client : Core
{
public Client(string MapFileName, int MapFileSize, int loopDelay = 50) : base(MapFileName, MapFileSize, loopDelay)
{
StartAction = () =>
{
try
{
var MapFileSync = $"{MapFileName}{MapFileSize}";
mmf = MemoryMappedFile.CreateOrOpen(MapFileName, MapFileSize);
mutex = new Mutex(false, MapFileSync, out mutexCreated);
ErrorMessage = string.Empty;
return true;
}
catch (Exception ex)
{
ErrorMessage = ex.Message;
return false;
}
};
StopAction = () =>
{
ErrorMessage = string.Empty;
brun = false;
return true;
};
}
}
}

View File

@@ -0,0 +1,574 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.MemoryMappedFiles;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
namespace AR.MemoryMap
{
public abstract class Core
{
protected ManualResetEvent mre;
protected MemoryMappedFile mmf;
protected Mutex mutex;
protected bool mutexCreated;
protected Func<bool> StartAction;
protected Func<bool> StopAction;
string MapFileName = string.Empty;
public int WriteTime = 100;
public int ReadTime = 100;
int MapSize = 100;
public bool Init { get; set; } = false;
Task loop;
protected bool brun = false;
public int LoopDelay { get; set; }
public string ErrorMessage { get; set; }
public Core(string mapFileName, int mapSize, int loopDelay = 50)
{
LoopDelay = loopDelay;
this.MapFileName = mapFileName;
this.MapSize = mapSize;
this.monitorvalue = new byte[mapSize];
mre = new ManualResetEvent(false);
}
~Core()
{
brun = false;
}
public bool Start()
{
Init = StartAction.Invoke();
return Init;
}
public void StartMonitor()
{
if (Init == false) return;
if (IsMonitorRun) return;
brun = true;
loop = Task.Factory.StartNew(() =>
{
Monitor_Loop();
});
}
public void StopMonitor()
{
brun = false;
}
public bool IsMonitorRun
{
get
{
if (loop == null) return false;
if (loop.IsCompleted) return false;
if (loop.IsCanceled) return false;
return true;
}
}
public bool SetMonitorTarget(bool All)
{
if (mre.WaitOne(100) == false) return false;
mre.Set();
return true;
}
byte[] monitorvalue;
public void Stop()
{
StopAction.Invoke();
}
private void Monitor_Loop()
{
while (brun)
{
//작업가능확인
bool readok = false;
byte[] value = null;
try
{
if (mre.WaitOne(100))
{
try
{
//메모리접근 권한 확인
if (MutexWaitOne(100))
{
//값을 읽은 경우
if (ReadBytes(0, this.MapSize, out value))
{
readok = true;
}
}
}
finally { mutex.ReleaseMutex(); }
}
}
finally { mre.Set(); }
if (readok)
{
//값의 변화가 있다면 이벤트 발생
List<int> changeindex = new List<int>();
for (int i = 0; i < value.Length; i++)
{
if (value[i] != monitorvalue[i]) changeindex.Add(i);
}
if (changeindex.Any())
{
ValueChanged.Invoke(this, new monitorvalueargs(changeindex.ToArray(), monitorvalue, value));
}
//신규값을 업데이트
Array.Copy(value, monitorvalue, value.Length);
}
//write
System.Threading.Thread.Sleep(LoopDelay);
}
}
public bool MutexWaitOne(int milli)
{
var MapFileSync = $"{MapFileName}{MapSize}";
if (mutexCreated == false)
{
mutex = new Mutex(false, MapFileSync, out mutexCreated);
return mutex.WaitOne(milli);
}
else
{
//이미생성된 경우에는 에러처리를 해야한다
try
{
return mutex.WaitOne(milli);
}
catch
{
//오류가있으니 다시 작성한다
mutex = new Mutex(false, MapFileSync, out mutexCreated);
return false;
}
}
}
public event EventHandler<monitorvalueargs> ValueChanged;
public class monitorvalueargs : EventArgs
{
public byte[] newdata;
public byte[] olddata;
public int[] idxlist;
public monitorvalueargs(int[] idxs, byte[] beforedata, byte[] afterdata)
{
idxlist = new int[idxs.Length];
Array.Copy(idxs, this.idxlist, idxs.Length);
newdata = new byte[afterdata.Length];
Array.Copy(afterdata, newdata, afterdata.Length);
olddata = new byte[beforedata.Length];
Array.Copy(beforedata, olddata, beforedata.Length);
}
}
#region "WRITE"
public bool Write(int address, Boolean value)
{
if (Init == false) return false;
if (MutexWaitOne(WriteTime) == false) return false;
Type type = value.GetType();
var size = Marshal.SizeOf(value.GetType());
using (MemoryMappedViewStream stream = mmf.CreateViewStream(address, size))
using (var writer = new BinaryWriter(stream))
writer.Write(value);
mutex.ReleaseMutex();
return true;
}
public bool Write(int address, byte[] value, int startIndex = 0, int size = 0)
{
if (Init == false) return false;
if (MutexWaitOne(WriteTime) == false) return false;
Type type = value.GetType();
if (size == 0) size = Marshal.SizeOf(value.GetType());
using (MemoryMappedViewStream stream = mmf.CreateViewStream(address, size))
using (var writer = new BinaryWriter(stream))
writer.Write(value,startIndex,size);
mutex.ReleaseMutex();
return true;
}
public bool Write(int address, byte value)
{
if (Init == false) return false;
if (MutexWaitOne(WriteTime) == false) return false;
Type type = value.GetType();
var size = Marshal.SizeOf(value.GetType());
using (MemoryMappedViewStream stream = mmf.CreateViewStream(address, size))
using (var writer = new BinaryWriter(stream))
writer.Write(value);
mutex.ReleaseMutex();
return true;
}
public bool Write(int address, string value)
{
if (Init == false) return false;
if (MutexWaitOne(WriteTime) == false) return false;
Type type = value.GetType();
var size = Marshal.SizeOf(type);
using (MemoryMappedViewStream stream = mmf.CreateViewStream(address, size))
using (var writer = new BinaryWriter(stream))
writer.Write(value);
mutex.ReleaseMutex();
return true;
}
public bool Write(int address, Int32 value)
{
if (Init == false) return false;
if (MutexWaitOne(WriteTime) == false) return false;
Type type = value.GetType();
var size = Marshal.SizeOf(type);
using (MemoryMappedViewStream stream = mmf.CreateViewStream(address, size))
using (var writer = new BinaryWriter(stream))
writer.Write(value);
mutex.ReleaseMutex();
return true;
}
public bool Write(int address, Int16 value)
{
if (Init == false) return false;
if (MutexWaitOne(WriteTime) == false) return false;
Type type = value.GetType();
var size = Marshal.SizeOf(type);
using (MemoryMappedViewStream stream = mmf.CreateViewStream(address, size))
using (var writer = new BinaryWriter(stream))
writer.Write(value);
mutex.ReleaseMutex();
return true;
}
public bool Write(int address, UInt32 value)
{
if (Init == false) return false;
if (MutexWaitOne(WriteTime) == false) return false;
Type type = value.GetType();
var size = Marshal.SizeOf(type);
using (MemoryMappedViewStream stream = mmf.CreateViewStream(address, size))
using (var writer = new BinaryWriter(stream))
writer.Write(value);
mutex.ReleaseMutex();
return true;
}
public bool Write(int address, UInt16 value)
{
if (Init == false) return false;
if (MutexWaitOne(WriteTime) == false) return false;
Type type = value.GetType();
var size = Marshal.SizeOf(type);
using (MemoryMappedViewStream stream = mmf.CreateViewStream(address, size))
using (var writer = new BinaryWriter(stream))
writer.Write(value);
mutex.ReleaseMutex();
return true;
}
public bool Write(int address, Single value)
{
if (Init == false) return false;
if (MutexWaitOne(WriteTime) == false) return false;
Type type = value.GetType();
var size = Marshal.SizeOf(type);
using (MemoryMappedViewStream stream = mmf.CreateViewStream(address, size))
using (var writer = new BinaryWriter(stream))
writer.Write(value);
mutex.ReleaseMutex();
return true;
}
public bool Write(int address, Double value)
{
if (Init == false) return false;
if (MutexWaitOne(WriteTime) == false) return false;
Type type = value.GetType();
var size = Marshal.SizeOf(type);
using (MemoryMappedViewStream stream = mmf.CreateViewStream(address, size))
using (var writer = new BinaryWriter(stream))
writer.Write(value);
mutex.ReleaseMutex();
return true;
}
//public bool Write<T>(int address, T value)
//{
// if (checktype(value.GetType()) == false) return false;
// if (MutexWaitOne(3000) == false) return false;
// var size = Marshal.SizeOf(typeof(T));
// using (MemoryMappedViewStream stream = mmf.CreateViewStream(address, size))
// {
// using (var reader = new BinaryWriter(stream))
// {
// var a = (byte[])Convert.ChangeType(value, typeof(byte[]));
// reader.Write(a, 0, a.Length);
// }
// }
// mutex.ReleaseMutex();
// return true;
//}
#endregion
#region "READ"
public bool ReadSingle(int address, out Single value)
{
value = 0;
if (Init == false) return false;
var retval = true;
var type = value.GetType();
if (MutexWaitOne(ReadTime) == false) return false;
var size = 1;
using (MemoryMappedViewStream stream = mmf.CreateViewStream(address, size))
{
using (var reader = new BinaryReader(stream))
{
byte[] buffer = new byte[size];
reader.Read(buffer, 0, size);
value = BitConverter.ToSingle(buffer, 0);
}
}
mutex.ReleaseMutex();
return retval;
}
public bool ReadDouble(int address, out double value)
{
var retval = true;
value = 0;
if (Init == false) return false;
var type = value.GetType();
if (MutexWaitOne(ReadTime) == false) return false;
var size = 1;
using (MemoryMappedViewStream stream = mmf.CreateViewStream(address, size))
{
using (var reader = new BinaryReader(stream))
{
byte[] buffer = new byte[size];
reader.Read(buffer, 0, size);
value = BitConverter.ToDouble(buffer, 0);
}
}
mutex.ReleaseMutex();
return retval;
}
public bool ReadBytes(int address, int size, out byte[] value)
{
var retval = true;
value = new byte[size];
if (Init == false) return false;
var type = value.GetType();
if (MutexWaitOne(ReadTime) == false) return false;
using (MemoryMappedViewStream stream = mmf.CreateViewStream(address, size))
{
using (var reader = new BinaryReader(stream))
{
reader.Read(value, 0, size);
}
}
mutex.ReleaseMutex();
return retval;
}
public bool ReadByte(int address, out byte value)
{
var retval = true;
value = 0;
if (Init == false) return false;
var type = value.GetType();
if (MutexWaitOne(ReadTime) == false) return false;
var size = 1;
using (MemoryMappedViewStream stream = mmf.CreateViewStream(address, size))
{
using (var reader = new BinaryReader(stream))
{
byte[] buffer = new byte[size];
reader.Read(buffer, 0, size);
value = buffer.First();
}
}
mutex.ReleaseMutex();
return retval;
}
public bool ReadInt16(int address, out Int16 value)
{
var retval = true;
value = 0;
if (Init == false) return false;
var type = value.GetType();
if (MutexWaitOne(ReadTime) == false) return false;
var size = 4;
using (MemoryMappedViewStream stream = mmf.CreateViewStream(address, size))
{
using (var reader = new BinaryReader(stream))
{
byte[] buffer = new byte[size];
reader.Read(buffer, 0, size);
value = BitConverter.ToInt16(buffer, 0);
}
}
mutex.ReleaseMutex();
return retval;
}
public bool ReadInt32(int address, out Int32 value)
{
var retval = true;
value = 0;
if (Init == false) return false;
var type = value.GetType();
if (MutexWaitOne(ReadTime) == false) return false;
var size = 4;
using (MemoryMappedViewStream stream = mmf.CreateViewStream(address, size))
{
using (var reader = new BinaryReader(stream))
{
byte[] buffer = new byte[size];
reader.Read(buffer, 0, size);
value = BitConverter.ToInt32(buffer, 0);
}
}
mutex.ReleaseMutex();
return retval;
}
public bool ReadInt64(int address, out Int64 value)
{
var retval = true;
value = 0;
if (Init == false) return false;
var type = value.GetType();
if (MutexWaitOne(ReadTime) == false) return false;
var size = 4;
using (MemoryMappedViewStream stream = mmf.CreateViewStream(address, size))
{
using (var reader = new BinaryReader(stream))
{
byte[] buffer = new byte[size];
reader.Read(buffer, 0, size);
value = BitConverter.ToInt64(buffer, 0);
}
}
mutex.ReleaseMutex();
return retval;
}
public bool ReadUInt16(int address, out UInt16 value)
{
var retval = true;
value = 0;
if (Init == false) return false;
var type = value.GetType();
if (MutexWaitOne(ReadTime) == false) return false;
var size = 4;
using (MemoryMappedViewStream stream = mmf.CreateViewStream(address, size))
{
using (var reader = new BinaryReader(stream))
{
byte[] buffer = new byte[size];
reader.Read(buffer, 0, size);
value = BitConverter.ToUInt16(buffer, 0);
}
}
mutex.ReleaseMutex();
return retval;
}
public bool ReadUInt32(int address, out UInt32 value)
{
var retval = true;
value = 0;
if (Init == false) return false;
var type = value.GetType();
if (MutexWaitOne(ReadTime) == false) return false;
var size = 4;
using (MemoryMappedViewStream stream = mmf.CreateViewStream(address, size))
{
using (var reader = new BinaryReader(stream))
{
byte[] buffer = new byte[size];
reader.Read(buffer, 0, size);
value = BitConverter.ToUInt32(buffer, 0);
}
}
mutex.ReleaseMutex();
return retval;
}
public bool ReadUInt64(int address, out UInt64 value)
{
var retval = true;
value = 0;
if (Init == false) return false;
var type = value.GetType();
if (MutexWaitOne(ReadTime) == false) return false;
var size = 4;
using (MemoryMappedViewStream stream = mmf.CreateViewStream(address, size))
{
using (var reader = new BinaryReader(stream))
{
byte[] buffer = new byte[size];
reader.Read(buffer, 0, size);
value = BitConverter.ToUInt64(buffer, 0);
}
}
mutex.ReleaseMutex();
return retval;
}
//public bool Read<T>(int address, out T value) where T : IConvertible
//{
// var retval = true;
// value = default(T);
// var type = value.GetType();
// if (checktype(type) == false) return false;
// if (MutexWaitOne(3000) == false) return false;
// var size = Marshal.SizeOf(typeof(T));
// using (MemoryMappedViewStream stream = mmf.CreateViewStream(address, size))
// {
// using (var reader = new BinaryReader(stream))
// {
// byte[] buffer = new byte[size];
// reader.Read(buffer, 0, size);
// if (type == typeof(Int32))
// value = (T)Convert.ChangeType(BitConverter.ToInt32(buffer, 0), typeof(T));
// else if (type == typeof(UInt32))
// value = (T)Convert.ChangeType(BitConverter.ToUInt32(buffer, 0), typeof(T));
// else if (type == typeof(Int16))
// value = (T)Convert.ChangeType(BitConverter.ToInt16(buffer, 0), typeof(T));
// else if (type == typeof(UInt16))
// value = (T)Convert.ChangeType(BitConverter.ToUInt16(buffer, 0), typeof(T));
// else if (type == typeof(byte))
// value = (T)Convert.ChangeType(buffer[0], typeof(T));
// else if (type == typeof(string))
// value = (T)Convert.ChangeType(System.Text.Encoding.Default.GetString(buffer), typeof(T));
// else retval = false;
// }
// }
// mutex.ReleaseMutex();
// return retval;
//}
#endregion
/// <summary>
/// 지정한 타입이 호환되는 타입인가?
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
//bool checktype(Type value)
//{
// if (value == typeof(Int32)) return true;
// else if (value == typeof(UInt32)) return true;
// else if (value == typeof(Int16)) return true;
// else if (value == typeof(UInt16)) return true;
// else if (value == typeof(byte)) return true;
// else if (value == typeof(string)) return true;
// else return false;
//}
}
}

View File

@@ -0,0 +1,45 @@
IO
01:VERSION(0~255)
10:DEVICE_ID
01:DICount(0~255)
01:DOCount(0~255)
---------------------12byte-----------
##Command Area
02:Command Device
02:Command Code
04:Command Value
---------------------20byte-----------
01:Status
0 : init(<28>ʱ<EFBFBD>ȭ<EFBFBD><C8AD><EFBFBD><EFBFBD>)
1 : error
02:StatusCode(-32767~32767)
32:DIValue (dicount<6E><74> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> dicount/8)
32:DOValue (docount<6E><74> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> docount/8)
---------------------87byte-----------
MOT
01:VERSION(0~255)
10:DEVICE_ID
01:Axis Count(0~255)
---------------------12byte----------------
02:Status
0 : init(<28>ʱ<EFBFBD>ȭ<EFBFBD><C8AD><EFBFBD><EFBFBD>)
1 : error
02:StatusCode(-32767~32767)
---------------------16byte----------------
<EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ͱ<EFBFBD> <20><>ȯ<EFBFBD>ȴ<EFBFBD>. <20><>10byte<74><65> <20><><EFBFBD><EFBFBD> <20><>
01:Axis No
01:Axist Status
0 : Servo On
1 : Inposition
2 : N-Limit
3 : P-Limit
4 : Origin Sensor
5 : HomeSet
7 : Emergency
04:Current Position
04:Command Position

View File

@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{140AF52A-5986-4413-BF02-8EA55A61891B}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MemoryMapCore</RootNamespace>
<AssemblyName>MemoryMapCore</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Client.cs" />
<Compile Include="Core.cs" />
<Compile Include="Server.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 어셈블리에 대한 일반 정보는 다음 특성 집합을 통해
// 제어됩니다. 어셈블리와 관련된 정보를 수정하려면
// 이러한 특성 값을 변경하세요.
[assembly: AssemblyTitle("MemoryMapCore")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("MemoryMapCore")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// ComVisible을 false로 설정하면 이 어셈블리의 형식이 COM 구성 요소에
// 표시되지 않습니다. COM에서 이 어셈블리의 형식에 액세스하려면
// 해당 형식에 대해 ComVisible 특성을 true로 설정하세요.
[assembly: ComVisible(false)]
// 이 프로젝트가 COM에 노출되는 경우 다음 GUID는 typelib의 ID를 나타냅니다.
[assembly: Guid("140af52a-5986-4413-bf02-8ea55a61891b")]
// 어셈블리의 버전 정보는 다음 네 가지 값으로 구성됩니다.
//
// 주 버전
// 부 버전
// 빌드 번호
// 수정 버전
//
// 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 번호를
// 기본값으로 할 수 있습니다.
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,40 @@
using System;
using System.CodeDom;
using System.Collections.Generic;
using System.IO.MemoryMappedFiles;
using System.Security.Policy;
using System.Text;
using System.Threading;
namespace AR.MemoryMap
{
public class Server : Core
{
public Server(string MapFileName, int MapFileSize, int loopDelay = 50) : base(MapFileName, MapFileSize, loopDelay)
{
StartAction = () =>
{
try
{
var MapFileSync = $"{MapFileName}{MapFileSize}";
mmf = MemoryMappedFile.CreateOrOpen(MapFileName, MapFileSize);
mutex = new Mutex(false, MapFileSync, out mutexCreated);
ErrorMessage = string.Empty;
return true;
}
catch (Exception ex)
{
ErrorMessage = ex.Message;
return false;
}
};
StopAction = () =>
{
ErrorMessage = string.Empty;
brun = false;
return true;
};
}
}
}

View File

@@ -0,0 +1,580 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing.Design;
using System.Linq;
using System.Management;
using System.Security.Policy;
using System.Text;
using System.Windows.Forms;
namespace AR
{
public class CommonSetting : SettingJson
{
public CommonSetting()
{
this.filename = UTIL.MakePath("Data", "Setting.json");
}
#region "log"
[Category("System Log - Main")]
public Boolean Log_CameraConn { get; set; }
[Category("System Log - Main"), DisplayName("Digital Input"),
Description("Records status changes of input/output devices.")]
public Boolean Log_DI { get; set; }
[Category("System Log - Main"), DisplayName("Digital Output"),
Description("Records status changes of input/output devices.")]
public Boolean Log_DO { get; set; }
[Category("System Log - Main"), DisplayName("Network Alive Check(Ping)"),
Description("Use debug messages")]
public Boolean Log_Debug { get; set; }
[Category("System Log - Main"), DisplayName("S/M Step Change"),
Description("Records state machine transition status.")]
public Boolean Log_StepChange { get; set; }
[Category("System Log - Main"), DisplayName("Motion State Change"),
Description("Records motion state changes.")]
public Boolean Log_motState { get; set; }
[Category("System Log - Main")]
public Boolean Log_flag { get; set; }
[Category("System Log - Main")]
public Boolean Log_ILock { get; set; }
[Category("System Log - Function"), DisplayName("Inter Lock")]
public Boolean Enable_Log_ILock { get; set; }
[Category("System Log - Function"), DisplayName("Flag")]
public Boolean Enable_Log_Flag { get; set; }
[Category("System Log - Function"), DisplayName("Motor Stop Message")]
public Boolean Enable_Log_MotStopReason { get; set; }
#endregion
#region "Communication"
[Category("Communication"), DisplayName("Keynece IP(Front)"), Description("Keyence Barcode IP Address")]
public string Keyence_IPF { get; set; }
[Category("Communication"), DisplayName("Keyence IP(Rear)"), Description("Keyence Barcode IP Address")]
public string Keyence_IPR { get; set; }
[Category("Communication"), DisplayName("Keyence Port"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public int Keyence_Port { get; set; }
[Category("Communication"), DisplayName("Left Printer (Port)"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public string PrintL_Port { get; set; }
[Category("Communication"), DisplayName("Left Printer (Baud)"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public int PrintL_Baud { get; set; }
[Category("Communication"), DisplayName("Right Printer (Port)"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public string PrintR_Port { get; set; }
[Category("Communication"), DisplayName("Right Printer (Baud)"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public int PrintR_Baud { get; set; }
[Category("Communication"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public string Barcode_Port { get; set; }
[Category("Communication"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public int Barcode_Baud { get; set; }
#endregion
#region "Time Out"
[Category("Timeout Setting"), DisplayName(), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public int Timeout_AutoConfirm { get; set; }
[Category("Timeout Setting"), DisplayName("Job completion wait time (sec)"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public int Timeout_JOBEnd { get; set; }
[Category("Timeout Setting"), DisplayName("Max vision analysis time (Loader)"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public int Timeout_VisionProcessL { get; set; }
[Category("Timeout Setting"), DisplayName("Max vision analysis time (Unloader)"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public int Timeout_VisionProcessU { get; set; }
[Category("Timeout Setting"), DisplayName("Equipment initialization wait time (sec)"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public int Timeout_HomeSearch { get; set; }
[Category("Timeout Setting"), DisplayName("Individual operation wait time (sec)"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public double Timeout_StepMaxTime { get; set; }
[Category("Timeout Setting"), DisplayName("Max motion operation time (sec)"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public int Timeout_MotionCommand { get; set; }
[Category("Timeout Setting"), DisplayName("Max DIO operation time (sec)"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public int Timeout_DIOCommand { get; set; }
[Category("Timeout Setting"), DisplayName("Auto Conveyor output time (sec)"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public int Timeout_AutoOutConvSignal { get; set; }
#endregion
[Category("WMS")]
public bool WMS_DB_PROD { get; set; }
[Category("WMS")]
public string WMS_PROGRAM_ID { get; set; }
[Category("WMS")]
public string WMS_CENTER_CD { get; set; }
[Category("WMS")]
public string WMS_REG_USERID { get; set; }
#region "Advanced Parameter"
[Category("Advanced Parameter"), DisplayName("Remote Controller Port"), Description("Debug port info (serial communication), Input example) COM1:9600"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public string Serial_Remocon { get; set; }
[Category("Advanced Parameter"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public int RetryPickOnMaxCount { get; set; }
[Category("Advanced Parameter"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public int RetryPickOnAngle { get; set; }
[Category("Advanced Parameter"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public float JOG_Speed { get; set; }
[Category("Advanced Parameter"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public float JOG_Acc { get; set; }
[Category("Advanced Parameter")]
public Boolean Disable_HomePortDown { get; set; }
[Category("Advanced Parameter"), Browsable(false), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public Boolean Disable_PrinterL { get; set; }
[Category("Advanced Parameter"), Browsable(false), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public Boolean Disable_PrinterR { get; set; }
[Category("Advanced Parameter"), Browsable(false), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public Boolean Disable_PLVac { get; set; }
[Category("Advanced Parameter"), Browsable(false), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public Boolean Disable_PRVac { get; set; }
[Category("Advanced Parameter"), Browsable(false), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public Boolean Disable_PKVac { get; set; }
[Category("Advanced Parameter"), Browsable(false), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public Boolean Disable_PLAir { get; set; }
[Category("Advanced Parameter"), Browsable(false), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public Boolean Disable_PRAir { get; set; }
[Category("Advanced Parameter"), Browsable(false), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public Boolean Disable_PortL { get; set; }
[Category("Advanced Parameter"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public Boolean Disable_PortC { get; set; }
[Category("Advanced Parameter"), Browsable(false), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public Boolean Disable_PortR { get; set; }
[Category("Advanced Parameter"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public Boolean Disable_SIDReferenceCheck { get; set; }
[Category("Advanced Parameter"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public Boolean Disable_BottomAirBlow { get; set; }
[Category("Advanced Parameter"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public Boolean Enable_ButtonStart { get; set; }
[Category("Advanced Parameter"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public Boolean Disable_RequestJobSeqNo { get; set; }
[Category("Advanced Parameter"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public Boolean DisableSensor_AIRCheck { get; set; }
[Category("Advanced Parameter"), Browsable(false), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public Boolean Disable_TowerLamp { get; set; }
[Category("Advanced Parameter"), Browsable(false), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public Boolean Disable_RoomLight { get; set; }
[Category("Advanced Parameter"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public bool Disable_vacum { get; set; }
[Category("Advanced Parameter"), DisplayName("*.Speed Limit")]
public Boolean Enable_SpeedLimit { get; set; }
[Category("Advanced Parameter"), DisplayName("*.Max Speed"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public int LimitSpeed { get; set; }
[Category("Advanced Parameter"), Browsable(false), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public Boolean Disable_SidQtyCheck { get; set; }
[Category("Advanced Parameter"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public Boolean EnableDebugMode { get; set; }
//[Category("Advanced Parameter"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
//public int AutoConveyorReelOut { get; set; }
#endregion
#region "function"
[Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public Boolean Force_JobEndBuzzer { get; set; }
[Browsable(false)]
public Boolean Disable_Buzzer { get; set; }
[Browsable(false)]
public Boolean Enable_Magnet0 { get; set; }
[Browsable(false)]
public Boolean Enable_Magnet1 { get; set; }
[Browsable(false)]
public Boolean Enable_Magnet2 { get; set; }
[Browsable(false)]
public Boolean Enable_PickerCylinder { get; set; }
public string GetDataPath()
{
if (Path_Data == null) Path_Data = AppDomain.CurrentDomain.BaseDirectory;
var di = new System.IO.DirectoryInfo(this.Path_Data);
return di.FullName;
}
[Category("Function"), DisplayName("Label QR Code Verification"), Description("Verifies QR code of attached label with print data"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public Boolean Enable_Unloader_QRValidation { get; set; }
[Category("Function"), DisplayName("Save Captured Images"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public Boolean Save_Image { get; set; }
[Category("Function"), DisplayName("Picker Auto Move (Front Door)"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public Boolean PickerAutoMoveForDoor { get; set; }
[Category("Function"), DisplayName("Data Save Path"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public string Path_Data { get; set; }
[Category("Function"), Browsable(false), DisplayName("Room Light Auto Control"),
Description("Automatically turns room light ON/OFF according to door status"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public Boolean Enable_AutoLight { get; set; }
//[Category("Function"), DisplayName("AIR OFF Timer(ms)"),
//Description("공압 OFF시 유지 시간(ms), 지정 시간 동안 스위치를 ON 시켜야 공압이 OFF 됩니다.")]
//public int AirOFFTimer { get; set; }
[Category("Function"), DisplayName("Buzzer Duration (ms)"),
Description("Buzzer sounds for specified duration (ms) when triggered"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public int buzz_run_ms { get; set; }
#endregion
#region "Vision"
[Category("Vision"), DisplayName("13' Image Center Position"), Description("Keyence image rotation axis coordinates")]
public System.Drawing.Point CenterPosition13 { get; set; }
[Category("Vision"), DisplayName("7' Image Center Position"), Description("Keyence image rotation axis coordinates")]
public System.Drawing.Point CenterPosition7 { get; set; }
[Category("Vision"), DisplayName("Disable Left Camera"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public Boolean Disable_Left { get; set; }
[Category("Vision"), DisplayName("Disable Right Camera"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public Boolean Disable_Right { get; set; }
[Category("Vision"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public string HostIPL { get; set; }
[Category("Vision"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public string HostIPR { get; set; }
[Category("Vision"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public int HostPortL { get; set; }
[Category("Vision"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public int HostPortR { get; set; }
[Category("Vision"), DisplayName("Camera Filename"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public string CameraLFile { get; set; }
[Category("Vision"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public float AngleOffsetL { get; set; }
[Category("Vision"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public float AngleOffsetR { get; set; }
#endregion
#region "Count Reset Setting"
[Category("Count Reset Setting"), Browsable(false), DisplayName("A/M Clear Enable"),
Description("AM reset enabled\nSet to True to reset work count"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public Boolean datetime_Check_1 { get; set; }
[Category("Count Reset Setting"), Browsable(false), DisplayName("P/M Clear Enable"),
Description("PM reset enabled\nSet to True to reset work count"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public Boolean datetime_Check_2 { get; set; }
[Category("Count Reset Setting"), Browsable(false), DisplayName("A/M Clear Time(HH:mm)"),
Description("AM reset time(HH:mm)\nExample) 09:00"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public string datetime_Reset_1 { get; set; }
[Category("Count Reset Setting"), Browsable(false), DisplayName("P/M Clear Time(HH:mm)"),
Description("PM reset time(HH:mm)\nExample) 19:00"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public string datetime_Reset_2 { get; set; }
#endregion
#region "Sensitive"
[Category("Sensitive"), DisplayName("Un/Loader Port Detect (fall)"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public ushort PortDetectFall { get; set; }
[Category("Sensitive"), DisplayName("Un/Loader Port Detect (rise)"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public ushort PortDetectRise { get; set; }
[Category("Sensitive"), DisplayName("Door Detection Sensor (rise)"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public ushort SaftyDetectRise { get; set; }
[Category("Sensitive"), DisplayName("Door Detection Sensor (fall)"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public ushort SaftyDetectFall { get; set; }
[Category("Sensitive"), DisplayName("AIR Button (rise/fall)"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public ushort AirChange { get; set; }
#endregion
#region "Operation Delay"
[Category("Operation Delay(ms)"), DisplayName("Wait time after label attach"), Description("PURGE wait time after label attachment"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public int PrintVacOffPurgeMS { get; set; }
[Category("Operation Delay(sec)"), DisplayName("Cart detect wait time (Left)"), Description("Cart will be HELD after specified time - ms"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public ushort WaitTime_Magnet0 { get; set; }
[Category("Operation Delay(sec)"), DisplayName("Cart detect wait time (Center)"), Description("Cart will be HELD after specified time - ms"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public ushort WaitTime_Magnet1 { get; set; }
[Category("Operation Delay(sec)"), DisplayName("Cart detect wait time (Right)"), Description("Cart will be HELD after specified time - ms"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public ushort WaitTime_Magnet2 { get; set; }
[Category("Operation Delay(sec)"), DisplayName("Print wait time (Left)"), Description("Wait time after printer label output (Left) - ms"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public int PrintLWaitMS { get; set; }
[Category("Operation Delay(sec)"), DisplayName("Print wait time (Right)"), Description("Wait time after printer label output (Right) - ms"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public int PrintRWaitMS { get; set; }
[Category("Operation Delay(sec)"), DisplayName("Port Down Time (Unloader)"), Description("Port descends for specified time during alignment"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public float PortAlignDownTimeU { get; set; }
[Category("Operation Delay(sec)"), DisplayName("Port Down Time (Loader)"), Description("Port descends for specified time during alignment"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public float PortAlignDownTimeL { get; set; }
[Category("Operation Delay(sec)"), DisplayName("Loader Port Down Time (Finish)"), Description("Descends for specified time (ms) after job completion"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public ushort Port1FisnishDownTime { get; set; }
#endregion
#region "GENERAL
[Category("General Setting"), DisplayName("Room Light Auto OFF Time (min)")]
public int AutoOffRoomLightMin { get; set; }
[Category("General Setting"), DisplayName("Equipment Asset Number"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public string Asset { get; set; }
[Category("General Setting"), DisplayName("Equipment Name"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public string McName { get; set; }
[Category("General Setting"), DisplayName("Ignore Barcode"), Description("Ignores barcodes starting with entered value. Separate multiple entries with comma (,)"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public string IgnoreBarcode { get; set; }
[Category("General Setting"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public string ReelIdDeviceID { get; set; }
[Category("General Setting"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public string ReelIdDeviceLoc { get; set; }
[Category("General Setting"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public bool Enable_AutoChangeModelbyHandBarcode { get; set; }
#endregion
//public Boolean MoveYForPaperVaccume { get; set; }
[Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public float MoveYForPaperVaccumeValue { get; set; }
[Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public uint MoveYForPaperVaccumeVel { get; set; }
[Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public uint MoveYForPaperVaccumeAcc { get; set; }
[Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public Boolean OnlineMode { get; set; }
//public Boolean STDLabelFormat7 { get; set; }
#region "Printer"
[Category("Printer"), DisplayName("Draw Barcode Outer Box"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public Boolean DrawOutbox { get; set; }
#endregion
[DisplayName("Barcode Position Rotation (Rear)")]
public float RearBarcodeRotate { get; set; }
[DisplayName("Barcode Position Rotation (Front)")]
public float FrontBarcodeRotate { get; set; }
[Browsable(false)]
public bool SystemBypass { get; set; }
#region "general"
[Category("General Setting"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public string Sidinfofilename { get; set; }
[Category("General Setting"), DisplayName("Bug Report Recipients"), Description("Bug report recipient list. Separate multiple recipients with semicolon"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public string BugreportToList { get; set; }
[Category("General Setting"), Browsable(false),
Description("Data auto-delete period (days) disabled=0"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public int AutoDeleteDay { get; set; }
[Category("General Setting"), Browsable(false),
Description("Data auto-delete condition (remaining capacity %)"), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public int AutoDeleteThreshold { get; set; }
[Category("General Setting"), Browsable(false), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public string Password_Setup { get; set; }
[Category("General Setting"), Browsable(false), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public string Language { get; set; }
[Category("General Setting"), DisplayName("Full Screen Window State"),
Description("Use full screen mode."), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public Boolean FullScreen { get; set; }
#region "표시안함"
[Category("Sensor Detect"), Browsable(false), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public Boolean Detect_CartL { get; set; }
[Category("Sensor Detect"), Browsable(false), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public Boolean Detect_CartC { get; set; }
[Category("Sensor Detect"), Browsable(false), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public Boolean Detect_CartR { get; set; }
[Category("Sensor Detect"), Browsable(false), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public Boolean Detect_PrintL { get; set; }
[Category("Sensor Detect"), Browsable(false), Editor(typeof(MyUITypeEditor), typeof(UITypeEditor))]
public Boolean Detect_PrintR { get; set; }
//[Category("Sensor Detect"), Browsable(false)]
//public Boolean Detect_CenterSafty { get; set; }
#endregion
#endregion
#region "Report"
[Category("Report"),
Description("Equipment identification code for status recording (4 digits)"),
DisplayName("M/C ID")]
public string MCID { get; set; }
[Category("Report"),
Description("Saves work records to Equipment Engineering (EE) Database. Allows remote monitoring of equipment status"),
DisplayName("SAVE EE-DB")]
public Boolean Save_EEDatabase { get; set; }
[Category("Report"), Description("Status transmission interval (sec)")]
public int StatusInterval { get; set; }
#endregion
#region "swplc"
public string swplc_name { get; set; }
public int swplc_size { get; set; }
#endregion
[Category("Develop")]
public string Bugreport_mail { get; set; }
public override void AfterLoad()
{
if (Timeout_AutoOutConvSignal < 1) Timeout_AutoOutConvSignal = 5;
if (WMS_CENTER_CD.isEmpty()) WMS_CENTER_CD = "V1";
if (WMS_PROGRAM_ID.isEmpty()) WMS_PROGRAM_ID = "LABEL ATTACH";
if (WMS_REG_USERID.isEmpty()) WMS_REG_USERID = "ATVLA1";
if (swplc_size < 1) swplc_size = 100;
if (swplc_name.isEmpty()) swplc_name = "swplc";
if (StatusInterval < 10) StatusInterval = 300; //5분간격
var currentpath = AppDomain.CurrentDomain.BaseDirectory;
if (AutoOffRoomLightMin == 0) AutoOffRoomLightMin = 5;
if (RetryPickOnAngle == 0) RetryPickOnAngle = 79;
if (Barcode_Baud == 0) Barcode_Baud = 9600;
if (JOG_Speed < 1) JOG_Speed = 200;
if (JOG_Acc < 1) JOG_Acc = 500;
if (PrintL_Baud == 0) PrintL_Baud = 115200;
if (PrintR_Baud == 0) PrintR_Baud = 115200;
if (BugreportToList.isEmpty()) BugreportToList = "chikyun.kim@amkor.co.kr";
if (HostIPL.isEmpty() && HostPortL < 1)
{
HostIPL = "127.0.0.1";
HostPortL = 7979;
}
if (HostIPR.isEmpty() && HostPortR < 1)
{
HostIPR = "127.0.0.1";
HostPortR = 7980;
}
if (ReelIdDeviceLoc.isEmpty()) ReelIdDeviceLoc = "4";
if (ReelIdDeviceID.isEmpty()) ReelIdDeviceID = "A";
if (IgnoreBarcode.isEmpty()) IgnoreBarcode = "{{{";
if (Timeout_AutoConfirm == 0) Timeout_AutoConfirm = 5;
//if (PrintVacOffPurgesec <= 0.0) PrintVacOffPurgesec = 1.1f;
if (PrintVacOffPurgeMS == 0) PrintVacOffPurgeMS = 500;
if (MoveYForPaperVaccumeVel == 0) MoveYForPaperVaccumeVel = 10;
if (MoveYForPaperVaccumeAcc == 0) MoveYForPaperVaccumeAcc = 1000;
//포트얼라인시간 210401
if (PortAlignDownTimeU == 0f &&
PortAlignDownTimeL == 0f)
{
PortAlignDownTimeL = 1.5f;
PortAlignDownTimeU = 1.0f;
}
if (PrintLWaitMS == 0) PrintLWaitMS = 1500;
if (PrintRWaitMS == 0) PrintRWaitMS = 1500;
if (WaitTime_Magnet0 == 0) WaitTime_Magnet0 = 3000;
if (WaitTime_Magnet1 == 0) WaitTime_Magnet1 = 3000;
if (WaitTime_Magnet2 == 0) WaitTime_Magnet2 = 3000;
//if (PrintLeftName.isEmpty()) PrintLeftName = "PrinterL";
//if (PrintRightName.isEmpty()) PrintRightName = "PrinterR";
if (SaftyDetectRise == 0) SaftyDetectRise = 20;
if (SaftyDetectFall == 0) SaftyDetectFall = 1000; //안전센서는 느리게 해제 한다
if (Timeout_JOBEnd == 0) Timeout_JOBEnd = 10;
if (Timeout_VisionProcessL == 0) Timeout_VisionProcessL = 10000;
if (Timeout_VisionProcessU == 0) Timeout_VisionProcessU = 10000;
if (PortDetectFall == 0) PortDetectFall = 50;
if (PortDetectRise == 0) PortDetectRise = 10;
if (AirChange == 0) AirChange = 3000;
if (Keyence_IPF.isEmpty()) Keyence_IPF = "192.168.100.100";
//if (Keyence_IPR.isEmpty()) Keyence_IPR = "192.168.100.101";
if (Keyence_Port == 0) Keyence_Port = 9004;
//데이터베이스
//if (Keyence_IPL.isEmpty() == true) Keyence_IPL = "net.pipe://127.0.0.1/barcode";
//if (Keyence_IPR.isEmpty() == true) Keyence_IPR = "net.pipe://127.0.0.1/barcode";
if (Timeout_MotionCommand == 0) Timeout_MotionCommand = 10;
if (Timeout_DIOCommand == 0) Timeout_DIOCommand = 10;
if (AutoDeleteThreshold == 0) AutoDeleteThreshold = 20;
if (Timeout_HomeSearch == 0) Timeout_HomeSearch = 50;
//if (AirOFFTimer == 0) AirOFFTimer = 3000; //181226
if (Asset == "") Asset = "DEV_SPLIT";
if (Language.isEmpty()) Language = "Kor";
//if (Password_Setup.isEmpty()) Password_Setup = "0000";
if (Path_Data == "") Path_Data = @".\SaveData";
try
{
if (System.IO.Directory.Exists(GetDataPath()) == false)
System.IO.Directory.CreateDirectory(GetDataPath());
}
catch
{
}
//if (Password_User.isEmpty()) Password_User = "9999";
}
public override void AfterSave()
{
//throw new NotImplementedException();
}
public void CopyTo(CommonSetting dest)
{
//이곳의 모든 쓰기가능한 속성값을 대상에 써준다.
Type thClass = this.GetType();
foreach (var method in thClass.GetMethods())
{
var parameters = method.GetParameters();
if (!method.Name.StartsWith("get_")) continue;
string keyname = method.Name.Substring(4);
string methodName = method.Name;
object odata = GetType().GetMethod(methodName).Invoke(this, null);
var wMethod = dest.GetType().GetMethod(Convert.ToString("set_") + keyname);
if (wMethod != null) wMethod.Invoke(dest, new object[] { odata });
}
}
}
}

View File

@@ -0,0 +1,78 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
namespace AR
{
public class CountSetting : SettingJson
{
public int seq { get; set; }
public string DateStr { get; set; }
public void ClearP()
{
CountV0 = CountV1 = CountV2 = CountE = CountP0 = CountP1 = CountP2 = CountPrintL = CountPrintR = 0;
this.Save();
}
public void ClearDay()
{
DateStr = string.Empty;
CountDP0 = CountDP1 = CountDP2 = CountDP3 = CountDP4 = 0;
this.Save();
}
public int CountD
{
get
{
return CountDP0 + CountDP1 + CountDP2 + CountDP3 + CountDP4;
}
}
public int Count
{
get
{
return CountP0 + CountP1 + CountP2 + CountPrintL + CountPrintR;
}
}
public int CountDP0 { get; set; }
public int CountDP1 { get; set; }
public int CountDP2 { get; set; }
public int CountDP3 { get; set; }
public int CountDP4 { get; set; }
//메인카운터
public int CountP0 { get; set; }
public int CountP1 { get; set; }
public int CountP2 { get; set; }
public int CountPrintL { get; set; }
public int CountPrintR { get; set; }
public int CountE { get; set; }
public int CountV0 { get; set; }
public int CountV1 { get; set; }
public int CountV2 { get; set; }
public CountSetting()
{
this.filename = AR.UTIL.MakePath("Data", "counter.json");
}
public override void AfterLoad()
{
//if (CountReset == null) CountReset = DateTime.Parse("1982-11-23");
}
public override void AfterSave()
{
//throw new NotImplementedException();
}
}
}

View File

@@ -0,0 +1,82 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
namespace AR
{
public class SystemSetting : SettingJson
{
public int SaftySensor_Threshold { get; set; }
#region "System Setting"
public int MotaxisCount { get; set; }
#endregion
#region "Signal Reverse"
[Category("Signal Reverse")]
public Boolean ReverseSIG_Emgergency { get; set; }
[Category("Signal Reverse")]
public Boolean ReverseSIG_ButtonAir { get; set; }
[Category("Signal Reverse")]
public Boolean ReverseSIG_DoorF { get; set; }
[Category("Signal Reverse")]
public Boolean ReverseSIG_DoorR { get; set; }
[Category("Signal Reverse")]
public Boolean ReverseSIG_AirCheck { get; set; }
[Category("Signal Reverse")]
public Boolean ReverseSIG_PortLimitUp { get; set; }
[Category("Signal Reverse")]
public Boolean ReverseSIG_PortLimitDn { get; set; }
[Category("Signal Reverse")]
public Boolean ReverseSIG_PortDetect0Up { get; set; }
[Category("Signal Reverse")]
public Boolean ReverseSIG_PortDetect1Up { get; set; }
[Category("Signal Reverse")]
public Boolean ReverseSIG_PortDetect2Up { get; set; }
[Category("Signal Reverse")]
public Boolean ReverseSIG_PickerSafe { get; set; }
[Category("Signal Reverse")]
public Boolean ReverseSIG_ExtConvReady { get; set; }
#endregion
[Category("Door Safty"), DisplayName("Disable Front - Left")]
public Boolean Disable_safty_F0 { get; set; }
[Category("Door Safty"), DisplayName("Disable Front - Center")]
public Boolean Disable_safty_F1 { get; set; }
[Category("Door Safty"), DisplayName("Disable Front - Right")]
public Boolean Disable_safty_F2 { get; set; }
[Category("Door Safty"), DisplayName("Disable Rear - Left")]
public Boolean Disable_safty_R0 { get; set; }
[Category("Door Safty"), DisplayName("Disable Rear - Center")]
public Boolean Disable_safty_R1 { get; set; }
[Category("Door Safty"), DisplayName("Disable Rear - Right")]
public Boolean Disable_safty_R2 { get; set; }
public SystemSetting()
{
this.filename = UTIL.MakePath("Data", "system.json");
}
public override void AfterLoad()
{
MotaxisCount = 7;
}
public override void AfterSave()
{
//throw new NotImplementedException();
}
}
}

View File

@@ -0,0 +1,72 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
namespace AR
{
public class UserSetting : SettingJson
{
public string customerlist { get; set; }
public Boolean Option_QtyUpdate1 { get; set; }
public Boolean Option_PartUpdate { get; set; }
public Boolean Option_printforce1 { get; set; }
public Boolean Option_Confirm1 { get; set; }
public Boolean Option_AutoConfirm { get; set; }
public Boolean Option_vname { get; set; }
public Boolean Option_FixPrint1 { get; set; }
public string Option_PrintPos1 { get; set; }
public Boolean Option_SidConv { get; set; }
//public Boolean Option_QtyUpdate3 { get; set; }
//public Boolean Option_printforce3 { get; set; }
//public Boolean Option_Confirm3 { get; set; }
//public Boolean Option_FixPrint3 { get; set; }
//public string Option_PrintPos3 { get; set; }
public string LastJobUnP11 { get; set; }
public string LastJobUnP12 { get; set; }
public string LastJobUnP21 { get; set; }
public string LastJobUnP22 { get; set; }
public string LastJobUnP31 { get; set; }
public string LastJobUnP32 { get; set; }
public string LastJobUnP41 { get; set; }
public string LastJobUnP42 { get; set; }
public string LastLot { get; set; }
public string LastAltag { get; set; }
public string LastModelM { get; set; }
public string LastModelV { get; set; }
public string LastMC { get; set; }
public int jobtype { get; set; }
public int scantype { get; set; }
public bool useConv { get; set; }
public UserSetting()
{
this.filename = UTIL.MakePath("data", "UserSet.json");
}
public override void AfterLoad()
{
if (LastJobUnP11.isEmpty()) LastJobUnP11 = "AUTO";
if (LastJobUnP12.isEmpty()) LastJobUnP12 = "AUTO";
if (LastJobUnP21.isEmpty()) LastJobUnP21 = "AUTO";
if (LastJobUnP22.isEmpty()) LastJobUnP22 = "AUTO";
if (LastJobUnP31.isEmpty()) LastJobUnP31 = "AUTO";
if (LastJobUnP32.isEmpty()) LastJobUnP32 = "AUTO";
if (LastJobUnP41.isEmpty()) LastJobUnP41 = "AUTO";
if (LastJobUnP42.isEmpty()) LastJobUnP42 = "AUTO";
}
public override void AfterSave()
{
//throw new NotImplementedException();
}
}
}

View File

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 어셈블리에 대한 일반 정보는 다음 특성 집합을 통해
// 제어됩니다. 어셈블리와 관련된 정보를 수정하려면
// 이러한 특성 값을 변경하세요.
[assembly: AssemblyTitle("Setting")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Setting")]
[assembly: AssemblyCopyright("Copyright © 2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// ComVisible을 false로 설정하면 이 어셈블리의 형식이 COM 구성 요소에
// 표시되지 않습니다. COM에서 이 어셈블리의 형식에 액세스하려면
// 해당 형식에 대해 ComVisible 특성을 true로 설정하세요.
[assembly: ComVisible(false)]
// 이 프로젝트가 COM에 노출되는 경우 다음 GUID는 typelib의 ID를 나타냅니다.
[assembly: Guid("48654765-548d-42ed-9238-d65eb3bc99ad")]
// 어셈블리의 버전 정보는 다음 네 가지 값으로 구성됩니다.
//
// 주 버전
// 부 버전
// 빌드 번호
// 수정 버전
//
// 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 번호를
// 기본값으로 할 수 있습니다.
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,36 @@
using System;
using System.Data;
namespace AR
{
public static class SETTING
{
public static SystemSetting System;
public static CountSetting Counter;
public static CommonSetting Data;
public static UserSetting User;
public static Boolean isInit { get; private set; } = false;
public static void Load()
{
if (Data == null) Data = new CommonSetting();
Data.Load();
if (User == null) User = new UserSetting();
User.Load();
if (System == null) System = new SystemSetting();
System.Load();
if (Counter == null) Counter = new CountSetting();
Counter.Load();
isInit = true;
}
public static void Save()
{
Data.Save();
User.Save();
System.Save();
Counter.Save();
}
}
}

View File

@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{48654765-548D-42ED-9238-D65EB3BC99AD}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Setting</RootNamespace>
<AssemblyName>Setting</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Management" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Model\Common.cs" />
<Compile Include="Model\Count.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SETTING.cs" />
<Compile Include="Model\System.cs" />
<Compile Include="Model\User.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\commutil\arCommUtil.csproj">
<Project>{14e8c9a5-013e-49ba-b435-ffffff7dd623}</Project>
<Name>arCommUtil</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@@ -0,0 +1,196 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StdLabelPrint
{
public class CAmkorSTDBarcode
{
public string Message { get; private set; }
public Boolean isValid = false;
public string SID { get; set; }
public string VLOT { get; set; }
public string RID { get; set; }
public string MFGDate { get; set; }
//public string MFGDateRaw { get; set; }
public string VENDERNAME { get; set; }
public string PARTNO { get; set; }
public int QTY { get; set; }
public string RAW { get; set; }
public Boolean DateError { get; private set; }
public Boolean DisposalCode { get; set; }
public Boolean NewLen15Barcode { get; set; }
public void CopyTo(CAmkorSTDBarcode obj)
{
if (obj == null) obj = new CAmkorSTDBarcode();
else obj.Clear();
obj.Message = this.Message;
obj.isValid = this.isValid;
obj.SID = this.SID;
obj.VLOT = this.VLOT;
obj.RID = this.RID;
obj.MFGDate = this.MFGDate;
obj.VENDERNAME = this.VENDERNAME;
obj.PARTNO = this.PARTNO;
obj.QTY = this.QTY;
obj.RAW = this.RAW;
obj.DateError = this.DateError;
obj.DisposalCode = this.DisposalCode;
obj.NewLen15Barcode = this.NewLen15Barcode;
}
public CAmkorSTDBarcode()
{
Clear();
}
public void Clear()
{
this.DisposalCode = false;
this.NewLen15Barcode = false;
this.Message = string.Empty;
this.isValid = false;
this.SID = string.Empty;
this.VLOT = string.Empty;
this.RID = string.Empty;
//this.MFGDateRaw = string.Empty;
this.MFGDate = string.Empty;// new DateTime(1982, 11, 23);
this.VENDERNAME = string.Empty;
this.PARTNO = string.Empty;
this.QTY = 0;
this.RAW = string.Empty;
DateError = false;
}
public CAmkorSTDBarcode(string raw)
{
SetBarcode(raw);
}
public void SetBarcodeDemo()
{
//SetBarcode("101410653;AG64B3W;SAMSUNG;20000;AG64B3W0031;19000101;");
SetBarcode("101410653;AG64B3W;SAMSUNG;20000;AG64B3W0031;19000101;");
}
/// <summary>
/// 현재 속성의 값을 가지고 바코드값을 반환합니다.
/// 원본 바코드 값을 확인하려면 RAW 속성을 확인하세요
/// </summary>
/// <returns></returns>
public string GetBarcode()
{
if (string.IsNullOrWhiteSpace(PARTNO))
return string.Format("{0};{1};{2};{3};{4};{5}",
SID, VLOT, VENDERNAME, QTY, RID, MFGDate);
else
return string.Format("{0};{1};{2};{3};{4};{5};{6}",
SID, VLOT, VENDERNAME, QTY, RID, MFGDate, PARTNO);
}
public void SetBarcode(string raw)
{
//101416868;01A3KX;KYOCERA;20000;RC00014A225001I;20220511;N/A
isValid = false;
this.RAW = raw;
var buf = raw.Split(';');
if (buf.Length < 5)
{
isValid = false;
Message = "buffer len error : " + raw;
return;
}
decimal vSID = 0;
double vQty = 0;
if (decimal.TryParse(buf[0], out vSID) == false) return;
this.SID = buf[0];
this.VLOT = buf[1];
//101인경우에는 3번 항목이 벤더네임이다.
//103은 partno 값이 들어간다
if (this.SID.StartsWith("103"))
{
if (buf.Length == 7) //구형바코드
{
this.VENDERNAME = buf[2];
this.PARTNO = string.Empty;
Message = "폐기된 103코드 입니다";
DisposalCode = true;
}
else
{
//05월 신형은 파트번호가 들어있다
this.PARTNO = buf[2];
this.VENDERNAME = string.Empty;
DisposalCode = false;
}
}
else
{
this.VENDERNAME = buf[2];
this.PARTNO = string.Empty;
DisposalCode = false;
}
//일부 데이터를 변조한다 210709
if (this.VENDERNAME == "K118165") this.VENDERNAME = "DELTA";
else if (this.VENDERNAME == "K113986") this.VENDERNAME = "DREAM CHIP";
if (double.TryParse(buf[3], out vQty) == false) return;
this.QTY = (int)vQty;
this.RID = buf[4];
//DateTime vMFGDate;
DateError = false;
this.MFGDate = buf[5].Trim();
//신형바코드는 angle 에서 제외하려고 판정한다
if (this.RID.Length == 15 && this.RID.StartsWith("RC")) //210703
this.NewLen15Barcode = true;
else
this.NewLen15Barcode = false;
//if (buf[5].Length == 4 && this.SUPPLY == "SAMSUNG")
//{
// //삼성은 주차로 한다
// DateError = true;
// Message = "Date Error(samsung)";
// MFGDate = new DateTime(2000+ int.Parse( buf[5].Substring(0,2) ), 1, 1);
// //DateTime.Now.
//}
//else if (buf[5].Length != 8)
//{
// Message = "Date value Length Error : " + buf[5];
// MFGDate = new DateTime(1900, 1, 1);
// return;
//}
//else
//{
// buf[5] = buf[5].Substring(0, 4) + "-" + buf[5].Substring(4, 2) + "-" + buf[5].Substring(6, 2);
// if (DateTime.TryParse(buf[5], out vMFGDate) == false) return;
// MFGDate = vMFGDate;
//}
//마지막 요소가 PartNo 이다. (아직 이코드는 본적 없음)
if (this.SID.StartsWith("103") && buf.Length == 7) //구형번호이다
{
this.PARTNO = buf[6];
}
if (buf.Length == 7 && string.IsNullOrEmpty(this.PARTNO))
{
this.PARTNO = buf[6];
}
//else this.PARTNO = string.Empty;
isValid = true;
}
}
}

View File

@@ -0,0 +1,118 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.InteropServices;
namespace StdLabelPrint
{
public partial class LabelPrint
{
private const int ERROR_INSUFFICIENT_BUFFER = 122;
[FlagsAttribute]
public enum PrinterEnumFlags
{
PRINTER_ENUM_DEFAULT = 0x00000001,
PRINTER_ENUM_LOCAL = 0x00000002,
PRINTER_ENUM_CONNECTIONS = 0x00000004,
PRINTER_ENUM_FAVORITE = 0x00000004,
PRINTER_ENUM_NAME = 0x00000008,
PRINTER_ENUM_REMOTE = 0x00000010,
PRINTER_ENUM_SHARED = 0x00000020,
PRINTER_ENUM_NETWORK = 0x00000040,
PRINTER_ENUM_EXPAND = 0x00004000,
PRINTER_ENUM_CONTAINER = 0x00008000,
PRINTER_ENUM_ICONMASK = 0x00ff0000,
PRINTER_ENUM_ICON1 = 0x00010000,
PRINTER_ENUM_ICON2 = 0x00020000,
PRINTER_ENUM_ICON3 = 0x00040000,
PRINTER_ENUM_ICON4 = 0x00080000,
PRINTER_ENUM_ICON5 = 0x00100000,
PRINTER_ENUM_ICON6 = 0x00200000,
PRINTER_ENUM_ICON7 = 0x00400000,
PRINTER_ENUM_ICON8 = 0x00800000,
PRINTER_ENUM_HIDE = 0x01000000,
PRINTER_ENUM_CATEGORY_ALL = 0x02000000,
PRINTER_ENUM_CATEGORY_3D = 0x04000000
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
public struct PRINTER_INFO_2
{
[MarshalAs(UnmanagedType.LPTStr)]
public string pServerName;
[MarshalAs(UnmanagedType.LPTStr)]
public string pPrinterName;
[MarshalAs(UnmanagedType.LPTStr)]
public string pShareName;
[MarshalAs(UnmanagedType.LPTStr)]
public string pPortName;
[MarshalAs(UnmanagedType.LPTStr)]
public string pDriverName;
[MarshalAs(UnmanagedType.LPTStr)]
public string pComment;
[MarshalAs(UnmanagedType.LPTStr)]
public string pLocation;
public IntPtr pDevMode;
[MarshalAs(UnmanagedType.LPTStr)]
public string pSepFile;
[MarshalAs(UnmanagedType.LPTStr)]
public string pPrintProcessor;
[MarshalAs(UnmanagedType.LPTStr)]
public string pDatatype;
[MarshalAs(UnmanagedType.LPTStr)]
public string pParameters;
public IntPtr pSecurityDescriptor;
public uint Attributes; // See note below!
public uint Priority;
public uint DefaultPriority;
public uint StartTime;
public uint UntilTime;
public uint Status;
public uint cJobs;
public uint AveragePPM;
}
[StructLayout(LayoutKind.Sequential)]
public struct DOCINFO
{
[MarshalAs(UnmanagedType.LPWStr)] public string pDocName;
[MarshalAs(UnmanagedType.LPWStr)] public string pOutputFile;
[MarshalAs(UnmanagedType.LPWStr)] public string pDataType;
}
public class PrintDirect
{
[DllImport("winspool.drv", CharSet = CharSet.Unicode, ExactSpelling = false,
CallingConvention = CallingConvention.StdCall)]
public static extern long OpenPrinter(string pPrinterName, ref IntPtr phPrinter, int pDefault);
[DllImport("winspool.drv", CharSet = CharSet.Unicode, ExactSpelling = false,
CallingConvention = CallingConvention.StdCall)]
public static extern long StartDocPrinter(IntPtr hPrinter, int Level, ref DOCINFO
pDocInfo);
[DllImport("winspool.drv", CharSet = CharSet.Unicode, ExactSpelling = true,
CallingConvention = CallingConvention.StdCall)]
public static extern long StartPagePrinter(IntPtr hPrinter);
[DllImport("winspool.drv", CharSet = CharSet.Ansi, ExactSpelling = true,
CallingConvention = CallingConvention.StdCall)]
public static extern long WritePrinter(IntPtr hPrinter, string data, int buf, ref int pcWritten);
[DllImport("winspool.drv", CharSet = CharSet.Unicode, ExactSpelling = true,
CallingConvention = CallingConvention.StdCall)]
public static extern long EndPagePrinter(IntPtr hPrinter);
[DllImport("winspool.drv", CharSet = CharSet.Unicode, ExactSpelling = true,
CallingConvention = CallingConvention.StdCall)]
public static extern long EndDocPrinter(IntPtr hPrinter);
[DllImport("winspool.drv", CharSet = CharSet.Unicode, ExactSpelling = true,
CallingConvention = CallingConvention.StdCall)]
public static extern long ClosePrinter(IntPtr hPrinter);
[DllImport("winspool.drv", CharSet = CharSet.Auto, SetLastError = true)]
public static extern bool EnumPrinters(PrinterEnumFlags Flags, string Name, uint Level, IntPtr pPrinterEnum, uint cbBuf, ref uint pcbNeeded, ref uint pcReturned);
}
}
}

View File

@@ -0,0 +1,308 @@
using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.InteropServices;
namespace StdLabelPrint
{
public partial class LabelPrint
{
public string printerName { get; set; } = string.Empty;
public List<string> connectedPrinter = new List<string>();
public string LastPrintZPL = string.Empty;
public string qrData = string.Empty;
public string baseZPL { get; set; }
public LabelPrint(string _prtName)
{
//GetPrinterList();
//if (connectedPrinter.Contains(_prtName) == false)
// throw new Exception("연결된 프린터가 아닙니다.");
printerName = _prtName;
baseZPL = Properties.Settings.Default.zpl;
}
public List<string> GetPrinterList()
{
connectedPrinter = new List<string>();
var list_local = FindPrinters(PrinterEnumFlags.PRINTER_ENUM_LOCAL);
var list_connected = FindPrinters(PrinterEnumFlags.PRINTER_ENUM_CONNECTIONS);
try
{
connectedPrinter.AddRange(list_local);
}
catch { }
try
{
connectedPrinter.AddRange(list_connected);
}
catch { }
return connectedPrinter;
}
public string makeZPL_210101(Reel reel, Boolean D1RID, Boolean drawbox, out string qrData)
{
string prtData = string.Empty;
qrData = string.Format("{0};{1};{2};{3};{4};{5};{6}", reel.sid, reel.lot, reel.manu, reel.qty, reel.id, reel.mfg, reel.partnum);
prtData = "^XA\r\n";
prtData += "^MMT\r\n";
prtData += "^PW519\r\n";
prtData += "^LL0200\r\n";
prtData += "^LS0\r\n";
prtData += "^FO128,96^GFA,01536,01536,00048,:Z64:\r\n";
prtData += "eJxjYBgFo2AUkADs/xMN/g1G9aNgFMABAIF9rE0=:1194\r\n";
if (drawbox)
prtData += "^FO1,7^GB505,185,4^FS\r\n";
prtData += "^BY2,3,41^FT280,82^BCN,,N,N,N,A\r\n";
prtData += "^FD" + reel.sid + "^FS\r\n";
prtData += "^FT12,160^BQN,2,4\r\n";
prtData += string.Format("^FH\\^FDLA,{0}^FS\r\n", qrData);
prtData += "^BY2,3,32^FT86,185^BCN,,N,N,N,A\r\n";
prtData += string.Format("^FD{0};{1}^FS\r\n", reel.sid, reel.lot);
prtData += "^FO278,7^GB0,26,4^FS\r\n";
prtData += "^FT160,29^A0N,20,19^FH\\^FDSID^FS\r\n";
prtData += "^FT159,111^A0N,20,19^FH\\^FDPN^FS\r\n";
prtData += "^FT159,137^A0N,20,19^FH\\^FDRID^FS\r\n";
prtData += "^FT194,29^A0N,20,19^FH\\^FD" + reel.sid + "^FS\r\n";
prtData += "^FT324,29^A0N,20,19^FH\\^FD" + reel.lot + "^FS\r\n";
prtData += "^FT195,111^A0N,20,19^FH\\^FD" + reel.partnum + "^FS\r\n";
prtData += "^FT195,137^A0N,20,19^FH\\^FD" + (D1RID ? reel.id : string.Empty) + "^FS\r\n"; //210302
prtData += "^FT441,137^A0N,20,19^FH\\^FD" + reel.qty.ToString() + "^FS\r\n";
prtData += "^FT285,29^A0N,20,19^FH\\^FDLOT^FS\r\n";
prtData += "^FT396,137^A0N,20,19^FH\\^FDQTY^FS\r\n";
prtData += "^FO154,7^GB352,28,4^FS\r\n";
prtData += "^FO154,89^GB352,54,4^FS\r\n";
prtData += "^FO190,90^GB0,51,4^FS\r\n";
prtData += "^FO188,9^GB0,24,4^FS\r\n";
prtData += "^FO388,117^GB0,26,4^FS\r\n";
prtData += "^FO430,116^GB0,26,4^FS\r\n";
prtData += "^FO316,7^GB0,26,4^FS\r\n";
prtData += "^PQ1,0,1,Y^XZ\r\n";
return prtData;
}
public string makeZPL_210510(Reel reel, Boolean drawbox, out string qrData)
{
string m_strSend = string.Empty;
qrData = string.Format("{0};{1};{2};{3};{4};{5}", reel.sid, reel.lot, reel.partnum, reel.qty, reel.id, reel.mfg);
m_strSend = this.baseZPL;
m_strSend = m_strSend.Replace("{qrData}", qrData);
m_strSend = m_strSend.Replace("{sid}", reel.sid);
m_strSend = m_strSend.Replace("{lot}", reel.lot);
m_strSend = m_strSend.Replace("{partnum}", reel.partnum);
m_strSend = m_strSend.Replace("{rid}", reel.id);
m_strSend = m_strSend.Replace("{qty}", reel.qty.ToString());
m_strSend = m_strSend.Replace("{mfg}", reel.mfg);
m_strSend = m_strSend.Replace("{supply}", reel.manu);
//줄바꿈제거
m_strSend = m_strSend.Replace("\r", "").Replace("\n", "");
return m_strSend;
}
public string makeZPL_210908(Reel reel, Boolean drawbox, out string qrData)
{
string m_strSend = string.Empty;
qrData = string.Format("{0};{1};{2};{3};{4};{5};{6}", reel.sid, reel.lot, reel.manu, reel.qty, reel.id, reel.mfg, reel.partnum);
m_strSend = this.baseZPL;
m_strSend = m_strSend.Replace("{qrData}", qrData);
m_strSend = m_strSend.Replace("{sid}", reel.sid);
m_strSend = m_strSend.Replace("{lot}", reel.lot);
m_strSend = m_strSend.Replace("{partnum}", reel.partnum);
m_strSend = m_strSend.Replace("{rid}", reel.id);
m_strSend = m_strSend.Replace("{qty}", reel.qty.ToString());
m_strSend = m_strSend.Replace("{mfg}", reel.mfg);
m_strSend = m_strSend.Replace("{supply}", reel.manu);
//줄바꿈제거
m_strSend = m_strSend.Replace("\r", "").Replace("\n", "");
return m_strSend;
}
public Boolean TestPrint(Boolean drawbox, string manu = "", string mfgdate = "", Boolean Array7 = false)
{
var dtstr = DateTime.Now.ToShortDateString();
var printcode = "103077807;Z577603504;105-35282-1105;15000;RC00004A219001W;20210612";
var reel = new StdLabelPrint.Reel(printcode);
//reel.id = "RLID" + DateTime.Now.ToString("MMHHmmssfff");
reel.sid = "103000000";
reel.partnum = "PARTNO".PadRight(20, '0'); //20자리
if (mfgdate == "") reel.mfg = dtstr;
else reel.mfg = mfgdate;
reel.lot = "LOT000000000";
if (manu == "") reel.manu = "ATK4EET1";
else reel.manu = manu;
reel.qty = 15000;
var rlt = Print(reel, true, drawbox, Array7);
var fi = new System.IO.FileInfo(System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "temp_zpl.txt"));
System.IO.File.WriteAllText(fi.FullName, LastPrintZPL, System.Text.Encoding.Default);
return rlt;
}
public Boolean Print(Reel reel, Boolean display1drid, Boolean drawOUtBox, Boolean Array7 = false)
{
string prtData;
if (Array7)
prtData = makeZPL_210908(reel, drawOUtBox, out qrData);
else
prtData = makeZPL_210510(reel, drawOUtBox, out qrData);
return Print(prtData);
}
public bool Print(string _zpl)
{
this.LastPrintZPL = _zpl;
bool retval = false;
System.IntPtr lhPrinter = new System.IntPtr();
DOCINFO di = new DOCINFO();
int pcWritten = 0;
//string st1;
// text to print with a form feed character
//st1 = "This is std label by using zpl\f";
di.pDocName = "Component Std Label";
di.pDataType = "RAW";
// the \x1b means an ascii escape character
//lhPrinter contains the handle for the printer opened
//If lhPrinter is 0 then an error has occured
//GetPrinterList();
//if (connectedPrinter.Contains(printerName) == false)
// throw new Exception("연결된 프린터가 아닙니다.");
PrintDirect.OpenPrinter(printerName, ref lhPrinter, 0);
PrintDirect.StartDocPrinter(lhPrinter, 1, ref di);
PrintDirect.StartPagePrinter(lhPrinter);
try
{
PrintDirect.WritePrinter(lhPrinter, _zpl, _zpl.Length, ref pcWritten);
retval = true;
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
PrintDirect.EndPagePrinter(lhPrinter);
PrintDirect.EndDocPrinter(lhPrinter);
PrintDirect.ClosePrinter(lhPrinter);
return retval;
}
private List<string> FindPrinters(PrinterEnumFlags Flags)
{
List<string> prtList = new List<string>();
uint cbNeeded = 0;
uint cReturned = 0;
if (PrintDirect.EnumPrinters(Flags, null, 2, IntPtr.Zero, 0, ref cbNeeded, ref cReturned))
{
return null;
}
int lastWin32Error = Marshal.GetLastWin32Error();
if (lastWin32Error == ERROR_INSUFFICIENT_BUFFER)
{
IntPtr pAddr = Marshal.AllocHGlobal((int)cbNeeded);
if (PrintDirect.EnumPrinters(Flags, null, 2, pAddr, cbNeeded, ref cbNeeded, ref cReturned))
{
PRINTER_INFO_2[] printerInfo2 = new PRINTER_INFO_2[cReturned];
int offset = pAddr.ToInt32();
Type type = typeof(PRINTER_INFO_2);
int increment = Marshal.SizeOf(type);
for (int i = 0; i < cReturned; i++)
{
printerInfo2[i] = (PRINTER_INFO_2)Marshal.PtrToStructure(new IntPtr(offset), type);
prtList.Add(printerInfo2[i].pPrinterName);
offset += increment;
}
Marshal.FreeHGlobal(pAddr);
return prtList;
}
lastWin32Error = Marshal.GetLastWin32Error();
}
throw new Win32Exception(lastWin32Error);
}
}
public class Reel
{
public string sid { get; set; }
public string lot { get; set; }
public string mfg { get; set; }
public int qty { get; set; }
public string id { get; set; }
//public string date { get; set; }
public string partnum { get; set; }
public string manu { get; set; }
public Reel()
{
Clear();
}
public void Clear()
{
sid = string.Empty;
lot = string.Empty;
mfg = string.Empty;
lot = string.Empty;
id = string.Empty;
//date = string.Empty;
partnum = string.Empty;
manu = string.Empty;
qty = 0;
}
public Reel(string _sid, string _lot, string _manu, int _qty, string _id, string _mfgdate, string _partnum)
{
int sidNum = 0;
if (int.TryParse(_sid, out sidNum) && sidNum.ToString().Length == 9)
sid = sidNum.ToString();
else
throw new Exception("SID가 숫자가 아니거나 9자리 숫자가 아닙니다.");
lot = _lot;
mfg = _mfgdate;
qty = _qty;
id = _id;
partnum = _partnum;
manu = _manu;
}
public Reel(string qrbarcodestr)
{
var spData = qrbarcodestr.Split(';');
if (spData.Length < 6)
throw new Exception("Barcode Length가 적습니다.");
sid = spData[0];
lot = spData[1];
manu = spData[2];
int _qty = 0;
if (int.TryParse(spData[3], out _qty))
qty = _qty;
else
throw new Exception("수량란에 숫자 정보가 아닙니다.");
id = spData[4];
mfg = spData[5];
if (spData.Length > 6) partnum = spData[6];
else partnum = string.Empty;
}
}
}

View File

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 어셈블리에 대한 일반 정보는 다음 특성 집합을 통해
// 제어됩니다. 어셈블리와 관련된 정보를 수정하려면
// 이러한 특성 값을 변경하세요.
[assembly: AssemblyTitle("StdLabelPrint")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("StdLabelPrint")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// ComVisible을 false로 설정하면 이 어셈블리의 형식이 COM 구성 요소에
// 표시되지 않습니다. COM에서 이 어셈블리의 형식에 액세스하려면
// 해당 형식에 대해 ComVisible 특성을 true로 설정하세요.
[assembly: ComVisible(false)]
// 이 프로젝트가 COM에 노출되는 경우 다음 GUID는 typelib의 ID를 나타냅니다.
[assembly: Guid("b18d3b96-2fdf-4ed9-9a49-d9b8cee4ed6d")]
// 어셈블리의 버전 정보는 다음 네 가지 값으로 구성됩니다.
//
// 주 버전
// 부 버전
// 빌드 번호
// 수정 버전
//
// 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 번호를
// 기본값으로 할 수 있습니다.
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,80 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 이 코드는 도구를 사용하여 생성되었습니다.
// 런타임 버전:4.0.30319.42000
//
// 파일 내용을 변경하면 잘못된 동작이 발생할 수 있으며, 코드를 다시 생성하면
// 이러한 변경 내용이 손실됩니다.
// </auto-generated>
//------------------------------------------------------------------------------
namespace StdLabelPrint.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.8.1.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute(@"^XA~TA000~JSN^LT0^MNW^MTT^PON^PMN^LH0,0^JMA^PR6,6~SD15^JUS^LRN^CI0^XZ
^XA
^MMT
^PW519
^LL0200
^LS25
^FO205,5^GB305,186,4^FS
^FT25,170^BQN,2,4
^FDLA,
{qrData}
^FS
^FO205,9^GB0,183,4^FS
^FO250,9^GB0,183,4^FS
^FO209,34^GB299,0,4^FS
^FO209,65^GB299,0,4^FS
^FO207,95^GB300,0,4^FS
^FO207,126^GB303,0,4^FS
^FT211,30^A0N,23,24^FDSID^FS
^FT210,59^A0N,23,24^FDLOT^FS
^FT215,91^A0N,23,24^FDPN^FS
^FT212,153^A0N,23,24^FDRID^FS
^FT210,120^A0N,23,24^FDQ'ty^FS
^FT260,31^A0N,23,24^FD
{sid}
^FS
^FT260,60^A0N,23,24^FD
{lot}
^FS
^FT258,93^A0N,27,16^FD
{partnum}
^FS
^FT256,150^A0N,21,19^FD
{rid}
^FS
^FT259,121^A0N,23,24^FD
{qty}
^FS
^FO207,157^GB303,0,4^FS
^FT212,182^A0N,20,19^FDDate^FS
^FT260,183^A0N,23,24^FD
{mfg}
^FS
^PQ1,0,1,Y^XZ")]
public string zpl {
get {
return ((string)(this["zpl"]));
}
set {
this["zpl"] = value;
}
}
}
}

View File

@@ -0,0 +1,51 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="StdLabelPrint.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="zpl" Type="System.String" Scope="User">
<Value Profile="(Default)">^XA~TA000~JSN^LT0^MNW^MTT^PON^PMN^LH0,0^JMA^PR6,6~SD15^JUS^LRN^CI0^XZ
^XA
^MMT
^PW519
^LL0200
^LS25
^FO205,5^GB305,186,4^FS
^FT25,170^BQN,2,4
^FDLA,
{qrData}
^FS
^FO205,9^GB0,183,4^FS
^FO250,9^GB0,183,4^FS
^FO209,34^GB299,0,4^FS
^FO209,65^GB299,0,4^FS
^FO207,95^GB300,0,4^FS
^FO207,126^GB303,0,4^FS
^FT211,30^A0N,23,24^FDSID^FS
^FT210,59^A0N,23,24^FDLOT^FS
^FT215,91^A0N,23,24^FDPN^FS
^FT212,153^A0N,23,24^FDRID^FS
^FT210,120^A0N,23,24^FDQ'ty^FS
^FT260,31^A0N,23,24^FD
{sid}
^FS
^FT260,60^A0N,23,24^FD
{lot}
^FS
^FT258,93^A0N,27,16^FD
{partnum}
^FS
^FT256,150^A0N,21,19^FD
{rid}
^FS
^FT259,121^A0N,23,24^FD
{qty}
^FS
^FO207,157^GB303,0,4^FS
^FT212,182^A0N,20,19^FDDate^FS
^FT260,183^A0N,23,24^FD
{mfg}
^FS
^PQ1,0,1,Y^XZ</Value>
</Setting>
</Settings>
</SettingsFile>

View File

@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{B18D3B96-2FDF-4ED9-9A49-D9B8CEE4ED6D}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>StdLabelPrint</RootNamespace>
<AssemblyName>StdLabelPrint</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="CAmkorSTDBarcode.cs" />
<Compile Include="Def.cs" />
<Compile Include="LabelPrint.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="StdLabelPrint.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<userSettings>
<StdLabelPrint.Properties.Settings>
<setting name="zpl" serializeAs="String">
<value>^XA~TA000~JSN^LT0^MNW^MTT^PON^PMN^LH0,0^JMA^PR6,6~SD15^JUS^LRN^CI0^XZ
^XA
^MMT
^PW519
^LL0200
^LS25
^FO205,5^GB305,186,4^FS
^FT25,170^BQN,2,4
^FDLA,
{qrData}
^FS
^FO205,9^GB0,183,4^FS
^FO250,9^GB0,183,4^FS
^FO209,34^GB299,0,4^FS
^FO209,65^GB299,0,4^FS
^FO207,95^GB300,0,4^FS
^FO207,126^GB303,0,4^FS
^FT211,30^A0N,23,24^FDSID^FS
^FT210,59^A0N,23,24^FDLOT^FS
^FT215,91^A0N,23,24^FDPN^FS
^FT212,153^A0N,23,24^FDRID^FS
^FT210,120^A0N,23,24^FDQ'ty^FS
^FT260,31^A0N,23,24^FD
{sid}
^FS
^FT260,60^A0N,23,24^FD
{lot}
^FS
^FT258,93^A0N,27,16^FD
{partnum}
^FS
^FT256,150^A0N,21,19^FD
{rid}
^FS
^FT259,121^A0N,23,24^FD
{qty}
^FS
^FO207,157^GB303,0,4^FS
^FT212,182^A0N,20,19^FDDate^FS
^FT260,183^A0N,23,24^FD
{mfg}
^FS
^PQ1,0,1,Y^XZ</value>
</setting>
</StdLabelPrint.Properties.Settings>
</userSettings>
</configuration>

View File

@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
namespace UIControl
{
public class CIcon
{
public string Text { get; set; }
public string Tag { get; set; }
public RectangleF Rect { get; set; }
public Boolean Focus { get; set; }
public Boolean Select { get; set; }
public CIcon() : this(string.Empty, RectangleF.Empty) { }
public CIcon(string tag,RectangleF rect)
{
Text = string.Empty;
Tag = tag;
Rect = rect;
}
public float X { get { return Rect.X; } }
public float Y { get { return Rect.Y; } }
public float W { get { return Rect.Width; } }
public float H { get { return Rect.Height; } }
}
}

View File

@@ -0,0 +1,158 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
namespace UIControl
{
[Serializable]
public class CItem
{
public Boolean Delete { get; set; }
/// <summary>
/// 어떠한 포트에서 픽업 되었는지
/// </summary>
public int iPort { get; set; }
/// <summary>
/// 출력 포트
/// </summary>
public int oPort { get; set; }
/// <summary>
/// 배출여부
/// </summary>
public int ErrorOut { get; set; }
/// <summary>
/// 크기는 어떠한지(7 or 13)
/// </summary>
public string Size { get; set; }
/// <summary>
/// 존번호 0~10
/// </summary>
public int index { get; set; }
/// <summary>
/// 피커에의해서 드랍된 시간
/// </summary>
public DateTime DropTime { get; set; }
/// <summary>
/// 차수별 일련번호
/// </summary>
public UInt16 Seq { get; set; }
public DateTime BarcodeStart { get; set; }
public DateTime BarcodeEnd { get; set; }
public DateTime PlcStartTime { get; set; }
public DateTime PlcEndTime { get; set; }
public DateTime ZoneIntime { get; set; }
/// <summary>
/// 컨베이어에 들어온 시간
/// 피커에서 드랍되면 dropTime 과 동일하며, 외부에서 들어오면 센서가 최초 감지한 시간이 된다
/// </summary>
public DateTime InTime { get; set; }
public DateTime OutTime { get; set; }
public Rectangle Rect { get; set; }
/// <summary>
/// jobhistory에 연결되는 데이터 키
/// </summary>
public string JGUID { get; set; }
/// <summary>
/// 바코드 데이터와 연결되는 키값
/// </summary>
public string Tag { get; set; }
public string RID { get; set; }
public string SID { get; set; }
public string BarcodeRaw { get; set; }
public string BarcodeMsg { get; set; }
public Boolean Processing { get; set; }
public string GUID { get; private set; }
public int Qty { get; set; }
public List<string> UnloaderMsg { get; set; }
/// <summary>
/// 바코드의 완료여부, timeout 혻은 설정 되었을때 적용
/// </summary>
public Boolean BarcodeDone { get; set; }
public Boolean hasBarcode
{
get
{
return !string.IsNullOrEmpty(RID);
}
}
public void AddMessage(string msg)
{
if (this.UnloaderMsg.Contains(msg) == false)
UnloaderMsg.Add(msg);
}
public CItem()
{
Qty = 0;
UnloaderMsg = new List<string>();
ErrorOut = 0;
this.GUID = Guid.NewGuid().ToString();
Tag = string.Empty;
JGUID = string.Empty;
Seq = 0;
SID = string.Empty;
BarcodeRaw = string.Empty;
BarcodeMsg = string.Empty;
RID = string.Empty;
Rect = Rectangle.Empty;
Delete = false;
Processing = false;
DropTime = DateTime.Parse("1982-11-23");
BarcodeStart = DateTime.Parse("1982-11-23");
BarcodeEnd = DateTime.Parse("1982-11-23");
PlcStartTime = DateTime.Parse("1982-11-23");
PlcEndTime = DateTime.Parse("1982-11-23");
InTime = DateTime.Parse("1982-11-23");
OutTime = DateTime.Parse("1982-11-23");
ZoneIntime = DateTime.Parse("1982-11-23");
index = -1;
oPort = -1;
iPort = -1;
Size = string.Empty;
}
public CItem Clone()
{
var item = new CItem();
item.Qty = Qty;
item.Seq = Seq;//0;
item.SID =SID;// string.Empty;
item.BarcodeRaw = BarcodeRaw;//string.Empty;
item.BarcodeMsg = BarcodeMsg;//string.Empty;
item.RID = RID;//string.Empty;
item.Rect = Rect;//Rectangle.Empty;
item.Delete = Delete;//DropTime;//;
item.DropTime =DropTime;// DateTime.Parse("1982-11-23");
item.BarcodeStart =BarcodeStart;// DateTime.Parse("1982-11-23");
item.BarcodeEnd = BarcodeEnd;//DropTime;//.Parse("1982-11-23");
item.PlcStartTime = PlcStartTime;//DateTime.Parse("1982-11-23");
item.PlcEndTime =PlcEndTime;// DateTime.Parse("1982-11-23");
item.InTime = InTime;//DropTime;//.Parse("1982-11-23");
item.OutTime = OutTime;//DateTime.Parse("1982-11-23");
item.ZoneIntime = ZoneIntime;//DateTime.Parse("1982-11-23");
item.index = index;
item.oPort = oPort;
item.iPort = iPort;
item.Size = Size;
return item;
}
}
}

View File

@@ -0,0 +1,84 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace UIControl
{
[Serializable]
public class CMenuButton
{
public eButtonType Shape { get; set; }
public string Text { get; set; }
public string Tag { get; set; }
public Rectangle Rect { get; set; }
public Color BackColor { get; set; }
public Color ForeColor { get; set; }
public Color OverColor { get; set; }
public Color BorderColor { get; set; }
public byte BorderSize { get; set; }
public Font Font { get; set; }
public CMenuButton() : this(string.Empty, string.Empty) { }
public CMenuButton(string text, string tag)
{
Font = null;
BorderColor = Color.Black;
BorderSize = 5;
Shape = eButtonType.Rectangle;
this.Text = text;
this.Tag = tag;
BackColor = Color.White;
OverColor = Color.Gold;
ForeColor = Color.Black;
text = "Button";
}
public string menutag { get; set; }
}
[Serializable]
public class CMenu
{
public string Title { get; set; }
public string Text { get; set; }
public string Tag { get; set; }
public RectangleF Rect { get; set; }
public Boolean Focus { get; set; }
public Boolean Select { get; set; }
public eMsgIcon Icon { get; set; }
public CMenuButton[] buttons { get; set; }
public Font Font { get; set; }
public Color BackColor { get; set; }
public Color ForeColor { get; set; }
public Color BorderColor { get; set; }
/// <summary>
/// 반드시 사용자의 허가를 받아야 넘어갈 수 있는 메뉴
/// </summary>
public Boolean RequireInput { get; set; }
public CMenu() : this("Contents", "Title", "tag", eMsgIcon.Info, null) { }
public CMenu(string text_, string title_, string tag_, eMsgIcon icon_, params CMenuButton[] buttons_)
{
this.Tag = tag_;
this.Title = title_;
this.Text = text_;
this.Icon = icon_;
this.buttons = buttons_;
this.Font = new Font("맑은 고딕", 15, FontStyle.Bold);
BackColor = Color.White;
ForeColor = Color.Black;
BorderColor = Color.Orange;
RequireInput = false;
}
public float X { get { return Rect.X; } }
public float Y { get { return Rect.Y; } }
public float W { get { return Rect.Width; } }
public float H { get { return Rect.Height; } }
}
}

View File

@@ -0,0 +1,90 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
namespace UIControl
{
public class CPicker
{
/// <summary>
/// 언로드포트 위치(L/R)
/// </summary>
public string PortPos { get; set; }
/// <summary>
/// 프린트 위치(H/L)
/// </summary>
public string PrintPos { get; set; }
/// <summary>
/// 릴이 있는 경우 해당 릴이 어느 포트에서 왔는지의 번호
/// </summary>
public short PortIndex { get; set; }
/// <summary>
/// 현재 작업이 프론트 포트의 작업인가? (portindex 값을 가지고 판단함)
/// </summary>
public Boolean isFrontJob
{
get
{
if (PortIndex <= 1) return true;
else return false;
}
}
public Boolean Overload { get; set; }
/// <summary>
/// VAC센서의 값을 가지고 있음, 현재 릴이 감지되었는가?
/// </summary>
public Boolean isReelDetect
{
get
{
return VacOutput.Where(t => t == true).Count() > 0;
}
}
/// <summary>
/// PICK후 60mm위치에서 미리 확인한 감지 상태값
/// 이값을 가지고 도중에 떨궜을 상황을 감지한다
/// </summary>
public Boolean PreCheckItemOn { get; set; }
public Boolean HasRealItemOn { get; set; }
public Boolean ItemOn { get; set; }
//public Boolean[] VacDetect { get; set; }
public Boolean[] VacOutput { get; set; }
public CPicker()
{
this.Overload = false;
PortPos = "7";
PortIndex = -1;
HasRealItemOn = false;
PreCheckItemOn = false;
}
public void Clear()
{
this.Overload = false;
ItemOn = false;
PortPos = "--";
PortIndex = -1;
//if(VacDetect != null && VacDetect.Length > 0)
//{
// for (int i = 0; i < VacDetect.Length; i++)
// VacDetect[i] = false;
//}
if (VacOutput != null && VacOutput.Length > 0)
{
for (int i = 0; i < VacOutput.Length; i++)
VacOutput[i] = false;
}
}
}
}

View File

@@ -0,0 +1,482 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
namespace UIControl
{
public class CPort
{
public Boolean SaftyErr { get; set; }
//public Boolean Safty2Err { get; set; }
// public Boolean SaftyErr { get { return Safty1Err || Safty2Err; } }
public Boolean MotorRun { get; set; }
public Boolean MotorDir { get; set; }
public int arrowIndex { get; set; }
public Boolean LimitUpper { get; set; }
public Boolean LimitLower { get; set; }
public Boolean OverLoad
{
get
{
return LimitLower && DetectUp;
}
}
public byte AlignOK { get; set; }
public void AlignReset() { AlignOK = 0; errorCount = 0; }
public Boolean Ready { get; set; }
public Boolean DetectUp { get; set; } //상단에 있는 자재 감지 센서
/// <summary>
/// 7인치 13인치의 크기 정보를 표시한다
/// </summary>
public string title { get; set; }
public int reelNo { get; set; }
/// <summary>
/// 차수별 릴 작업 수량이 표시됨
/// </summary>
public int reelCount { get; set; }
public int errorCount { get; set; }
public int CartSize { get; set; }
public System.Drawing.Color bgColor { get; set; }
private Boolean _enable = false;
public Color fgColor { get; set; }
public Color fgColorCount { get; set; }
public Rectangle rect_title { get; set; }
public RectangleF Rect { get; set; }
public Rectangle rect_count { get; set; }
public int AnimationStepPort { get; set; }
/// <summary>
/// 0:notcart , 1:ready, 2:full
/// </summary>
public ushort State { get; set; }
public Boolean Enable
{
get { return _enable; }
set
{
_enable = value;
this.bgColor = value ? Color.Lime : Color.FromArgb(43, 43, 43);
this.fgColor = value ? Color.White : Color.DimGray;
}
}
public CPort()
{
CartSize = 0;
Ready = false;
Enable = false;
rect_title = Rectangle.Empty;
rect_count = Rectangle.Empty;
Rect = RectangleF.Empty;
reelNo = -1;
arrowIndex = 2;
reelCount = 0;
fgColor = Color.Black;
Clear();
AlignOK = 0;
AnimationStepPort = 9;
//Items.Clear();
}
//public void ClearItem()
//{
// Items.Clear();
//}
public void Clear()
{
CartSize = 0;
Enable = true;
SaftyErr = false;
MotorRun = false;
MotorDir = false;
LimitUpper = false;
LimitLower = false;
reelNo = 0;
reelCount = 0;
DetectUp = false;
}
public void Display(Graphics g, Font fCnt, Font fMsg, Boolean Magneton, Boolean VisionRdy, Boolean VisionEnd, Boolean ItemOn, Boolean VisionLock, int VisionCnt)
{
if (Enable == false)
{
g.DrawLine(Pens.DimGray, Rect.Left, Rect.Top, Rect.Right, Rect.Bottom);
g.DrawLine(Pens.DimGray, Rect.Right, Rect.Top, Rect.Left, Rect.Bottom);
}
//모터사용시 화살표
eDirection DirL = MotorDir == false ? eDirection.TopToBottom : eDirection.BottomToTop;
if (MotorRun) UIControl.Common.Draw_Arrow(g, Rect, DirL, arrowIndex, AnimationStepPort, Color.Gold, fMsg);
//글자표시 (크기 및 작업 수량)
var sf = new StringFormat
{
Alignment = StringAlignment.Center,
LineAlignment = StringAlignment.Center,
};
//리밋영역표시(상/하)
var limitSizeH = (int)(Rect.Height * 0.2);
if (OverLoad == true)//과적
{
g.FillRectangle(Brushes.Red, Rect);
g.DrawString("OVER\nLOAD", fMsg, new SolidBrush(fgColor), Rect, sf);
}
else
{
if (errorCount > 5)
{
g.FillRectangle(new SolidBrush(Color.FromArgb(250, Color.Gold)), Rect);
}
else
{
g.FillRectangle(new SolidBrush(Color.FromArgb(150, Color.Black)), Rect);
}
if (errorCount > 0)
{
if (errorCount > 05)
{
g.DrawString(reelCount.ToString() + "\n(ERROR)", fCnt, new SolidBrush(Color.Red), Rect, sf);
}
else g.DrawString(reelCount.ToString() + "\nE:" + errorCount.ToString(), fCnt, new SolidBrush(Color.Red), Rect, sf);
}
else
{
g.DrawString(reelCount.ToString(), fCnt, new SolidBrush(fgColor), Rect, sf);
}
}
//마그넷상태표시
var magheight = 30;
var magrect = new RectangleF(this.Rect.Left, this.Rect.Bottom - magheight, this.Rect.Width, magheight);
if (Magneton)
{
g.DrawString("LOCK(" + CartSize.ToString() + ")", new Font("Consolas", 10, FontStyle.Bold), Brushes.Gold, magrect, new StringFormat { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center });
}
else
{
g.FillRectangle(Brushes.DimGray, magrect);
g.DrawString("UNLOCK(" + CartSize.ToString() + ")", new Font("Consolas", 10, FontStyle.Bold), Brushes.Black, magrect, new StringFormat { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center });
}
//아이템을 가지고 있다면 처리해준다.
if (ItemOn)
{
magrect = new RectangleF(this.Rect.Left, this.Rect.Top, this.Rect.Width, magheight);
g.FillRectangle(Brushes.Gold, magrect);
g.DrawString("ITEM-ON", new Font("Consolas", 12, FontStyle.Bold), Brushes.Black, magrect, new StringFormat { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center });
}
//데두리표시 ( 비활성 회색, 활성 감지 : 라임, 미감지 흰색)
Color borderL = Enable ? (LimitUpper ? Color.Red : (LimitLower ? Color.Blue : (DetectUp ? Color.Lime : Color.White))) : Color.DimGray;
if (OverLoad) borderL = Color.White;
int bordersize = 7;//ortL.enable ? 7 : 1;
//비젼영역추가 201228
using (Font f = new Font("Consolas", 8, FontStyle.Bold))
{
var vrect = new RectangleF(Rect.Right, Rect.Top, 20, Rect.Height);
Color fcolor2 = Color.Gray;
var drawstr = "VISON RDY";
if (VisionEnd) { drawstr = "VISION END"; fcolor2 = Color.Lime; }
else if (VisionRdy) { drawstr = "VISION RUN"; fcolor2 = Color.Gold; };
drawstr += "(" + VisionCnt.ToString() + ")";
if (VisionLock) g.DrawRect(vrect, Color.Blue, 7);
else g.DrawRect(vrect, fcolor2, 7);
g.DrawString(drawstr, f, new SolidBrush(fcolor2), vrect, new StringFormat
{
Alignment = StringAlignment.Center,
LineAlignment = StringAlignment.Center,
FormatFlags = StringFormatFlags.DirectionVertical
});
vrect = new RectangleF(Rect.Left - 20, Rect.Top, 20, Rect.Height);
fcolor2 = Color.Gray;
drawstr = "PORT RDY(" + this.AlignOK.ToString() + ")";
if (Ready) fcolor2 = Color.Lime;
g.DrawRect(vrect, fcolor2, 7);
g.DrawString(drawstr, f, new SolidBrush(fcolor2), vrect, new StringFormat
{
Alignment = StringAlignment.Center,
LineAlignment = StringAlignment.Center,
FormatFlags = StringFormatFlags.DirectionVertical
});
}
if (OverLoad == false)
{
var fontsize = 9;
using (Font fnt = new Font("Consolas", fontsize, FontStyle.Bold))
{
//상단 리밋은 상단에
if (LimitUpper)
{
var msgLU = "+ LIMIT";
var fsize = g.MeasureString(msgLU, fnt);
var msgW = fsize.Width * 1.5f;
var msgH = fsize.Height * 1.5f;
if (msgW > this.Rect.Width * 0.70f) msgW = this.Rect.Width * 0.7f;
var RectMsgL = new RectangleF(
Rect.Left + (Rect.Width - msgW) / 2.0f,
Rect.Top - msgH - bordersize / 2.0f + 1,
msgW, msgH);
g.FillRectangle(new SolidBrush(Color.FromArgb(250, Color.Red)), RectMsgL);
// g.DrawRectangle(Pens.Black, RectMsgL);
g.DrawString(msgLU, fnt, Color.White, RectMsgL);
}
//아이템 감지신호는 상단 아래쪽으로
if (Ready)
{
//var msgLU = "READY";
//var fsize = g.MeasureString(msgLU, fnt);
//var msgW = fsize.Width * 1.5f;
//var msgH = fsize.Height * 1.5f;
//if (msgW > this.Rect.Width * 0.70f) msgW = this.Rect.Width * 0.7f;
//var RectMsgL = new RectangleF(
//Rect.Left + (Rect.Width - msgW) / 2.0f,
//Rect.Top + bordersize / 2.0f - 1,
//msgW, msgH);
//g.FillRectangle(new SolidBrush(Color.FromArgb(250, Color.Lime)), RectMsgL);
//// g.DrawRectangle(Pens.Black, RectMsgL);
//g.DrawString(msgLU, fnt, Color.Black, RectMsgL);
}
//하단 리밋은 하단에표시
if (LimitLower)
{
var msgLU = "- LIMIT";
var fsize = g.MeasureString(msgLU, fnt);
var msgW = fsize.Width * 1.5f;
var msgH = fsize.Height * 1.5f;
if (msgW > this.Rect.Width * 0.70f) msgW = this.Rect.Width * 0.7f;
var RectMsgL = new RectangleF(
Rect.Left + (Rect.Width - msgW) / 2.0f,
Rect.Top - msgH - bordersize / 2.0f + 1,
msgW, msgH);
g.FillRectangle(new SolidBrush(Color.FromArgb(250, Color.Blue)), RectMsgL);
//g.DrawString(msgLU, fnt, Brushes.White, RectMsgL, sf);
g.DrawString(msgLU, fnt, Color.White, RectMsgL);
}
//아이템 감지
if (DetectUp)
{
var msgLU = "DETECT";
var fsize = g.MeasureString(msgLU, fnt);
var msgW = fsize.Width * 1.5f;
var msgH = fsize.Height * 1.5f;
if (msgW > this.Rect.Width * 0.70f) msgW = this.Rect.Width * 0.7f;
var RectMsgL = new RectangleF(
Rect.Left + (Rect.Width - msgW) / 2.0f,
Rect.Bottom + 1,
msgW, msgH);
g.FillRectangle(new SolidBrush(Color.FromArgb(250, Color.Lime)), RectMsgL);
//g.DrawRectangle(Pens.Black, RectMsgL);
g.DrawString(msgLU, fnt, Color.Black, RectMsgL);
}
//안전 오류는 중앙에
if (SaftyErr)
{
var msgS = "SAFTY ERROR";
var fsize = g.MeasureString(msgS, fMsg);
var msgW = fsize.Width * 1.5f;
var msgH = fsize.Height * 1.5f;
if (msgW > this.Rect.Width * 0.80f) msgW = this.Rect.Width * 0.8f;
var RectMsgL = new RectangleF(
Rect.Left + (Rect.Width - msgW) / 2.0f,
Rect.Top + (Rect.Height - msgH) / 2.0f,
msgW, msgH);
g.FillRectangle(new SolidBrush(Color.FromArgb(240, Color.Khaki)), RectMsgL);
g.DrawRectangle(Pens.Black, RectMsgL);
g.DrawString(msgS, fMsg, Color.Maroon, RectMsgL);
}
}
}
//테두리가 리밋영역을 감추도록 그린다
g.DrawRectangle(new Pen(borderL, bordersize), Rect.Left, Rect.Top, Rect.Width, Rect.Height);
sf.Dispose();
}
public void DisplayConv(Graphics g, Font fCnt, Font fMsg, Boolean Magneton, Boolean VisionRdy, Boolean VisionEnd, Boolean ItemOn, Boolean VisionLock, int VisionCnt, bool cvbusy, bool cvreadyoff)
{
if (Enable == false)
{
g.DrawLine(Pens.DimGray, Rect.Left, Rect.Top, Rect.Right, Rect.Bottom);
g.DrawLine(Pens.DimGray, Rect.Right, Rect.Top, Rect.Left, Rect.Bottom);
}
//모터사용시 화살표
eDirection DirL = MotorDir == false ? eDirection.TopToBottom : eDirection.BottomToTop;
if (MotorRun) UIControl.Common.Draw_Arrow(g, Rect, DirL, arrowIndex, AnimationStepPort, Color.Gold, fMsg);
//글자표시 (크기 및 작업 수량)
var sf = new StringFormat
{
Alignment = StringAlignment.Center,
LineAlignment = StringAlignment.Center,
};
//리밋영역표시(상/하)
var limitSizeH = (int)(Rect.Height * 0.2);
if (errorCount > 5)
{
g.FillRectangle(new SolidBrush(Color.FromArgb(250, Color.Gold)), Rect);
}
else
{
if (cvbusy)
g.FillRectangle(new SolidBrush(Color.FromArgb(150, Color.Tomato)), Rect);
if (cvreadyoff)
g.FillRectangle(new SolidBrush(Color.FromArgb(150, Color.Red)), Rect);
else
g.FillRectangle(new SolidBrush(Color.FromArgb(150, Color.Black)), Rect);
}
if (reelCount != 0)
{
//버튼형태처럼 보이게한다.
g.FillRectangle(new SolidBrush(Color.FromArgb(100, Color.Gold)), Rect);
g.DrawRectangle(new Pen(Color.WhiteSmoke, 5), Rect.Left, Rect.Top, Rect.Width, Rect.Height);
}
if (errorCount > 0)
{
if (errorCount > 05)
{
g.DrawString(reelCount.ToString() + "\n(ERROR)", fCnt, new SolidBrush(Color.Red), Rect, sf);
}
else g.DrawString(reelCount.ToString() + "\nE:" + errorCount.ToString(), fCnt, new SolidBrush(Color.Red), Rect, sf);
}
else if (reelCount > 0)
{
g.DrawString(reelCount.ToString(), fCnt, new SolidBrush(fgColor), Rect, sf);
}
//마그넷상태표시
var magheight = 30;
var magrect = new RectangleF(this.Rect.Left, this.Rect.Bottom - magheight, this.Rect.Width, magheight);
//if (Magneton)
//{
// g.DrawString("LOCK(" + CartSize.ToString() + ")", new Font("Consolas", 10, FontStyle.Bold), Brushes.Gold, magrect, new StringFormat { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center });
//}
//else
//{
// g.FillRectangle(Brushes.DimGray, magrect);
// g.DrawString("UNLOCK(" + CartSize.ToString() + ")", new Font("Consolas", 10, FontStyle.Bold), Brushes.Black, magrect, new StringFormat { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center });
//}
//아이템을 가지고 있다면 처리해준다.
if (ItemOn)
{
magrect = new RectangleF(this.Rect.Left, this.Rect.Top, this.Rect.Width, magheight);
g.FillRectangle(Brushes.Gold, magrect);
g.DrawString("ITEM-ON", new Font("Consolas", 12, FontStyle.Bold), Brushes.Black, magrect, new StringFormat { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center });
}
//데두리표시 ( 비활성 회색, 활성 감지 : 라임, 미감지 흰색)
Color borderL = Enable ? Color.White : Color.DimGray;
//if (OverLoad) borderL = Color.White;
int bordersize = 7;//ortL.enable ? 7 : 1;
//비젼영역추가 201228
using (Font f = new Font("Consolas", 8, FontStyle.Bold))
{
var vrect = new RectangleF(Rect.Right, Rect.Top, 20, Rect.Height);
Color fcolor2 = Color.Gray;
var drawstr = "VISON RDY";
if (VisionEnd) { drawstr = "VISION END"; fcolor2 = Color.Lime; }
else if (VisionRdy) { drawstr = "VISION RUN"; fcolor2 = Color.Gold; };
drawstr += "(" + VisionCnt.ToString() + ")";
if (VisionLock) g.DrawRect(vrect, Color.Blue, 7);
else g.DrawRect(vrect, fcolor2, 7);
g.DrawString(drawstr, f, new SolidBrush(fcolor2), vrect, new StringFormat
{
Alignment = StringAlignment.Center,
LineAlignment = StringAlignment.Center,
FormatFlags = StringFormatFlags.DirectionVertical
});
vrect = new RectangleF(Rect.Left - 20, Rect.Top, 20, Rect.Height);
fcolor2 = Color.Gray;
drawstr = "EXT RDY";
if (cvreadyoff) fcolor2 = Color.Red;
else if (Ready) fcolor2 = Color.Lime;
g.DrawRect(vrect, fcolor2, 7);
g.DrawString(drawstr, f, new SolidBrush(fcolor2), vrect, new StringFormat
{
Alignment = StringAlignment.Center,
LineAlignment = StringAlignment.Center,
FormatFlags = StringFormatFlags.DirectionVertical
});
}
//테두리가 리밋영역을 감추도록 그린다
if (reelCount == 0)
{
g.DrawRectangle(new Pen(borderL, bordersize), Rect.Left, Rect.Top, Rect.Width, Rect.Height);
}
sf.Dispose();
}
}
}

View File

@@ -0,0 +1,126 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
namespace UIControl
{
public static class Common
{
public static void Draw_Arrow(Graphics g, RectangleF rect, eDirection dir, int arrowindex, int animstep, Color basecolor,Font f )
{
//컨베어 RUN 표시기 표시
var paddingX = rect.Height * 0.15f; //상하단에 이만큼의 여백을 준다
var paddingY = rect.Height * 0.15f;
var sigHeight = rect.Height - (paddingX * 2.0f);
var sigWidth = rect.Width / animstep;
if (dir == eDirection.BottomToTop || dir == eDirection.TopToBottom)
{
paddingX = rect.Width * 0.15f;
paddingY = rect.Height / 10.0f;
sigWidth = rect.Width - (paddingX * 2.0f);
sigHeight = rect.Height / 4.5f;
}
List<PointF> pts = new List<PointF>();
//사각영역을 표시해준다.
//if (dir == eDirection.LeftToRight || dir == eDirection.RightToLeft)
//{
// var rect2width = rect.Width / animstep;
// for (int i = 0; i < animstep; i++)
// {
// var rect2 = new RectangleF(rect.X + i * rect2width, rect.Y, rect2width, rect.Height);
// g.DrawRectangle(new Pen(Color.FromArgb(100, Color.Gray)), rect2.Left, rect2.Top, rect2.Width, rect2.Height);
// g.DrawString(i.ToString(), this.Font, Brushes.White, rect2.Left, rect2.Top);
// }
//}
//else
//{
// var rect2width = rect.Height / animstep;
// for (int i = 0; i < animstep; i++)
// {
// var rect2 = new RectangleF(rect.X, rect.Y + i * rect2width, rect.Width, rect2width);
// g.DrawRectangle(new Pen(Color.FromArgb(100, Color.Gray)), rect2.Left, rect2.Top, rect2.Width, rect2.Height);
// g.DrawString(i.ToString(), this.Font, Brushes.White, rect2.Left, rect2.Top);
// }
//}
var bX = rect.X + paddingX;
var bY = rect.Y + paddingY;
if (dir == eDirection.LeftToRight)
{
var gridSize = rect.Width / animstep;
pts.Add(new PointF(rect.X + paddingX + (arrowindex * sigWidth), rect.Y + paddingX));
pts.Add(new PointF(rect.X + paddingX + (arrowindex * sigWidth) + sigWidth, rect.Y + paddingX));
pts.Add(new PointF(rect.X + paddingX + (arrowindex * sigWidth) + sigWidth * 2.0f, rect.Y + paddingX + sigHeight / 2.0f));
pts.Add(new PointF(rect.X + paddingX + (arrowindex * sigWidth) + sigWidth, rect.Y + paddingX + sigHeight));
pts.Add(new PointF(rect.X + paddingX + (arrowindex * sigWidth), rect.Y + paddingX + sigHeight));
pts.Add(new PointF(rect.X + paddingX + (arrowindex * sigWidth) + sigWidth, rect.Y + paddingX + sigHeight / 2.0f));
}
else if (dir == eDirection.RightToLeft)
{
var gridSize = rect.Width / animstep;
paddingY = rect.Height * 0.1f; //상,하 여백을 10%크기로 한다
sigHeight = rect.Height - paddingY * 2.0f;
bX = rect.X + ((animstep - 1) - arrowindex) * gridSize;
bY = rect.Y + paddingY;
pts.Add(new PointF(bX, bY));
pts.Add(new PointF(bX - gridSize, bY + sigHeight / 2.0f));
pts.Add(new PointF(bX, bY + sigHeight));
pts.Add(new PointF(bX + gridSize, bY + sigHeight));
pts.Add(new PointF(bX, bY + sigHeight / 2.0f));
pts.Add(new PointF(bX + gridSize, bY));
}
else if (dir == eDirection.TopToBottom)
{
var gridSize = rect.Height / animstep;
paddingX = rect.Width * 0.2f; //상,하 여백을 10%크기로 한다
sigWidth = rect.Width - paddingX * 2.0f;
bX = rect.X + paddingX;
bY = rect.Y + (arrowindex + 1) * gridSize;
pts.Add(new PointF(bX, bY));
pts.Add(new PointF(bX + (sigWidth / 2.0f), bY + gridSize));
pts.Add(new PointF(bX + sigWidth, bY));
pts.Add(new PointF(bX + sigWidth, bY - gridSize));
pts.Add(new PointF(bX + (sigWidth / 2.0f), bY));
pts.Add(new PointF(bX, bY - gridSize));
}
else if (dir == eDirection.BottomToTop)
{
var gridSize = rect.Height / animstep;
paddingX = rect.Width * 0.2f; //상,하 여백을 10%크기로 한다
sigWidth = rect.Width - paddingX * 2.0f;
bX = rect.X + paddingX;
bY = rect.Y + ((animstep - 1) - arrowindex) * gridSize;
pts.Add(new PointF(bX, bY));
pts.Add(new PointF(bX + (sigWidth / 2.0f), bY - gridSize));
pts.Add(new PointF(bX + sigWidth, bY));
pts.Add(new PointF(bX + sigWidth, bY + gridSize));
pts.Add(new PointF(bX + (sigWidth / 2.0f), bY));
pts.Add(new PointF(bX, bY + gridSize));
}
if (pts.Count > 0)
{
g.FillPolygon(new SolidBrush(Color.FromArgb(10, basecolor)), pts.ToArray());
g.DrawPolygon(new Pen(Color.FromArgb(100, basecolor)), pts.ToArray());
}
//g.DrawString(arrowindex.ToString(), f, Brushes.Yellow, rect.Left, rect.Top - 20);
}
}
}

View File

@@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace UIControl
{
public enum eMsgIcon
{
None,
Info,
Alert,
Error,
Help
}
public enum eButtonType
{
Rectangle = 0,
Circle,
}
public enum eDirection
{
LeftToRight,
RightToLeft,
BottomToTop,
TopToBottom
}
public partial class HMI
{
enum eAxis : byte
{
Y_P = 0,
Z_F,
Z_R,
X_F,
X_R,
}
public enum eScean : byte
{
Nomal = 0,
MotHome,
xmove,
}
}
}

View File

@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace UIControl
{
public partial class HMI
{
public class MessageArgs : EventArgs
{
public string Message { get; set; }
public Boolean isError { get; set; }
public MessageArgs(string m, Boolean err)
{
this.Message = m;
this.isError = err;
}
}
public event EventHandler<MessageArgs> Message;
}
}

1469
Handler/Sub/UIControl/HMI.cs Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,95 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Windows.Forms;
namespace UIControl
{
public partial class HMI
{
void Draw_PickerPrinter(Graphics g, RectangleF rect,
int motAxisY, int motAxisZ, bool reverse,
Boolean LockY, Boolean LockZ, Boolean ItemOn, Boolean ItemPickOK,
Boolean CylFW, Boolean CylBW)
{
//실제 로봇의 길이를 입력한다 (단위:mm)
var RealLenY = 400;
var RealLenZ = 250;
g.FillRectangle(Brushes.DimGray, rect);
if (LockY) g.DrawRect(rect, Color.Blue, 5);
else g.DrawRect(rect, Color.White);
var PXName = motAxisY == 2 ? arMotPosNameLM : arMotPosNameRM;
g.DrawString(PXName, this.arFont_MotPosName, Brushes.Black, rect, new StringFormat { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center, FormatFlags = StringFormatFlags.DirectionVertical });
var RPosY = this.arMotorPosition[motAxisY];
var RPosZ = this.arMotorPosition[motAxisZ];
//RPosY = 0;
//RPosZ = 300;
//모터의 실제 위치에 뭉치를 그린다.
var PosY = (float)(rect.Top + (rect.Height - (rect.Height * RPosY / RealLenY)));
//Y뭉치를 그린다
var rectYP = new RectangleF(rect.X - 1, PosY - (rect.Width / 2.0f), rect.Width + 2, rect.Width);
g.FillRectangle(Brushes.Yellow, rectYP);
g.DrawRect(rectYP, Color.Black, 2);
//g.DrawLine(Pens.Red, rect.X - 30, PosY, rect.Right + 130, PosY);
//Z축을 그린다.
RectangleF rectZ = RectangleF.Empty;
var zwidth = 60;
if (reverse) rectZ = new RectangleF(rect.X - zwidth, PosY - 10, zwidth, 20);
else rectZ = new RectangleF(rect.Right, PosY - 10, zwidth, 20);
float PosZ = 0f;
if (reverse) PosZ = (float)(rectZ.Left + rectZ.Width - (rectZ.Width * RPosZ / RealLenZ));
else PosZ = (float)(rectZ.Left + rectZ.Width * RPosZ / RealLenZ);
g.FillRectangle(Brushes.DimGray, rectZ);
if (LockZ) g.DrawRect(rectZ, Color.Blue, 5);
else g.DrawRect(rectZ, Color.White);
//z축 포지션 이름
var ZposName = motAxisZ == 3 ? arMotPosNameLZ : arMotPosNameRZ;
g.DrawString(ZposName, this.arFont_MotPosName, Brushes.Black, rectZ, new StringFormat { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center });
//var CylStr = string.Format("FW:{0},BW:{1}", CylFW, CylBW);
//if (CylFW == true && CylFW != CylBW) CylStr = "FW";
//else if (CylBW == true && CylFW != CylBW) CylStr = "BW";
//g.DrawString(CylStr, this.arFont_MotPosName, Brushes.Red, rectZ.Left, rectZ.Top - 20);
//Z뭉치를 그린다
var rectZP = new RectangleF(PosZ - (rectZ.Height / 2.0f), rectZ.Y - 1, rectZ.Height, rectZ.Height + 2);
if (ItemOn)
{
g.FillRectangle(Brushes.Lime, rectZP);
g.DrawRect(rectZP, Color.Black, 2);
}
else
{
g.FillRectangle(Brushes.SkyBlue, rectZP);
g.DrawRect(rectZP, Color.Black, 2);
}
using (Font f = new Font("Consolas", 10, FontStyle.Bold))
g.DrawString((ItemPickOK ? "O" : "X"), f, Brushes.Black, rectZP, new StringFormat
{
Alignment = StringAlignment.Center,
LineAlignment = StringAlignment.Center
});
//g.DrawLine(Pens.Blue, PosZ, rectZ.Top - 30, PosZ, rectZ.Bottom + 100);
}
}
}

View File

@@ -0,0 +1,237 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Windows.Forms;
namespace UIControl
{
public partial class HMI
{
void Draw_PickerY(Graphics g, RectangleF rect)
{
//return;
//전체영역의 80% 영역에 Y-로봇의 축을 그린다.
//var motorMax = 400; //전체 가동 길이 400mm
var cx = rect_main.Left + rect_main.Width / 2.0f;
var cy = rect_main.Top + rect_main.Height * 0.2f;// / 2.0f - 200;
//모터길이가 설정되지않았따면 600으로 설정한다
if (this.arMotorLengthY == 0) this.arMotorLengthY = 600;
var motYPosX = rect.Left + (rect.Width * ((arMotorPosition[0] + 1) / (this.arMotorLengthY * 1.0f)));
//g.DrawString(arMotorPositionYP.ToString() + "/" + motYPosX.ToString(), this.Font, Brushes.Red, 100, 100);
//Y축 모터의 현재위치를 표시한다
g.DrawLine(new Pen(Color.SteelBlue, 10), (float)motYPosX, rect.Top, (float)motYPosX, rect.Bottom);
g.DrawLine(new Pen(Color.Black, 1), (float)motYPosX, rect.Top - 5, (float)motYPosX, rect.Bottom + 5);
//Y축 모터의 영역을 표시한다.
// g.DrawRect(rect_picker, Color.White, 3);
if(arPickerSafeZone) g.FillRectangle(Brushes.Lime, rect_picker);
else g.FillRectangle(Brushes.DimGray, rect_picker);
g.DrawString(arMotPosNamePX, arFont_MotPosName, Brushes.Gray, rect_picker, new StringFormat
{
Alignment = StringAlignment.Near,
LineAlignment = StringAlignment.Center
});
if (arMotILockPKX) g.DrawRect(rect_picker, Color.Blue, 5);
else g.DrawRect(rect_picker, Color.FromArgb(50, 50, 50), 3);
//중앙에 Safty Zone 글자 표시함
if(arPickerSafeZone)
{
g.DrawString("PICKER X - SAFETY ZONE", new Font("Consolas",12, FontStyle.Bold), Brushes.Black, rect_picker, new StringFormat
{
Alignment = StringAlignment.Center,
LineAlignment = StringAlignment.Center
});
}
//Z축 모터의 영역 계산
var motZLPosX = motYPosX;
// var motZRPosX = motYPosX + CvtMMtoPX_W(motZSpaceMM / 2, 0);
var motZPosY = rect.Top - CvtMMtoPX_H(50, 0); //Y축하단에서 50mm 아래에 Z축을 표시한다.
var motZHMm = 300;
var motZhPx = CvtMMtoPX_H(motZHMm, 0); //
var motZwPx = rect.Height;
rect_zlaxis = new RectangleF((float)(motZLPosX - motZwPx / 2.0), (float)motZPosY, motZwPx, (float)motZhPx);
// rect_zraxis = new RectangleF((float)(motZRPosX - motZwPx / 2.0), (float)motZPosY, motZwPx, (float)motZhPx);
//현재위치를 표시하는 영역생성
var zlSize = g.MeasureString("UNKNOWN", this.Font);
var zrSize = g.MeasureString("UNKNOWN", this.Font);
var zSizeW = Math.Max(zlSize.Width, zrSize.Width);
var zSizeH = Math.Max(zlSize.Height, zrSize.Height);
var rect_zlposname = new RectangleF(
rect_zlaxis.Left + (rect_zlaxis.Width - zSizeW) / 2.0f,
rect_zlaxis.Top - zSizeH + 5,
zSizeW,
zSizeH);
g.FillRectangle(Brushes.DimGray, rect_zlaxis);
//테두리
if (arMotILockPKZ == true) g.DrawRect(rect_zlaxis, Color.Blue, 5);
else g.DrawRect(rect_zlaxis, Color.DimGray, 3);
g.FillRectangle(Brushes.DimGray, rect_zlposname);
if (arMotILockPKZ == true) g.DrawRect(rect_zlposname, Color.Blue, 5);
else g.DrawRect(rect_zlposname, Color.DimGray, 3);
//피커Z축위치 표시
g.DrawString(arMotPosNamePZ, arFont_MotPosName, Brushes.Gray, rect_zlposname, new StringFormat
{
Alignment = StringAlignment.Center,
LineAlignment = StringAlignment.Center
});
//중심점 센서 확인
g.DrawLine(new Pen(Color.Black, 1), (float)motZLPosX, rect.Top - 5, (float)motZLPosX, rect.Bottom + 5);
//Z축 모터위치와 길이확인
if (this.arMotorLengthZL == 0) this.arMotorLengthZL = 600;
var motZLosY = rect_zlaxis.Top + (rect_zlaxis.Height * ((arMotorPosition[1] + 1) / (this.arMotorLengthZL * 1.0f)));
//상(Rear), 하(Front)로 영역을 그린다
var port_width = rect_picker_left.Width;// * 3f;
var port_height = rect_picker_left.Height; // rect.Height * 0.2f;
//New Front Position
var newYF = (float)(motZLPosX - port_width / 2.0);
if (newYF != rect_picker_left.X)
{
var offset = newYF - rect_picker_left.X;
this.rect_picker_left.Offset(offset, 0); //좌표가 변경되었다면 재계산
this.rect_picker_front_vac1.Offset(offset, 0);
this.rect_picker_front_vac2.Offset(offset, 0);
this.rect_picker_front_vac3.Offset(offset, 0);
this.rect_picker_front_vac4.Offset(offset, 0);
}
if (motZLosY != rect_picker_left.Y)
{
var offset = (float)(motZLosY - rect_picker_left.Y);
this.rect_picker_left.Offset(0, offset); //좌표가 변경되었다면 재계산
this.rect_picker_front_vac1.Offset(0, offset);
this.rect_picker_front_vac2.Offset(0, offset);
this.rect_picker_front_vac3.Offset(0, offset);
this.rect_picker_front_vac4.Offset(0, offset);
}
//피커 #1 Circle 색상
var Bg1 = Color.FromArgb(100, 100, 100);
var Bg2 = Color.FromArgb(160, 160, 160);
if (this.arVar_Picker[0].Overload)
{
Bg1 = Color.Tomato;
Bg2 = Color.Red;
}
else
{
if (this.arVar_Picker[0].ItemOn)
{
//if (this.arVar_Picker[0].isReelDetect)
//{
Bg1 = Color.Lime; //.FromArgb(100, 100, 100);
Bg2 = Color.Green;//.FromArgb(160, 160, 160);
//}
//else
//{
// Bg1 = Color.Magenta; //.FromArgb(100, 100, 100);
// Bg2 = Color.DarkMagenta;//.FromArgb(160, 160, 160);
//}
}
else
{
Bg1 = Color.FromArgb(100, 100, 100);
Bg2 = Color.FromArgb(160, 160, 160);
}
}
using (var br = new LinearGradientBrush(rect_picker_left, Bg1, Bg2, LinearGradientMode.Vertical))
{
g.FillEllipse(br, rect_picker_left);
}
//피커 #2 Circle 색상
if (this.arVar_Picker[1].Overload)
{
Bg1 = Color.Tomato;
Bg2 = Color.Red;
}
else
{
if (this.arVar_Picker[1].ItemOn)
{
//실제 아이템 체크
if (this.arVar_Picker[1].isReelDetect)
{
Bg1 = Color.Lime; //.FromArgb(100, 100, 100);
Bg2 = Color.Green;//.FromArgb(160, 160, 160);
}
else
{
Bg1 = Color.Magenta; //.FromArgb(100, 100, 100);
Bg2 = Color.DarkMagenta;//.FromArgb(160, 160, 160);
}
}
else
{
Bg1 = Color.FromArgb(100, 100, 100);
Bg2 = Color.FromArgb(160, 160, 160);
}
}
//피커 테두리
using (var bgPen = new Pen(Color.Black, 3))
{
var posT = arMotorPosition[6];
g.DrawEllipse(bgPen, rect_picker_left);
g.DrawString(posT.ToString("N0"), this.Font, Brushes.Black, rect_picker_left,new StringFormat { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center });
}
//피커 내부의 진공 표현
g.FillEllipse((this.arVar_Picker[0].VacOutput[0] ? brVacOn : brVacOff), rect_picker_front_vac1);
g.FillEllipse((this.arVar_Picker[0].VacOutput[1] ? brVacOn : brVacOff), rect_picker_front_vac2);
g.FillEllipse((this.arVar_Picker[0].VacOutput[2] ? brVacOn : brVacOff), rect_picker_front_vac3);
g.FillEllipse((this.arVar_Picker[0].VacOutput[3] ? brVacOn : brVacOff), rect_picker_front_vac4);
//피커설명 표시
if (arVar_Picker[0].Overload)
g.DrawString("OVL", arFont_picker, Brushes.Black, rect_picker_left, sfCenter);
else
g.DrawString(this.arVar_Picker[0].PortPos, arFont_picker, Brushes.Black, rect_picker_left, sfCenter);
//피커 진공표시 테두리 (진공출력상태에 따라서 색상을 달리 함)
g.DrawEllipse((this.arVar_Picker[0].VacOutput[0] ? penVacOn : penVacOff), rect_picker_front_vac1);
g.DrawEllipse((this.arVar_Picker[0].VacOutput[1] ? penVacOn : penVacOff), rect_picker_front_vac2);
g.DrawEllipse((this.arVar_Picker[0].VacOutput[2] ? penVacOn : penVacOff), rect_picker_front_vac3);
g.DrawEllipse((this.arVar_Picker[0].VacOutput[3] ? penVacOn : penVacOff), rect_picker_front_vac4);
}
}
}

View File

@@ -0,0 +1,37 @@
namespace UIControl
{
partial class PrintDirection
{
/// <summary>
/// 필수 디자이너 변수입니다.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 사용 중인 모든 리소스를 정리합니다.
/// </summary>
/// <param name="disposing">관리되는 리소스를 삭제해야 하면 true이고, 그렇지 않으면 false입니다.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region
/// <summary>
/// 디자이너 지원에 필요한 메서드입니다.
/// 이 메서드의 내용을 코드 편집기로 수정하지 마세요.
/// </summary>
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
}
#endregion
}
}

View File

@@ -0,0 +1,106 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace UIControl
{
public partial class PrintDirection : UserControl
{
public PrintDirection()
{
InitializeComponent();
// Set Optimized Double Buffer to reduce flickering
this.SetStyle(ControlStyles.UserPaint, true);
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);
this.SetStyle(ControlStyles.ContainerControl, false);
this.SetStyle(ControlStyles.Selectable, true);
this.Resize += Loader_Resize;
BorderColor = Color.Black;
}
[DisplayName("AR_TITLEFONT")]
public Font TitleFont { get; set; }
Boolean bRemake = true;
void Loader_Resize(object sender, EventArgs e)
{
if (this.Width < 16) this.Width = 16;
if (this.Height < 16) this.Height = 16;
bRemake = true;
}
public Color BorderColor { get; set; }
List<RectangleF> rects = new List<RectangleF>();
[DisplayName("AR_COLORS")]
public Color[] colors { get; set; }
[DisplayName("AR_TITLES")]
public string[] titles { get; set; }
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
var disprect = new Rectangle(DisplayRectangle.Left, DisplayRectangle.Top, DisplayRectangle.Width - 1, DisplayRectangle.Height - 1); ;
if (bRemake)
{
rects.Clear();
var w = (disprect.Width - 2) / 3f;
var h = (disprect.Height - 2) / 3f;
for (int i = 2; i >= 0; i--)
{
for (int j = 0; j < 3; j++)
{
var rect = new RectangleF(j * w + 2, i * h + 2, w - 2, h - 2);
rects.Add(rect);
}
}
}
for (int i = 0; i < rects.Count; i++)
{
var item = this.rects[i];
if (this.colors != null && i < this.colors.Length)
{
var color = this.colors[i];
if (color != Color.Transparent)
e.Graphics.FillRectangle(new SolidBrush(color), item);
}
//테두리 그리기
if (BorderColor != Color.Transparent)
e.Graphics.DrawRect(item, BorderColor, 1);
if (this.titles != null && i < this.titles.Length)
{
var title = this.titles[i];
if (string.IsNullOrEmpty(title) == false)
{
using (var br = new SolidBrush(this.ForeColor))
{
if (i == 4 && TitleFont != null)
e.Graphics.DrawString(title, this.TitleFont, br, rects[i], new StringFormat { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center });
else
e.Graphics.DrawString(title, this.Font, br, rects[i], new StringFormat { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center });
}
}
}
}
//전체외곽
//e.Graphics.DrawRect(disprect, Color.Black, 1);
}
public void SetColor(int idx, Color color)
{
this.colors[idx] = color;
}
}
}

View File

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 어셈블리에 대한 일반 정보는 다음 특성 집합을 통해
// 제어됩니다. 어셈블리와 관련된 정보를 수정하려면
// 이러한 특성 값을 변경하세요.
[assembly: AssemblyTitle("CapCleaningControl")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CapCleaningControl")]
[assembly: AssemblyCopyright("Copyright © 2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// ComVisible을 false로 설정하면 이 어셈블리의 형식이 COM 구성 요소에
// 표시되지 않습니다. COM에서 이 어셈블리의 형식에 액세스하려면
// 해당 형식에 대해 ComVisible 특성을 true로 설정하세요.
[assembly: ComVisible(false)]
// 이 프로젝트가 COM에 노출되는 경우 다음 GUID는 typelib의 ID를 나타냅니다.
[assembly: Guid("9264cd2e-7cf8-4237-a69f-dcda984e0613")]
// 어셈블리의 버전 정보는 다음 네 가지 값으로 구성됩니다.
//
// 주 버전
// 부 버전
// 빌드 번호
// 수정 버전
//
// 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 번호를
// 기본값으로 할 수 있습니다.
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,243 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 이 코드는 도구를 사용하여 생성되었습니다.
// 런타임 버전:4.0.30319.42000
//
// 파일 내용을 변경하면 잘못된 동작이 발생할 수 있으며, 코드를 다시 생성하면
// 이러한 변경 내용이 손실됩니다.
// </auto-generated>
//------------------------------------------------------------------------------
namespace UIControl.Properties {
using System;
/// <summary>
/// 지역화된 문자열 등을 찾기 위한 강력한 형식의 리소스 클래스입니다.
/// </summary>
// 이 클래스는 ResGen 또는 Visual Studio와 같은 도구를 통해 StronglyTypedResourceBuilder
// 클래스에서 자동으로 생성되었습니다.
// 멤버를 추가하거나 제거하려면 .ResX 파일을 편집한 다음 /str 옵션을 사용하여 ResGen을
// 다시 실행하거나 VS 프로젝트를 다시 빌드하십시오.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// 이 클래스에서 사용하는 캐시된 ResourceManager 인스턴스를 반환합니다.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("UIControl.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 이 강력한 형식의 리소스 클래스를 사용하여 모든 리소스 조회에 대해 현재 스레드의 CurrentUICulture 속성을
/// 재정의합니다.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
/// </summary>
internal static System.Drawing.Bitmap air {
get {
object obj = ResourceManager.GetObject("air", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
/// </summary>
internal static System.Drawing.Bitmap alert {
get {
object obj = ResourceManager.GetObject("alert", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
/// </summary>
internal static System.Drawing.Bitmap bcd {
get {
object obj = ResourceManager.GetObject("bcd", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
/// </summary>
internal static System.Drawing.Bitmap bg_blue {
get {
object obj = ResourceManager.GetObject("bg_blue", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
/// </summary>
internal static System.Drawing.Bitmap bg_red {
get {
object obj = ResourceManager.GetObject("bg_red", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
/// </summary>
internal static System.Drawing.Bitmap debug {
get {
object obj = ResourceManager.GetObject("debug", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
/// </summary>
internal static System.Drawing.Bitmap debug40 {
get {
object obj = ResourceManager.GetObject("debug40", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
/// </summary>
internal static System.Drawing.Bitmap emg {
get {
object obj = ResourceManager.GetObject("emg", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
/// </summary>
internal static System.Drawing.Bitmap erase {
get {
object obj = ResourceManager.GetObject("erase", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
/// </summary>
internal static System.Drawing.Bitmap error {
get {
object obj = ResourceManager.GetObject("error", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
/// </summary>
internal static System.Drawing.Bitmap help {
get {
object obj = ResourceManager.GetObject("help", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
/// </summary>
internal static System.Drawing.Bitmap icons8_pause_button_30 {
get {
object obj = ResourceManager.GetObject("icons8_pause_button_30", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
/// </summary>
internal static System.Drawing.Bitmap info {
get {
object obj = ResourceManager.GetObject("info", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
/// </summary>
internal static System.Drawing.Bitmap mot {
get {
object obj = ResourceManager.GetObject("mot", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
/// </summary>
internal static System.Drawing.Bitmap plc {
get {
object obj = ResourceManager.GetObject("plc", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
/// </summary>
internal static System.Drawing.Bitmap reel_big {
get {
object obj = ResourceManager.GetObject("reel_big", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
/// </summary>
internal static System.Drawing.Bitmap reel_small {
get {
object obj = ResourceManager.GetObject("reel_small", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
/// </summary>
internal static System.Drawing.Bitmap safty {
get {
object obj = ResourceManager.GetObject("safty", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
}
}

View File

@@ -0,0 +1,435 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="air" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAABGdBTUEAALGPC/xhBQAABXRJREFUWEft
WHlM22UYxmMeMWo8ojPxH2E6l02dqPFWsrgZ2WaWsbiLjcTEOc8tGq9t0f3hkajTMGJBEDY2GFA3xmCj
COUqpXd/pa1dyzoJjGsgx2DGxOn4fN7m/fWADtNC2WL2JE8gv/f73vf5rvd7v8ZdxqUGu91+h9VqXQQu
t1gsiS6X6xo2XVxAzFK9RdLnqN1iR0WbeL+sQ3xZeVKUNTnOwqYA7+KmMwulUnkVgud8W+UVD+cMi3sU
ZydwZWGvqGh2jpjN5sXcbeaApcx9p/RUWGHBXPDjiChudJ2TJOlJ7hp7YOZWfK3yhghZU9wrdle3itxa
t/gUS/147pDftjB7WNTpbW1er/dadhFbNJkk60MIKgsgsZjRDCxlvMPhuAUDWNJokNzJ+/v8bWhvwr6R
XcQOQogrihpc5+XAqw/0CgjazWY/jEbjbapmx8AcxaivXWLOEAksZ3NsYbRIVWklXWJ5wWmham7p1ul0
t7IpBBD0xYrC0/5ZrNbbO9kUW2i12hsRfDsJAOP58wTA9vbGkm6/wHLMKJsuDWDpC5/OG/SJS8gcFdiX
LjZdfGD2krPV7jF59l7c1097VcHm6EGbGyfyFXBTNKRlhZADWTWesfnIgbLADKQg5MJHOUx0MBgMd6u0
9sF3SzvEpoNdUZEOz3N7BvzCiGuLeygN7eMw0QMjfy81aFNPB0mc1mST6GBxmOiB5Vm182hb2ECRkA7E
S/v7haKmdQyDzp8WcQRKwnD4TWWzva9cax+NhkebnYNNRpsTS5oBX4ns+n8OjHYlcpTjcJOjZyZYq7d1
aAwSwlpzwWVYuStZykSYTKbZRSiH5mYFUsJMMAF3dNLe332Vj8Zo80DHUywpFLRPvlKdDOtkpkiFREGD
62/M5nqWFUB9ff3VWF7zB2XtYfNaLEi5cilKMTrtssh78X9+3fF/kEmSWFoAEHkdDCkYQdjbIQZ8C/xO
pXMMrC7q9Yt8MPuMwP5s9xe2ELV4XMdJifZrwAtWL5ECN9dNBqPl2Hokc1kkF7YbaO/totdXakmPWIcG
/8UNuGHoDZJZ4xF6s6WarkWOMyXguXqDWt/SNTeLC9ufhqmoqIgr0zj+kFVHykU4fRVax9CUL38GBO2g
N43sv1LnHIjDwbA/EfSwiZSJeGqq8RBCNX09x4kaWNJVVKDIvpWaX89Rcp6nN1vVuJ66wyXT8SzTOvqy
1Z6xpKBKhU4kRv8xxwkBvq9D4HJwJ/6fxZ/DAvY3X/05UKTg0T/KpsgARwlqg/3UApw2cnQ/9o3OLJnY
7AcG/+wP1R7xANptPthJg8hkU1gYTJKW9h75pL1oNEl6NkUOBNuSpgyM9ojWOcImP6hNanGgTUbNiTHM
5Fo2hwDfP/wsqIKiNwz6f8Lm8ECDRLXB9ptS4/oL/6cH35WYnc9Tgl5qlTp7H5v8wLU1P682UO7TNapQ
t46hby5sz0NUPPwuMVkspZRJ4jlhU+I+1OT8ExniTnYVHhqjZKJfA6jT1sMdNCIlnCbh75YC3NvyW/cR
XFEIUsHdQoD2379xqNPXTmYyakSarfTqE74fmigbBNvpXsYgtrKLC6NOL7nuCyoelhX0ie3lbeJ17Ce6
kuTvVNxCSAp3CwEGM0tntvyyeZzIcIwHt8E/+uRw98mBhmm7qry+juEcEmmZkQVqqMjlbhNAIsF0Ov0v
5IfOFpH8v4zHf2G9kwqFbZP5mgDavLnYR8/wu1bmPLzUPjrSLgxmqRHBb+bmkwL7biH85VXqHGeyaty+
F15OrUeodC39NACIm8NNIwMcPwYHymNae/+eOrcobDh+HoWmHQ5fo98HuVlEgM/ZEEuH5Hb+ND2gh8+M
/Xx2GVNGXNy/B7Gt3iRjVn4AAAAASUVORK5CYII=
</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="alert" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-automatic-gearbox-warning-80.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="bcd" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAABGdBTUEAALGPC/xhBQAAAsxJREFUWEft
ll1IU1EcwBdGBUFvPfRUD0VBjaAeerCHCMyHHkrXsZwhohOE2q6F835s0jUlg6h7J2rp7hJsICzQHiJI
LGePfdFLDyVEEEG9SEEguez0P/Nfzu3cfRjn+rIf/OAw/uec38O2e11lypQpEcWMBRXTWgSpQ75X++9u
x+sLo5rWC84hYo3EavD6wihmdIJ7iFgJXl8Y1Yz1cQ4QbfGBcsTycg4QbfGBmjG8g3OAaIsPZMAv+Tnn
EGHKkegpvLo45EjMzztIgClwRu+Pb8Ori6PjxthW2Pgl46D/tvPmCJWuD9C27lu0OdxHz3depWcv6efw
ytJRjFgD76JCdvXfXhoY6aWDd0K0vaeXNso9tK49TM8EtBw9kjaE160N+AO9ApcuZUegC7IZfaUY1his
ZdmwTirG6C76aPfmxeSB8VTSTb9NHaKh7jZuHNMT0N7hVWtHNaxKNWINQcQ92bTCqhGtDUZG95BEogJH
cqAJUpGadU+zyPmpw7Q52MENZNZeCO3Ebc7yc8a9DwJ/s8j4YB03jkkktQW3OA/EvWGBrxPHuXHoOI47
D8RNssC5B5W8sGUl9SuMblje4TC/Zt0N8F18+SxePceNQ2v88kHcsj5AxLXsqExJIHQZR9cHiPicHbVK
SXuIo+sDRKRyolb7/Ziub8Rx54EAH/gxIyhHj6QewfH8VHlb3zLZ+oTXp1d5fbS6vnU/k63ZZytzPrpi
S/qVKb2u991n60yamvQt8OQY5sUx4f9QwdH8iApksEiImc+OWzb0GMfyIzKQATHTuXFpfxBd34Rj9ogO
JH5tkhOXlkihozhmj+hACElmh2XYhWP2OBD4IStqRUl9gmP2iAwkUngvNwwlAe0pjtojNDCgSbywv8J3
8CKO2iMyEB5pjbwwNEEIsX0J/ofIQPY4gxD24sCeKgvgJ3DC066expEyZcqUhsv1B6iAtIhPh2shAAAA
AElFTkSuQmCC
</value>
</data>
<data name="bg_blue" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAABGdBTUEAALGPC/xhBQAAAsFJREFUeF7t
nL1uE0EUhS0QvBDvYCcVCHAQeRoXId4N1IBrRyClSiSwgR7vFoCgQHZkp4wpDUqo+Bnm7M5AFM1aa07n
OUf6uvG17ifvrKvTUBRFUZan3fl8vdnN7rXS/FkrySetJDu3mDXD7mR3K3bMtrCzW59Lq5vf2UhGJ5e+
LAZmG2l222lYPe2Dg6utNHvkB24/+WR2h3PT//DdHB3/NIPZ77UCO2E37Ihd/d72x/Ow0zFXnJb68fI2
93KTvPliBtPwF68jL6e/TPf1vNgdDpppvue01AseWy+vN/oa/JIY6I0WFySObjk9y4PL0995xS8vMDgm
dl/N/eM8rfViKd629gO4B/BTDg2NCTjYfvyxvA+7o7bTVJ1mkj3HYZgPDYyRneGpE5jtO03VsQePcXjf
vpFCw2Kk//7cPcb5xGmqjj14hsOHkx/BYTFyZF2UArMzp6k67mBwUMx4L05TdSQwjASSSCCJBJJIIIkE
kkggiQSSSCCJBJJIIIkEkkggiQSSSCCJBJJIIIkEkkggiQSSSCCJBJJIIIkEkkggiQSSSCCJBJJIIIkE
kkggiQSSSCCJBJJIIIkEkkggiQSSSCCJBJJIIIkEkkggiQSSSCCJBJJIIIkEkkggiQSSSCDJKgKL0gkU
LYQGxcjh+G/pxDenqTr2kGpPLrFa7UnZn2ceDE+Dw2JkZ1AW7zSTrO80Vcce3MJh1B2p+qmsfrrvqp+a
aX7XaaoOCrbs4Rk+gAq40NCYQJ8gXFimN3rvrjlNy4PmRnyorL9bBAfHwNO3C7OZlvV39v676fTUC5ob
vUQUkcX0OL+wu+KX909eljot9YPaSzQ3ugHFnYgWM7yR1rFXCzthN7w8/Z3n5f1XBagPmhvtkOmFgbFg
d17xsa0KLk+UD6I/zw4eW4o/22sGdhpjR7xta78wFEVRok2j8Qfk0Qty9BRILAAAAABJRU5ErkJggg==
</value>
</data>
<data name="bg_red" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAABGdBTUEAALGPC/xhBQAAAsFJREFUeF7t
nMFOE1EYhRuMvozLtok+gxq1UMDAri7EXaXs2WkpbO3MGiyKb6EriVsD9g68AwFcSa73n/mnMeROM8PZ
zT0n+XZ37uT/OnOnq9NgGIZh5ufh0a8H7ShZaUXJxHHaisyVw9YMN5PMlkzaY7MsM+v4WFrj6aLb/OzW
zUIgaUfTjmqonu6Rved+id18w5W9b/ZwMLRnvZ79s/bS2tUntUJmktlkRpk1n7sZTUeNbbugWsonl/f4
46n9+u69vVl96r1xHbl59cx+2fyQzp6JTHZUS7noa5tucPym771JCBxv9GcSm3HyQvXMjxye7oL0zJMn
z7dxSHzeHGZPYWxMqQ9L9rXNzjx5lH2bhoQ4WN77rk+h6aqm4rTi6aEslsPUt2GIfBqMMoGROVBNxXEL
f8vic/dF8m0WIknvdfYau/+Jqqk4buGlLL6u4V+Vu3K93lGB5lI1FUcXejcKmdyLaioOBfqhQBAKBKFA
EAoEoUAQCgShQBAKBKFAEAoEoUAQCgShQBAKBKFAEAoEoUAQCgShQBAKBKFAEAoEoUAQCgShQBAKBKFA
EAoEoUAQCgShQBAKBKFAEAoEoUAQCgShQBAKBKFAEAoEoUAQCgShQBAKBKFAEAoEoUAQCgShQBAKBKki
MCudWO94NwqRq7XFXOCFaiqOW8Tak1tUrD2RjkBjJ4Md72Yhsr+1mz+B+6qpOFI+KIul7ojVT1n1U1er
nxxLqqk4Wj6WyAVSAefbNCSkAiuVFxvTjH/eV03zI82NclFaf7cRbv3dj7d9+2icdwia56qnXKS5MZco
FXAhvc5/3azy5M3kxclQtVTItl2Q5ka1n56J0mImX6Q69mrJTDLbwdbo/zMvk3eXCtA80two7/9sw1DI
Zq722hZFDk8pH5T+PLfpiSP9s10zZKYTnXGp9AeDYRgm2DQa/wBGopc1FSaqkQAAAABJRU5ErkJggg==
</value>
</data>
<data name="debug" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-bug-80.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="debug40" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-bug-40.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="emg" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAABGdBTUEAALGPC/xhBQAABOJJREFUWEft
WOtvFFUUb6Ifff8HRv8AE9xZmqJsd0ZgW0BCWWp4tDxcKIK8FFsSEx/VAlXjB1NrNWpCMUSiSLR0i00w
EEHlIeq3on4UE40K2Z2ZfR/PuXvnzr0z03Vf9VNP8ktn5575nd/ce+fcc9oyb/NWwf6Khe8yDa0zHdX6
zaj2Nv79iMCv+2mMfLj7/2MQidye0sNPpPXQl2ldKyDgP5BHTKX0UDfE47dxmrkxFLYmpWu/egRUDVPX
fkkZodWcrnl2a2nrfSjsVFBQgrkyClZvHOydW8HevQ3sJ9fjPT3Ql4BcJ28uWnQvp2/MbkVaHwyaNbMr
Brk3DkPxi9MAV34EuPqTD8WpafQZBqt7ufIse97Qfr4ZXfAAD1OfkTgk+10hXhGF/OgIwKVrgaICgS+Q
f2c0aFZv1C2SL6syc3ZiA5TOnlcCFz49CdlDg2DvSoC1uRusresgs7cPskMv4+xOKEJL575Gjo2yQDaT
/0QeuoeHrd6C9pzVuxbgm8ssWOHoUbA2rlHGg2BtWA2Fj0+4Qi99z16Atkh26CXmY+qhT3jY6iwV1eLe
QA7s3QnIDOwLHKuEzMFnAC7/IESWzl+A/IcfiHH8wlfx8JWtnOekpTXCYO/YLIgagf10golzZlMWiLhe
VZ4sJ+HyQ7SEtMeIzFq3SiarHfiiucOvKF+8RyBgjlzLZcxudEKwL3XkLYUs9+ZrClmtMDseZdsjO/gi
5N8bg+LnE5B/d8zrl+Qygu1vY8Hd6FQwOxezPVOaPisEls5dgPSSVi9hs5H/s63tTi7Hb+zglx4onp4q
i5v+Cq+TYO/pk8nmBGb04RiX47e0ERoQjsvb3eV9/Uj5XsdihaxhLGtjqSsde8S9Z2gHuBy/pQxt1HGk
hOsIpPNVEDQJdt8mscetHjefmnp4hMvxGzocEwS4oYXALesFQbNgbep2+Z/aIo2Fx7kcv6FDoECaTZeg
OVAEYhXkjlUQKC+xrSxxQiJoDljS5vzVLzGW6cLxcV0Q5IaHBEGzkKWkTfy4DynvirFo+Fkux29me7hD
JqF6jkjoNJHvNwPFz04xbqp41LHQMi7Hb9TgoBP1EMyZik1nFmnPuCSNgZbU4c0NH5LHchUTNRnmoTOC
CCthJxUUxsdlooZAXEwgFg5m11JpLDzJZcxu1H3JZPmxUfG29ZRZXmSf7xd8VJnLY1TmcRmzG5U8VOU6
D9GJIqrob6+wBCuT1gKWnL+7yrjobPe0ADNVt6UpI9wlPQj2th63B8EAmef2ysR+yEcXBytYHQ78a2/v
UcbN9oUrefjqjFpDmYCOO+ftCbSPgkp+M96Jdd774jedtWrJfw0y+3epzxjaCR62eqO+VV5qgr29V22a
EJl9O9xAWKYVJ6ewnL9YbkknJhVfWlbvzCFmqMzjYWszagmR4IZMaK6IuG0n9hiU0NnYYwuhcPy4IkgA
fekZavBlLsx5v9lLtPt5uPqMRHpnkkDpITOwX/zOHNijisL0VJxMQu7Iq7jsMeVZjpmGxTlGfSu1hgFB
FNBXWkyeYQIpnQT5EGjP1b2slYxaQwxw3RtQAS519oWD2PMOBo3P1Py11mqUq6j7wmBJhDgWfcAujl/n
6ISgJDzn/37zGp2b1ENQmU5lEoqhevIYu8Z7dPD/EYncwd3nbd781tLyLxOgcrDBNHH8AAAAAElFTkSu
QmCC
</value>
</data>
<data name="erase" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAK
YQAACmEB/MxKJQAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAJrSURBVEhLvdZd
b9JQGAdwEr3wTm9M/AheqJlfxWSfQudMBnYaWarQ8WIyMBlUWoSp0CkzawWM6C5G0aiZzhfoMCZidIu6
bG5DL8yc0mMPO8cwOIUyWv/J/6aF55eekifYzMogHT424AqdoGl6H7pkfSgvn/bzYu36XVmlfNHNU3Tk
MLplXRwe7mn0zqw6pyyCuYUlIL+sgLPe6O+BS+xx9BHzA1GGnVLThTJ4UvxUh2ELrypg2BezBseomFeA
JCsg84iMn2FCfegrvacZxW3BtWMf9se2TMH10B14aSdO+a719uSdUFxTcaMorg7e3bHbPZH0yBVBlfIl
IqLX7OMyeNbwzvPz74HDw//UlsxeNFo/rnCSCgnZqjNwE9x6ME8E2jXThN+QCurgxXA/Gk8OROPizFr1
lwreLa2CnnFtyVzmp2unGfYIIlrTiP7YAvX+wx/uAtfeOZeaUbWjTiOiNe6Q4Elm5Y3vCGxs5es6GNHw
yfvPiQCp4mwJXAgmVDvD3UZEa9qhuBgXci+IUGNNQ3GN4KajuO1wQyjDCkPNPySjJeEQdWqow8uJiGiN
wx8/FJyQlneD4kLcObaNG0Jhzvu5PuGevEoa2E3fLq7Un9wZTKpDTCSLxuunP5XaM8pOvi5/XK6RBhot
PLHxRKZq9/ASGt05lDey380KpTeVz39IQzt1Y7OmLYfcmms8cRKNNJ46HhaUbvGeUByMFytfDOGmoDhG
cVNRnE44RKNTuW+mojh0IH6AhFuK4kCcCQsLxQ/b+H9Bcc6Nxg66rwqKtsfXAxPTK3C9olvWB/5Hosbi
R+F6RZd6jM32F+J393EUKic/AAAAAElFTkSuQmCC
</value>
</data>
<data name="error" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-hazard-warning-flasher-80.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="help" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-help-80.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icons8_pause_button_30" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAK
YQAACmEB/MxKJQAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAKmSURBVEhL1ZfL
bxJRFMbrwvj4a4wLXdRUXZo4vGkxtDst0MQFGKMwMB1eKdVNI9CdaNQmxkWtIQyvqRTqprU8VpZuNLFt
FOq0tbpo7ALvCbch0gsZ4Frjl3wJmTnn/HIvl3MPff+F9NZXZxi7cFnBCka1K3lf7Uzcg88KNjZwhc+c
xmH0pOFSar17Pmfwvd0YCxertsjavmPmUw1se1zeh2cGf2Z90D2fVXMJJU7rXhoucVXPi2vm6dKe/021
9jC+29YQYw4X9/QesazhkwO4TGfSuUXXSCD3zfe6QoS0s3euUhtGuTo+5cDl5EnHi89NofzuA2GHWFiO
IdcULOwg+FNctr104ym/JVz6QSrWjS2hwne09RwuT5aajV8yBhalXlbabKhlDOQkrSt2EWOaVTuhd6dX
fTIOUaf2z1VrWj79ARgY1pDKmVTBd0JKfLn0s3aoz9LBkffw7FAQ2/webArmtxln8jrGNTToSb9rtVoa
YPh16N1iFuPqYvjoWYN/YZOUAKYBBhu8C5t/dDhoeZbpkkQKBtMCm0NFSWEX+jEWTrNgvBMpH5CCwbTA
tsjqL4aN3cBY1BpRl7K/+EgMBtMC21FvR33fhbHQk5Pj9pljAqNFYmx9q2EbSMFgWmArYihZYQhj/+Hh
unZbODXky2yQgsG0wAZvZn10dOUkxtaF2mXubzcQHZ/OYFxD0DLNocI2KYkG2PSoRcsEocu/4Jn9Skzs
xZ7ZL9AuVzDmqDQuod84kduifS0OT2SrKjZ6AWPIQrPS2K2p9y1PeKe+ObUsabi4CZdvL3R3PqM1+mh5
8QkuK09aLn13ZLKHYW9ycUvrTltxuc7EOKLnUfIyGlkrssfbYL6KBrwllSN2DpfpXjCkyx3olVySwWn0
dOx/Yeirr+83SXRvTbd4pKkAAAAASUVORK5CYII=
</value>
</data>
<data name="info" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-info-80.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="mot" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAABGdBTUEAALGPC/xhBQAABF1JREFUWEft
Vt1PU2ccZtebu5gXy7Ys2TJ3vf9id5rtZhdeumQxQbaQQQnooAWhxZaPtpSV0p5+QG0nLT0gVaHGQqQF
lkgUK6UyQJSYbZmaqVkCi5ydp/m97Hh62h5LSxazJ3mSk/M+z+/39LwffateOySCX22lr317rxTCS2Uq
h3Ss+o+d9T6hFMJLZSqH/wPuF//pgDVnLJ/09bU/dwx2PyuF8KIGlSsvTp2xftxs9qdH40sCP5MqiZH4
baHFHMjUt9k/pbLlQTnCMZY9ZDnDMZYtZCXCMe47ZCXDMZYc8iDCMb5yyIMMx6g6JM6oZvP5ZRiUCknJ
jSWeGRyRVTU0cRcfFKuJcfQueE42mrw31YT7MXj1UZ3e2UG2oqAfnlYTEhnIlovmXv+MklFK6/Dkb/Ud
Tg1ZVANL54fe4ksHGciSi3qD2x2O31I0gl3c+P269oHjJH9lFAuJ9w0GzkXyXJxq6z/mjszuyI2R6ZSg
t4+u1bcNfE7SklEoJMdf/7tGZztK0lyc0HQeOufk78mNLZZApqbV/hnJ9g2syRZxTcr7oDcykEwZzRZ/
Um4UN4SHhssG1JT3EUMnaDg/Gjpdgcj0y7tNKeCggW8K2q9tXnDMbBQiNNCSbQ/ygOjZcI7z03B+fNfa
f9w7nnwhNcsD9mgDH0U8iY1f7jwV1JD3JDZt2qEjZM9CHtA7lnxRq+0vvgG/1na/Y3Jf3JKa5QHdXdHp
zNKTvQCrqafC8o3Hwu2FR1niGe/Y+F1R6zZGp4Uq4Q0qkRPQxI1vVTf2HabhwtBZAj9LzdKAg/rI9wvx
jb9Y8yUx0NzUQ+FSMCWEXfPbIJ7xDmGZDh54qUxOQK01sEBDxdFgdId5yTpkAbtPez8Ic7NrrOni7O/C
ZGh519cbW7ad5Y8a63xvgnbx2WeeSk+G0rvQMD28qIFa0oA4xhqNnhG8V4XaVvvJoej8rjwgZ4zGVmhq
8eUQzmO6wmVNCuCMV7xToZVdaOGBFzUwJg04HJ0Xas86TmZNavBNU897vZ7or9KAg+189dzV9edohPWF
KcSXI0teiJqVudhD0fNnNiRqoJY0YI/Y64TG+j5Z1EFnDS6yAho9FxxxzqyiAYhNgHWGaSV5Xgy0hb64
/FNKuHPj302FWqjJ6uusgUWSq0edwTXCrktave/+ys3Hew0wZSHn3LZNe+EtkudFp8Z1SNTuSDdM5tYT
oUXve8DqoxfJS4PbOHFZIeCOmoCWmuG3lQK6TdEJkuwfvU3n31WaYuxWkuSFQxf+UmmKUZMk5YHiJhGP
EhrOiyFLLKO0SWi4vJAeM5gynHM4Smg4B+6uS/5YnmOmIlA6qHHO4Uv2d4wdw5oEMa0+cyyDcPkO6opB
8a9OnEKss1FufhvEM96xLwfK/+oqCs40EcdOZM2xvrAJMO0gntmaA3FZEKf2pctCRWE7HfiQ9ybXWYBi
5D3JTVzRyH4wwCU0zF1f472J1UKERunC+pqgquofdvoa6+LDQkwAAAAASUVORK5CYII=
</value>
</data>
<data name="plc" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAABGdBTUEAALGPC/xhBQAAAnhJREFUWEft
ls1rE1EUxd/eP0BcigvBpS5sQcVdFEVTUFuoOi1pG8ViotSkBGea1tSQzJBObEhSMOmHMYm2JqmlWgNq
IoiLdiXBD1zozmVx6cJc33u+DIozNZ1JYsU58CMhN/eew7tvYJApU1tZMIe2wRSaw6w1lDh6jj/3Mhv9
ghgaxMOgKcRQidnoFx7iVR3eGCrMRr/++YDvvAgWL6pTvorgW0y9j9H8gPJpBMEObT6Oq/cxmh/wlQvB
LKdO/gKCrxH1PoZ5B41iBjSKGdAoZkCjmAGNYgY0yv8RcOu98vd6pT0cL+0juH3uA6/Du5ffT+5800je
yrtWs+KxrrOeiR3Mtn71jYY+9fAitIpeQfrACVI3s/+zAsl7n8dvp6EV8JEZ6B+TqzSsII6xCBur8Oxl
BQPzKyVw+SQYuMaDP5YA8tvPTM5mwe4SwDnih9TSk19qm+lN5pbBKcbIaVbP82I7i6EtPIAG7By4DPst
JxW8oahicGsmC20Wq1KzdHIwXywp9c32JguP2cqlaRZDW3hIJfWwSJs5hwvuLK7AoRNn4JTtkmJidwu0
Hs88gCteP/0uT6dpTW+v/Ua4ygniKouhLTykQlbUfrQDjnfbwBMIQ9sRK5wbHFJMHCM36WBiUDutqUyO
1vT0xtM5sI2GyF18wWJoCw+hKx72TyirOGztUgIQyJ0jqyE1Qv/QdaWmpzeSKbAnWvSxGNrCQ2hAQnJh
CUKJFGQfPVUMaiwUyyAn72Lz/G81Qj298XSehvtxetJ6n0fezmJoa1hOfHEGo9BsHIFoba3k4Vjv4YMH
WYSNhf98HzettQRBLJO11nVypkz9FSH0HdsLU8gVsNwDAAAAAElFTkSuQmCC
</value>
</data>
<data name="reel_big" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAABGdBTUEAALGPC/xhBQAADlRJREFUeF7t
XOlzFMcV96dcH5L8BTm+53alkg+5/oNUkvJ3V0VoDyGMsGFXO7urlbQ6kXbn2FurvXQghGStThsMso2N
IWAS4jJg7LKNMT6CQRDQEYOh079mZMFs7zkzwgev6le1pZnu9/qpu9/Rr+eRh/SQvr5U74t/x+oM/sni
DFhtLjnU4A0dafAo521u+ZJVkFYszeJnAH7jb3hmp+/g3fpm0bKlOfBH9KF29/WgOqH/txZBbKeK+LfF
JX7a5I9f84gjK10DeSIOHyCxiRfJwNTLJD17jGQXjjPgN/6GZ3gH73rE4ZWm9vg19GHzKKfq3VIbVepv
VDZfLapzKz+2CHIrnUUfbmuNXm+LjN+UR58jmbl/kKFnXtUF9IG+2sLjNxt9kRt2t/KB1SX56Mz+kcr+
y0t1TulRm0d+lipu1SvvWYuMP89VgpEIjy+SFnlszeqW1+weeaHeFfyVKs6Xh6A4q1t50e5Rlulyu23E
TKsW4NmTnL5D981V+g88bHX2/1IV74tLj/uC37e5pSQVeKV3cPZ2bv44d3CbCcjQm5q5Q/dJzMpEvaP7
e6q4XyyyCeJjVHlXPeLoanrmGHcwDxKpmaPEHRyhs1G6ahXEv6liP3h63Of7lk2QB7Z6Q8vhvebvcXoR
HlskW73hFTudjY2N8jfVYTwYgnWly+INZ192OT33xZt1xZCibpGjN7NKjczZB2atLY7+n9sEaal7IP9Z
boEvKFDqmdkoJ1dXIn/L6pau1LnEn6nD2hxCBECVdyOQW7jDE24d0sh+8mRnnDnCvOdmAjzBOzj0LPf5
OjAGui/esDjEP6jDM5egPLpsV+C88gQCBqePEG8wSzy7Q0ROREhnbB/3PTPRQXlKlLe3L8RkSeZf4b4H
YCwYk+lKrHcEfkqn/HV55ABXEACzrrFFJk9PJ8itT3Lk6oUs2eaTSw7AaIAXeII3ZJjMJ5hMUgm5lT0H
CWbiFlfwF+pwjSUYDOx5pZZtd3KK7OoMkXfPpAlZGvocGIBPGeG2MQPgNTmVuE+Gd8+kyK4OhfQM5rlt
AIwNe6LhhkV1Vc7BYPAYI+CH0L7+MLn2fvY+wYG1j3OkqU1hyQBeeyMBHuAFnlo5MCNb+kOkjcqamz/B
bQ/DYndLZwx1cRBdOHrSK3yrdoK0SDnSF4lwhV7HwecGiDuQ4rQ3Fu7+NDl08P7Zdy/+958cCcQjTGbI
rm2PMTp3Z1ZsHimuDl8fIcJo8IZWivl57eExEohFyGef8AVeB/YiZ1eI7TW8fowA+gYP8OLJsA7I2h+N
UNn3cPuBn9hAne0tzsBfVDXURmpse7VYhNERnyStgRD7r/IE1eLE0STZ1RWnbfnLRw8wcxzdcfLq0UEu
by2wWloCYdJFx8DrLzR2iBoVeUlX7Gx3K0mPNLrKYyAO76cGQyH/5ex5xXDnyhDxi2HSn10o6E8v0Gdb
MMJ48HjzgP16Jx1DMLef26cQHF21CUpUVUd1VOeUHqXxIjcxkJp+hWxvC5HzGmtbCd58LUWa2sMsS6Lt
t1bAiO3wh8kbpyqbfffivbNpOhaFjUnbLxIQyGXW5NpQ5b3Um5otcFmwVIT+DJmeLb5Rl4MYj5Z0J6pF
TzJPneYol1clyM8kiNCX4oZ+PcmZ2za38ryqlsoIyUe6fFeznFnSl56j+164rNEohQ/fypBtrQoxIgGB
PtAX+uTxqgQYC1ywvvR8Qf9YKXavsoIVqaqnPDV4lWe7B6ZvazuDQpvo0sW05wlSDTIjMeKPjd/Xfy3w
R8dJZjTG5VENsB1hW+JNmi7q/9o9yryqntLEIg667nlpeOpIk9Bg7UvlXmADZyHe1JECPpUCMTf6WHqv
ckNWCkoyhmOAAj7QBc5Y/i70/VBVU3HC6RkOgHidPNEaIu+fq32paDE1HSc+ufYQr0UaJlN0/+L1XQs+
eDNDnvAp3NNC6MTqkjyqmooTnX0f8E7P8J+JZvQvlXuhJ8QrFbLpQSRFZ+Fg4SyEL0yNyUVVTXzCoTfO
bbWNgV1dsZrchHI4dJCGeDT84vEsBVjNxUMD3D714My/UsTZA2f/fn6w0Ftbwje2OMVfq+oqJKsr6G8L
77upbRyfPEx2tCvk9mU+Uz2ABXR2KUQZrTzEQ8gGJ75cyFYL4Ig/6VfYmLV8W5XxT6mOfKq6CgnlFrxE
KZKTE5r0kJE4eSxJdlYc4p1gIdvJY8avhnWMT8ZZmKrljTyo3R06qarrfkKRDupMeBvoUx2Rghyfkbgb
4kUqCvHwDt6tJmSrFu+cTtMxRwt4Qzesnqcp8G1VbRuEKikU+mgbDdIQp8Ej0eVr/HK5F2+/nmYhXpQa
sPbIGN1zo4wvgN/+8BiJTrxAl1eYvPWaef9MANuK3S2ysWv10dSeuMZN/aPEDFVS2gaB3DOkU4lwGRmJ
W5eGiNCrkO2tMpmbT5ALb6RZlge4QB13/O0J+sxN3zFj79OiQ44QkXMg5Q6OLG9pFreoatsgqyCFUTam
bdARmyBPU3+Nx8QoQHn9UTr70qWTsngWSYVJIFY+56cXk3m6D8YK90Gqozt2ISSpatsgFDfyDl1axCw5
fiTJZWIUhvdGSYwqr5J9De9E02GyZ58xEVExHHs5SceeKdAH6hO3epXDqto2yOZV3uM5tA7qE507leIy
MQIXz9EN2y9V5RCvfpRlbRA58J4bgbPUH3T0JAr0Edv3AqHeyruq2jbIJsiXB/IvFzRArkxPpqMc9k7E
yDzd33jPSmF2Lk7GaVveMyOAMSO5oNXHAI3dabR2SVXbBqEOGWcB2gawgviP85gYgZY+mbxPDQbvWSnA
sPj6Ze4zI7DyUY6NXasPJFmtbvmGqrYNQjE3MrvaBtTvIfXNQdNgE4IVn6ncCyx5uBq8Po2CVRAL9IH8
INXJLVVtG1RMgWajwVvd/rcOtOHNELNRVIHFlrDZ2NkZYT4fT0mlgKTuTupg8/o0E0WXcDEjYjYQYczW
cL4yMxMn7WH9Ge1qUdSI2D2h85tReqFFfOJw1Xk9GDVELLyMidko6sbAkYaTyGtkNlAhoCSjFTvS8kCU
xcu8vsyGOLSf70hTixPuTuZLFkyaBRgv1+5BpsRSLhOe4R0XjiCLFAeZjaKhXLFkwmYhQ63bU9SgNLWK
zEmGkYB7g6WN3/gbniG1lp17MMoDiiYTUHna5E8UpLM2Cz2DM+y8GQ4yIgw4yY1ekQG/xydjLOzzS2HS
myo8s9gsbPfHr9U1B36vqm2DSiVUzQYMCVJVH79dPmT85B2cnMlsM+f1ZSZKJlRBNq9yqlTtsxmAUE91
RsnRlyrP+Bx/ZZDs8Ee4x49mAtkqaoFfVdVVSLiGipuUvMZmAZWtg0PVJwWStE1raPPKhgFfCIdKUouq
rkLCfVtcGeU1NgO4goCCyFpCORgYV0/IlFI5HtaPNcvWyODweDOupSbzR+i+p7Dib56CKgGsM/pAdMDj
YSTCexeJ3aNcUNVUnHBZmVfaYSRyCyeIs2eAHNiv/6j0wP4Blvg02y/0SqNrlmbRraqpOKHEv1hxkVHA
OUt/rLLIoxzQB+oNO+PmXeaBLqxuaa3eIf1AVVNpogp8pntgmnulQS9Qe7yjTa6qNLgcrl/MscoJswrY
uxJTKG+bU9VTnlDSWqzAUg+QCkKaHPUnPEXoAc5tcPwwOH2Uy7tWQAdUeStVfzqAKvBFGh0UFFnWClgx
TyBjaonIvqk4K1QCL54MtaA7OY0S30OqWionlPliL8Ss4XVcLVAyhlDNzPNcVE+wUI9TnlYLUHiOQvua
r8PaBCnuFod1JxiqCdX0wshQTwiOrFoFJayqo3rCJRN20WZskcugEtQSqumFEaHe3Ys20lKjT/6uqo7a
yNIc/CuuPdV6XtIq01Bt2NzSEB4QHrbWeEMUd2Nwvc3iCPxZVYM+srrlRPHLhsWhJ1TTi1pDPYzRsTu7
TP2+iDp8/YSrn3aPdBZXQXlMeTAiVNOLWkK9zvjULWo4Xn/M5/uGOnxjCBGKVZAv0/9oWdfGyFBNL6oJ
9QJZ9v2EyxVHHNUSjZN/YhWk61KZnKE/NkncvSFTaqqrBWSALJCJJ+s6UKNNlXcDXyNRh2sOoTqT7okl
PzqBT9U1706SDuqTIQ3PG9hmAHda4Be6qCyQiScrgNpnjInOvN+pwzSXcB0CM7EvM1fiFO8E2Z2eI9vp
HgQrfOW8eQVKWlw+n2FWGLwhQynj159ZuI2xcM85zCR455TxFRiWUgLi+y347AlzbjMxVsDNG7QRePt0
il0GguHAzYJSfiBkhsHAnoetSR3W5tLd1Jd0xtGbWS7nJ2Iw3ck8c6qbe8JkZjbBTuD0pLTQFpYWV2+b
u0NkJ+0bN6rKOdDw8xy96VWbRz5tmsGolODiWF1yDB8fg/fOE1iLyN5FdssShUUI8YLxKJmeuXtdH7MI
X9dY+TDHFATgN/6GSn68k6fvBuMxss0nsQIj9IUPL/J4aQEZG7zKql1Qooa7KnoIH2iwueUlfGKumgQE
blyiXMIfmyA+KUtcvQmW8mpskYjFFWT1ifiNv+GZT86yd9Gmmo/5IDEgBBDbykuGRRhGE4udPVIUWRzc
9DY6n1gLIANSUsiqILrQHdtuBiEhaxPkRSo0PgF6S09QXyvYnnv3ojRdrvLipn+hzQhSM9vz1Mda88h7
1sz+QCMsK07PcACEM4wGtzJrumO8GYSb3pZm0Ust9kWcrbYqe2/CeTViZqIPVAzg0Bt94+jR6gp6Hrh1
NYtw3xan+zav8k9WZ9KeuCYER7DU736Ie98LLGqAW4SyNwC/2Ye46TMYD+p7EiE4vIxCH/SBG5R0y/DW
VfNhiK8CoUgHoaHFGaxHzV2DN/RSg0d5hxqhS1TJn38K3iKIy/gbnqG4Ee+iDaKHooU+D+khfQ3okUf+
D1WHWk/swkxBAAAAAElFTkSuQmCC
</value>
<comment>rell icon ( 80x80)</comment>
</data>
<data name="reel_small" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAABGdBTUEAALGPC/xhBQAABe5JREFUWEfd
mF1zE1UYxzOjd+r38AVH/TBcOIgX3sggQtJqgQIlpQn2vSSbwiabzW42zXvSNiUJjjJKodBC6oXjgKDA
ADpjWxTEGwWkx/Pf7gm7ydlkU+SGZ+Y3k9lznv95Nuftedb1wtqOfcH3uv3S8N4htXrwWGqpL5i5TLlp
cPngxNQS2tBnZ+/Eu4bb87WPeoZe8/ijg/snEstjavVBbG6RJE4ttwR9RtXqnwfGEsuegcjgTu/kq4bc
/2der/dlj0/y9wXTP0Vnz6/zAnGCNLuwTjWueXyRAWga8s9mu72BLXuHleVw8exj3qCbQSzMP+4ZVmvd
R8U3jWE2Z3v84of9ofxtrVrjDvQsQPNIKH+ryy99YAzXmXn8kT3Dcmm1Lli5RILxPBmX002DOQW+0IAW
ezYolVa7ByKfGsM6s939ke3D8txvTEQuLZCQqpK1Gyo5fVohkeKZ+gBOgQ98oRFSFF2TtQ1F59Yc/5NY
c5hW5ixR4VgqRh7f1Qi5lyBPftdIUNHq4k6BD3yhAS2ZakrF+Xp7fyh3yz0w+YYRBt+ws7Ah2JqLzi4Q
JRMj638kdGFGbVEhxzNf1cXbgb6XFlWLBjSVlKyPgT5apUawcVrubhwlbLdinUzSaf33rjU4xnE1ToWd
bJ6a3pengX8SSyde3ViTYn7+kXsgfMQIx2o4hHHOMeGAmiN3b/KFwfUfVCIky6ZA+AjJk+Rn2penAdZu
xEkgnq33p7fQVe5hjhuCHcLRmQUyV45xBc1Ek4plRzaCNvTh+ZoplRUc4rpPdOb8epc/ctQI66ntn5ha
ZsIBJUUervHFzKzQHRnUpi1BmUEb+vB8zfyzSjeemqr79Y5pNSOsDcPFj7sVjWr5IslMt39rxlReIbGT
S5bAgFJeIql8+1lgJGlfjA3fMbVyf9ch4W0jPExveJRd/MJUhdy52v6tGX/9qtF//OkaYuAZ2ng+PG5f
UYiQqui+sdIF0u2TvjDCc7n2jcQrTBh/deOx0o7sdJQE5Lh+XoKJaJz+ezK3rx0YUzBN894RtWyE53Id
HJ+6yBrklPO3BvduqyRXDJNHxkEO8DtbEPU2c992ROnYLA4a06IRnsvVF8hcYQ1arjPRwrRoCY6BZ8UZ
sel5KzA2iwNJrxEevUGE7HXW4Bckkp9RHaMm7YNQUyLXxw6/EKkH6BUy143wrAF2CtYcLzigpGNcHydY
AjRPcacEYhvT2RgcngnKFNfHCZYpNm+STpFmzpJYMmYJEr9lPRG4wPVxgmWT9JiOmc0wKqVIMnuC5It0
zVHSOZGMRTef2ALLMdN1NDLipELjEc59Tc6dab55LiwoRMw6T8nM4KC23McfHwq+g9KQ17kVeCklbX8t
xlL0GqSD8XxbMaqU7+/oDWwxwtuwA+OJGq+zHVoVG0Qjf6/YH+xIAo7Jmt6Xp2FHU7IAQ1GNupXnwAOZ
Sqs8j3HzCs0bE/YZTyPSzPknbr/YnG4hSURRzXNqJFz4llROOc94ylWF+nzD1WqkL5C8uv2zkVeMsKzm
8Yn9kcLZhzxHBlIiUVM6SijQFz4snbJDzJ951DUQ9hrhNBsKlp4htdaqUJ+QU+TBL/algB0badnTbKUR
FE2fDyqXtm7NvWSEwzd8jkDFzxOZpPnadxedT20j39cUqnGySRd4adm5yyu8boTR2ty+E9toMV0v3AFd
vDTr7SzH4wENaJm1h6TSqtsX2WYM78y6fOHdg9G5FSaCKQgliqRQotfamv3RYgdKzMqXKjmm5Ejc+ulj
xd3ppw9mbp+8DRW/eU1Ks+eIoGVIqqjqpUGrzYK2Oz+qet9QPE0rtnN1HbwwptXtE983htuc4XMEKn4U
1UwcYEdOpqskSAeW0zTZzKokWVB08BuZOdqwbht3bzg//xAbwvGaa2cbHzAj/SiqUbeaB+sEHMI459x+
6XDb3boZw2GOU37/uFZDaejknpVLi/rd2juWqMH3uXwC5hkuc1yPPcNKBbkbEszDQuYGwG88Q5uHlo+f
HAq9Zbi9aOZy/Qe4xYHxvg6NpAAAAABJRU5ErkJggg==
</value>
<comment>reel icon (40x40)</comment>
</data>
<data name="safty" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAABGdBTUEAALGPC/xhBQAAAW9JREFUWEfl
2E1qwlAUBeBndygvC9CdCHHcuIkWqp27DK3toLiIOrRkkno1B6TcJO/e95fSA2fiUfgwPogx/yLNYvGw
K4rqOJt9UPfWPtJr7Zw3BNlPpy+nsvw+V1VD/SrL+s3a1+zIxpjJBfJ8j0NPy2V9KIpNNmQfDs2GdMGh
yZESHJoMqcGh0ZE+ODQaMgQODY6U4BBuu28wpPSbQ7jtd72RmsuKcBtXNVL7m0O4ratipM+BQLitr85I
HxwV4bahDiJ9cVSE21zaiQyBoyLc5loWSTebdA/HfUBShNskJQuZWp4xx/n8nXujtAi3Sft5MbW8PwAc
4yWm/zUt73ZIDtY+jeiQrNmTHALp004ckhM5iEPUyNWqqbfba9m9p844RIMkGCJBinGIFKkBqnGIBpkM
h8Q4OMFwSEhkcBwSAhkNh/ggo+MQDTIZDpEgk+MQF2Q2HNKHzI5DCDDaR8AIQeiml+6CqaN6iB43xvwA
iFk1KsvXeuAAAAAASUVORK5CYII=
</value>
</data>
</root>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 789 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 778 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 778 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 750 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 865 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 667 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 816 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 648 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 825 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 997 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 570 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 809 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 705 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 440 B

View File

@@ -0,0 +1,214 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{9264CD2E-7CF8-4237-A69F-DCDA984E0613}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>UIControl</RootNamespace>
<AssemblyName>UIControl</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>AnyCPU</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="CItem.cs" />
<Compile Include="CMenu.cs" />
<Compile Include="Common.cs" />
<Compile Include="CPicker.cs" />
<Compile Include="CIcon.cs" />
<Compile Include="CPort.cs" />
<Compile Include="EnumStruct.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Events.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="fTestControl.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="fTestControl.Designer.cs">
<DependentUpon>fTestControl.cs</DependentUpon>
</Compile>
<Compile Include="HMI.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Loader\Draw_PickerPrinter.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Loader\Draw_PickerY.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="PrintDirection.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="PrintDirection.Designer.cs">
<DependentUpon>PrintDirection.cs</DependentUpon>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Utility.cs" />
<Service Include="{94E38DFF-614B-4cbd-B67C-F211BB35CE8B}" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="fTestControl.resx">
<DependentUpon>fTestControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="Resources\icons8-code-30.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\icons8-erase-30.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\icons8-pause-button-30.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\icons8-settings-30.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\icons8-start-30.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\icons8-assembly-machine-40.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\icons8-rounded-square-80.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\icons8-rounded-square-80_blue.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\icons8-rounded-square-80_red.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\icons8-high-priority-40.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\icons8-wind-40.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\icons8-emergency-stop-button-40.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\icons8-deployment-40.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\icons8-barcode-reader-40.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\reel_big.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\reel_small.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\bg_red.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\air.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\bcd.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\bg_blue.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\emg.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\erase.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\icons8_pause_button_30.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\mot.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\plc.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\safty.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\icons8-automatic-gearbox-warning-80.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\icons8-hazard-warning-flasher-80.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\icons8-info-80.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\icons8-help-80.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\icons8-bug-80.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\icons8-bug-40.png" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\arAjinextek_Union\Library\arAjinextek_Union\arAjinextek_Union.csproj">
<Project>{62370293-92aa-4b73-b61f-5c343eeb4ded}</Project>
<Name>arAjinextek_Union</Name>
</ProjectReference>
<ProjectReference Include="..\CommData\CommData.csproj">
<Project>{14e8c9a5-013e-49ba-b435-efefc77dd623}</Project>
<Name>CommData</Name>
</ProjectReference>
<ProjectReference Include="..\commutil\arCommUtil.csproj">
<Project>{14e8c9a5-013e-49ba-b435-ffffff7dd623}</Project>
<Name>arCommUtil</Name>
</ProjectReference>
<ProjectReference Include="..\Setting\Setting.csproj">
<Project>{48654765-548d-42ed-9238-d65eb3bc99ad}</Project>
<Name>Setting</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@@ -0,0 +1,168 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
namespace UIControl
{
public static class Utility
{
public static Rectangle OffsetRect(this Rectangle rect, int x,int y)
{
var retval = new Rectangle(rect.X + x, rect.Y + y, rect.Width, rect.Height);
return retval;
}
public static void DrawString(this Graphics g,
string msg,
Font font,
Color fcolor,
RectangleF rect,
ContentAlignment textalign = ContentAlignment.MiddleCenter,
Color? ShadowColor = null,
Brush BackBrush = null,
Pen BorderPen = null)
{
DrawString(g, msg, font, fcolor, rect.toRect(), textalign, ShadowColor, BackBrush, BorderPen);
}
public static void DrawRectangle(this Graphics g, Pen pen, RectangleF rect)
{
g.DrawRectangle(pen, rect.Left, rect.Top, rect.Width, rect.Height);
}
public static void DrawString(this Graphics g,
string msg,
Font font,
Color fcolor,
Rectangle rect,
ContentAlignment textalign = ContentAlignment.MiddleCenter,
Color? ShadowColor = null,
Brush BackBrush = null,
Pen BorderPen = null)
{
//배경색 지정되어 있다면
if (BackBrush != null) g.FillRectangle(BackBrush, rect);
//테두리 지정되어 있다면
if (BorderPen != null) g.DrawRectangle(BorderPen, rect);
//그립자가 지정되있다면 별도 처리를 한다
if (ShadowColor != null && ShadowColor != Color.Transparent)
{
SizeF fsize;
var drawPT = GetTextPosition(g, msg, font, rect, textalign, out fsize);
//그림자를 먼저 그린다
g.DrawString(msg, font, new SolidBrush((Color)ShadowColor), drawPT.X + 1, drawPT.Y + 1);
g.DrawString(msg, font, new SolidBrush(fcolor), drawPT.X, drawPT.Y);
}
else
{
var sf = new StringFormat();
if (textalign == ContentAlignment.BottomCenter) { sf.Alignment = StringAlignment.Center; sf.LineAlignment = StringAlignment.Near; }
else if (textalign == ContentAlignment.BottomLeft) { sf.Alignment = StringAlignment.Near; sf.LineAlignment = StringAlignment.Near; }
else if (textalign == ContentAlignment.BottomRight) { sf.Alignment = StringAlignment.Far; sf.LineAlignment = StringAlignment.Near; }
else if (textalign == ContentAlignment.MiddleCenter) { sf.Alignment = StringAlignment.Center; sf.LineAlignment = StringAlignment.Center; }
else if (textalign == ContentAlignment.MiddleLeft) { sf.Alignment = StringAlignment.Near; sf.LineAlignment = StringAlignment.Center; }
else if (textalign == ContentAlignment.MiddleRight) { sf.Alignment = StringAlignment.Far; sf.LineAlignment = StringAlignment.Center; }
else if (textalign == ContentAlignment.TopCenter) { sf.Alignment = StringAlignment.Center; sf.LineAlignment = StringAlignment.Far; }
else if (textalign == ContentAlignment.TopLeft) { sf.Alignment = StringAlignment.Near; sf.LineAlignment = StringAlignment.Far; }
else if (textalign == ContentAlignment.TopRight) { sf.Alignment = StringAlignment.Far; sf.LineAlignment = StringAlignment.Far; }
else { sf.Alignment = StringAlignment.Center; sf.LineAlignment = StringAlignment.Center; }
g.DrawString(msg, font, new SolidBrush(fcolor), rect, sf);
sf.Dispose();
}
}
public static void DrawRect(this Graphics g, Rectangle rect, Color color, Color shadowColor, int pensize = 1)
{
//우측하단에 선을 그려준다. 일단은 검은색
g.DrawLine(new Pen(shadowColor, pensize), rect.Left + 1, rect.Bottom + 1, rect.Right - 1, rect.Bottom + 1);
g.DrawLine(new Pen(shadowColor, pensize), rect.Right + 1, rect.Top + 1, rect.Right + 1, rect.Bottom - 1);
DrawRect(g, rect, color, pensize);
}
public static void DrawRect(this Graphics g, Rectangle rect, Color color, int pensize = 1)
{
g.DrawRectangle(new Pen(color, pensize), rect);
}
public static void DrawRect(this Graphics g, RectangleF rect, Color color, int pensize = 1, Boolean shadow = false)
{
g.DrawRectangle(new Pen(color, pensize), rect.Left, rect.Top, rect.Width, rect.Height);
}
/// <summary>
/// Rectangle 개체를 반환 합니다. 단순 float -> int 로 값을 변환 합니다.
/// </summary>
/// <param name="rect"></param>
/// <returns></returns>
public static Rectangle toRect(this RectangleF rect)
{
return new Rectangle((int)rect.Left, (int)rect.Top, (int)rect.Width, (int)rect.Height); ;
}
static PointF GetTextPosition(Graphics g, string data, Font f, Rectangle rect, ContentAlignment align, System.Windows.Forms.Padding Padding, out SizeF fsize)
{
float x = 0;
float y = 0;
fsize = g.MeasureString(data, f);
if (align == ContentAlignment.MiddleCenter)
{
x = (rect.Width - fsize.Width) / 2 + Padding.Left - Padding.Right;
y = (rect.Height - fsize.Height) / 2 + Padding.Top - Padding.Bottom;
}
else if (align == ContentAlignment.MiddleLeft)
{
x = Padding.Left;
y = (rect.Height - fsize.Height) / 2;
}
else if (align == ContentAlignment.MiddleRight)
{
x = rect.Width - fsize.Width - Padding.Right;
y = (rect.Height - fsize.Height) / 2;
}
else if (align == ContentAlignment.BottomLeft)
{
x = Padding.Left;
y = rect.Height - fsize.Height - Padding.Bottom;
}
else if (align == ContentAlignment.BottomRight)
{
x = rect.Width - fsize.Width - Padding.Right;
y = rect.Height - fsize.Height - Padding.Bottom;
}
else if (align == ContentAlignment.BottomCenter)
{
x = (rect.Width - fsize.Width) / 2;
y = rect.Height - fsize.Height - Padding.Bottom;
}
else if (align == ContentAlignment.TopLeft)
{
x = Padding.Left;
y = Padding.Top;
}
else if (align == ContentAlignment.TopRight)
{
x = rect.Width - fsize.Width - Padding.Right;
y = Padding.Top;
}
else if (align == ContentAlignment.TopCenter)
{
x = (rect.Width - fsize.Width) / 2;
y = Padding.Top;
}
return new PointF(x + rect.Left, y + rect.Top);
}
static PointF GetTextPosition(Graphics g, string data, Font f, Rectangle rect, ContentAlignment align, out SizeF fsize)
{
return GetTextPosition(g, data, f, rect, align, new System.Windows.Forms.Padding(0), out fsize);
}
}
}

View File

@@ -0,0 +1,82 @@
namespace UIControl
{
partial class fTestControl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.printDirection1 = new UIControl.PrintDirection();
this.SuspendLayout();
//
// printDirection1
//
this.printDirection1.BackColor = System.Drawing.Color.White;
this.printDirection1.BorderColor = System.Drawing.Color.Black;
this.printDirection1.colors = new System.Drawing.Color[] {
System.Drawing.Color.Empty,
System.Drawing.Color.Empty,
System.Drawing.Color.Empty,
System.Drawing.Color.Empty,
System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(192))))),
System.Drawing.Color.Empty,
System.Drawing.Color.Empty,
System.Drawing.Color.Empty,
System.Drawing.Color.Empty};
this.printDirection1.Font = new System.Drawing.Font("맑은 고딕", 36F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
this.printDirection1.Location = new System.Drawing.Point(62, 56);
this.printDirection1.Margin = new System.Windows.Forms.Padding(7, 10, 7, 10);
this.printDirection1.Name = "printDirection1";
this.printDirection1.Size = new System.Drawing.Size(323, 283);
this.printDirection1.TabIndex = 0;
this.printDirection1.TitleFont = new System.Drawing.Font("궁서체", 9F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(129)));
this.printDirection1.titles = new string[] {
"↖",
"↑",
"↗",
"←",
"?",
"→",
"↙",
"↓",
"↘"};
//
// fTestControl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(476, 453);
this.Controls.Add(this.printDirection1);
this.Name = "fTestControl";
this.Text = "fTestControl";
this.ResumeLayout(false);
}
#endregion
private PrintDirection printDirection1;
}
}

View File

@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace UIControl
{
public partial class fTestControl : Form
{
public fTestControl()
{
InitializeComponent();
}
}
}

View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

Submodule Handler/Sub/arAjinextek_Union added at fb8cfe47eb

View File

@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
namespace arFrame.Control
{
[TypeConverterAttribute(typeof(ExpandableObjectConverter))]
public class ColorListItem
{
public System.Drawing.Color BackColor1 { get; set; }
public System.Drawing.Color BackColor2 { get; set; }
public string Remark { get; set; }
public ColorListItem()
{
BackColor1 = System.Drawing.Color.Transparent;
BackColor2 = System.Drawing.Color.Transparent;
Remark = string.Empty;
}
}
}

View File

@@ -0,0 +1,50 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
namespace arFrame.Control
{
[TypeConverterAttribute(typeof(ExpandableObjectConverter))]
public class GridViewItem
{
public int row { get; private set; }
public int col { get; private set; }
public int idx { get; private set; }
[Category("arFrame"), DisplayName("Tag")]
public string Tag { get; set; }
[Category("arFrame"), DisplayName("글자 정렬 방식")]
public System.Drawing.ContentAlignment TextAlign { get; set; }
[Category("arFrame"), DisplayName("글자 여백")]
public System.Windows.Forms.Padding Padding { get; set; }
[Category("arFrame"), DisplayName("메뉴 사용여부"), Description("활성화시 메뉴의 클릭이벤트가 발생하지 않습니다")]
public Boolean Enable { get; set; }
public System.Drawing.Color BackColor1 { get; set; }
public System.Drawing.Color BackColor2 { get; set; }
public Boolean Dirty { get; set; }
public System.Drawing.RectangleF rect { get; set; }
[Category("arFrame"), DisplayName("번호")]
public int No { get; set; }
public GridViewItem(int idx_,int _r,int _c)
{
this.row = _r;
this.col = _c;
BackColor1 = System.Drawing.Color.Transparent;
BackColor2 = System.Drawing.Color.Transparent;
rect = System.Drawing.RectangleF.Empty;
Enable = true;
this.idx = idx_;
TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
Padding = new System.Windows.Forms.Padding(0, 0, 0, 0);
No = 0;
this.Dirty = true;
}
}
}

View File

@@ -0,0 +1,36 @@
namespace arFrame.Control
{
partial class GridView
{
/// <summary>
/// 필수 디자이너 변수입니다.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 사용 중인 모든 리소스를 정리합니다.
/// </summary>
/// <param name="disposing">관리되는 리소스를 삭제해야 하면 true이고, 그렇지 않으면 false입니다.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region
/// <summary>
/// 디자이너 지원에 필요한 메서드입니다.
/// 이 메서드의 내용을 코드 편집기로 수정하지 마십시오.
/// </summary>
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
}
#endregion
}
}

View File

@@ -0,0 +1,632 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace arFrame.Control
{
public partial class GridView : System.Windows.Forms.Control
{
private int bordersize = 0;
private int menubordersize = 1;
private int menugap = 5;
private System.Windows.Forms.Padding padding = new Padding(3, 3, 3, 3);
private System.Drawing.Color backcolor = System.Drawing.Color.White;
private System.Drawing.Color bordercolor = System.Drawing.Color.Black;
private Boolean textattachtoimage = true;
private Boolean _showIndexString = true;
private System.Drawing.Color _shadowColor = System.Drawing.Color.Transparent;
private System.Drawing.Color foreColorPin = System.Drawing.Color.WhiteSmoke;
private System.Drawing.Font fontPin = new Font("Consolas", 8, FontStyle.Bold);
private Point _matrixsize = new Point(8, 2);
public Point MatrixSize { get { return _matrixsize; } set { _matrixsize = value; ResetArray(); RemakeChartRect(); } }
public Boolean arVeriticalDraw { get; set; }
[Browsable(false)]
public int ColumnCount { get { return _matrixsize.X; } }
[Browsable(false)]
public int RowCount { get { return _matrixsize.Y; } }
public int ItemCount { get { return ColumnCount * RowCount; } }
private GridViewItem[] Items;
private UInt16[] _values;
private string[] _titles;
private string[] _tags;
private string[] _names;
private ColorListItem[] _colorlist;
public ColorListItem[] ColorList { get { return _colorlist; } set { _colorlist = value; this.Invalidate(); } }
public string[] Names { get { return _names; } set { _names = value; Invalidate(); } }
public string[] Titles { get { return _titles; } set { _titles = value; Invalidate(); } }
public UInt16[] Values { get { return _values; } set { _values = value; Invalidate(); } }
public string[] Tags { get { return _tags; } set { _tags = value; } }
private bool _showdebuginfo = false;
public Boolean showDebugInfo { get { return _showdebuginfo; } set { _showdebuginfo = value; Invalidate(); } }
public void setNames(string[] value)
{
_names = value;
}
public void setTitle(string[] value)
{
List<string> titlerows = new List<string>();
List<string> tagrows = new List<string>();
for (int i = 0; i < value.Length; i++)
{
var r = (int)(Math.Floor((double)(i / ColumnCount)));
var c = i % ColumnCount;
//세로 그리기 였을때에는 다르게 처리해야함 201215
if(arVeriticalDraw)
{
c = (int)(Math.Floor((double)(i / ColumnCount)));
r = i % ColumnCount;
}
if (titlerows.Count < r + 1) titlerows.Add(string.Empty);
if (tagrows.Count < r + 1) tagrows.Add(string.Empty);
var prestr = titlerows[r];
if (c > 0 ) prestr += "|";
titlerows[r] = prestr + value[i];
var prestr_t = tagrows[r];
if (prestr_t != "") prestr_t += "|";
tagrows[r] = prestr_t + "";
if (i < itemCount) this.Items[i].Enable = true;
}
this._titles = titlerows.ToArray();
this._tags = tagrows.ToArray();
}
public void setTags(string[] value)
{
List<string> titlerows = new List<string>();
for (int i = 0; i < value.Length; i++)
{
var r = (int)(Math.Floor((double)(i / ColumnCount)));
var c = i % ColumnCount;
if (titlerows.Count < r + 1) titlerows.Add(string.Empty);
var prestr = titlerows[r];
if (c > 0 ) prestr += "|";
titlerows[r] = prestr + value[i];
if (i < itemCount) this.Items[i].Enable = true;
}
this._tags = titlerows.ToArray();
}
public Boolean setTitle(int row, int col, string value, string itemtag = "")
{
if (_titles == null) _titles = new string[0];
if (_tags == null) _tags = new string[0];
if (row >= _titles.Length) Array.Resize(ref _titles, row + 1);
if (row >= _tags.Length) Array.Resize(ref _tags, row + 1);
if (_titles[row] == null) _titles[row] = string.Empty;
if (_tags[row] == null) _tags[row] = string.Empty;
var linebuf = _titles[row].Split('|');
var linebuf_t = _tags[row].Split('|');
if (col >= linebuf.Length) Array.Resize(ref linebuf, col + 1);
if (col >= linebuf_t.Length) Array.Resize(ref linebuf_t, col + 1);
linebuf[col] = value;
linebuf_t[col] = itemtag;
_titles[row] = string.Join("|", linebuf);
_tags[row] = string.Join("|", linebuf_t);
return true;
//var idx = row * this.ColumnCount + col;
//return setTitle(idx, value);
}
public Boolean setTitle(int idx, string value)
{
if (idx < ColumnCount) return setTitle(0, idx, value);
else
{
//줄값이 필요하다
var row = (int)(Math.Floor((double)(idx / ColumnCount)));
var col = idx % ColumnCount;
return setTitle(row, col, value);
}
}
public void setValue(bool[] value)
{
var v = new UInt16[value.Length];
for (int i = 0; i < value.Length; i++)
v[i] = (UInt16)(value[i] ? 1 : 0);
_values = v;
//값이 잇으니 enable 한다
for (int i = 0; i < value.Length; i++)
{
if (i < Items.Length)
this.Items[i].Enable = true;
}
}
public void setValue(UInt16[] value)
{
_values = value;
for (int i = 0; i < value.Length; i++)
{
if (i < Items.Length)
this.Items[i].Enable = true;
}
}
public Boolean setValue(int idx, ushort value)
{
if (idx >= _values.Length || idx >= this.Items.Length) return false;
this._values[idx] = value;
this.Items[idx].Enable = true;
return true;
}
public void ClearValue(ushort defaultValue = 0)
{
if (_values != null)
for (int i = 0; i < _values.Length; i++)
_values[i] = defaultValue;
}
public void ClearTitle(string defaultValue = "")
{
if (_values != null)
for (int i = 0; i < _titles.Length; i++)
_titles[i] = defaultValue;
}
public void setValue(ushort value)
{
for (int i = 0; i < _values.Length; i++)
this._values[i] = value;
}
public void setItemEnable(int idx, bool value)
{
if (idx >= _values.Length || idx >= this.Items.Length) return;
this.Items[idx].Enable = value;
}
/// <summary>
/// 지정된 컬러태그값을 입력한다.
/// </summary>
/// <param name="idx"></param>
/// <param name="tagString"></param>
/// <returns></returns>
public Boolean setValue(int idx, string tagString)
{
//동일태그값을 찾는다
if (idx >= _values.Length) return false;
int value = -1;
for (int i = 0; i < ColorList.Length; i++)
if (ColorList[i].Remark.ToLower() == tagString.ToLower())
{
value = i;
break;
}
if (value != -1)
{
this._values[idx] = (ushort)value;
this.Items[idx].Enable = true;
return true;
}
else return false;
}
public Boolean setValue(int idx, bool value)
{
return setValue(idx, (ushort)(value ? 1 : 0));
}
public Boolean setValue(int row, int col, ushort value)
{
var idx = row * this.ColumnCount + col;
return setValue(idx, value);
}
public Boolean setValueToggle(int row, int col, ushort value1, ushort value2)
{
var idx = row * this.ColumnCount + col;
if (getValue(idx) == value1) return setValue(idx, value2);
else return setValue(idx, value1);
}
public Boolean setValue(int row, int col, bool value)
{
var idx = row * this.ColumnCount + col;
return setValue(idx, (ushort)(value ? 1 : 0));
}
public Boolean setValue(int row, int col, string value)
{
var idx = row * this.ColumnCount + col;
return setValue(idx, value);
}
public ushort getValue(int idx)
{
if (idx >= _values.Length) return 0;
return _values[idx];
}
public ushort getValue(int row, int col)
{
var idx = row * this.ColumnCount + col;
return getValue(idx);
}
[Category("arFrame")]
public bool ShowIndexString { get { return _showIndexString; } set { _showIndexString = value; Invalidate(); } }
[Category("arFrame"), DisplayName("테두리 굵기")]
public int BorderSize { get { return bordersize; } set { this.bordersize = value; Invalidate(); } }
[Category("arFrame"), DisplayName("메뉴 테두리 굵기")]
public int MenuBorderSize { get { return menubordersize; } set { this.menubordersize = value; Invalidate(); } }
[Category("arFrame"), DisplayName("메뉴 간격")]
public int MenuGap { get { return menugap; } set { this.menugap = value; RemakeChartRect(); Invalidate(); } }
[Category("arFrame"), DisplayName("글자를 이미지 다음에 표시"), Description("이미지가 있는 경우 해당 이미지 옆에 글자를 붙입니다")]
public Boolean TextAttachToImage { get { return textattachtoimage; } set { this.textattachtoimage = value; Invalidate(); } }
[Category("arFrame"), DisplayName("색상-테두리")]
public System.Drawing.Color BorderColor { get { return bordercolor; } set { this.bordercolor = value; Invalidate(); } }
[Category("arFrame"), DisplayName("내부 여백")]
public new System.Windows.Forms.Padding Padding { get { return padding; } set { this.padding = value; RemakeChartRect(); Invalidate(); } }
[Category("arFrame"), DisplayName("색상-전체배경색")]
public override System.Drawing.Color BackColor { get { return backcolor; } set { this.backcolor = value; Invalidate(); } }
[Category("arFrame"), DisplayName("색상-글자(그림자)")]
public System.Drawing.Color ShadowColor { get { return _shadowColor; } set { _shadowColor = value; this.Invalidate(); } }
[Category("arFrame"), DisplayName("색상-글자")]
public override Color ForeColor { get { return base.ForeColor; } set { base.ForeColor = value; } }
[Category("arFrame"), DisplayName("색상-글자(번호)")]
public Color ForeColorPin { get { return foreColorPin; } set { foreColorPin = value; } }
[Category("arFrame"), DisplayName("글꼴-번호")]
public Font FontPin { get { return fontPin; } set { fontPin = value; Invalidate(); } }
[Category("arFrame"), DisplayName("글꼴-항목")]
public override Font Font { get { return base.Font; } set { base.Font = value; Invalidate(); } }
private int mouseOverItemIndex = -1;
public GridView()
{
InitializeComponent();
// Set Optimized Double Buffer to reduce flickering
this.SetStyle(ControlStyles.UserPaint, true);
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
// Redraw when resized
this.SetStyle(ControlStyles.ResizeRedraw, true);
//값과 이름은 외부의 값을 사용한다
ResetArray();
if (MinimumSize.Width == 0 || MinimumSize.Height == 0)
MinimumSize = new Size(100, 50);
}
void ResetArray()
{
if (this._values != null) Array.Resize(ref this._values, itemCount);// = new UInt16[itemCount];
// if (this._titles != null) Array.Resize(ref this._titles, itemCount);//
// if (this._names != null) Array.Resize(ref this._names, itemCount);//
}
int itemCount { get { return ColumnCount * RowCount; } }
protected override void OnSizeChanged(EventArgs e)
{
base.OnSizeChanged(e);
RemakeChartRect();
}
public event EventHandler<ItemClickEventArgs> ItemClick;
public class ItemClickEventArgs : EventArgs
{
public int idx { get; set; }
public GridViewItem Item { get; set; }
public ItemClickEventArgs(int idx_, GridViewItem item)
{
this.Item = item;
this.idx = idx_;
}
}
protected override void OnMouseClick(MouseEventArgs e)
{
//마우스클릭시 해당 버튼을 찾아서 반환한다.
if (Items == null || Items.Length < 1) return;
for (int i = 0; i < Items.Length; i++)
{
var rect = Items[i].rect;//[i];
if (rect.Contains(e.Location))
{
var menu = Items[i];
//미사용개체는 이벤트를 아에 발생하지 않는다
if (menu.Enable == true && ItemClick != null)
ItemClick(this, new ItemClickEventArgs(i, menu));
break;
}
}
}
protected override void OnMouseLeave(EventArgs e)
{
this.mouseOverItemIndex = -1;
this.Invalidate();
}
protected override void OnMouseMove(MouseEventArgs e)
{
if (Items == null || Items.Length < 1)
{
this.mouseOverItemIndex = -1;
return;
}
for (int i = 0; i < Items.Length; i++)
{
var rect = Items[i].rect;// rects[i];
if (rect.Contains(e.Location))
{
if (i != mouseOverItemIndex)
{
mouseOverItemIndex = i;
this.Invalidate();
}
break;
}
}
}
public void setItemTextAlign(int row, int col, System.Drawing.ContentAlignment TextAlign)
{
var item = this.Items.Where(t => t.row == row && t.col == col).FirstOrDefault();
if (item != null) item.TextAlign = TextAlign;
}
public void setItemTextAlign(System.Drawing.ContentAlignment TextAlign)
{
foreach (var item in this.Items)
item.TextAlign = TextAlign;
}
protected override void OnPaint(PaintEventArgs pe)
{
//배경그리기
//using (var sb = new System.Drawing.Drawing2D.LinearGradientBrush(DisplayRectangle, BackColor, BackColor2On, System.Drawing.Drawing2D.LinearGradientMode.Vertical))
pe.Graphics.FillRectangle(new SolidBrush(BackColor), DisplayRectangle);
if (Items == null)
{
pe.Graphics.DrawString("no items", this.Font, Brushes.Red, 100, 100);
return;
}
var items = Items.OrderBy(t => t.No);
foreach (var menu in items)
{
drawItem(menu.idx, pe.Graphics);
}
//테두리 그리기
if (BorderSize > 0)
{
pe.Graphics.DrawRectangle(new Pen(this.BorderColor, BorderSize),
this.DisplayRectangle.Left,
this.DisplayRectangle.Top,
this.DisplayRectangle.Width - 1,
this.DisplayRectangle.Height - 1);
}
}
public void drawItem(int itemIndex, Graphics g = null)
{
if (g == null) g = this.CreateGraphics();
var menu = this.Items[itemIndex];
if (menu.rect == RectangleF.Empty) return;
var rect = menu.rect;// rects[i];
var diplayText = string.Empty;
// if(_titles[1].Trim() != "")
// Console.WriteLine("sdf");
//타이틀이 줄번호별로 처리됨
if (_titles != null && menu.row < _titles.Length)
{
if (_titles[menu.row] == null) _titles[menu.row] = string.Empty;
var linebif = _titles[menu.row].Split('|');
if (menu.col < linebif.Length)
diplayText = linebif[menu.col];
}
UInt16 Value = 0;
if (_values != null && menu.idx < _values.Length) Value = _values[menu.idx];
//배경이 투명이 아니라면 그린다.
var bgColor1 = Color.FromArgb(30, 30, 30);// BackColor1Off;
var bgColor2 = Color.FromArgb(30, 30, 30);// BackColor2Off;
//해당 값에 따른 컬러값을 읽는다.
if (ColorList != null && Value < ColorList.Length)
{
bgColor1 = this.ColorList[Value].BackColor1;
bgColor2 = this.ColorList[Value].BackColor2;
}
using (var sb = new System.Drawing.Drawing2D.LinearGradientBrush(rect, bgColor1, bgColor2, System.Drawing.Drawing2D.LinearGradientMode.Vertical))
g.FillRectangle(sb, rect);
// if (mouseOverItemIndex == menu.idx)
// this.Cursor = Cursors.Hand;
// else
// this.Cursor = Cursors.Arrow;
//테두리를 그리는 속성과 트기가 설정된 경우에만 표시
//if (mouseOverItemIndex == i)
// {
// pe.Graphics.DrawRectangle(new Pen(Color.DeepSkyBlue), rect.Left, rect.Top, rect.Width, rect.Height);
//}
//else
{
if (MenuBorderSize > 0)
{
using (var p = new Pen(BorderColor, MenuBorderSize))
g.DrawRectangle(p, rect.Left, rect.Top, rect.Width, rect.Height);
}
}
//인덱스번호 출력
if (ShowIndexString && _names != null && menu.idx < _names.Length)
{
//표시글자
var idxstr = string.Format("[{0}] {1}", menu.idx, _names[menu.idx]);
//그림자 추가
if (ShadowColor != System.Drawing.Color.Transparent)
g.DrawString(idxstr, FontPin, new SolidBrush(ShadowColor), menu.rect.Left + 4, menu.rect.Top + 4);
//일반글자표시
g.DrawString(idxstr, FontPin, new SolidBrush(this.ForeColorPin), menu.rect.Left + 3, menu.rect.Top + 3);
}
if (diplayText != "")
{
using (StringFormat sf = new StringFormat(StringFormatFlags.NoClip))
{
//글자를 텍스트 이후에 붙이는 거라면?
if (menu.TextAlign == ContentAlignment.BottomCenter || menu.TextAlign == ContentAlignment.BottomLeft ||
menu.TextAlign == ContentAlignment.BottomRight) sf.LineAlignment = StringAlignment.Far;
else if (menu.TextAlign == ContentAlignment.MiddleCenter || menu.TextAlign == ContentAlignment.MiddleLeft ||
menu.TextAlign == ContentAlignment.MiddleRight) sf.LineAlignment = StringAlignment.Center;
else if (menu.TextAlign == ContentAlignment.TopCenter || menu.TextAlign == ContentAlignment.TopLeft ||
menu.TextAlign == ContentAlignment.TopRight) sf.LineAlignment = StringAlignment.Near;
if (menu.TextAlign == ContentAlignment.BottomCenter || menu.TextAlign == ContentAlignment.MiddleCenter ||
menu.TextAlign == ContentAlignment.TopCenter) sf.Alignment = StringAlignment.Center;
else if (menu.TextAlign == ContentAlignment.BottomLeft || menu.TextAlign == ContentAlignment.MiddleLeft ||
menu.TextAlign == ContentAlignment.TopLeft) sf.Alignment = StringAlignment.Near;
else if (menu.TextAlign == ContentAlignment.BottomRight || menu.TextAlign == ContentAlignment.MiddleRight ||
menu.TextAlign == ContentAlignment.TopRight) sf.Alignment = StringAlignment.Far;
//그림자 추가
if (ShadowColor != System.Drawing.Color.Transparent)
g.DrawString(diplayText, this.Font, new SolidBrush(ShadowColor),
new RectangleF((float)(rect.Left + 1f), (float)(rect.Top + 1f), (float)rect.Width, (float)rect.Height), sf);
g.DrawString($"{diplayText}", this.Font, new SolidBrush(ForeColor), rect, sf);
}
}
if (showDebugInfo)
{
g.DrawString(Value.ToString(), this.fontPin, Brushes.SkyBlue, rect.Left, rect.Top);
}
}
/// <summary>
/// arFrame 전용 속성값을 복사 합니다
/// </summary>
/// <param name="ctl"></param>
public void copyTo(GridView ctl)
{
ctl.backcolor = this.backcolor;
ctl.menugap = this.menugap;
ctl.Items = this.Items;
ctl.menubordersize = this.menubordersize;
ctl.padding = this.padding;
ctl.ForeColor = this.ForeColor;
ctl.Font = this.Font;
ctl.TextAttachToImage = this.TextAttachToImage;
ctl.bordercolor = this.bordercolor;
ctl.bordersize = this.bordersize;
}
public void RemakeChartRect()
{
if (DisplayRectangle == Rectangle.Empty) return;
double x = 0;
double y = 0;
double w = DisplayRectangle.Width / (ColumnCount * 1.0);
double h = DisplayRectangle.Height / (RowCount * 1.0);
//아이템갯수가 달라졌으므로 다시 갱신해야함
GridViewItem[] item = new GridViewItem[RowCount * ColumnCount];
if(arVeriticalDraw)
{
for (int c = 0; c < ColumnCount; c++)
{
for (int r = 0; r < RowCount; r++)
{
int idx = c * ColumnCount + r;
item[idx] = new GridViewItem(idx, r, c);
if (this.Items != null && idx < this.Items.Length)
item[idx].Enable = this.Items[idx].Enable; // false;
else
item[idx].Enable = false;
item[idx].Padding = new Padding(0, 0, 0, 0);
item[idx].TextAlign = ContentAlignment.MiddleCenter;
x = (c * w);
y = (r * h);
item[idx].Dirty = true;
item[idx].rect = new RectangleF((float)x, (float)y, (float)w, (float)h);
}
}
}
else
{
for (int r = 0; r < RowCount; r++)
{
for (int c = 0; c < ColumnCount; c++)
{
int idx = r * ColumnCount + c;
item[idx] = new GridViewItem(idx, r, c);
if (this.Items != null && idx < this.Items.Length)
item[idx].Enable = this.Items[idx].Enable; // false;
else
item[idx].Enable = false;
item[idx].Padding = new Padding(0, 0, 0, 0);
item[idx].TextAlign = ContentAlignment.MiddleCenter;
x = (c * w);
y = (r * h);
item[idx].Dirty = true;
item[idx].rect = new RectangleF((float)x, (float)y, (float)w, (float)h);
}
}
}
this.Items = item;
this.Invalidate();
}
}
}

View File

@@ -0,0 +1,36 @@
namespace arFrame.Control
{
partial class MenuControl
{
/// <summary>
/// 필수 디자이너 변수입니다.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 사용 중인 모든 리소스를 정리합니다.
/// </summary>
/// <param name="disposing">관리되는 리소스를 삭제해야 하면 true이고, 그렇지 않으면 false입니다.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region
/// <summary>
/// 디자이너 지원에 필요한 메서드입니다.
/// 이 메서드의 내용을 코드 편집기로 수정하지 마십시오.
/// </summary>
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
}
#endregion
}
}

View File

@@ -0,0 +1,676 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Xml;
namespace arFrame.Control
{
public partial class MenuControl : System.Windows.Forms.Control
{
private int bordersize = 0;
private int menubordersize = 1;
private int menuwidth = 100;
private int menugap = 5;
private System.Windows.Forms.Padding padding = new Padding(3, 3, 3, 3);
private System.Drawing.Color backcolor = System.Drawing.Color.White;
private System.Drawing.Color backcolor2 = System.Drawing.Color.Gainsboro;
private System.Drawing.Color bordercolor = System.Drawing.Color.Black;
private Boolean enablemenubakcolor = false;
private Boolean enablemenuborder = false;
private Boolean textattachtoimage = true;
[Category("arFrame"), DisplayName("메뉴")]
public MenuItem[] menus { get; set; }
private Rectangle[] rects = null;
[Category("arFrame"), DisplayName("테두리 굵기")]
public int BorderSize { get { return bordersize; } set { this.bordersize = value; Invalidate(); } }
[Category("arFrame"), DisplayName("메뉴 테두리 굵기")]
public int MenuBorderSize { get { return menubordersize; } set { this.menubordersize = value; Invalidate(); } }
[Category("arFrame"), DisplayName("메뉴 너비")]
public int MenuWidth { get { return menuwidth; } set { this.menuwidth = value; RemakeChartRect(); Invalidate(); } }
[Category("arFrame"), DisplayName("메뉴 간격")]
public int MenuGap { get { return menugap; } set { this.menugap = value; RemakeChartRect(); Invalidate(); } }
[Category("arFrame"), DisplayName("기능-메뉴별 배경색")]
public Boolean EnableMenuBackColor { get { return enablemenubakcolor; } set { this.enablemenubakcolor = value; Invalidate(); } }
[Category("arFrame"), DisplayName("기능-메뉴별 테두리")]
public Boolean EnableMenuBorder { get { return enablemenuborder; } set { this.enablemenuborder = value; Invalidate(); } }
[Category("arFrame"), DisplayName("글자를 이미지 다음에 표시"), Description("이미지가 있는 경우 해당 이미지 옆에 글자를 붙입니다")]
public Boolean TextAttachToImage { get { return textattachtoimage; } set { this.textattachtoimage = value; Invalidate(); } }
[Category("arFrame"), DisplayName("이미지 표시 여백(좌,상)")]
public System.Drawing.Point ImagePadding { get; set; }
[Category("arFrame"), DisplayName("이미지 표시 크기(너비,높이)")]
public System.Drawing.Size ImageSize { get; set; }
[Category("arFrame"), DisplayName("색상-테두리")]
public System.Drawing.Color BorderColor { get { return bordercolor; } set { this.bordercolor = value; Invalidate(); } }
[Category("arFrame"), DisplayName("내부 여백")]
public new System.Windows.Forms.Padding Padding { get { return padding; } set { this.padding = value; RemakeChartRect(); Invalidate(); } }
[Category("arFrame"), DisplayName("색상-배경1")]
public override System.Drawing.Color BackColor { get { return backcolor; } set { this.backcolor = value; Invalidate(); } }
[Category("arFrame"), DisplayName("색상-배경2")]
public System.Drawing.Color BackColor2 { get { return backcolor2; } set { this.backcolor2 = value; Invalidate(); } }
[Category("arFrame"), DisplayName("색상-글자")]
public override Color ForeColor { get { return base.ForeColor; } set { base.ForeColor = value; } }
private int mouseOverItemIndex = -1;
public MenuControl()
{
InitializeComponent();
// Set Optimized Double Buffer to reduce flickering
this.SetStyle(ControlStyles.UserPaint, true);
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
// Redraw when resized
this.SetStyle(ControlStyles.ResizeRedraw, true);
ImagePadding = new System.Drawing.Point(0, 0);
ImageSize = new System.Drawing.Size(24, 24);
if (MinimumSize.Width == 0 || MinimumSize.Height == 0)
MinimumSize = new Size(100, 50);
}
protected override void OnSizeChanged(EventArgs e)
{
base.OnSizeChanged(e);
RemakeChartRect();
}
public event EventHandler<MenuEventArgs> ItemClick;
public class MenuEventArgs : EventArgs
{
public string Command { get; set; }
public int idx { get; set; }
public MenuEventArgs(string cmd_, int idx_)
{
this.Command = cmd_;
this.idx = idx_;
}
}
protected override void OnMouseClick(MouseEventArgs e)
{
// if(DesignMode)
// {
// if(e.Button == System.Windows.Forms.MouseButtons.Right)
// {
// System.Windows.Forms.MessageBox.Show("Sdf");
// }
// }
// else
{
//마우스클릭시 해당 버튼을 찾아서 반환한다.
if (menus == null || menus.Length < 1) return;
for (int i = 0; i < menus.Length; i++)
{
var rect = rects[i];
if (rect.Contains(e.Location))
{
var menu = menus[i];
//미사용개체는 이벤트를 아에 발생하지 않는다
if (menu.Enable == true && ItemClick != null)
ItemClick(this, new MenuEventArgs(menu.Command, i));
break;
}
}
}
}
protected override void OnMouseLeave(EventArgs e)
{
this.mouseOverItemIndex = -1;
this.Invalidate();
}
protected override void OnMouseMove(MouseEventArgs e)
{
if (menus == null || menus.Length < 1)
{
this.mouseOverItemIndex = -1;
return;
}
for (int i = 0; i < menus.Length; i++)
{
var rect = rects[i];
if (rect.Contains(e.Location))
{
if (i != mouseOverItemIndex)
{
mouseOverItemIndex = i;
this.Invalidate();
}
break;
}
}
}
protected override void OnPaint(PaintEventArgs pe)
{
// if(DesignMode)
// {
// pe.Graphics.FillRectangle(Brushes.Red, this.DisplayRectangle);
// }
//else
{
//배경그리기
using (var sb = new System.Drawing.Drawing2D.LinearGradientBrush(DisplayRectangle, BackColor, BackColor2, System.Drawing.Drawing2D.LinearGradientMode.Vertical))
pe.Graphics.FillRectangle(sb, DisplayRectangle);
}
//테두리 그리기
if (BorderSize > 0)
{
pe.Graphics.DrawRectangle(new Pen(this.BorderColor, BorderSize),
this.DisplayRectangle.Left,
this.DisplayRectangle.Top,
this.DisplayRectangle.Width - 1,
this.DisplayRectangle.Height - 1);
}
//커서모양
if (mouseOverItemIndex == -1) this.Cursor = Cursors.Arrow;
else this.Cursor = Cursors.Hand;
if (rects == null) RemakeChartRect();
if (rects != null && rects.Length > 0)
{
StringFormat sf = new StringFormat(StringFormatFlags.NoClip);
var items = menus.OrderBy(t => t.No);
int i = 0;
foreach (var menu in items)
{
var rect = rects[i];
//배경이 투명이 아니라면 그린다.
if (mouseOverItemIndex == i)
{
//마우스오버된놈이다.
using (var sb = new System.Drawing.Drawing2D.LinearGradientBrush(rect, Color.FromArgb(100, Color.LightSkyBlue), Color.FromArgb(100, Color.DeepSkyBlue), System.Drawing.Drawing2D.LinearGradientMode.Vertical))
pe.Graphics.FillRectangle(sb, rect);
}
else
{
if (this.enablemenubakcolor == true && menu.BackColor != System.Drawing.Color.Transparent && menu.BackColor2 != System.Drawing.Color.Transparent)
{
using (var sb = new System.Drawing.Drawing2D.LinearGradientBrush(rect, menu.BackColor, menu.BackColor2, System.Drawing.Drawing2D.LinearGradientMode.Vertical))
pe.Graphics.FillRectangle(sb, rect);
}
}
//이미지표시
int ix, iy, iw, ih;
ix = iy = iw = ih = 0;
if (menu.Image != null)
{
ix = rect.Left;
iy = rect.Top;
iw = ImageSize.Width;
ih = ImageSize.Height;
if (menu.ImageAlign == ContentAlignment.BottomCenter || menu.ImageAlign == ContentAlignment.BottomLeft ||
menu.ImageAlign == ContentAlignment.BottomRight) iy += DisplayRectangle.Bottom - ih;
else if (menu.ImageAlign == ContentAlignment.MiddleCenter || menu.ImageAlign == ContentAlignment.MiddleLeft ||
menu.ImageAlign == ContentAlignment.MiddleRight) iy += (int)(DisplayRectangle.Top + ((rect.Height - ih) / 2.0));
else if (menu.ImageAlign == ContentAlignment.TopCenter || menu.ImageAlign == ContentAlignment.TopLeft ||
menu.ImageAlign == ContentAlignment.TopRight) iy += DisplayRectangle.Top;
if (menu.ImageAlign == ContentAlignment.BottomCenter || menu.ImageAlign == ContentAlignment.MiddleCenter ||
menu.ImageAlign == ContentAlignment.TopCenter) ix += (int)(DisplayRectangle.Left + ((rect.Width - iw) / 2.0));
else if (menu.ImageAlign == ContentAlignment.BottomLeft || menu.ImageAlign == ContentAlignment.MiddleLeft ||
menu.ImageAlign == ContentAlignment.TopLeft) ix += DisplayRectangle.Left;
else if (menu.ImageAlign == ContentAlignment.BottomRight || menu.ImageAlign == ContentAlignment.MiddleRight ||
menu.ImageAlign == ContentAlignment.TopRight) ix += DisplayRectangle.Right - iw;
if (menu.ImagePadding.X != 0 || menu.ImagePadding.Y != 0)
{
ix += menu.ImagePadding.X;
iy += menu.ImagePadding.Y;
}
else
{
ix += ImagePadding.X;
iy += ImagePadding.Y;
}
if (menu.ImageSize.Width != 0 && menu.ImageSize.Height != 0)
{
iw = menu.ImageSize.Width;
ih = menu.ImageSize.Height;
}
pe.Graphics.DrawImage(menu.Image,
new Rectangle(ix, iy, iw, ih));
}
//테두리를 그리는 속성과 트기가 설정된 경우에만 표시
if (mouseOverItemIndex == i)
{
pe.Graphics.DrawRectangle(new Pen(Color.DeepSkyBlue), rect);
}
else
{
if (EnableMenuBorder && MenuBorderSize > 0)
{
using (var p = new Pen(menu.BorderColor, MenuBorderSize))
pe.Graphics.DrawRectangle(p, rect);
}
}
//글자를 텍스트 이후에 붙이는 거라면?
if (menu.Image != null && TextAttachToImage)
{
var fsize = pe.Graphics.MeasureString(menu.Text, this.Font);
pe.Graphics.DrawString(menu.Text, this.Font, new SolidBrush(menu.ForeColor),
(float)(ix + iw + 1),
(float)(iy + ((ih - fsize.Height) / 2.0)));
}
else
{
if (menu.TextAlign == ContentAlignment.BottomCenter || menu.TextAlign == ContentAlignment.BottomLeft ||
menu.TextAlign == ContentAlignment.BottomRight) sf.LineAlignment = StringAlignment.Far;
else if (menu.TextAlign == ContentAlignment.MiddleCenter || menu.TextAlign == ContentAlignment.MiddleLeft ||
menu.TextAlign == ContentAlignment.MiddleRight) sf.LineAlignment = StringAlignment.Center;
else if (menu.TextAlign == ContentAlignment.TopCenter || menu.TextAlign == ContentAlignment.TopLeft ||
menu.TextAlign == ContentAlignment.TopRight) sf.LineAlignment = StringAlignment.Near;
if (menu.TextAlign == ContentAlignment.BottomCenter || menu.TextAlign == ContentAlignment.MiddleCenter ||
menu.TextAlign == ContentAlignment.TopCenter) sf.Alignment = StringAlignment.Center;
else if (menu.TextAlign == ContentAlignment.BottomLeft || menu.TextAlign == ContentAlignment.MiddleLeft ||
menu.TextAlign == ContentAlignment.TopLeft) sf.Alignment = StringAlignment.Near;
else if (menu.TextAlign == ContentAlignment.BottomRight || menu.TextAlign == ContentAlignment.MiddleRight ||
menu.TextAlign == ContentAlignment.TopRight) sf.Alignment = StringAlignment.Far;
pe.Graphics.DrawString(menu.Text, this.Font, new SolidBrush(menu.ForeColor), rect, sf);
}
i += 1;
}
sf.Dispose();
}
//if(DesignMode)
//{
// pe.Graphics.DrawString("deisgn", this.Font, Brushes.Red, 1, 1);
//}
}
/// <summary>
/// arFrame 전용 속성값을 복사 합니다
/// </summary>
/// <param name="ctl"></param>
public void copyTo(MenuControl ctl)
{
ctl.backcolor = this.backcolor;
ctl.backcolor2 = this.BackColor2;
ctl.MenuWidth = this.menuwidth;
ctl.menugap = this.menugap;
ctl.menus = this.menus;
ctl.menubordersize = this.menubordersize;
ctl.padding = this.padding;
ctl.ForeColor = this.ForeColor;
ctl.Font = this.Font;
ctl.EnableMenuBackColor = this.EnableMenuBackColor;
ctl.EnableMenuBorder = this.EnableMenuBorder;
ctl.ImagePadding = this.ImagePadding;
ctl.ImageSize = this.ImageSize;
ctl.TextAttachToImage = this.TextAttachToImage;
ctl.bordercolor = this.bordercolor;
ctl.bordersize = this.bordersize;
}
public void Save(string File)
{
//xml로 데이터를 저장자
System.Text.StringBuilder NewXml = new System.Text.StringBuilder();
NewXml.AppendLine("<?xml version='1.0' encoding='UTF-8'?>");
NewXml.AppendLine("<tindevil create='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "'> ");
NewXml.AppendLine("</tindevil>");
if (System.IO.File.Exists(File)) System.IO.File.Delete(File);
System.IO.File.WriteAllText(File, NewXml.ToString().Replace('\'', '\"'), System.Text.Encoding.UTF8);
var vDocu = new XmlDocument();
vDocu.Load(File);
//var nsmgr = new XmlNamespaceManager(new System.Xml.NameTable());
//nsmgr.AddNamespace("x", "http://tindevil.com");
var Root = vDocu.DocumentElement;
//저장하려는 속성목록을 먼저 생성한다
//미사용 목록이 너무 많아서 그렇게 함
foreach (var m in this.GetType().GetMethods())
{
var mName = m.Name.ToLower();
if (mName.StartsWith("get_") == false || mName == "get_menus") continue;
var pt = this.GetType().GetProperty(m.Name.Substring(4));
if (pt != null)
{
var categoryName = GetCategoryName(pt);
if (categoryName.ToLower() != "arframe") continue;
//자료형에따라서 그값을 변경한다
var value = m.Invoke(this, null);
var newNode = vDocu.CreateElement(pt.Name);// m.Name.Substring(4));
newNode.InnerText = getValueString(m, value);
Root.AppendChild(newNode);
}
}
foreach (var item in this.menus.OrderBy(t => t.No))
{
var node = vDocu.CreateElement("Item");
var attNo = vDocu.CreateAttribute("No");
attNo.Value = item.No.ToString();
node.Attributes.Append(attNo);
foreach (var m in item.GetType().GetMethods())
{
var mName = m.Name.ToLower();
if (mName.StartsWith("get_") == false || mName == "get_no") continue;
var value = m.Invoke(item, null);
var sNode = vDocu.CreateElement(m.Name.Substring(4));
sNode.InnerText = getValueString(m, value);
node.AppendChild(sNode);
}
Root.AppendChild(node);
}
vDocu.Save(File);
}
public void Load(string File)
{
if (System.IO.File.Exists(File) == false) return;
List<MenuItem> NewMenu = new List<MenuItem>();
var vDocu = new XmlDocument();
vDocu.Load(File);
var Root = vDocu.DocumentElement; //루트요소(Tindevil)
//저장하려는 속성목록을 먼저 생성한다
//미사용 목록이 너무 많아서 그렇게 함
foreach (var m in this.GetType().GetMethods())
{
var mName = m.Name.ToLower();
if (mName.StartsWith("get_") == false || mName == "get_menus") continue;
var methodName = m.Name.Substring(4);
var pt = this.GetType().GetProperty(methodName);
if (pt != null)
{
var categoryName = GetCategoryName(pt);
if (categoryName.ToLower() != "arframe") continue;
//SEt명령이 있어야 사용이 가능하다
var setMethod = this.GetType().GetMethod("set_" + methodName);
if (setMethod == null) continue;
//값을 읽어온다
var Node = Root.SelectSingleNode(methodName);
if (Node != null)
{
var strValue = Node.InnerText;
var value = getValueFromString(m.ReturnType, strValue); // setValueString(m.ReturnType, setMethod, strValue);
setMethod.Invoke(this, new object[] { value });
}
}
}
//foreach (var item in this.menus.OrderBy(t => t.No))
//{
// var node = vDocu.CreateElement("Item");
// var attNo = vDocu.CreateAttribute("No");
// attNo.Value = item.No.ToString();
// node.Attributes.Append(attNo);
// foreach (var m in item.GetType().GetMethods())
// {
// var mName = m.Name.ToLower();
// if (mName.StartsWith("get_") == false || mName == "get_no") continue;
// var value = m.Invoke(item, null);
// var sNode = vDocu.CreateElement(m.Name.Substring(4));
// sNode.InnerText = getValueString(m, value);
// node.AppendChild(sNode);
// }
// Root.AppendChild(node);
//}
}
private string getValueString(System.Reflection.MethodInfo m, object value)
{
var strValue = "";
string valuetype = m.ReturnType.Name.ToLower();
if (m.ReturnType == typeof(System.Drawing.Color))
strValue = ((System.Drawing.Color)value).ToArgb().ToString();
else if (m.ReturnType == typeof(System.Drawing.Rectangle))
{
var rect = (System.Drawing.Rectangle)value;
strValue = string.Format("{0};{1};{2};{3}", rect.Left, rect.Top, rect.Width, rect.Height);
}
else if (m.ReturnType == typeof(System.Drawing.RectangleF))
{
var rectf = (System.Drawing.RectangleF)value;
strValue = string.Format("{0};{1};{2};{3}", rectf.Left, rectf.Top, rectf.Width, rectf.Height);
}
else if (m.ReturnType == typeof(Boolean))
{
strValue = ((Boolean)value) ? "1" : "0";
}
else if (m.ReturnType == typeof(System.Drawing.Point))
{
var pt1 = (Point)value;
strValue = string.Format("{0};{1}", pt1.X, pt1.Y);
}
else if (m.ReturnType == typeof(System.Drawing.PointF))
{
var ptf = (PointF)value;
strValue = string.Format("{0};{1}", ptf.X, ptf.Y);
}
else if (m.ReturnType == typeof(System.Drawing.Size))
{
var sz = (Size)value;
strValue = string.Format("{0};{1}", sz.Width, sz.Height);
}
else if (m.ReturnType == typeof(System.Drawing.SizeF))
{
var szf = (SizeF)value;
strValue = string.Format("{0};{1}", szf.Width, szf.Height);
}
else if (m.ReturnType == typeof(System.Drawing.Bitmap))
{
var bitmap = (Bitmap)value;
// Convert the image to byte[]
System.IO.MemoryStream stream = new System.IO.MemoryStream();
bitmap.Save(stream, System.Drawing.Imaging.ImageFormat.Bmp);
byte[] imageBytes = stream.ToArray();
strValue = Convert.ToBase64String(imageBytes);
}
else if (m.ReturnType == typeof(System.Windows.Forms.Padding))
{
var pd = (System.Windows.Forms.Padding)value;
strValue = string.Format("{0};{1};{2};{3}", pd.Left, pd.Top, pd.Right, pd.Bottom);
}
else
strValue = value.ToString();
return strValue;
}
private object getValueFromString(Type ReturnType, string strValue)
{
if (ReturnType == typeof(System.Drawing.Color))
{
var cint = int.Parse(strValue);
return System.Drawing.Color.FromArgb(cint);
}
else if (ReturnType == typeof(System.Drawing.Rectangle))
{
var buf = strValue.Split(';');
var x = int.Parse(buf[0]);
var y = int.Parse(buf[1]);
var w = int.Parse(buf[2]);
var h = int.Parse(buf[3]);
return new Rectangle(x, y, w, h);
}
else if (ReturnType == typeof(System.Drawing.RectangleF))
{
var buf = strValue.Split(';');
var x = float.Parse(buf[0]);
var y = float.Parse(buf[1]);
var w = float.Parse(buf[2]);
var h = float.Parse(buf[3]);
return new RectangleF(x, y, w, h);
}
else if (ReturnType == typeof(Boolean))
{
return strValue == "1";
}
else if (ReturnType == typeof(System.Drawing.Point))
{
var buf = strValue.Split(';');
var x = int.Parse(buf[0]);
var y = int.Parse(buf[1]);
return new Point(x, y);
}
else if (ReturnType == typeof(System.Drawing.PointF))
{
var buf = strValue.Split(';');
var x = float.Parse(buf[0]);
var y = float.Parse(buf[1]);
return new PointF(x, y);
}
else if (ReturnType == typeof(System.Drawing.Size))
{
var buf = strValue.Split(';');
var x = int.Parse(buf[0]);
var y = int.Parse(buf[1]);
return new Size(x, y);
}
else if (ReturnType == typeof(System.Drawing.SizeF))
{
var buf = strValue.Split(';');
var x = float.Parse(buf[0]);
var y = float.Parse(buf[1]);
return new SizeF(x, y);
}
else if (ReturnType == typeof(System.Drawing.Bitmap))
{
//문자을을 바이트로 전환다
byte[] imageBytes = Convert.FromBase64String(strValue);
Bitmap retval = null;
using (System.IO.MemoryStream stream = new System.IO.MemoryStream(imageBytes))
retval = new Bitmap(stream);
return retval;
}
else if (ReturnType == typeof(System.Windows.Forms.Padding))
{
var buf = strValue.Split(';');
var x = int.Parse(buf[0]);
var y = int.Parse(buf[1]);
var w = int.Parse(buf[2]);
var h = int.Parse(buf[3]);
return new Padding(x, y, w, h);
}
else if (ReturnType == typeof(Int16)) return Int16.Parse(strValue);
else if (ReturnType == typeof(Int32)) return Int32.Parse(strValue);
else if (ReturnType == typeof(Int64)) return Int64.Parse(strValue);
else if (ReturnType == typeof(UInt16)) return UInt16.Parse(strValue);
else if (ReturnType == typeof(UInt32)) return UInt32.Parse(strValue);
else
return strValue;
}
public string GetCategoryName(System.Reflection.PropertyInfo m)
{
var displayName = m
.GetCustomAttributes(typeof(CategoryAttribute), true)
.FirstOrDefault() as CategoryAttribute;
if (displayName != null)
return displayName.Category;
return "";
}
public string GetDisplayName(System.Reflection.MethodInfo m)
{
var displayName = m
.GetCustomAttributes(typeof(DisplayNameAttribute), true)
.FirstOrDefault() as DisplayNameAttribute;
if (displayName != null)
return displayName.DisplayName;
return "";
}
public void RemakeChartRect()
{
if (rects != null) rects = null;
if (menus == null || menus.Length < 1) return;
rects = new Rectangle[menus.Length];
int leftIdx = 0;
int rightIdx = 0;
int leftAcc = 0;
int rightAcc = 0;
int i = 0;
var menuList = this.menus.OrderBy(t => t.No).ToArray();
foreach (var menu in menuList)
{
int x, y, w, h;
// var menu = menus[i];
var mWidth = menuwidth;
if (menu.MenuWidth > 0) mWidth = menu.MenuWidth;
w = mWidth;
h = DisplayRectangle.Height - Padding.Top - Padding.Bottom;
if (menu.isRightMenu)
{
x = DisplayRectangle.Right - Padding.Right - (rightAcc) - (MenuGap * rightIdx);
y = DisplayRectangle.Top + Padding.Top;
rightAcc += 0;// = 0;// x;
rightIdx += 1;
}
else
{
x = DisplayRectangle.Left + Padding.Left + leftAcc + (MenuGap * leftIdx);
y = DisplayRectangle.Top + Padding.Top;
leftAcc += mWidth;
leftIdx += 1;
}
rects[i] = new Rectangle(x, y, w, h);
i += 1;
}
}
}
}

View File

@@ -0,0 +1,69 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
namespace arFrame.Control
{
[TypeConverterAttribute(typeof(ExpandableObjectConverter))]
public class MenuItem
{
[Category("arFrame"),DisplayName("메뉴이름")]
public string Text { get; set; }
[Category("arFrame"), DisplayName("색상-테두리"), Description("메뉴속성의 테두리 기능이 켜져야 합니다")]
public System.Drawing.Color BorderColor { get; set; }
[Category("arFrame"),DisplayName("색상-배경1"),Description("메뉴속성의 배경 기능이 켜져야 합니다")]
public System.Drawing.Color BackColor { get; set; }
[Category("arFrame"), DisplayName("색상-배경2"), Description("메뉴속성의 배경 기능이 켜져야 합니다")]
public System.Drawing.Color BackColor2 { get; set; }
[Category("arFrame"),DisplayName("색상-글자")]
public System.Drawing.Color ForeColor { get; set; }
[Category("arFrame"),DisplayName("메뉴 구분자로 사용합니다")]
public Boolean isSeparate { get; set; }
[Category("arFrame"),DisplayName("오른쪽 붙임")]
public Boolean isRightMenu { get; set; }
[Category("arFrame"),DisplayName("실행 명령")]
public string Command { get; set; }
[Category("arFrame"),DisplayName("아이콘 이미지")]
public System.Drawing.Bitmap Image { get; set; }
[Category("arFrame"),DisplayName("글자 정렬 방식")]
public System.Drawing.ContentAlignment TextAlign { get; set; }
[Category("arFrame"),DisplayName("이미지 정렬 방식")]
public System.Drawing.ContentAlignment ImageAlign { get; set; }
[Category("arFrame"),DisplayName("글자 여백")]
public System.Windows.Forms.Padding Padding { get; set; }
[Category("arFrame"),DisplayName("메뉴 사용여부"),Description("활성화시 메뉴의 클릭이벤트가 발생하지 않습니다")]
public Boolean Enable { get; set; }
[Category("arFrame"),DisplayName("이미지 표시 여백(좌,상)")]
public System.Drawing.Point ImagePadding { get; set; }
[Category("arFrame"),DisplayName("이미지 표시 크기(너비,높이)")]
public System.Drawing.Size ImageSize { get; set; }
[Category("arFrame"),DisplayName("메뉴 간격")]
public int MenuWidth { get; set; }
[Category("arFrame"),DisplayName("번호")]
public int No { get; set; }
public MenuItem()
{
Enable = true;
BorderColor = System.Drawing.Color.FromArgb(20, 20, 20);
BackColor = System.Drawing.Color.DimGray;
BackColor2 = System.Drawing.Color.FromArgb(100, 100, 100);
ForeColor = System.Drawing.Color.Black;
Text = "Menu";
isRightMenu = false;
Command = string.Empty;
Image = null;
isSeparate = false;
TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
Padding = new System.Windows.Forms.Padding(0, 0, 0, 0);
ImagePadding = new System.Drawing.Point(0, 0);
ImageSize = new System.Drawing.Size(0, 0);
MenuWidth = 0;
No = 0;
}
}
}

View File

@@ -0,0 +1,36 @@
namespace arFrame.Control
{
partial class MotCommandButton
{
/// <summary>
/// 필수 디자이너 변수입니다.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 사용 중인 모든 리소스를 정리합니다.
/// </summary>
/// <param name="disposing">관리되는 리소스를 삭제해야 하면 true이고, 그렇지 않으면 false입니다.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region
/// <summary>
/// 디자이너 지원에 필요한 메서드입니다.
/// 이 메서드의 내용을 코드 편집기로 수정하지 마십시오.
/// </summary>
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
}
#endregion
}
}

View File

@@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace arFrame.Control
{
public partial class MotCommandButton : Button
{
public enum eCommand
{
AbsoluteMove = 0,
RelativeMove ,
AcceptPosition
}
public MotCommandButton()
{
InitializeComponent();
motCommand = eCommand.AbsoluteMove;
motValueControl = null;
motAccControl = null;
motSpdControl = null;
}
public MotValueNumericUpDown motValueControl { get; set; }
public MotValueNumericUpDown motAccControl { get; set; }
public MotValueNumericUpDown motSpdControl { get; set; }
public eCommand motCommand { get; set; }
}
}

View File

@@ -0,0 +1,36 @@
namespace arFrame.Control
{
partial class MotLinkLabel
{
/// <summary>
/// 필수 디자이너 변수입니다.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 사용 중인 모든 리소스를 정리합니다.
/// </summary>
/// <param name="disposing">관리되는 리소스를 삭제해야 하면 true이고, 그렇지 않으면 false입니다.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region
/// <summary>
/// 디자이너 지원에 필요한 메서드입니다.
/// 이 메서드의 내용을 코드 편집기로 수정하지 마십시오.
/// </summary>
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
}
#endregion
}
}

View File

@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace arFrame.Control
{
public partial class MotLinkLabel : System.Windows.Forms.LinkLabel
{
public MotLinkLabel()
{
InitializeComponent();
this.LinkColor = Color.Chartreuse;
}
public MotValueNumericUpDown motValueControl { get; set; }
}
}

View File

@@ -0,0 +1,36 @@
namespace arFrame.Control
{
partial class MotValueNumericUpDown
{
/// <summary>
/// 필수 디자이너 변수입니다.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 사용 중인 모든 리소스를 정리합니다.
/// </summary>
/// <param name="disposing">관리되는 리소스를 삭제해야 하면 true이고, 그렇지 않으면 false입니다.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region
/// <summary>
/// 디자이너 지원에 필요한 메서드입니다.
/// 이 메서드의 내용을 코드 편집기로 수정하지 마십시오.
/// </summary>
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
}
#endregion
}
}

View File

@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace arFrame.Control
{
public partial class MotValueNumericUpDown : NumericUpDown
{
public MotValueNumericUpDown()
{
InitializeComponent();
MotionIndex = -1;
}
public int MotionIndex { get; set; }
}
}

View File

@@ -0,0 +1,56 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
namespace arFrame.Control
{
[TypeConverterAttribute(typeof(ExpandableObjectConverter))]
public class MotITem
{
public int idx { get; private set; }
[Category("arFrame"), DisplayName("Tag")]
public string Tag { get; set; }
[Category("arFrame"), DisplayName("글자 정렬 방식")]
public System.Drawing.ContentAlignment TextAlign { get; set; }
[Category("arFrame"), DisplayName("글자 여백")]
public System.Windows.Forms.Padding Padding { get; set; }
[Category("arFrame"), DisplayName("메뉴 사용여부"), Description("활성화시 메뉴의 클릭이벤트가 발생하지 않습니다")]
public Boolean Enable { get; set; }
public string Text { get; set; }
public Boolean Dirty { get; set; }
public System.Drawing.Rectangle[] subRect = null;
//모션 상태값
public Boolean[] State;
public double Position { get; set; }
public double PositionCmd { get; set; }
public System.Drawing.Color PositionColor { get; set; }
public System.Drawing.RectangleF rect { get; set; }
[Category("arFrame"), DisplayName("번호")]
public int No { get; set; }
public MotITem(int idx_)
{
this.Dirty = true;
PositionColor = System.Drawing.Color.White;
subRect = new System.Drawing.Rectangle[6];
rect = System.Drawing.RectangleF.Empty;
Enable = true;
this.idx = idx_;
TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
Padding = new System.Windows.Forms.Padding(0, 0, 0, 0);
No = 0;
this.Text = string.Empty;
this.Enable = true;
this.State = new bool[] { false,false,false,false,false,false};
Position = 0;
PositionCmd = 0;
}
}
}

View File

@@ -0,0 +1,36 @@
namespace arFrame.Control
{
partial class MotionDisplay
{
/// <summary>
/// 필수 디자이너 변수입니다.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 사용 중인 모든 리소스를 정리합니다.
/// </summary>
/// <param name="disposing">관리되는 리소스를 삭제해야 하면 true이고, 그렇지 않으면 false입니다.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region
/// <summary>
/// 디자이너 지원에 필요한 메서드입니다.
/// 이 메서드의 내용을 코드 편집기로 수정하지 마십시오.
/// </summary>
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
}
#endregion
}
}

View File

@@ -0,0 +1,306 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace arFrame.Control
{
public partial class MotionDisplay : System.Windows.Forms.Control
{
private Color[] colorB1 = new Color[] {
Color.MediumSeaGreen,
Color.DeepSkyBlue,
Color.Tomato,
Color.Purple,
Color.Tomato,
Color.FromArgb(40,40,40)
};
private Color[] colorB2 = new Color[] {
Color.SeaGreen,
Color.SteelBlue,
Color.Red,
Color.Indigo,
Color.Red,
Color.FromArgb(30,30,30)
};
private StringFormat sf = new StringFormat();
private string[] IndiName = new string[] { "INP","ORG","LIM","HST","ALM","" };
public MotITem[] Items;
private int _colcount = 3;
private int _rowcount = 2;
private Color _bordercolor = Color.Black;
private Color _gridcolor = Color.FromArgb(50, 50, 50);
private int _bordersize = 1;
private Padding _padding;
private string _postionformat = "";
private int _headerHeight = 16;
private Font _headerfont = new Font("Consolas",7f);
private int itemCount { get { return _colcount * _rowcount; } }
public new Font Font { get { return base.Font; } set { base.Font = value; this.Invalidate(); } }
public Font HeaderFont { get { return _headerfont; } set { _headerfont = value; this.Invalidate(); } }
public int HeaderHeight { get { return _headerHeight; } set { _headerHeight = value; RemakeChartRect(); this.Invalidate(); } }
public new Padding Padding { get { if (_padding == null) return Padding.Empty; else return _padding; } set { _padding = value; RemakeChartRect(); Invalidate(); } }
public int ColumnCount { get { return _colcount; } set { _colcount = value; ResetArray(); RemakeChartRect(); } }
public int RowCount { get { return _rowcount; } set { _rowcount = value; ResetArray(); RemakeChartRect(); } }
public int BorderSize { get { return _bordersize; } set { _bordersize = value; Invalidate(); } }
public Color BorderColor { get { return _bordercolor; } set { _bordercolor = value; Invalidate(); } }
public string PositionDisplayFormat { get { return _postionformat; } set { _postionformat = value; Invalidate(); } }
public Color GridColor { get { return _gridcolor; } set { _gridcolor = value; Invalidate(); } }
public new Boolean Enabled { get { return base.Enabled; } set { base.Enabled = value; Invalidate(); } }
public MotionDisplay()
{
InitializeComponent();
// Set Optimized Double Buffer to reduce flickering
this.SetStyle(ControlStyles.UserPaint, true);
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
// Redraw when resized
this.SetStyle(ControlStyles.ResizeRedraw, true);
sf.LineAlignment = StringAlignment.Center;
sf.Alignment = StringAlignment.Center;
//값과 이름은 외부의 값을 사용한다
ResetArray();
if (MinimumSize.Width == 0 || MinimumSize.Height == 0)
MinimumSize = new Size(100, 50);
}
void ResetArray()
{
}
protected override void OnSizeChanged(EventArgs e)
{
base.OnSizeChanged(e);
RemakeChartRect();
}
public void RemakeChartRect()
{
if (DisplayRectangle == Rectangle.Empty) return;
var baseRect = new Rectangle(
DisplayRectangle.Left + _padding.Left,
DisplayRectangle.Top + _padding.Top,
DisplayRectangle.Width - _padding.Left - _padding.Right,
DisplayRectangle.Height - _padding.Top - _padding.Bottom);
double x = 0;
double y = 0;
double w = baseRect.Width / (_colcount * 1.0);
double h = baseRect.Height / (_rowcount * 1.0);
if (this.Items == null || itemCount != this.Items.Length)
{
//아이템갯수가 달라졌으므로 다시 갱신해야함
var item = new MotITem[RowCount * ColumnCount];
for (int r = 0; r < RowCount; r++)
{
for (int c = 0; c < ColumnCount; c++)
{
int idx = r * ColumnCount + c;
item[idx] = new MotITem(idx);
item[idx].Enable = false;
item[idx].Padding = new Padding(0, 0, 0, 0);
item[idx].TextAlign = ContentAlignment.MiddleCenter;
x = baseRect.Left + (c * w);
y = baseRect.Top + (r * h);
item[idx].rect = new RectangleF((float)x, (float)y, (float)w, (float)h);
item[idx].Dirty = true;
}
}
this.Items = item;
}
else
{
//아이템의 갯수는 같으므로 좌표값만 변경해준다.
for (int r = 0; r < RowCount; r++)
{
for (int c = 0; c < ColumnCount; c++)
{
int idx = r * ColumnCount + c;
var item = Items[idx];
x = (c * w);
y = (r * h);
item.rect = new RectangleF((float)x, (float)y, (float)w, (float)h);
item.Dirty = true;
}
}
}
this.Invalidate();
}
protected override void OnPaint(PaintEventArgs pe)
{
//배경그리기
//using (var sb = new System.Drawing.Drawing2D.LinearGradientBrush(DisplayRectangle, BackColor, BackColor2On, System.Drawing.Drawing2D.LinearGradientMode.Vertical))
pe.Graphics.FillRectangle(new SolidBrush(this.BackColor), DisplayRectangle);
if (Items == null)
{
pe.Graphics.DrawString("no items", this.Font, Brushes.Red, 100, 100);
return;
}
var items = Items.OrderBy(t => t.No);
foreach (var menu in items)
{
drawItem(menu.idx, pe.Graphics);
}
//테두리 그리기
if (BorderSize > 0)
{
pe.Graphics.DrawRectangle(new Pen(this.BorderColor, BorderSize),
this.DisplayRectangle.Left,
this.DisplayRectangle.Top,
this.DisplayRectangle.Width - 1,
this.DisplayRectangle.Height - 1);
}
}
private void drawItem(int itemIndex, Graphics g = null)
{
if (g == null) g = this.CreateGraphics();
var item = this.Items[itemIndex];
// g.DrawString("rect null", this.Font, Brushes.White, 100, 100);
if (item.rect == RectangleF.Empty) return;
var rect = item.rect;// rects[i];
var diplayText = item.Text;
//byte Value = 0;
//배경이 투명이 아니라면 그린다.
//var bgColor1 = Color.DarkBlue; //BackColor1Off;
//var bgColor2 = Color.Blue;// BackColor2Off;
//if (Value != 0 && item.Enable != false)
//{
// //bgColor1 = Value == 1 ? BackColor1On : BackColor1Err;
// //bgColor2 = Value == 1 ? BackColor2On : BackColor2Err;
//}
//using (var sb = new System.Drawing.Drawing2D.LinearGradientBrush(rect, bgColor1, bgColor2, System.Drawing.Drawing2D.LinearGradientMode.Vertical))
// g.FillRectangle(sb, rect);
// if (mouseOverItemIndex == menu.idx)
// this.Cursor = Cursors.Hand;
// else
// this.Cursor = Cursors.Arrow;
//테두리를 그리는 속성과 트기가 설정된 경우에만 표시
//if (mouseOverItemIndex == i)
// {
// pe.Graphics.DrawRectangle(new Pen(Color.DeepSkyBlue), rect.Left, rect.Top, rect.Width, rect.Height);
//}
//else
{
// using (var p = new Pen(BorderColor, 1))
// g.DrawRectangle(p, rect.Left, rect.Top, rect.Width, rect.Height);
}
//총 5개의 인디게이터와 하단에 위치값을 표시하는 영역이 있따.
//줄 영역은 50%비율로 처리함
if(item.Dirty)
{
//각 영역을 다시 그려줘야한다.
var indiWidth = rect.Width / 5.0;
// var indiHeight = rect.Height / 2.0;
for (int c = 0; c < 5; c++)
{
item.subRect[c] = new Rectangle((int)(c * indiWidth + item.rect.Left), (int)(item.rect.Top), (int)indiWidth, (int)HeaderHeight);
}
item.Dirty = false;
//위치값을 나타내는 영역
item.subRect[5] = new Rectangle((int)item.rect.Left, (int)(item.rect.Top + HeaderHeight), (int)rect.Width, (int)rect.Height - HeaderHeight );
}
for(int i = 0 ; i < item.subRect.Length;i++)
{
var B1 = colorB1[i];
var B2 = colorB2[i];
if (i < (item.subRect.Length - 1)) //상태표시칸은 현재 값에 따라서 색상을 달리한다
{
if ( this.Enabled == false || (item.State[i] == false && DesignMode == false))
{
B1 = Color.FromArgb(20,20,20);
B2 = Color.FromArgb(50,50,50);
}
}
var rt = item.subRect[i];
using (var br = new System.Drawing.Drawing2D.LinearGradientBrush(rt, B1, B2, System.Drawing.Drawing2D.LinearGradientMode.Vertical))
g.FillRectangle(br, rt);
// g.DrawRectangle(Pens.Yellow, rt);
if (i < (item.subRect.Length-1))
{
sf.Alignment = StringAlignment.Center;
sf.LineAlignment = StringAlignment.Center;
g.DrawString(IndiName[i], HeaderFont, Brushes.White, rt, sf);
}
else
{
sf.LineAlignment = StringAlignment.Center;
sf.Alignment = StringAlignment.Far;
g.DrawString(item.Position.ToString(PositionDisplayFormat) + " [" + item.PositionCmd.ToString(PositionDisplayFormat) + "] ",
this.Font,
new SolidBrush(item.PositionColor),
rt,
sf);
}
}
//테두리선은 우측만 처리한다
for (int i = 0; i < item.subRect.Length ; i++)
{
var rt = item.subRect[i];
var x1 = rt.Right;
var y1 = rt.Top;
var x2 = rt.Right;
var y2 = rt.Bottom;
g.DrawLine(new Pen(GridColor), x1, y1, x2, y2);
}
var posRect = item.subRect[item.subRect.Length - 1];
g.DrawLine(new Pen(Color.Black,1), posRect.Left, posRect.Top, posRect.Right, posRect.Top);
//인덱스번호 출력
if (diplayText != "")
{
g.DrawString(string.Format("[{0}] {1}", item.idx, diplayText),
this.Font, new SolidBrush(this.ForeColor),
item.rect.Left + 3, item.rect.Top + 3);
}
}
}
}

View File

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 어셈블리의 일반 정보는 다음 특성 집합을 통해 제어됩니다.
// 어셈블리와 관련된 정보를 수정하려면
// 이 특성 값을 변경하십시오.
[assembly: AssemblyTitle("arFrameControl")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("arFrameControl")]
[assembly: AssemblyCopyright("Copyright © 2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// ComVisible을 false로 설정하면 이 어셈블리의 형식이 COM 구성 요소에
// 표시되지 않습니다. COM에서 이 어셈블리의 형식에 액세스하려면
// 해당 형식에 대해 ComVisible 특성을 true로 설정하십시오.
[assembly: ComVisible(false)]
// 이 프로젝트가 COM에 노출되는 경우 다음 GUID는 typelib의 ID를 나타냅니다.
[assembly: Guid("9fa3ef10-3c75-40a2-b3e6-a37900b26d0e")]
// 어셈블리의 버전 정보는 다음 네 가지 값으로 구성됩니다.
//
// 주 버전
// 부 버전
// 빌드 번호
// 수정 버전
//
// 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 버전이 자동으로
// 지정되도록 할 수 있습니다.
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,98 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{A16C9667-5241-4313-888E-548375F85D29}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>arFrame.Control</RootNamespace>
<AssemblyName>arFrameControl</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>AnyCPU</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="GridView\ColorListItem.cs" />
<Compile Include="MotCommandButton.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="MotCommandButton.Designer.cs">
<DependentUpon>MotCommandButton.cs</DependentUpon>
</Compile>
<Compile Include="MotionView\MotITem.cs" />
<Compile Include="GridView\GridView.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="GridView\GridView.Designer.cs">
<DependentUpon>GridView.cs</DependentUpon>
</Compile>
<Compile Include="MenuBar\MenuControl.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="MenuBar\MenuControl.Designer.cs">
<DependentUpon>MenuControl.cs</DependentUpon>
</Compile>
<Compile Include="GridView\GridItem.cs" />
<Compile Include="MenuBar\MenuItem.cs" />
<Compile Include="MotionView\MotionDisplay.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="MotionView\MotionDisplay.Designer.cs">
<DependentUpon>MotionDisplay.cs</DependentUpon>
</Compile>
<Compile Include="MotLinkLabel.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="MotLinkLabel.Designer.cs">
<DependentUpon>MotLinkLabel.cs</DependentUpon>
</Compile>
<Compile Include="MotValueNumericUpDown.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="MotValueNumericUpDown.Designer.cs">
<DependentUpon>MotValueNumericUpDown.cs</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

Submodule Handler/Sub/arImageViewer_Emgu added at b9c8948aaf

Some files were not shown because too many files have changed in this diff Show More