12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- using System.Windows.Forms;
- using System.Drawing;
- using System.Diagnostics;
- namespace FPER
- {
- // cyim 2015.7.1 입력회로 상태값 추가
- //입력회로상태값 초기상태(-1),감지(0),정상(1),단선(3),PreFire(4)
- public enum InputDeviceStatus { Init = -1, Use = 0, Normal = 1, Blocking = 3, PreFire = 4 }
- //출력회로상태값 초기상태(-1),출력없음(0),출력있음(1),차단(3)
- public enum OutputDeviceStatus { Init = -1, NotWrite = 0, Write = 1, Blocking = 3 }
- //입력출력회로 상태 text표시----------------------------------------------------시작
- static public class DeviceStatusText
- {
- static public String InputText(InputDeviceStatus ins, bool cutFlag)
- {
- String toText = "";
- try
- {
- if (cutFlag)
- {
- toText = "차단";
- }
- else
- {
- switch (ins)
- {
- case InputDeviceStatus.Init: toText = " - "; break;
- case InputDeviceStatus.Use: toText = "감지"; break;
- case InputDeviceStatus.Normal: toText = "정상"; break;
- case InputDeviceStatus.Blocking: toText = "단선"; break;
- case InputDeviceStatus.PreFire: toText = "PreFire"; break; // cyim 2015.7.1 입력회로 상태값 추가
- }
- }
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- return toText;
- }
- static public String InputText(InputDeviceStatus ins, DeviceTypeInfo dev)
- {//sdkim, 2011.11.22, don't use device => ' - '
- String toText = " - ";
- try
- {
- if (dev == null || !dev.UseFlag)
- {
- toText = " - ";
- }
- else if (dev.CutFlag)
- {
- toText = "차단";
- }
- else
- {
- switch (ins)
- {
- case InputDeviceStatus.Init:
- toText = " - ";
- break;
- case InputDeviceStatus.Use:
- toText = "감지";
- break;
- case InputDeviceStatus.Normal:
- toText = "정상";
- break;
- case InputDeviceStatus.Blocking:
- toText = "단선";
- break;
- case InputDeviceStatus.PreFire: // cyim 2015.7.1 입력회로 상태값 추가
- toText = "PreFire";
- break;
- }
- }
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- return toText;
- }
- static public String OutputText(OutputDeviceStatus outs, bool cutFlag)
- {
- String outText = "";
- try
- {
- if (cutFlag)
- {
- outText = "차단";
- }
- else
- {
- switch (outs)
- {
- case OutputDeviceStatus.NotWrite: outText = "정상"; break;
- case OutputDeviceStatus.Write: outText = "출력"; break;
- case OutputDeviceStatus.Blocking: outText = "차단"; break;
- }
- }
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- return outText;
- }
- static public String OutputText(OutputDeviceStatus outs, DeviceTypeInfo dev)
- {//sdkim, 2011.11.22, don't use device => ' - ' , 없음 => 꺼짐, 출력 => 동작
- String outText = " - ";
- try
- {
- if (dev == null || !dev.UseFlag)
- {
- outText = " - ";
- }
- else if (dev.CutFlag)
- {
- outText = "차단";
- }
- else
- {
- switch (outs)
- {
- case OutputDeviceStatus.NotWrite:
- outText = "꺼짐";
- break;
- case OutputDeviceStatus.Write:
- outText = "동작";
- break;
- case OutputDeviceStatus.Blocking:
- outText = "차단";
- break;
- }
- }
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- return outText;
- }
- }
- //입력출력회로 상태 text표시----------------------------------------------------끝
- /************************************************************************************************************************/
- /* DataGridView에 중계기 표시 class -frmRepeaterGroup [시작] */
- /************************************************************************************************************************/
- public class GridRepeater
- {
- DataGridViewCell repCell;
- //int repNo = -1;
- ImageList backmg;
- bool loopCutFlag = false;
- //중계기회로 설정값
- RepeaterDeviceTypeInfo dev;
- //중계기회로데이터값
- RepeaterPointUnit unit = null;
- public RepeaterPointUnit Unit { get { return this.unit; } }
- //중계기 상태메세지
- String infoMessage = "";
- public GridRepeater(DataGridViewCell repCell, ImageList backmg, int repNo)
- {
- try
- {
- this.repCell = repCell;
- this.backmg = backmg;
- //if (repNo <= 127)
- //{
- this.repCell.Value = this.backmg.Images[0]; //정상
- //}
- //else
- //{
- // this.repCell.Value = this.backmg.Images[3]; //없음
- //}
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- }
- // cyim 2015.7.2 중계기 및 회로 설정값 중복루틴 제거, 하단코드는 dev 변수 처리외, Set_DeviceUnit 와 동일하므로 삭제해버림
- //중계기및회로 설정값 넣기
- public void Set_DeviceInfo(RepeaterDeviceTypeInfo dev)
- {
- try
- {
- this.dev = dev;
- //if (this.dev == null)
- //{
- // if (this.loopCutFlag) repCell.Value = new Bitmap(this.backmg.Images[1]); //차단이미지
- // return;
- //}
- //if (this.dev.UseFlag)
- //{
- // //중계기타입별 표시
- // if (this.dev.RepeaterType.Equals("A")) repCell.Value = A_typeImage();
- // else if (this.dev.RepeaterType.Equals("B")) repCell.Value = B_typeImage();
- //}
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- }
- //중계기및회로 입력,출력값 넣기
- public void Set_DeviceUnit(RepeaterPointUnit unit)
- {
- try
- {
- this.unit = unit;
- this.reset = true;
- if (this.dev == null)
- {
- if (this.loopCutFlag) repCell.Value = new Bitmap(this.backmg.Images[1]); //차단이미지
- return;
- }
- if (this.dev.UseFlag)
- {
- if (unit != null)
- {
- //중계기타입별 표시
- if (this.dev.RepeaterType.Equals("A")) repCell.Value = A_typeImage();
- else if (this.dev.RepeaterType.Equals("B")) repCell.Value = B_typeImage();
- // cyim 2015.6.8 아날로그 감지기 연동 추가
- else if (this.dev.RepeaterType.Equals("C")) repCell.Value = C_typeImage(unit.AnalogDetecterValue_Input);
- else if (this.dev.RepeaterType.Equals("D")) repCell.Value = C_typeImage(unit.AnalogDetecterValue_Input);
- }
- }
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- //Debug.WriteLine("GridRepeater.Set_DeviceUnit()" + ex.Message);
- }
- }
- bool reset = true;
- //중계기및회로 입력,출력값 넣기
- public bool UpdateDeviceUnit(RepeaterData data)
- {
- bool ret = false;
- try
- {
- if (this.unit.UpdateData(data) || this.reset)
- {
- ret = true;
- this.reset = false;
- if (this.dev == null)
- {
- if (this.loopCutFlag)
- {
- //repCell.Value = new Bitmap(this.backmg.Images[1]); //차단이미지
- repCell.Value = this.backmg.Images[1]; //차단이미지
- }
- return ret;
- }
- if (this.dev.UseFlag)
- {
- //중계기타입별 표시
- if (this.dev.RepeaterType.Equals("A"))
- repCell.Value = this.A_typeImage();
- else if (this.dev.RepeaterType.Equals("B"))
- repCell.Value = this.B_typeImage();
- }
- }
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- //Debug.WriteLine("GridRepeater.Set_DeviceUnit()" + ex.Message);
- }
- return ret;
- }
- // cyim 2015.7.1 입력회로 상태값 추가
- // 아날로그 감지기 값을 기존 중계기 입력 상태와 맞출수가 없어서 결국 UpdateData 함수를 변형함.
- // UpdateData 는 함수오버로딩되어있어서 아날로그 타입인 경우와 구분되도록 루틴을 변경한다
- //중계기및회로 입력,출력값 넣기
- public bool UpdateDeviceUnit(RepeaterData data, AnalogLevel analogLevel, MDIParent mdi) // cyim 2015.8.4 수신반을 위한 static 클래스 정리
- {
- bool ret = false;
- try
- {
- if (this.unit.UpdateData(data, analogLevel, mdi) || this.reset) // cyim 2015.8.4 수신반을 위한 static 클래스 정리
- {
- ret = true;
- this.reset = false;
- if (this.dev == null)
- {
- if (this.loopCutFlag)
- {
- //repCell.Value = new Bitmap(this.backmg.Images[1]); //차단이미지
- repCell.Value = this.backmg.Images[1]; //차단이미지
- }
- return ret;
- }
- if (this.dev.UseFlag)
- {
- //중계기타입별 표시
- if (this.dev.RepeaterType.Equals("A"))
- repCell.Value = this.A_typeImage();
- else if (this.dev.RepeaterType.Equals("B"))
- repCell.Value = this.B_typeImage();
- // cyim 2015.6.8 아날로그 감지기 연동 추가
- else if (this.dev.RepeaterType.Equals("C") || this.dev.RepeaterType.Equals("D"))
- repCell.Value = this.C_typeImage(data.AnalogDetecterValue_Input);
- }
- }
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- //Debug.WriteLine("GridRepeater.Set_DeviceUnit()" + ex.Message);
- }
- return ret;
- }
- public RepeaterDeviceTypeInfo DeviceInfo { get { return this.dev; } }
- public RepeaterPointUnit DeviceUnit { get { return this.unit; } }
- public String InfoMessage { get { return this.infoMessage; } }
- public bool LoopCutFlag { get { return this.loopCutFlag; } set { this.loopCutFlag = value; } }
- //중계기 이미지 표시생성 -- 2회로
- private Image A_typeImage()
- {
- Point posIn1 = new Point(13, 8);
- Point posIn2 = new Point(13, 23);
- Point posOut1 = new Point(49, 8);
- Point posOut2 = new Point(49, 23);
- System.Drawing.Color StColor_in1 = System.Drawing.Color.Silver;
- System.Drawing.Color StColor_in2 = System.Drawing.Color.Silver;
- System.Drawing.Color StColor_out1 = System.Drawing.Color.Silver;
- System.Drawing.Color StColor_out2 = System.Drawing.Color.Silver;
- //중계기 입출력 데이터 별 색상값
- if (this.unit != null)
- {
- StColor_in1 = InputValue(this.unit.Repeater_Input1, this.dev.getDeviceTypeInfo(1, "I"));
- StColor_in2 = InputValue(this.unit.Repeater_Input2, this.dev.getDeviceTypeInfo(2, "I"));
- StColor_out1 = OutputValue(this.unit.Repeater_Output1, this.dev.getDeviceTypeInfo(1, "O"));
- StColor_out2 = OutputValue(this.unit.Repeater_Output2, this.dev.getDeviceTypeInfo(2, "O"));
- }
- Bitmap bmp;
- //중계기차단여부에 따른 이미지
- if (this.dev.CutFlag || this.loopCutFlag)
- {
- bmp = new Bitmap(this.backmg.Images[1]); //차단이미지
- this.infoMessage = "차단된 중계기"; // cyim 2015.2.16 차단된 중계기 문구로 조정
- }
- else
- {
- bmp = new Bitmap(this.backmg.Images[0]); //정상이미지
- if (this.unit != null)
- {
- if (this.unit.RepeaterNon == true)
- {
- bmp = new Bitmap(this.backmg.Images[3]);
- this.infoMessage = "존재하지 않는 중계기";
- }
- else if (this.unit.RepeaterErr == true)
- {
- bmp = new Bitmap(this.backmg.Images[2]); //에러이미지 //2010.4.13_moon >0 -> == true
- this.infoMessage = "중계기 통신 에러";
- }
- else if (this.unit.RepeaterR0 == true)
- {
- bmp = new Bitmap(this.backmg.Images[2]); //에러이미지 //2010.4.13_moon >0 -> == true
- this.infoMessage = "중계기 전원 이상";
- }
- else
- {
- this.infoMessage = "";
- }
- }
- }
- try
- {
- int Width = 12, Height = 12;
- // cyim 2015.6.19 속도개선작업 : 입력1,2 출력1,2
- FillRectangle(bmp, posIn1.X, posIn1.Y, Width, Height, StColor_in1);
- FillRectangle(bmp, posIn2.X, posIn2.Y, Width, Height, StColor_in2);
- FillRectangle(bmp, posOut1.X, posOut1.Y, Width, Height, StColor_out1);
- FillRectangle(bmp, posOut2.X, posOut2.Y, Width, Height, StColor_out2);
- ////입력1
- //for (int Xcount = posIn1.X; Xcount < posIn1.X + Width; Xcount++)
- // for (int Ycount = posIn1.Y; Ycount < posIn1.Y + Height; Ycount++)
- // bmp.SetPixel(Xcount, Ycount, StColor_in1);
- ////입력2
- //for (int Xcount = posIn2.X; Xcount < posIn2.X + Width; Xcount++)
- // for (int Ycount = posIn2.Y; Ycount < posIn2.Y + Height; Ycount++)
- // bmp.SetPixel(Xcount, Ycount, StColor_in2);
- ////출력1
- //for (int Xcount = posOut1.X; Xcount < posOut1.X + Width; Xcount++)
- // for (int Ycount = posOut1.Y; Ycount < posOut1.Y + Height; Ycount++)
- // bmp.SetPixel(Xcount, Ycount, StColor_out1);
- ////출력2
- //for (int Xcount = posOut2.X; Xcount < posOut2.X + Width; Xcount++)
- // for (int Ycount = posOut2.Y; Ycount < posOut2.Y + Height; Ycount++)
- // bmp.SetPixel(Xcount, Ycount, StColor_out2);
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- return bmp;
- }
- //중계기 이미지 표시생성 --4회로
- private Image B_typeImage()
- {
- Point posIn1 = new Point(6, 9);
- Point posIn2 = new Point(20, 9);
- Point posIn3 = new Point(6, 23);
- Point posIn4 = new Point(20, 23);
- Point posOut1 = new Point(43, 9);
- Point posOut2 = new Point(57, 9);
- Point posOut3 = new Point(43, 23);
- Point posOut4 = new Point(57, 23);
- System.Drawing.Color StColor_in1 = System.Drawing.Color.Silver;
- System.Drawing.Color StColor_in2 = System.Drawing.Color.Silver;
- System.Drawing.Color StColor_in3 = System.Drawing.Color.Silver;
- System.Drawing.Color StColor_in4 = System.Drawing.Color.Silver;
- System.Drawing.Color StColor_out1 = System.Drawing.Color.Silver;
- System.Drawing.Color StColor_out2 = System.Drawing.Color.Silver;
- System.Drawing.Color StColor_out3 = System.Drawing.Color.Silver;
- System.Drawing.Color StColor_out4 = System.Drawing.Color.Silver;
- //중계기 입출력 데이터 별 색상값
- if (this.unit != null)
- {
- StColor_in1 = InputValue(this.unit.Repeater_Input1, this.dev.getDeviceTypeInfo(1, "I"));
- StColor_in2 = InputValue(this.unit.Repeater_Input2, this.dev.getDeviceTypeInfo(2, "I"));
- StColor_in3 = InputValue(this.unit.Repeater_Input3, this.dev.getDeviceTypeInfo(3, "I"));
- StColor_in4 = InputValue(this.unit.Repeater_Input4, this.dev.getDeviceTypeInfo(4, "I"));
- StColor_out1 = OutputValue(this.unit.Repeater_Output1, this.dev.getDeviceTypeInfo(1, "O"));
- StColor_out2 = OutputValue(this.unit.Repeater_Output2, this.dev.getDeviceTypeInfo(2, "O"));
- StColor_out3 = OutputValue(this.unit.Repeater_Output3, this.dev.getDeviceTypeInfo(3, "O"));
- StColor_out4 = OutputValue(this.unit.Repeater_Output4, this.dev.getDeviceTypeInfo(4, "O"));
- }
- Bitmap bmp;
- //중계기차단여부에 따른 이미지
- if (this.dev.CutFlag || this.loopCutFlag)
- {
- bmp = new Bitmap(this.backmg.Images[1]); //차단이미지
- this.infoMessage = "차단된 중계기"; // cyim 2015.2.16 차단된 중계기 문구로 조정
- }
- else
- {
- bmp = new Bitmap(this.backmg.Images[0]); //정상이미지
- if (this.unit != null)
- {
- if (this.unit.RepeaterNon == true)
- {
- bmp = new Bitmap(this.backmg.Images[3]);
- this.infoMessage = "존재하지 않는 중계기";
- }
- else if (this.unit.RepeaterErr == true)
- {
- bmp = new Bitmap(this.backmg.Images[2]); //에러이미지 //2010.4.13_moon >0 -> == true
- this.infoMessage = "중계기 통신 에러";
- }
- else if (this.unit.RepeaterR0 == true)
- {
- bmp = new Bitmap(this.backmg.Images[2]); //에러이미지 //2010.4.13_moon >0 -> == true
- this.infoMessage = "중계기 전원 이상";
- }
- else
- {
- this.infoMessage = "";
- }
- }
- }
- try
- {
- int Width = 12, Height = 12;
- // cyim 2015.6.19 속도개선작업 : //입력1,2,3,4 출력1,2,3,4
- FillRectangle(bmp, posIn1.X, posIn1.Y, Width, Height, StColor_in1);
- FillRectangle(bmp, posIn2.X, posIn2.Y, Width, Height, StColor_in2);
- FillRectangle(bmp, posIn3.X, posIn3.Y, Width, Height, StColor_in3);
- FillRectangle(bmp, posIn4.X, posIn4.Y, Width, Height, StColor_in4);
- FillRectangle(bmp, posOut1.X, posOut1.Y, Width, Height, StColor_out1);
- FillRectangle(bmp, posOut2.X, posOut2.Y, Width, Height, StColor_out2);
- FillRectangle(bmp, posOut3.X, posOut3.Y, Width, Height, StColor_out3);
- FillRectangle(bmp, posOut4.X, posOut4.Y, Width, Height, StColor_out4);
- ////입력1--색상표시
- //for (int Xcount = posIn1.X; Xcount < posIn1.X + Width; Xcount++)
- // for (int Ycount = posIn1.Y; Ycount < posIn1.Y + Height; Ycount++)
- // bmp.SetPixel(Xcount, Ycount, StColor_in1);
- ////입력2--색상표시
- //for (int Xcount = posIn2.X; Xcount < posIn2.X + Width; Xcount++)
- // for (int Ycount = posIn2.Y; Ycount < posIn2.Y + Height; Ycount++)
- // bmp.SetPixel(Xcount, Ycount, StColor_in2);
- ////입력3--색상표시
- //for (int Xcount = posIn3.X; Xcount < posIn3.X + Width; Xcount++)
- // for (int Ycount = posIn3.Y; Ycount < posIn3.Y + Height; Ycount++)
- // bmp.SetPixel(Xcount, Ycount, StColor_in3);
- ////입력4--색상표시
- //for (int Xcount = posIn4.X; Xcount < posIn4.X + Width; Xcount++)
- // for (int Ycount = posIn4.Y; Ycount < posIn4.Y + Height; Ycount++)
- // bmp.SetPixel(Xcount, Ycount, StColor_in4);
- ////출력1--색상표시
- //for (int Xcount = posOut1.X; Xcount < posOut1.X + Width; Xcount++)
- // for (int Ycount = posOut1.Y; Ycount < posOut1.Y + Height; Ycount++)
- // bmp.SetPixel(Xcount, Ycount, StColor_out1);
- ////출력2--색상표시
- //for (int Xcount = posOut2.X; Xcount < posOut2.X + Width; Xcount++)
- // for (int Ycount = posOut2.Y; Ycount < posOut2.Y + Height; Ycount++)
- // bmp.SetPixel(Xcount, Ycount, StColor_out2);
- ////출력3--색상표시
- //for (int Xcount = posOut3.X; Xcount < posOut3.X + Width; Xcount++)
- // for (int Ycount = posOut3.Y; Ycount < posOut3.Y + Height; Ycount++)
- // bmp.SetPixel(Xcount, Ycount, StColor_out3);
- ////출력4--색상표시
- //for (int Xcount = posOut4.X; Xcount < posOut4.X + Width; Xcount++)
- // for (int Ycount = posOut4.Y; Ycount < posOut4.Y + Height; Ycount++)
- // bmp.SetPixel(Xcount, Ycount, StColor_out4);
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- return bmp;
- }
- // cyim 2015.6.8 아날로그 감지기 연동 추가
- // '1' = A : 2X2
- // '2' = B : 4X4
- // '4' = C : 아날로그연감지기
- // '5' = D : 아날로그열감지기
- private Image C_typeImage(int AnalogDetecterValue_Input)
- {
- //Point posIn1 = new Point(3,3);
- Point posIn1 = new Point(6, 9);
- System.Drawing.Color StColor_in1 = System.Drawing.Color.Silver;
- //중계기 입출력 데이터 별 색상값
- if (this.unit != null)
- {
- StColor_in1 = AnalogInputValue(this.unit.Repeater_Input1, this.dev.getDeviceTypeInfo(1, "I"));
- }
- Bitmap bmp;
- //중계기차단여부에 따른 이미지
- if (this.dev.CutFlag || this.loopCutFlag)
- {
- bmp = new Bitmap(this.backmg.Images[1]); //차단이미지
- this.infoMessage = "차단된 감지기"; // cyim 2015.2.16 차단된 중계기 문구로 조정 // cyim 2016.01.07 아날로그 감지기 문구로 수정
- }
- else
- {
- bmp = new Bitmap(this.backmg.Images[0]); //정상이미지
- if (this.unit != null)
- {
- if (this.unit.RepeaterNon == true)
- {
- bmp = new Bitmap(this.backmg.Images[3]);
- this.infoMessage = "존재하지 않는 감지기"; // cyim 2016.01.07 아날로그 감지기 문구로 수정
- StColor_in1 = System.Drawing.Color.Silver; // cyim 2016.01.07 아날로그 감지기 통신이상, 존재하지않음, 전원이상 회색표시 하고 글자 표시안함
- }
- else if (this.unit.RepeaterErr == true)
- {
- bmp = new Bitmap(this.backmg.Images[2]); //에러이미지 //2010.4.13_moon >0 -> == true
- this.infoMessage = "감지기 통신 에러"; // cyim 2016.01.07 아날로그 감지기 문구로 수정
- StColor_in1 = System.Drawing.Color.Silver; // cyim 2016.01.07 아날로그 감지기 통신이상, 존재하지않음, 전원이상 회색표시 하고 글자 표시안함
- }
- else if (this.unit.RepeaterR0 == true)
- {
- bmp = new Bitmap(this.backmg.Images[2]); //에러이미지 //2010.4.13_moon >0 -> == true
- this.infoMessage = "감지기 전원 이상"; // cyim 2016.01.07 아날로그 감지기 문구로 수정
- StColor_in1 = System.Drawing.Color.Silver; // cyim 2016.01.07 아날로그 감지기 통신이상, 존재하지않음, 전원이상 회색표시 하고 글자 표시안함
- }
- else
- {
- this.infoMessage = "";
- }
- }
- }
- try
- {
- //int Width = 68 , Height = 37;
- int Width = 62, Height = 25;
- //입력1
- FillRectangle(bmp, posIn1.X, posIn1.Y, Width, Height, StColor_in1, AnalogDetecterValue_Input);
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- return bmp;
- }
- // cyim 2015.6.19 속도개선작업
- // 기존 코드는 픽셀로 점을 찍는 코드로 구성되어 있다.
- // 속도 개선을 위해 영역으로 색상을 칠하도록 수정한다
- private void FillRectangle(Bitmap bmp, int x, int y, int w, int h, Color color)
- {
- Graphics gBuffer = Graphics.FromImage(bmp);
- SolidBrush cbrush = new SolidBrush(color);
- Rectangle rect = new Rectangle(x, y, w, h);
- gBuffer.FillRectangle(cbrush, rect);
- }
- // cyim 2015.7.2 아날로그감지기 값 표시 (내부 텍스트)
- private void FillRectangle(Bitmap bmp, int x, int y, int w, int h, Color color, int AnalogDetecterValue)
- {
- Graphics gBuffer = Graphics.FromImage(bmp);
- SolidBrush cbrush = new SolidBrush(color);
- Rectangle rect = new Rectangle(x, y, w, h);
- gBuffer.FillRectangle(cbrush, rect);
- // 아날로그 감지기의 경우 색상을 칠하고 별도로 현재값을 표시해야 한다. 이때 글자는 검정이지만, 단선의 경우 흰색으로 표시하도록 한다
- if (color == Color.Black)
- cbrush = new SolidBrush(Color.White);
- // cyim 2016.01.07 아날로그 감지기 통신이상, 존재하지않음, 전원이상 회색표시 하고 글자 표시안함
- else if (color == Color.Silver)
- cbrush = new SolidBrush(Color.Silver);
- else
- cbrush = new SolidBrush(Color.Black);
- gBuffer.DrawString(
- string.Format("{0:000}", AnalogDetecterValue),
- new System.Drawing.Font("굴림", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point),
- cbrush,
- new PointF(22, 13));
- }
- //입력값별 상태색상
- //private Color InputValue(InputDeviceStatus inputValue)
- //{
- // System.Drawing.Color StColor_in = System.Drawing.Color.Silver;
- // try
- // {
- // //if (inputValue != null)
- // //{
- // switch (inputValue)
- // {
- // case InputDeviceStatus.Init: StColor_in = System.Drawing.Color.Silver; break; //초기
- // case InputDeviceStatus.Blocking: StColor_in = System.Drawing.Color.Black; break; //차단
- // case InputDeviceStatus.Normal: StColor_in = System.Drawing.Color.Lime; break; //정상
- // case InputDeviceStatus.Use: StColor_in = System.Drawing.Color.Red; break; //감지
- // }
- // //}
- // }
- // catch (Exception ex)
- // {
- // Util.UErrorMessage(ex, 0, 0);
- // }
- // return StColor_in;
- //}
- //입력값별 상태색상
- private Color InputValue(InputDeviceStatus inputValue, DeviceTypeInfo d)
- {
- System.Drawing.Color StColor_in = System.Drawing.Color.Silver;
- try
- {
- if (d == null)
- {
- StColor_in = System.Drawing.Color.Silver;
- }
- else
- {
- switch (inputValue)
- {
- case InputDeviceStatus.Init:
- StColor_in = System.Drawing.Color.Silver;
- break; //초기
- case InputDeviceStatus.Blocking:
- StColor_in = System.Drawing.Color.Black;
- break; //차단
- case InputDeviceStatus.Normal:
- StColor_in = System.Drawing.Color.Lime;
- break; //정상
- case InputDeviceStatus.Use:
- // 설비와 화재는 색상이 틀리다
- if (d.DeviceType == "IC")
- {
- StColor_in = System.Drawing.Color.Blue; //작동
- }
- else
- {
- StColor_in = System.Drawing.Color.Red; //감지
- }
- break;
- }
- }
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- return StColor_in;
- }
- // cyim 2015.7.1 입력회로 상태값 추가
- private Color AnalogInputValue(InputDeviceStatus inputValue, DeviceTypeInfo d)
- {
- System.Drawing.Color StColor_in = System.Drawing.Color.Silver;
- try
- {
- if (d == null)
- {
- StColor_in = System.Drawing.Color.Silver;
- }
- else
- {
- switch (inputValue)
- {
- //초기
- case InputDeviceStatus.Init:
- StColor_in = System.Drawing.Color.Silver;
- break;
- // 단선 (falut)
- case InputDeviceStatus.Blocking:
- StColor_in = System.Drawing.Color.Black;
- break;
- //정상
- case InputDeviceStatus.Normal:
- StColor_in = System.Drawing.Color.Lime;
- break;
- //화재
- case InputDeviceStatus.Use:
- StColor_in = System.Drawing.Color.Red;
- break;
- // PreFire
- case InputDeviceStatus.PreFire:
- StColor_in = System.Drawing.Color.HotPink;
- break;
- }
- }
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- return StColor_in;
- }
- //출력값별 상태색상
- //private Color OutputValue(OutputDeviceStatus outputValue)
- //{
- // System.Drawing.Color StColor_out = System.Drawing.Color.Silver;
- // try
- // {
- // //if (outputValue != null)
- // //{
- // switch (outputValue)
- // {
- // case OutputDeviceStatus.Init: StColor_out = System.Drawing.Color.Silver; break; //초기
- // case OutputDeviceStatus.Blocking: StColor_out = System.Drawing.Color.Black; break; //차단
- // case OutputDeviceStatus.NotWrite: StColor_out = System.Drawing.Color.Green; break; //출력없음
- // case OutputDeviceStatus.Write: StColor_out = System.Drawing.Color.Firebrick; break; //출력있음
- // }
- // //}
- // }
- // catch (Exception ex)
- // {
- // Util.UErrorMessage(ex, 0, 0);
- // }
- // return StColor_out;
- //}
- //출력값별 상태색상
- private Color OutputValue(OutputDeviceStatus outputValue, DeviceTypeInfo d)
- {
- System.Drawing.Color StColor_out = System.Drawing.Color.Silver;
- try
- {
- //if (outputValue != null)
- //{
- if (d == null) // 설정 없음.
- {
- StColor_out = System.Drawing.Color.Silver;
- }
- else
- {
- switch (outputValue)
- {
- case OutputDeviceStatus.Init: // 초기
- StColor_out = System.Drawing.Color.Silver;
- break;
- case OutputDeviceStatus.Blocking: // 차단
- StColor_out = System.Drawing.Color.Black;
- break;
- case OutputDeviceStatus.NotWrite: // 출력없음
- StColor_out = System.Drawing.Color.Green;
- break;
- case OutputDeviceStatus.Write: // 출력
- StColor_out = System.Drawing.Color.Firebrick;
- break;
- }
- }
- //}
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- return StColor_out;
- }
- }
- /************************************************************************************************************************/
- /* DataGridView에 중계기 표시 class -frmRepeaterGroup [끝] */
- /************************************************************************************************************************/
- /*****************************************************************************************************************
- /* 수신기설정값 [시작]*/
- /*****************************************************************************************************************/
- public class ReceiverTypeInfo
- {
- private int receiverNo = -1; //수신기ID
- private Boolean frontLoop_UseFlag = true; //frontLoop 사용여부
- private Boolean backLoop_UseFlag = true; //backLoop 사용여부
- private Boolean io_UseFlag = true; //io보드 사용여부
- private Boolean keypad_UseFlag = true; //keypad 사용여부
-
- // cyim 2017.01.12 : IFC3300 은 통신보드 0번이 존재한다
- // cyim 2016.11.03 : 통신보드(중계반)는 최대 64
- private BoardTypeInfo[] myBoardType = new BoardTypeInfo[65]; //통신보드설정값
- public ReceiverTypeInfo(int receiverNo)
- {
- try
- {
- this.receiverNo = receiverNo;
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- }
- public int ReceiverNo { get { return this.receiverNo; } }
- public Boolean FrontLoop_UseFlag { get { return this.frontLoop_UseFlag; } set { this.frontLoop_UseFlag = value; } }
- public Boolean BackLoop_UseFlag { get { return this.backLoop_UseFlag; } set { this.backLoop_UseFlag = value; } }
- public Boolean Io_UseFlag { get { return this.io_UseFlag; } set { this.io_UseFlag = value; } }
- public Boolean Keypad_UseFlag { get { return this.keypad_UseFlag; } set { this.keypad_UseFlag = value; } }
- public BoardTypeInfo[] MyBoardType { get { return this.myBoardType; } set { this.myBoardType = value; } } //통신보드설정값
- //개별통신보드 설정값 넣기
- public void Set_RepeaterType(BoardTypeInfo info)
- {
- try
- {
- this.myBoardType[info.BoardNo - 1] = info;
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- }
- //개별통신보드 설정값 읽기
- public BoardTypeInfo Get_RepeaterType(int boardNo)
- {
- BoardTypeInfo info = null;
- try
- {
- info = this.myBoardType[boardNo - 1];
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- return info;
- }
- }
- /*****************************************************************************************************************/
- /* 수신기설정값 [끝] */
- /*****************************************************************************************************************/
- // cyim 2016.10.31 : 대용량 수신기용 UI 변경
- /************************************************************************************************************************/
- /* 통신보드설정값 [시작] */
- /************************************************************************************************************************/
- public class BoardTypeInfo
- {
- private int boardNo = -1; //통신보드No
-
- private Boolean loop0UseFlag = false; //loop 0 사용여부
- private Boolean loop1UseFlag = false; //loop 1 사용여부
- private Boolean loop2UseFlag = false; //loop 0 사용여부
- private Boolean loop3UseFlag = false; //loop 1 사용여부
-
- private Boolean useFlag = false; //통신보드 사용여부
-
- private Boolean loop0CutFlag = false; //loop 0 차단여부
- private Boolean loop1CutFlag = false; //loop 1 차단여부
- private Boolean loop2CutFlag = false; //loop 0 차단여부
- private Boolean loop3CutFlag = false; //loop 1 차단여부
- private Boolean loop0CutFlag_change = false; //loop 0 차단여부 변경여부
- private Boolean loop1CutFlag_change = false; //loop 1 차단여부 변경여부
- private Boolean loop2CutFlag_change = false; //loop 2 차단여부 변경여부
- private Boolean loop3CutFlag_change = false; //loop 3 차단여부 변경여부
-
- private RepeaterDeviceTypeInfo[] loop0_RepeaterType = new RepeaterDeviceTypeInfo[127]; //loop 0 의 127개 중계기및회로 설정정보
- private RepeaterDeviceTypeInfo[] loop1_RepeaterType = new RepeaterDeviceTypeInfo[127]; //loop 1 의 127개 중계기및회로 설정정보
- private RepeaterDeviceTypeInfo[] loop2_RepeaterType = new RepeaterDeviceTypeInfo[127]; //loop 2 의 127개 중계기및회로 설정정보
- private RepeaterDeviceTypeInfo[] loop3_RepeaterType = new RepeaterDeviceTypeInfo[127]; //loop 3 의 127개 중계기및회로 설정정보
- private RepeaterPointUnit[] loop0_RepeaterUnit_Data = new RepeaterPointUnit[127]; //loop 0 의 127개 중계기및회로 데이터값
- private RepeaterPointUnit[] loop1_RepeaterUnit_Data = new RepeaterPointUnit[127]; //loop 1 의 127개 중계기및회로 데이터값
- private RepeaterPointUnit[] loop2_RepeaterUnit_Data = new RepeaterPointUnit[127]; //loop 2 의 127개 중계기및회로 데이터값
- private RepeaterPointUnit[] loop3_RepeaterUnit_Data = new RepeaterPointUnit[127]; //loop 3 의 127개 중계기및회로 데이터값
- public BoardTypeInfo(int boardNo)
- {
- try
- {
- this.boardNo = boardNo;
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- }
- public BoardTypeInfo(int boardNo, Boolean useFlag, Boolean loop0UseFlag, Boolean loop1UseFlag, Boolean loop2UseFlag, Boolean loop3UseFlag)
- {
- try
- {
- this.boardNo = boardNo;
- this.useFlag = useFlag;
- this.loop0UseFlag = loop0UseFlag;
- this.loop1UseFlag = loop1UseFlag;
- this.loop2UseFlag = loop2UseFlag;
- this.loop3UseFlag = loop3UseFlag;
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- }
- public int BoardNo { get { return this.boardNo; } }
- public Boolean UseFlag { get { return this.useFlag; } set { this.useFlag = value; } }
- public Boolean Loop0UseFlag { get { return this.loop0UseFlag; } set { this.loop0UseFlag = value; } }
- public Boolean Loop1UseFlag { get { return this.loop1UseFlag; } set { this.loop1UseFlag = value; } }
- public Boolean Loop2UseFlag { get { return this.loop2UseFlag; } set { this.loop2UseFlag = value; } }
- public Boolean Loop3UseFlag { get { return this.loop3UseFlag; } set { this.loop3UseFlag = value; } }
-
- public Boolean Loop0CutFlag { get { return this.loop0CutFlag; } set { this.loop0CutFlag = value; } }
- public Boolean Loop1CutFlag { get { return this.loop1CutFlag; } set { this.loop1CutFlag = value; } }
- public Boolean Loop2CutFlag { get { return this.loop2CutFlag; } set { this.loop2CutFlag = value; } }
- public Boolean Loop3CutFlag { get { return this.loop3CutFlag; } set { this.loop3CutFlag = value; } }
- public RepeaterDeviceTypeInfo[] Loop0_RepeaterType { get { return this.loop0_RepeaterType; } set { this.loop0_RepeaterType = value; } }
- public RepeaterDeviceTypeInfo[] Loop1_RepeaterType { get { return this.loop1_RepeaterType; } set { this.loop1_RepeaterType = value; } }
- public RepeaterDeviceTypeInfo[] Loop2_RepeaterType { get { return this.loop2_RepeaterType; } set { this.loop2_RepeaterType = value; } }
- public RepeaterDeviceTypeInfo[] Loop3_RepeaterType { get { return this.loop3_RepeaterType; } set { this.loop3_RepeaterType = value; } }
- public RepeaterPointUnit[] Loop0_RepeaterUnit_Data { get { return this.loop0_RepeaterUnit_Data; } set { this.loop0_RepeaterUnit_Data = value; } }
- public RepeaterPointUnit[] Loop1_RepeaterUnit_Data { get { return this.loop1_RepeaterUnit_Data; } set { this.loop1_RepeaterUnit_Data = value; } }
- public RepeaterPointUnit[] Loop2_RepeaterUnit_Data { get { return this.loop2_RepeaterUnit_Data; } set { this.loop2_RepeaterUnit_Data = value; } }
- public RepeaterPointUnit[] Loop3_RepeaterUnit_Data { get { return this.loop3_RepeaterUnit_Data; } set { this.loop3_RepeaterUnit_Data = value; } }
- public void Loop0CutFlagChangeReset()
- {
- try
- {
- loop0CutFlag_change = false;
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- }
- public void Loop1CutFlagChangeReset()
- {
- try
- {
- loop1CutFlag_change = false;
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- }
- public void Loop2CutFlagChangeReset()
- {
- try
- {
- loop2CutFlag_change = false;
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- }
- public void Loop3CutFlagChangeReset()
- {
- try
- {
- loop3CutFlag_change = false;
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- }
- public Boolean Loop0CutFlagChange
- {
- get { return this.loop0CutFlag_change; }
- set
- {
- bool cutFlag = value;
- //차단설정데이터 변경여부를 저장한다.
- if (this.loop0CutFlag != cutFlag) loop0CutFlag_change = true;
- this.loop0CutFlag = value;
- }
- }
- public Boolean Loop1CutFlagChange
- {
- get { return this.loop1CutFlag_change; }
- set
- {
- bool cutFlag = value;
- //차단설정데이터 변경여부를 저장한다.
- if (this.loop1CutFlag != cutFlag) loop1CutFlag_change = true;
- this.loop1CutFlag = value;
- }
- }
- public Boolean Loop2CutFlagChange
- {
- get { return this.loop2CutFlag_change; }
- set
- {
- bool cutFlag = value;
- //차단설정데이터 변경여부를 저장한다.
- if (this.loop2CutFlag != cutFlag) loop2CutFlag_change = true;
- this.loop2CutFlag = value;
- }
- }
- public Boolean Loop3CutFlagChange
- {
- get { return this.loop3CutFlag_change; }
- set
- {
- bool cutFlag = value;
- //차단설정데이터 변경여부를 저장한다.
- if (this.loop3CutFlag != cutFlag) loop3CutFlag_change = true;
- this.loop3CutFlag = value;
- }
- }
- }
- /************************************************************************************************************************/
- /* 통신보드설정값 [끝] */
- /************************************************************************************************************************/
- /************************************************************************************************************************/
- /* 중계기회로설정값 -frmReceiverConfig [시작] */
- /************************************************************************************************************************/
- public class RepeaterDeviceTypeInfo
- {
- int repeaterNo = -1;
- DeviceTypeInfo[] inDeviceTypeInfo;
- DeviceTypeInfo[] outDeviceTypeInfo;
- //String[] intype = new String[4]; //회로타입 [TB_DEVICE_TYPE , SYMBOL_TYPE = "I"인경우]
- //String[] intypeName = new String[4]; //회로 설명(입력)
- //Boolean[] inCutFlag = new Boolean[4]; //회로차단 설정(입력)
- //String[] outtype = new String[4]; //회로타입 [TB_DEVICE_TYPE , SYMBOL_TYPE = "O"인경우]
- //String[] outtypeName = new String[4]; //회로타입 설명(출력)
- //Boolean[] outCutFlag = new Boolean[4]; //회로차단 설정(출력)
- // cyim 2015.6.8 아날로그 감지기 연동 추가
- // '1' = A : 2X2
- // '2' = B : 4X4
- // '4' = C : 아날로그연감지기
- // '5' = D : 아날로그열감지기
- String repeaterType = "";
- Boolean cutFlag = false; //중계기 차단여부
- Boolean useFlag = false; //중계기 사용여부
- Boolean cutFlag_change = false; //중계기 차단여부 설정 변경 여부
- Boolean fireResetFlag = false; //비화재보호기능
- public void CutFlagChangeReset()
- {
- try
- {
- cutFlag_change = false;
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- }
- public Boolean CutFlagChange
- {
- get { return this.cutFlag_change; }
- set
- {
- bool cutFlag = value;
- //차단설정데이터 변경여부를 저장한다.
- if (this.cutFlag != cutFlag) cutFlag_change = true;
- this.cutFlag = value;
- }
- }
- public RepeaterDeviceTypeInfo(int repeaterNo)
- {
- try
- {
- this.repeaterNo = repeaterNo;
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- }
- public RepeaterDeviceTypeInfo(int repeaterNo, String repeaterType)
- {
- try
- {
- this.repeaterNo = repeaterNo;
- this.repeaterType = repeaterType;
- this.useFlag = true;
- if (repeaterType.Equals("A"))
- {
- this.inDeviceTypeInfo = new DeviceTypeInfo[2];
- this.outDeviceTypeInfo = new DeviceTypeInfo[2];
- }
- else if (repeaterType.Equals("B"))
- {
- this.inDeviceTypeInfo = new DeviceTypeInfo[4];
- this.outDeviceTypeInfo = new DeviceTypeInfo[4];
- }
- // cyim 2015.6.8 아날로그 감지기 연동 추가
- else if (repeaterType.Equals("C") || repeaterType.Equals("D"))
- {
- this.inDeviceTypeInfo = new DeviceTypeInfo[1];
- this.outDeviceTypeInfo = new DeviceTypeInfo[1];
- }
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- }
- public RepeaterDeviceTypeInfo(int repeaterNo, String repeaterType, Boolean cutFlag)
- {
- try
- {
- this.repeaterNo = repeaterNo;
- this.repeaterType = repeaterType;
- this.cutFlag = cutFlag;
- this.useFlag = true;
- if (repeaterType.Equals("A"))
- {
- this.inDeviceTypeInfo = new DeviceTypeInfo[2];
- this.outDeviceTypeInfo = new DeviceTypeInfo[2];
- }
- else if (repeaterType.Equals("B"))
- {
- this.inDeviceTypeInfo = new DeviceTypeInfo[4];
- this.outDeviceTypeInfo = new DeviceTypeInfo[4];
- }
- // cyim 2015.6.8 아날로그 감지기 연동 추가
- else if (repeaterType.Equals("C") || repeaterType.Equals("D"))
- {
- this.inDeviceTypeInfo = new DeviceTypeInfo[1];
- this.outDeviceTypeInfo = new DeviceTypeInfo[1];
- }
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- }
- public void setInputDeviceTypeInfo(int deviceNo, String deviceType, String deviceName, String positionCode, Boolean cutFlag)
- {
- try
- {
- if (this.inDeviceTypeInfo == null) return;
- if (this.inDeviceTypeInfo[deviceNo - 1] == null) this.inDeviceTypeInfo[deviceNo - 1] = new DeviceTypeInfo(deviceNo);
- this.inDeviceTypeInfo[deviceNo - 1].DeviceType = deviceType;
- this.inDeviceTypeInfo[deviceNo - 1].DeviceName = deviceName;
- this.inDeviceTypeInfo[deviceNo - 1].PositionCode = positionCode;
- this.inDeviceTypeInfo[deviceNo - 1].CutFlag = cutFlag;
- this.inDeviceTypeInfo[deviceNo - 1].UseFlag = true;
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- }
- public void setOutputDeviceTypeInfo(int deviceNo, String deviceType, String deviceName, String positionCode, Boolean cutFlag)
- {
- try
- {
- if (this.outDeviceTypeInfo == null) return;
- if (this.outDeviceTypeInfo[deviceNo - 1] == null) this.outDeviceTypeInfo[deviceNo - 1] = new DeviceTypeInfo(deviceNo);
- this.outDeviceTypeInfo[deviceNo - 1].DeviceType = deviceType;
- this.outDeviceTypeInfo[deviceNo - 1].DeviceName = deviceName;
- this.outDeviceTypeInfo[deviceNo - 1].PositionCode = positionCode;
- this.outDeviceTypeInfo[deviceNo - 1].CutFlag = cutFlag;
- this.outDeviceTypeInfo[deviceNo - 1].UseFlag = true;
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- }
- public int RepeaterNo { get { return this.repeaterNo; } set { this.repeaterNo = value; } }
- public bool FireResetFlag { get { return this.fireResetFlag; } set { this.fireResetFlag = value; } }
- //public String InType1 { get { return this.intype[0]; } set { this.intype[0] = value; } }
- //public String InType2 { get { return this.intype[1]; } set { this.intype[1] = value; } }
- //public String InType3 { get { return this.intype[2]; } set { this.intype[2] = value; } }
- //public String InType4 { get { return this.intype[3]; } set { this.intype[3] = value; } }
- //public String InTypeName1 { get { return this.intypeName[0]; } set { this.intypeName[0] = value; } }
- //public String InTypeName2 { get { return this.intypeName[1]; } set { this.intypeName[1] = value; } }
- //public String InTypeName3 { get { return this.intypeName[2]; } set { this.intypeName[2] = value; } }
- //public String InTypeName4 { get { return this.intypeName[3]; } set { this.intypeName[3] = value; } }
- //public Boolean InCutFlag1 { get { return this.inCutFlag[0]; } set { this.inCutFlag[0] = value; } }
- //public Boolean InCutFlag2 { get { return this.inCutFlag[1]; } set { this.inCutFlag[1] = value; } }
- //public Boolean InCutFlag3 { get { return this.inCutFlag[2]; } set { this.inCutFlag[2] = value; } }
- //public Boolean InCutFlag4 { get { return this.inCutFlag[3]; } set { this.inCutFlag[3] = value; } }
- //public String OutType1 { get { return this.outtype[0]; } set { this.outtype[0] = value; } }
- //public String OutType2 { get { return this.outtype[1]; } set { this.outtype[1] = value; } }
- //public String OutType3 { get { return this.outtype[2]; } set { this.outtype[2] = value; } }
- //public String OutType4 { get { return this.outtype[3]; } set { this.outtype[3] = value; } }
- //public String OutTypeName1 { get { return this.outtypeName[0]; } set { this.outtypeName[0] = value; } }
- //public String OutTypeName2 { get { return this.outtypeName[1]; } set { this.outtypeName[1] = value; } }
- //public String OutTypeName3 { get { return this.outtypeName[2]; } set { this.outtypeName[2] = value; } }
- //public String OutTypeName4 { get { return this.outtypeName[3]; } set { this.outtypeName[3] = value; } }
- //public Boolean OutCutFlag1 { get { return this.outCutFlag[0]; } set { this.outCutFlag[0] = value; } }
- //public Boolean OutCutFlag2 { get { return this.outCutFlag[1]; } set { this.outCutFlag[1] = value; } }
- //public Boolean OutCutFlag3 { get { return this.outCutFlag[2]; } set { this.outCutFlag[2] = value; } }
- //public Boolean OutCutFlag4 { get { return this.outCutFlag[3]; } set { this.outCutFlag[3] = value; } }
- //public String[] InType { get { return this.intype; } set { this.intype= value; } }
- //public String[] InTypeName { get { return this.intypeName; } set { this.intypeName = value; } }
- //public Boolean[] InCutFlag { get { return this.inCutFlag; } set { this.inCutFlag = value; } }
- //public String[] OutType { get { return this.outtype; } set { this.outtype = value; } }
- //public String[] OuttypeName { get { return this.outtypeName; } set { this.outtypeName = value; } }
- //public Boolean[] OutCutFlag { get { return this.outCutFlag; } set { this.outCutFlag = value; } }
- public void setDeviceTypeInfo(DeviceTypeInfo dev, string inoutType)
- {
- try
- {
- if (inoutType.Equals(code_InOutType.Input)) this.inDeviceTypeInfo[dev.DeviceNo - 1] = dev;
- else if (inoutType.Equals(code_InOutType.Output)) this.outDeviceTypeInfos[dev.DeviceNo - 1] = dev;
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- }
- public DeviceTypeInfo getDeviceTypeInfo(int deviceNo, string inoutType)
- {
- DeviceTypeInfo dev = null;
- try
- {
- if (inoutType.Equals(code_InOutType.Input)) dev = this.inDeviceTypeInfo[deviceNo - 1];
- else if (inoutType.Equals(code_InOutType.Output)) dev = this.outDeviceTypeInfos[deviceNo - 1];
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- return dev;
- }
- public DeviceTypeInfo[] inDeviceTypeInfos { get { return this.inDeviceTypeInfo; } set { this.inDeviceTypeInfo = value; } }
- public DeviceTypeInfo[] outDeviceTypeInfos { get { return this.outDeviceTypeInfo; } set { this.outDeviceTypeInfo = value; } }
- // cyim 2015.6.8 아날로그 감지기 연동 추가
- // '1' = A : 2X2
- // '2' = B : 4X4
- // '4' = C : 아날로그연감지기
- // '5' = D : 아날로그열감지기
- public String RepeaterType
- {
- get { return this.repeaterType; }
- set
- {
- this.repeaterType = value;
- // 2회로
- if (this.repeaterType.Equals("A"))
- {
- if (this.inDeviceTypeInfo == null)
- {
- this.inDeviceTypeInfo = new DeviceTypeInfo[2];
- this.outDeviceTypeInfo = new DeviceTypeInfo[2];
- }
- }
- // 4회로
- else if (this.repeaterType.Equals("B"))
- {
- if (this.inDeviceTypeInfo == null)
- {
- this.inDeviceTypeInfo = new DeviceTypeInfo[4];
- this.outDeviceTypeInfo = new DeviceTypeInfo[4];
- }
- }
- // cyim 2015.6.8 아날로그 감지기 연동 추가
- else if (this.repeaterType.Equals("C") || this.repeaterType.Equals("D"))
- {
- if (this.inDeviceTypeInfo == null)
- {
- this.inDeviceTypeInfo = new DeviceTypeInfo[1];
- this.outDeviceTypeInfo = new DeviceTypeInfo[1];
- }
- }
- }
- }
- public Boolean CutFlag { get { return this.cutFlag; } set { this.cutFlag = value; } }
- public Boolean UseFlag { get { return this.useFlag; } set { this.useFlag = value; } }
- }
- /************************************************************************************************************************/
- /* 중계기회로설정값 -frmReceiverConfig [끝] */
- /************************************************************************************************************************/
- /************************************************************************************************************************/
- /* 회로설정값 -frmReceiverConfig [시작] */
- /************************************************************************************************************************/
- public class DeviceTypeInfo
- {
- int deviceNo = -1;
- string deviceType = null; //연동타입
- string deviceName = null; //회로설명
- bool cutFlag = false; //차단여부
- bool useFlag = false; //사용여부
- string positionCode = null; //위치코드
- public DeviceTypeInfo(int deviceNo)
- {
- try
- {
- this.deviceNo = deviceNo;
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- }
- public int DeviceNo { get { return this.deviceNo; } }
- public String DeviceType { get { return this.deviceType; } set { this.deviceType = value; } }
- public String DeviceName { get { return this.deviceName; } set { this.deviceName = value; } }
- public bool CutFlag { get { return this.cutFlag; } set { this.cutFlag = value; } }
- public bool UseFlag { get { return this.useFlag; } set { this.useFlag = value; } }
- public String PositionCode { get { return this.positionCode; } set { this.positionCode = value; } }
- }
- /************************************************************************************************************************/
- /* 중계기 상태값 및 회로 데이터 [시작] */
- /************************************************************************************************************************/
- public class RepeaterPointUnit
- {
- //입력회로 데이터값
- private InputDeviceStatus input1 = InputDeviceStatus.Init;
- private InputDeviceStatus input2 = InputDeviceStatus.Init;
- private InputDeviceStatus input3 = InputDeviceStatus.Init;
- private InputDeviceStatus input4 = InputDeviceStatus.Init;
- //출력회로 데이터값
- private OutputDeviceStatus output1 = OutputDeviceStatus.Init;
- private OutputDeviceStatus output2 = OutputDeviceStatus.Init;
- private OutputDeviceStatus output3 = OutputDeviceStatus.Init;
- private OutputDeviceStatus output4 = OutputDeviceStatus.Init;
- //Tprotocol의 중계기 데이터
- // RCVData_ReadRepeaterPoint_unit unitData; //2010.4.13_moon
- //RepeaterData unitData;
- // repeater id//
- private int repeater_ID = 0;
- // repeater state //
- private bool repeaterErr = false; //에러상태
- private bool repeaterNon = false; //존재하지 않는 중계기
- private bool repeaterR0 = false; //Reserved--24Voltage Fault발생
- private bool repeaterR1 = false; //Reserved
- private bool repeaterR2 = false; //Reserved
- private bool repeaterR = false; //중계기 복구 명령 0-완료,1-완료안함
- private bool repeaterW = false; //출력쓰기 완료 0-완료,1-완료안함
- private bool repeaterS = false; //Search Complete 0-완료,1-완료안함
- // cyim 2015.7.1 입력회로 상태값 추가 : 아날로그 감지기 연동으로 인하여 입력값은 중계기든 아날로그 감지기는 반드시 1byte 저장하게 된다
- public int AnalogDetecterValue_Input = 0;
- // cyim 2015.7.1 입력회로 상태값 추가
- // 아날로그 감지기 레벨값은 데이타베이스가 기준이 되므로, 결국 메모리 할당 직전에 아날로그 감지기인지 확인하고 아래의 값을 셋팅할 수 밖에 없다.
- // 함수오버로딩으로 기본으로 사용하는 생성자외에, 아날로그 타입인지 아닌지 구분하기 위해서 Fault, PreFire, FireDay, FireNight 가 모두 0 이면
- // 이는 중계기이고 그렇지 않으면 아날로그 감지기라고 판단하고 동작해야 한다.
- public AnalogLevel AnalogDetecterLevel = new AnalogLevel(0, 0, 0, 0);
- // 기본
- public RepeaterPointUnit(int repeater_ID, RepeaterData unitData) // public RepeaterPointUnit(int repeater_ID, RCVData_ReadRepeaterPoint_unit unitData) //2010.4.13_moon
- {
- try
- {
- // 중계기 아이디
- this.repeater_ID = repeater_ID;
- // 상태값 넣기
- this.SetStateData(unitData);
- // 입력값 넣기
- this.SetInputData(unitData);
- // 출력값 넣기
- this.SetOutputData(unitData);
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- }
- // cyim 2015.7.3 아날로그 감지기와 중계기 생성자 구분
- // 생성자의 경우 함수오버로딩을 통하여 기존의 중계기는 그대로 이용하되 별도로 아날로그 중계기 전용 생성자를 이용하도록 한다
- // 중요한 것은 생성자가 실행되기 직전에 미리 내부적으로 중계기 아이디만을 가지고 이것이 아날로그 감지기 인지 아닌지를 판단할수 밖에 없는 구조를 안고 구성된다는 점이다.
- // 결국 분기된 생성자는 별도로 업데이트 함수가 필요할 수 밖에 없을 것 같다.
- public RepeaterPointUnit(int repeater_ID, RepeaterData unitData, AnalogLevel analogLevel, MDIParent mdi) // cyim 2015.8.4 수신반을 위한 static 클래스 정리
- {
- try
- {
- // 아날로그 감지기 레벨 정보 추가
- this.AnalogDetecterLevel = analogLevel;
- // 중계기 아이디
- this.repeater_ID = repeater_ID;
- // 상태값 넣기
- this.SetStateData(unitData);
- // 입력값 넣기
- this.SetInputData(unitData.AnalogDetecterValue_Input, analogLevel, mdi); // 특별처리 아날로그 감지기는 입력이 틀리다 상위1비트를 제외한 나머지 7 bir 의 아날로그 값이 입력값이다. // cyim 2015.8.4 수신반을 위한 static 클래스 정리
- // 출력값 넣기
- this.SetOutputData(unitData); //출력값 넣기
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- }
- // 일반 중계기용
- public bool UpdateData(RepeaterData unitData)
- {
- bool ret = false;
- try
- {
- if (this.UpdateStateData(unitData))
- {
- ret = true;
- }
- if (this.UpdateInputData(unitData))
- {
- ret = true;
- }
- if (this.UpdateOutputData(unitData))
- {
- ret = true;
- }
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- return ret;
- }
- // cyim 2015.7.3 아날로그 감지기와 중계기 생성자 구분 -> 아날로그 감지기용
- public bool UpdateData(RepeaterData unitData, AnalogLevel analogLevel, MDIParent mdi) // cyim 2015.8.4 수신반을 위한 static 클래스 정리
- {
- bool ret = false;
- try
- {
- if (this.UpdateStateData(unitData))
- {
- ret = true;
- }
- if (this.UpdateInputData(unitData.AnalogDetecterValue_Input, analogLevel, mdi)) // cyim 2015.8.4 수신반을 위한 static 클래스 정리
- {
- ret = true;
- }
- if (this.UpdateOutputData(unitData))
- {
- ret = true;
- }
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- return ret;
- }
- bool UpdateStateData(RepeaterData unitData)
- {
- bool ret = false;
- try
- {
- // cyim 2013.7.18 중계기상태보기 오류
- if (repeaterNon != unitData.Non)
- {
- repeaterNon = unitData.Non;
- ret = true;
- }
- if (repeaterErr != unitData.Err)
- {
- repeaterErr = unitData.Err;
- ret = true;
- }
- if (repeaterR0 != unitData.R0)
- {
- repeaterR0 = unitData.R0;
- ret = true;
- }
- if (repeaterR1 != unitData.R1)
- {
- repeaterR1 = unitData.R1;
- ret = true;
- }
- if (repeaterR2 != unitData.R2)
- {
- repeaterR2 = unitData.R2;
- ret = true;
- }
- if (repeaterR != unitData.R)
- {
- repeaterR = unitData.R;
- ret = true;
- }
- if (repeaterW != unitData.W)
- {
- repeaterW = unitData.W;
- ret = true;
- }
- if (repeaterS != unitData.S)
- {
- repeaterS = unitData.S;
- ret = true;
- }
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- return ret;
- }
- //중계기 상태값 저장
- private void SetStateData(RepeaterData unitData)
- {
- try
- {
- repeaterErr = unitData.Err;
- repeaterNon = unitData.Non;
- repeaterR0 = unitData.R0;
- repeaterR1 = unitData.R1;
- repeaterR2 = unitData.R2;
- repeaterR = unitData.R;
- repeaterW = unitData.W;
- repeaterS = unitData.S;
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- }
- //입력데이터 저장
- private void SetInputData(RepeaterData unitData)
- {
- try
- {
- input1 = inputCompute(unitData.Repeater_state_1); //2010.4.13_moon repeater -> Repeater
- input2 = inputCompute(unitData.Repeater_state_2);//2010.4.13_moon repeater -> Repeater
- input3 = inputCompute(unitData.Repeater_state_3);//2010.4.13_moon repeater -> Repeater
- input4 = inputCompute(unitData.Repeater_state_4);//2010.4.13_moon repeater -> Repeater
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- }
- // cyim 2015.7.3 아날로그 감지기와 중계기 생성자 구분 -> 아날로그 감지기 입력데이터 저장하는 경우에는 매개변수가 int 값
- private void SetInputData(int analogValue, AnalogLevel analogLevel, MDIParent mdi) // cyim 2015.8.4 수신반을 위한 static 클래스 정리
- {
- try
- {
- input1 = inputCompute(analogValue, analogLevel, mdi); // cyim 2015.8.4 수신반을 위한 static 클래스 정리
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- }
- // cyim 2015.7.3 아날로그 감지기와 중계기 생성자 구분 -> 일반 중계기용
- bool UpdateInputData(RepeaterData unitData)
- {
- bool ret = false;
- try
- {
- if (input1 != inputCompute(unitData.Repeater_state_1))
- {
- input1 = inputCompute(unitData.Repeater_state_1); //2010.4.13_moon repeater -> Repeater
- ret = true;
- }
- if (input2 != inputCompute(unitData.Repeater_state_2))
- {
- input2 = inputCompute(unitData.Repeater_state_2); //2010.4.13_moon repeater -> Repeater
- ret = true;
- }
- if (input3 != inputCompute(unitData.Repeater_state_3))
- {
- input3 = inputCompute(unitData.Repeater_state_3); //2010.4.13_moon repeater -> Repeater
- ret = true;
- }
- if (input4 != inputCompute(unitData.Repeater_state_4))
- {
- input4 = inputCompute(unitData.Repeater_state_4); //2010.4.13_moon repeater -> Repeater
- ret = true;
- }
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- return ret;
- }
- // cyim 2015.7.3 아날로그 감지기와 중계기 생성자 구분 -> 아날로그 감지기용
- bool UpdateInputData(int analogValue, AnalogLevel analogLevel, MDIParent mdi) // cyim 2015.8.4 수신반을 위한 static 클래스 정리
- {
- bool ret = false;
- try
- {
- if (input1 != inputCompute(analogValue, analogLevel, mdi) // cyim 2015.8.4 수신반을 위한 static 클래스 정리
- || AnalogDetecterValue_Input != analogValue) // 아날로그 감지기는 정상인 상태이더라도 결국 값자체는 지속적으로 변하게된다. 값이 변경되어도 업데이트 조건에 해당된다
- {
- input1 = inputCompute(analogValue, analogLevel, mdi); // cyim 2015.8.4 수신반을 위한 static 클래스 정리
- ret = true;
- }
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- return ret;
- }
- //출력데이터 저장
- private void SetOutputData(RepeaterData unitData)
- {
- try
- {
- output1 = outputCompute(unitData.Repeater_output_1_C, unitData.Repeater_output_1_W);//2010.4.13_moon repeater -> Repeater
- output2 = outputCompute(unitData.Repeater_output_2_C, unitData.Repeater_output_2_W);//2010.4.13_moon repeater -> Repeater
- output3 = outputCompute(unitData.Repeater_output_3_C, unitData.Repeater_output_3_W);//2010.4.13_moon repeater -> Repeater
- output4 = outputCompute(unitData.Repeater_output_4_C, unitData.Repeater_output_4_W);//2010.4.13_moon repeater -> Repeater
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- }
- bool UpdateOutputData(RepeaterData unitData)
- {
- bool ret = false;
- try
- {
- if (output1 != outputCompute(unitData.Repeater_output_1_C, unitData.Repeater_output_1_W))
- {
- output1 = outputCompute(unitData.Repeater_output_1_C, unitData.Repeater_output_1_W); //2010.4.13_moon repeater -> Repeater
- ret = true;
- }
- if (output2 != outputCompute(unitData.Repeater_output_2_C, unitData.Repeater_output_2_W))
- {
- output2 = outputCompute(unitData.Repeater_output_2_C, unitData.Repeater_output_2_W); //2010.4.13_moon repeater -> Repeater
- ret = true;
- }
- if (output3 != outputCompute(unitData.Repeater_output_3_C, unitData.Repeater_output_3_W))
- {
- output3 = outputCompute(unitData.Repeater_output_3_C, unitData.Repeater_output_3_W); //2010.4.13_moon repeater -> Repeater
- ret = true;
- }
- if (output4 != outputCompute(unitData.Repeater_output_4_C, unitData.Repeater_output_4_W))
- {
- output4 = outputCompute(unitData.Repeater_output_4_C, unitData.Repeater_output_4_W); //2010.4.13_moon repeater -> Repeater
- ret = true;
- }
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- return ret;
- }
- // cyim 2015.7.1 입력회로 상태값 추가
- // 아날로그 감지기 연동으로 인하여 변형된 입력회로 값은 아래와 같다
- //
- //입력회로상태값 초기상태(-1),감지(0),정상(1),단선(3),PreFire(4)
- //public enum InputDeviceStatus { Init = -1, Use = 0, Normal = 1, Blocking = 3, PreFire = 4 }
- //출력회로상태값 초기상태(-1),출력없음(0),출력있음(1),차단(3)
- //public enum OutputDeviceStatus { Init = -1, NotWrite = 0, Write = 1, Blocking = 3 }
- //출력데이터를 UI확인값으로 형변환
- private OutputDeviceStatus outputCompute(bool repeater_output_C, bool repeater_output_W)//2010.4.13_moon repeater -> Repeater
- {
- if (repeater_output_C == true) return OutputDeviceStatus.Blocking; //차단 //2010.4.13_moon == 1 -> == true
- else if (repeater_output_W == true) return OutputDeviceStatus.Write; //출력있음 //2010.4.13_moon == 1 -> == true
- else if (repeater_output_W == false) return OutputDeviceStatus.NotWrite; //출력없음 //2010.4.13_moon == 0 -> == true
- else return OutputDeviceStatus.Init;
- }
- //입력데이터를 UI확인값으로 형변환
- private InputDeviceStatus inputCompute(int repeater_state)
- {
- if (repeater_state == 0) return InputDeviceStatus.Use; //감지
- else if (repeater_state == 1) return InputDeviceStatus.Normal; //정상
- else if (repeater_state == 3) return InputDeviceStatus.Blocking; //단선
- else if (repeater_state == 4) return InputDeviceStatus.PreFire; //PreFire
- else return InputDeviceStatus.Init;
- }
- // 아날로그 감지기 연동을 위해 별도로 레벨 값 정보가 필요하다
- private InputDeviceStatus inputCompute(int analogValue, AnalogLevel analogLevel, MDIParent mdi) // cyim 2015.8.4 수신반을 위한 static 클래스 정리
- {
- // (Normal : 0, Fault :1, PreFire : 2, Fire : 3)
- int repeater_state = mdi.AnalogDetect.Get_LevelStatus(analogValue, analogLevel); // cyim 2015.8.4 수신반을 위한 static 클래스 정리
- if (repeater_state == 3) return InputDeviceStatus.Use; //감지
- else if (repeater_state == 0) return InputDeviceStatus.Normal; //정상
- else if (repeater_state == 1) return InputDeviceStatus.Blocking; //단선
- else if (repeater_state == 2) return InputDeviceStatus.PreFire; //PreFire
- else return InputDeviceStatus.Init;
- }
- public bool RepeaterErr { get { return this.repeaterErr; } } //2010.4.13_moon int -> bool
- public bool RepeaterNon { get { return this.repeaterNon; } } //2010.4.13_moon int -> bool
- public bool RepeaterR0 { get { return this.repeaterR0; } } //2010.4.13_moon int -> bool
- public bool RepeaterR1 { get { return this.repeaterR1; } } //2010.4.13_moon int -> bool
- public bool RepeaterR2 { get { return this.repeaterR2; } } //2010.4.13_moon int -> bool
- public bool RepeaterR { get { return this.repeaterR; } } //2010.4.13_moon int -> bool
- public bool RepeaterW { get { return this.repeaterW; } } //2010.4.13_moon int -> bool
- public bool RepeaterS { get { return this.repeaterS; } } //2010.4.13_moon int -> bool
- public InputDeviceStatus[] Repeater_Input
- {
- get
- {
- InputDeviceStatus[] indata = new InputDeviceStatus[4] {
- this.input1,this.input2,this.input3,this.input4
- };
- return indata;
- }
- }
- public InputDeviceStatus Repeater_Input1 { get { return this.input1; } }
- public InputDeviceStatus Repeater_Input2 { get { return this.input2; } }
- public InputDeviceStatus Repeater_Input3 { get { return this.input3; } }
- public InputDeviceStatus Repeater_Input4 { get { return this.input4; } }
- public OutputDeviceStatus[] Repeater_Output
- {
- get
- {
- OutputDeviceStatus[] outdata = new OutputDeviceStatus[4] {
- this.output1,this.output2,this.output3,this.output4
- };
- return outdata;
- }
- set
- {
- this.output1 = value[0];
- this.output2 = value[1];
- this.output3 = value[2];
- this.output4 = value[3];
- }
- }
- public OutputDeviceStatus Repeater_Output1 { get { return this.output1; } }
- public OutputDeviceStatus Repeater_Output2 { get { return this.output2; } }
- public OutputDeviceStatus Repeater_Output3 { get { return this.output3; } }
- public OutputDeviceStatus Repeater_Output4 { get { return this.output4; } }
- }
- /************************************************************************************************************************/
- /* 중계기 상태값 및 회로 데이터 [끝] */
- /************************************************************************************************************************/
- }
|