aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Stubs Collection
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2021-01-04 23:40:17 +0200
committerShlomo Hecht <shlomo@twine-s.com>2021-01-04 23:40:17 +0200
commit4070df75dc74431946374f00d0570ea3776f2d32 (patch)
tree3a26fcb6b63236f9ac8325f7bb39db40b37e060c /Software/Stubs Collection
parent23f536059dd646d60097134579b8c523ad2855e2 (diff)
downloadTango-4070df75dc74431946374f00d0570ea3776f2d32.tar.gz
Tango-4070df75dc74431946374f00d0570ea3776f2d32.zip
improve BTSR keeping
Diffstat (limited to 'Software/Stubs Collection')
-rw-r--r--Software/Stubs Collection/stubs/EvalBoardLedsTest.cs76
1 files changed, 76 insertions, 0 deletions
diff --git a/Software/Stubs Collection/stubs/EvalBoardLedsTest.cs b/Software/Stubs Collection/stubs/EvalBoardLedsTest.cs
new file mode 100644
index 000000000..7cd0b6818
--- /dev/null
+++ b/Software/Stubs Collection/stubs/EvalBoardLedsTest.cs
@@ -0,0 +1,76 @@
+using System;
+using System.Text;
+using System.Linq;
+using System.Drawing;
+using System.Diagnostics;
+using System.Windows.Forms;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using Tango.PMR.Stubs;
+using Tango.Stubs;
+
+public void OnExecute(StubManager stubManager)
+{
+
+StubGPIOWriteBitRequest speed = new StubGPIOWriteBitRequest();
+speed.PortId = "F";
+speed.PinId = 1;
+speed.BitToWrite = false;
+StubGPIOWriteBitRequest link = new StubGPIOWriteBitRequest();
+link.PortId = "K";
+link.PinId = 4;
+link.BitToWrite = false;
+StubGPIOWriteBitRequest Activity = new StubGPIOWriteBitRequest();
+Activity.PortId = "K";
+Activity.PinId = 6;
+Activity.BitToWrite = false;
+StubGPIOWriteBitRequest Q7 = new StubGPIOWriteBitRequest();
+Q7.PortId = "Q";
+Q7.PinId = 7;
+Q7.BitToWrite = false;
+StubGPIOWriteBitRequest N5 = new StubGPIOWriteBitRequest();
+N5.PortId = "N";
+N5.PinId = 5;
+N5.BitToWrite = false;
+
+var response = stubManager.Run<StubGPIOWriteBitRequest>(speed);
+response = stubManager.Run<StubGPIOWriteBitRequest>(link);
+response = stubManager.Run<StubGPIOWriteBitRequest>(Activity);
+Thread.Sleep(2000);
+ for (int i = 1; i<100000000; i++)
+ {
+ speed.BitToWrite = (i%3>0)?true:false;
+ link.BitToWrite = (i%4>0)?true:false;
+ Activity.BitToWrite = (i%5>0)?true:false;
+ response = stubManager.Run<StubGPIOWriteBitRequest>(speed);
+ Thread.Sleep(10);
+ response = stubManager.Run<StubGPIOWriteBitRequest>(link);
+ Thread.Sleep(10);
+ response = stubManager.Run<StubGPIOWriteBitRequest>(Activity);
+ Thread.Sleep(10);
+ Q7.BitToWrite = (i%7>3)?true:false;
+ response = stubManager.Run<StubGPIOWriteBitRequest>(Q7);
+ Thread.Sleep(10);
+ N5.BitToWrite = (i%11>4)?true:false;
+ response = stubManager.Run<StubGPIOWriteBitRequest>(N5);
+ Thread.Sleep(10);
+ Thread.Sleep(100);
+ }
+ speed.BitToWrite = true;
+ link.BitToWrite = true;
+ Activity.BitToWrite = true;
+ response = stubManager.Run<StubGPIOWriteBitRequest>(speed);
+ Thread.Sleep(10);
+ response = stubManager.Run<StubGPIOWriteBitRequest>(link);
+ Thread.Sleep(10);
+ response = stubManager.Run<StubGPIOWriteBitRequest>(Activity);
+ Thread.Sleep(10);
+ Q7.BitToWrite = false;
+ response = stubManager.Run<StubGPIOWriteBitRequest>(Q7);
+ Thread.Sleep(10);
+ N5.BitToWrite = false;
+ response = stubManager.Run<StubGPIOWriteBitRequest>(N5);
+ Thread.Sleep(10);
+
+} \ No newline at end of file