From 9fa36c9eb1bb294c58b4e4dd7592893f829ce282 Mon Sep 17 00:00:00 2001
From: Justin Fichtner <Justin.Fichtner@lakeshore.com>
Date: 周一, 14 8月 2017 23:36:13 +0800
Subject: [PATCH] Add support for STATus:OPERation:CONDition register and general handling of condition registers

---
 libscpi/test/test_parser.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/libscpi/test/test_parser.c b/libscpi/test/test_parser.c
index 32773f9..6f0d2ca 100644
--- a/libscpi/test/test_parser.c
+++ b/libscpi/test/test_parser.c
@@ -81,6 +81,11 @@
     { .pattern = "STATus:QUEStionable:ENABle", .callback = SCPI_StatusQuestionableEnable,},
     { .pattern = "STATus:QUEStionable:ENABle?", .callback = SCPI_StatusQuestionableEnableQ,},
 
+    {.pattern = "STATus:OPERation[:EVENt]?", .callback = SCPI_StatusOperationEventQ, },
+    {.pattern = "STATus:OPERation:CONDition?", .callback = SCPI_StatusOperationConditionQ, },
+    {.pattern = "STATus:OPERation:ENABle", .callback = SCPI_StatusOperationEnable, },
+    {.pattern = "STATus:OPERation:ENABle?", .callback = SCPI_StatusOperationEnableQ, },
+
     { .pattern = "STATus:PRESet", .callback = SCPI_StatusPreset,},
 
     { .pattern = "TEXTfunction?", .callback = text_function,},
@@ -440,6 +445,21 @@
     TEST_IEEE4882_REG(SCPI_REG_QUES, 0);
     TEST_IEEE4882("STATus:QUEStionable:EVENt?\r\n", "0\r\n");
 
+    TEST_IEEE4882_REG_SET(SCPI_REG_OPERE, 1);
+    TEST_IEEE4882("STATus:OPERation:ENABle?\r\n", "1\r\n");
+    TEST_IEEE4882_REG(SCPI_REG_OPERE, 1);
+    TEST_IEEE4882("STATus:OPERation:ENABle 2\r\n", "");
+    TEST_IEEE4882_REG(SCPI_REG_OPERE, 2);
+
+    TEST_IEEE4882("STATus:OPERation:CONDition?\r\n", "0\r\n");
+    TEST_IEEE4882_REG_SET(SCPI_REG_OPERC, 1);
+    TEST_IEEE4882("STATus:OPERation:CONDition?\r\n", "1\r\n");
+    TEST_IEEE4882("STATus:OPERation:EVENt?\r\n", "1\r\n");
+    TEST_IEEE4882_REG(SCPI_REG_OPERC, 0);
+    TEST_IEEE4882("STATus:OPERation:CONDition?\r\n", "0\r\n");
+    TEST_IEEE4882("STATus:OPERation:EVENt?\r\n", "1\r\n");
+    TEST_IEEE4882("STATus:OPERation:EVENt?\r\n", "0\r\n");
+
     TEST_IEEE4882("STUB\r\n", "");
     TEST_IEEE4882("STUB?\r\n", "0\r\n");
 

--
Gitblit v1.9.1