File indexing completed on 2024-05-05 05:46:04
0001 /*************************************************************************** 0002 * Copyright (C) 2003-2004 by David Saxton * 0003 * david@bluehaze.org * 0004 * * 0005 * This program is free software; you can redistribute it and/or modify * 0006 * it under the terms of the GNU General Public License as published by * 0007 * the Free Software Foundation; either version 2 of the License, or * 0008 * (at your option) any later version. * 0009 ***************************************************************************/ 0010 0011 #ifndef ECBCDTO7SEGMENT_H 0012 #define ECBCDTO7SEGMENT_H 0013 0014 #include "component.h" 0015 #include "logic.h" 0016 0017 /** 0018 @short Converts a BCD input to 7-Segment Output 0019 @author David Saxton 0020 */ 0021 class ECBCDTo7Segment : public CallbackClass, public Component 0022 { 0023 public: 0024 ECBCDTo7Segment(ICNDocument *icnDocument, bool newItem, const char *id = nullptr); 0025 ~ECBCDTo7Segment() override; 0026 0027 static Item *construct(ItemDocument *itemDocument, bool newItem, const char *id); 0028 static LibraryItem *libraryItem(); 0029 0030 public: // internal interface 0031 void inStateChanged(bool newState); 0032 private: 0033 LogicIn *ALogic, *BLogic, *CLogic, *DLogic; 0034 LogicIn *ltLogic, *rbLogic, *enLogic; 0035 LogicOut *outLogic[7]; 0036 0037 // Old values 0038 bool oldOut[7]; 0039 }; 0040 0041 #endif