@@ -390,7 +390,7 @@ public void ComplexVariableAccessTest1()
390390 var s = new Signal ( "#A.B.C[#D.E.F, 1]" ) ;
391391 s . AddXmlToStringBuilder ( 1 , sb ) ;
392392 var xml = sb . ToString ( ) ;
393- Assert . AreEqual ( "<Access Scope=\" LocalVariable\" UId=\" 1\" >\r \n <Symbol>\r \n <Component Name=\" A\" >\r \n </Component>\r \n <Component Name=\" B\" >\r \n </Component>\r \n <Component Name=\" C\" >\r \n <Access Scope=\" LocalVariable\" >\r \n <Symbol>\r \n <Component Name=\" D\" />\r \n <Component Name=\" E\" />\r \n <Component Name=\" F\" />\r \n </Symbol>\r \n </Access>\r \n <Access Scope=\" LiteralConstant\" >\r \n <Constant>\r \n <ConstantType>DInt</ConstantType>\r \n <ConstantValue>1</ConstantValue>\r \n </Constant>\r \n </Access>\r \n </Component>\r \n </Symbol>\r \n </Access>\r \n " . Replace ( "\n " , "" ) . Replace ( "\r " , "" ) , xml . Replace ( "\n " , "" ) . Replace ( "\r " , "" ) ) ;
393+ Assert . AreEqual ( "<Access Scope=\" LocalVariable\" UId=\" 1\" >\r \n <Symbol>\r \n <Component Name=\" A\" >\r \n </Component>\r \n <Component Name=\" B\" >\r \n </Component>\r \n <Component Name=\" C\" >\r \n <Access Scope=\" LocalVariable\" >\r \n <Symbol>\r \n <Component Name=\" D\" />\r \n <Component Name=\" E\" />\r \n <Component Name=\" F\" />\r \n </Symbol>\r \n </Access>\r \n <Access Scope=\" LiteralConstant\" >\r \n <Constant>\r \n <ConstantType>DInt</ConstantType>\r \n <ConstantValue>1</ConstantValue>\r \n </Constant>\r \n </Access>\r \n </Component>\r \n </Symbol>\r \n </Access>\r \n " . Replace ( "\n " , "" ) . Replace ( "\r " , "" ) , xml . Replace ( "\n " , "" ) . Replace ( "\r " , "" ) ) ;
394394 }
395395
396396 [ Test ]
@@ -436,5 +436,133 @@ public void SystemFunctionDPXX_DAT()
436436
437437 //Assert.AreEqual("<Access Scope=\"LocalVariable\" UId=\"1\">\r\n<Symbol>\r\n<Component Name=\"A\">\r\n</Component>\r\n<Component Name=\"B\">\r\n</Component>\r\n<Component Name=\"C\">\r\n<Access Scope=\"LocalVariable\">\r\n<Symbol>\r\n<Component Name=\"D\" />\r\n<Component Name=\"E\" />\r\n<Component Name=\"F\" />\r\n</Symbol>\r\n</Access>\r\n<Access Scope=\"LiteralConstant\">\r\n<Constant>\r\n<ConstantType>DInt</ConstantType>\r\n<ConstantValue>1</ConstantValue>\r\n</Constant>\r\n</Access>\r\n</Component>\r\n</Symbol>\r\n</Access>\r\n".Replace("\n", "").Replace("\r", ""), xml.Replace("\n", "").Replace("\r", ""));
438438 }
439+
440+ [ Test ]
441+ public void ComplexOr ( )
442+ {
443+ var codeblock = new CodeBlock ( ) { Safety = false } ;
444+
445+ var nw = new Network ( "T1" , "T1" ) ;
446+
447+ nw . Add (
448+ new Coil (
449+ new Signal ( "Test11" ) ,
450+ new Or (
451+ new And (
452+ new Signal ( "Test1" ) ,
453+ new Or (
454+ new And (
455+ new Signal ( "Test2" ) ,
456+ new Or (
457+ new Signal ( "Test3" ) ,
458+ new Signal ( "Test4" )
459+ )
460+ { DebugInfo = "aaa" }
461+ ) ,
462+ new Signal ( "Test5" )
463+ )
464+ { DebugInfo = "bbb" }
465+ ) ,
466+ new And (
467+ new Signal ( "Test6" ) ,
468+ new Or (
469+ new And (
470+ new Signal ( "Test7" ) ,
471+ new Or (
472+ new Signal ( "Test8" ) ,
473+ new Signal ( "Test9" )
474+ )
475+ { DebugInfo = "ccc" }
476+ ) ,
477+ new Signal ( "Test10" )
478+ )
479+ { DebugInfo = "ddd" }
480+ )
481+ )
482+ { DebugInfo = "eee" }
483+ )
484+ ) ;
485+ codeblock . Add ( nw ) ;
486+
487+ var block = new Block ( "Test" , "blabla" , codeblock ) ;
488+ block . Interface = TestInterface ;
489+ var xml = block . GetCode ( ) ;
490+ }
491+
492+ [ Test ]
493+ public void ComplexOr2 ( )
494+ {
495+ var codeblock = new CodeBlock ( ) { Safety = false } ;
496+
497+ var nw = new Network ( "T1" , "T1" ) ;
498+
499+ nw . Add (
500+ new Coil (
501+ new Signal ( "Test11" ) ,
502+ new Or (
503+ new Signal ( "Test12" ) ,
504+ new Or (
505+ new And (
506+ new Signal ( "Test1" ) ,
507+ new Or (
508+ new And (
509+ new Signal ( "Test2" ) ,
510+ new Or (
511+ new Signal ( "Test3" ) ,
512+ new Signal ( "Test4" )
513+ )
514+ ) ,
515+ new Signal ( "Test5" )
516+ )
517+ ) ,
518+ new And (
519+ new Signal ( "Test6" ) ,
520+ new Or (
521+ new And (
522+ new Signal ( "Test7" ) ,
523+ new Or (
524+ new Signal ( "Test8" ) ,
525+ new Signal ( "Test9" )
526+ )
527+ ) ,
528+ new Signal ( "Test10" )
529+ )
530+ )
531+ )
532+ )
533+ )
534+ ) ;
535+ codeblock . Add ( nw ) ;
536+
537+ var block = new Block ( "Test" , "blabla" , codeblock ) ;
538+ block . Interface = TestInterface ;
539+ var xml = block . GetCode ( ) ;
540+ }
541+
542+
543+ [ Test ]
544+ public void Complex3 ( )
545+ {
546+ var codeblock = new CodeBlock ( ) { Safety = false } ;
547+
548+ var nw = new Network ( "T1" , "T1" ) ;
549+
550+ nw . Add (
551+ new Coil (
552+ new Signal ( "Test11" ) ,
553+ new And (
554+ new Signal ( "Test1" ) ,
555+ new Or (
556+ new Signal ( "Test2" )
557+ )
558+ )
559+ )
560+ ) ;
561+ codeblock . Add ( nw ) ;
562+
563+ var block = new Block ( "Test" , "blabla" , codeblock ) ;
564+ block . Interface = TestInterface ;
565+ var xml = block . GetCode ( ) ;
566+ }
439567 }
440568}
0 commit comments