From b3786e3cf0a1ebe7d7982b2d50f1223bd462f344 Mon Sep 17 00:00:00 2001 From: Ryan Klaassen Date: Thu, 28 Jul 2016 10:34:30 -0500 Subject: Upload new file --- Layout/LayoutSemtech.h | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 Layout/LayoutSemtech.h (limited to 'Layout') diff --git a/Layout/LayoutSemtech.h b/Layout/LayoutSemtech.h new file mode 100644 index 0000000..374c1ff --- /dev/null +++ b/Layout/LayoutSemtech.h @@ -0,0 +1,75 @@ +/* Copyright (c) <2016> , MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software + * and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef __LAYOUTSEMTECH_H__ +#define __LAYOUTSEMTECH_H__ + +#include "Layout.h" +#include "GPSPARSER.h" +#include "LoRaHandler.h" + +class LayoutSemtech : public Layout +{ +public: + LayoutSemtech(DOGS102* lcd, uint8_t band); + ~LayoutSemtech(); + + void display(); + void display(bool success, mDot::snr_stats snr, mDot::rssi_stats rssi,int power, int fsb, int padding, int dr); + + void sending(); + void updateSw2(string str); + void sendResult(string str); + void updateNextCh(int count_down); + void updateSw1(string Sw1, string Sw2, int dr, int power, int padding); + void updateStats(bool GPS, GPSPARSER::longitude lon, GPSPARSER::latitude lat, struct tm time, float temp); + +private: + uint8_t _band; + + Label _lDr; + Label _lFSB; + Label _lSend; + Label _lTemp; + Label _lNoGps; + Label _lPower; + Label _lNoLink; + Label _lPadding; + Label _lNoChannel; + + Field _fDr; + Field _fSw1; + Field _fSw2; + Field _fFSB; + Field _fTemp; + Field _fPower; + Field _fNextCh; + Field _fGpsLat; + Field _fGpsLon; + Field _fResult; + Field _fGpsTime; + Field _fDownSnr; + Field _fPadding; + Field _fDownRssi; +}; + +#endif + + + + -- cgit v1.2.3 From 172705f116714555decd2635b3a4cca0f32f4a8c Mon Sep 17 00:00:00 2001 From: Ryan Klaassen Date: Thu, 28 Jul 2016 10:35:12 -0500 Subject: Upload new file --- Layout/LayoutSemtech.cpp | 193 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 193 insertions(+) create mode 100644 Layout/LayoutSemtech.cpp (limited to 'Layout') diff --git a/Layout/LayoutSemtech.cpp b/Layout/LayoutSemtech.cpp new file mode 100644 index 0000000..dcaf2ad --- /dev/null +++ b/Layout/LayoutSemtech.cpp @@ -0,0 +1,193 @@ +/* Copyright (c) <2016> , MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software + * and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#include "LayoutSemtech.h" + + +LayoutSemtech::LayoutSemtech(DOGS102* lcd, uint8_t band) + : Layout(lcd), + _lDr(8,0,"DR"), + _lFSB(0,0,"FSB"), + _lPower(13,0,"P"), + _lTemp(8,6,"Temp "), + _lPadding(0,6,"Pad"), + _lSend(3,3,"Sending..."), + _lNoGps(0,4,"No Gps Lock"), + _lNoLink(0,2,"No Link Data"), + _lNoChannel(0,3,"No Free Channel"), + _fFSB(3,0,1), + _fDr(10,0,2), + _fSw2(0,7,9), + _fSw1(13,7,4), + _fTemp(13,6,4), + _fPower(14,0,2), + _fNextCh(0,5,17), + _fGpsLat(0,3,17), + _fGpsLon(0,4,17), + _fResult(3,3,16), + _fPadding(4,6,3), + _fDownSnr(12,2,5), + _fGpsTime(0,5,16), + _fDownRssi(0,2,11), + _band(band) +{} + +LayoutSemtech::~LayoutSemtech() {} + +void LayoutSemtech::display() {} + +void LayoutSemtech::display(bool success, mDot::snr_stats snr, mDot::rssi_stats rssi, int power, int fsb, int padding, int dr) +{ + char buf[17]; + size_t size; + + clear(); + startUpdate(); + + writeLabel(_lDr); + writeLabel(_lTemp); + writeLabel(_lPower); + writeLabel(_lPadding); + if (_band == mDot::FB_915) { + writeLabel(_lFSB); + } + if(success) { + size = snprintf(buf, sizeof(buf), "DWN %3d dbm", rssi.last); + writeField(_fDownRssi, buf, size); + + memset(buf, 0, sizeof(buf)); + size = snprintf(buf, sizeof(buf), " %2.1f", (float)snr.last / 10.0); + writeField(_fDownSnr, buf, size); + } else writeLabel(_lNoLink); + + memset(buf, 0, sizeof(buf)); + size = snprintf(buf, sizeof(buf), "%d",dr); + writeField(_fDr, buf, size, true); + + memset(buf, 0, sizeof(buf)); + size = snprintf(buf, sizeof(buf), "%d",power); + writeField(_fPower, buf, size, true); + + if (_band == mDot::FB_915) { + memset(buf, 0, sizeof(buf)); + size = snprintf(buf, sizeof(buf), "%d",fsb); + writeField(_fFSB, buf, size, true); + } + + memset(buf, 0, sizeof(buf)); + size = snprintf(buf, sizeof(buf), "%d",padding); + writeField(_fPadding, buf, size, true); + + endUpdate(); +} + +void LayoutSemtech::updateSw1(string Sw1, string Sw2, int dr, int power, int padding) +{ + size_t size; + char buf[17]; + string temp; + for(int i = Sw1.size(); i<4; i++) temp+=" "; + temp+=Sw1; + writeField(_fSw1, temp, true); + startUpdate(); + if(Sw2=="Data Rate") { + memset(buf, 0, sizeof(buf)); + size = snprintf(buf, sizeof(buf), "%d",dr); + writeField(_fDr, buf, size, true); + } else if(Sw2=="Power") { + memset(buf, 0, sizeof(buf)); + size = snprintf(buf, sizeof(buf), "%d",power); + writeField(_fPower, buf, size, true); + } else if(Sw2=="Padding") { + memset(buf, 0, sizeof(buf)); + size = snprintf(buf, sizeof(buf), "%d",padding); + writeField(_fPadding, buf, size, true); + } + endUpdate(); +} + +void LayoutSemtech::updateSw2(string Sw2) +{ + writeField(_fSw2, Sw2, true); +} + +void LayoutSemtech::sending() +{ + clear(); + writeLabel(_lSend); +} + +void LayoutSemtech::sendResult(string str) +{ + clear(); + writeField(_fResult,str,true); +} + + +void LayoutSemtech::updateNextCh(int count_down) +{ + clear(); + size_t size; + char buf[17]; + size = snprintf(buf, sizeof(buf), "Countdown:%d",count_down); + writeField(_fNextCh, buf, size, true); + writeLabel(_lNoChannel); +} + +void LayoutSemtech::updateStats(bool GPS, GPSPARSER::longitude lon, GPSPARSER::latitude lat, struct tm time, float temp) +{ + char buf[17]; + size_t size; + + startUpdate(); + + if(GPS) { + size = snprintf(buf, sizeof(buf), "%d %d %d.%03d %c", + abs(lon.degrees), + lon.minutes, + (lon.seconds * 6) / 1000, + (lon.seconds * 6) % 1000, + (lon.degrees > 0) ? 'E' : 'W'); + writeField(_fGpsLon, buf, size, true); + + memset(buf, 0, sizeof(buf)); + size = snprintf(buf, sizeof(buf), "%d %d %d.%03d %c", + abs(lat.degrees), + lat.minutes, + (lat.seconds * 6) / 1000, + (lat.seconds * 6) % 1000, + (lat.degrees > 0) ? 'N' : 'S'); + writeField(_fGpsLat, buf, size, true); + + memset(buf, 0, sizeof(buf)); + size = snprintf(buf, sizeof(buf), "%02d:%02d %02d/%02d/%04d", + time.tm_hour, + time.tm_min, + time.tm_mon + 1, + time.tm_mday, + time.tm_year + 1900); + writeField(_fGpsTime, buf, size, true); + + } else writeLabel(_lNoGps); + + memset(buf, 0, sizeof(buf)); + size = snprintf(buf, sizeof(buf), "%.1f",temp); + writeField(_fTemp, buf, size, true); + + endUpdate(); +} -- cgit v1.2.3 From a431bf590dfe3360abdda47df4e9808c4064b8dc Mon Sep 17 00:00:00 2001 From: Ryan Klaassen Date: Thu, 28 Jul 2016 10:35:35 -0500 Subject: Upload new file --- Layout/LayoutSemtechJoin.h | 58 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 Layout/LayoutSemtechJoin.h (limited to 'Layout') diff --git a/Layout/LayoutSemtechJoin.h b/Layout/LayoutSemtechJoin.h new file mode 100644 index 0000000..09ae474 --- /dev/null +++ b/Layout/LayoutSemtechJoin.h @@ -0,0 +1,58 @@ +/* Copyright (c) <2016> , MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software + * and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef __LAYOUTSEMTECHJOIN_H__ +#define __LAYOUTSEMTECHJOIN_H__ + +#include "Layout.h" +#include "mDot.h" + +class LayoutSemtechJoin : public Layout { + public: + LayoutSemtechJoin(DOGS102* lcd, uint8_t band); + ~LayoutSemtechJoin(); + + void display(); + + void updateId(std::string id); + void updateKey(std::string key); + void updateFsb(uint8_t band); + void updateRate(std::string rate); + void updatePower(uint32_t power); + + private: + uint8_t _band; + + Label _lId; + Label _lKey; + Label _lFsb; + Label _lRate; + Label _lJoin; + Label _lPower; + + Field _fId; + Field _fKey; + Field _fFsb; + Field _fRate; + Field _fPower; + Field _fStatus; + Field _fSubBand; +}; + +#endif + -- cgit v1.2.3 From 2e2fd69055e52853eaf489ccd3454ac30a0f70ce Mon Sep 17 00:00:00 2001 From: Ryan Klaassen Date: Thu, 28 Jul 2016 10:35:58 -0500 Subject: Upload new file --- Layout/LayoutSemtechJoin.cpp | 91 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 Layout/LayoutSemtechJoin.cpp (limited to 'Layout') diff --git a/Layout/LayoutSemtechJoin.cpp b/Layout/LayoutSemtechJoin.cpp new file mode 100644 index 0000000..f7dbf80 --- /dev/null +++ b/Layout/LayoutSemtechJoin.cpp @@ -0,0 +1,91 @@ +/* Copyright (c) <2016> , MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software + * and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#include "LayoutSemtechJoin.h" + +LayoutSemtechJoin::LayoutSemtechJoin(DOGS102* lcd, uint8_t band) + : Layout(lcd), + _lId(0, 1, "NI="), + _lKey(0, 2, "NK="), + _lFsb(0, 3, "FSB="), + _lRate(0, 5, "DR="), + _lPower(6, 5, "P="), + _lJoin(0, 7, "Join"), + _fId(3, 1, 14), + _fFsb(4, 3, 2), + _fKey(3, 2, 14), + _fRate(3, 5, 2), + _fPower(8, 5, 2), + _fSubBand(16,7,1), + _fStatus(0, 0, 17), + _band(band) +{} + +LayoutSemtechJoin::~LayoutSemtechJoin() {} + +void LayoutSemtechJoin::display() +{ + clear(); + startUpdate(); + + writeLabel(_lId); + writeLabel(_lKey); + if (_band == mDot::FB_915) { + writeLabel(_lFsb); + } + writeLabel(_lRate); + writeLabel(_lPower); + writeLabel(_lJoin); + + endUpdate(); +} + +void LayoutSemtechJoin::updateId(std::string id) +{ + writeField(_fId, id, true); +} + +void LayoutSemtechJoin::updateKey(std::string key) +{ + writeField(_fKey, key, true); +} + +void LayoutSemtechJoin::updateFsb(uint8_t band) +{ + if (_band == mDot::FB_915) { + char buf[8]; + size_t size; + size = snprintf(buf, sizeof(buf), "%u", band); + writeField(_fFsb, buf, size, true); + writeField(_fSubBand, buf, size, true); + } +} + +void LayoutSemtechJoin::updateRate(std::string rate) +{ + writeField(_fRate, rate, true); +} + +void LayoutSemtechJoin::updatePower(uint32_t power) +{ + char buf[16]; + size_t size; + + size = snprintf(buf, sizeof(buf), "%lu", power); + writeField(_fPower, buf, size, true); +} -- cgit v1.2.3 From e80da86edcd65ab6925cf2e1ab9f579146da2637 Mon Sep 17 00:00:00 2001 From: Ryan Klaassen Date: Mon, 8 Aug 2016 09:47:07 -0500 Subject: Replace LayoutSemtechJoin.cpp --- Layout/LayoutSemtechJoin.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Layout') diff --git a/Layout/LayoutSemtechJoin.cpp b/Layout/LayoutSemtechJoin.cpp index f7dbf80..7bb7ac0 100644 --- a/Layout/LayoutSemtechJoin.cpp +++ b/Layout/LayoutSemtechJoin.cpp @@ -20,6 +20,7 @@ LayoutSemtechJoin::LayoutSemtechJoin(DOGS102* lcd, uint8_t band) : Layout(lcd), + _band(band), _lId(0, 1, "NI="), _lKey(0, 2, "NK="), _lFsb(0, 3, "FSB="), @@ -27,13 +28,12 @@ LayoutSemtechJoin::LayoutSemtechJoin(DOGS102* lcd, uint8_t band) _lPower(6, 5, "P="), _lJoin(0, 7, "Join"), _fId(3, 1, 14), - _fFsb(4, 3, 2), _fKey(3, 2, 14), + _fFsb(4, 3, 2), _fRate(3, 5, 2), _fPower(8, 5, 2), - _fSubBand(16,7,1), _fStatus(0, 0, 17), - _band(band) + _fSubBand(16,7,1) {} LayoutSemtechJoin::~LayoutSemtechJoin() {} -- cgit v1.2.3 From 7be7e57c6f5067fc33f11d9823b6702590704682 Mon Sep 17 00:00:00 2001 From: Ryan Klaassen Date: Mon, 8 Aug 2016 09:48:31 -0500 Subject: Replace LayoutSemtech.cpp --- Layout/LayoutSemtech.cpp | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'Layout') diff --git a/Layout/LayoutSemtech.cpp b/Layout/LayoutSemtech.cpp index dcaf2ad..e31d149 100644 --- a/Layout/LayoutSemtech.cpp +++ b/Layout/LayoutSemtech.cpp @@ -21,36 +21,42 @@ LayoutSemtech::LayoutSemtech(DOGS102* lcd, uint8_t band) : Layout(lcd), + _band(band), _lDr(8,0,"DR"), _lFSB(0,0,"FSB"), - _lPower(13,0,"P"), - _lTemp(8,6,"Temp "), - _lPadding(0,6,"Pad"), _lSend(3,3,"Sending..."), + _lTemp(8,6,"Temp "), _lNoGps(0,4,"No Gps Lock"), - _lNoLink(0,2,"No Link Data"), + _lPower(13,0,"P"), + _lBlank(0,1," "), + _lNoLink(0,1,"Send Failed"), + _lPadding(0,6,"Pad"), _lNoChannel(0,3,"No Free Channel"), - _fFSB(3,0,1), _fDr(10,0,2), - _fSw2(0,7,9), _fSw1(13,7,4), + _fSw2(0,7,9), + _fFSB(3,0,1), _fTemp(13,6,4), _fPower(14,0,2), _fNextCh(0,5,17), _fGpsLat(0,3,17), _fGpsLon(0,4,17), _fResult(3,3,16), - _fPadding(4,6,3), - _fDownSnr(12,2,5), _fGpsTime(0,5,16), - _fDownRssi(0,2,11), - _band(band) + _fDownSnr(12,2,5), + _fPadding(4,6,3), + _fDownRssi(0,2,11) {} LayoutSemtech::~LayoutSemtech() {} void LayoutSemtech::display() {} +void LayoutSemtech::initial() +{ + writeLabel(_lBlank); +} + void LayoutSemtech::display(bool success, mDot::snr_stats snr, mDot::rssi_stats rssi, int power, int fsb, int padding, int dr) { char buf[17]; @@ -191,3 +197,4 @@ void LayoutSemtech::updateStats(bool GPS, GPSPARSER::longitude lon, GPSPARSER::l endUpdate(); } + -- cgit v1.2.3 From 93e044d9d55af4cdf4f9f75c12129a8d318fcfa1 Mon Sep 17 00:00:00 2001 From: Ryan Klaassen Date: Mon, 8 Aug 2016 09:49:05 -0500 Subject: Replace LayoutSemtechJoin.h --- Layout/LayoutSemtechJoin.h | 106 +++++++++++++++++++++++++++------------------ 1 file changed, 63 insertions(+), 43 deletions(-) (limited to 'Layout') diff --git a/Layout/LayoutSemtechJoin.h b/Layout/LayoutSemtechJoin.h index 09ae474..dd62fd6 100644 --- a/Layout/LayoutSemtechJoin.h +++ b/Layout/LayoutSemtechJoin.h @@ -1,58 +1,78 @@ /* Copyright (c) <2016> , MIT License * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software - * and associated documentation files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, publish, distribute, - * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software + * and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all copies or + * The above copyright notice and this permission notice shall be included in all copies or * substantial portions of the Software. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#ifndef __LAYOUTSEMTECHJOIN_H__ -#define __LAYOUTSEMTECHJOIN_H__ +#ifndef __LAYOUTSEMTECH_H__ +#define __LAYOUTSEMTECH_H__ #include "Layout.h" -#include "mDot.h" - -class LayoutSemtechJoin : public Layout { - public: - LayoutSemtechJoin(DOGS102* lcd, uint8_t band); - ~LayoutSemtechJoin(); - - void display(); - - void updateId(std::string id); - void updateKey(std::string key); - void updateFsb(uint8_t band); - void updateRate(std::string rate); - void updatePower(uint32_t power); - - private: - uint8_t _band; - - Label _lId; - Label _lKey; - Label _lFsb; - Label _lRate; - Label _lJoin; - Label _lPower; - - Field _fId; - Field _fKey; - Field _fFsb; - Field _fRate; - Field _fPower; - Field _fStatus; - Field _fSubBand; +#include "GPSPARSER.h" +#include "LoRaHandler.h" + +class LayoutSemtech : public Layout +{ +public: + LayoutSemtech(DOGS102* lcd, uint8_t band); + ~LayoutSemtech(); + + void display(); + void display(bool success, mDot::snr_stats snr, mDot::rssi_stats rssi,int power, int fsb, int padding, int dr); + + void sending(); + void initial(); + void updateSw2(string str); + void sendResult(string str); + void updateNextCh(int count_down); + void updateSw1(string Sw1, string Sw2, int dr, int power, int padding); + void updateStats(bool GPS, GPSPARSER::longitude lon, GPSPARSER::latitude lat, struct tm time, float temp); + +private: + uint8_t _band; + + Label _lDr; + Label _lFSB; + Label _lSend; + Label _lTemp; + Label _lNoGps; + Label _lPower; + Label _lBlank; + Label _lNoLink; + Label _lPadding; + Label _lNoChannel; + + Field _fDr; + Field _fSw1; + Field _fSw2; + Field _fFSB; + Field _fTemp; + Field _fPower; + Field _fNextCh; + Field _fGpsLat; + Field _fGpsLon; + Field _fResult; + Field _fGpsTime; + Field _fDownSnr; + Field _fPadding; + Field _fDownRssi; }; #endif + + + + -- cgit v1.2.3 From 6ef3714eaa2095dfd2b7bf111157ef0362cf0e64 Mon Sep 17 00:00:00 2001 From: Ryan Klaassen Date: Mon, 8 Aug 2016 09:49:34 -0500 Subject: Replace LayoutSemtechJoin.h --- Layout/LayoutSemtechJoin.h | 105 +++++++++++++++++++-------------------------- 1 file changed, 43 insertions(+), 62 deletions(-) (limited to 'Layout') diff --git a/Layout/LayoutSemtechJoin.h b/Layout/LayoutSemtechJoin.h index dd62fd6..f848334 100644 --- a/Layout/LayoutSemtechJoin.h +++ b/Layout/LayoutSemtechJoin.h @@ -1,78 +1,59 @@ /* Copyright (c) <2016> , MIT License * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software - * and associated documentation files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, publish, distribute, - * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software + * and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all copies or + * The above copyright notice and this permission notice shall be included in all copies or * substantial portions of the Software. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#ifndef __LAYOUTSEMTECH_H__ -#define __LAYOUTSEMTECH_H__ +#ifndef __LAYOUTSEMTECHJOIN_H__ +#define __LAYOUTSEMTECHJOIN_H__ #include "Layout.h" -#include "GPSPARSER.h" -#include "LoRaHandler.h" - -class LayoutSemtech : public Layout -{ -public: - LayoutSemtech(DOGS102* lcd, uint8_t band); - ~LayoutSemtech(); - - void display(); - void display(bool success, mDot::snr_stats snr, mDot::rssi_stats rssi,int power, int fsb, int padding, int dr); - - void sending(); - void initial(); - void updateSw2(string str); - void sendResult(string str); - void updateNextCh(int count_down); - void updateSw1(string Sw1, string Sw2, int dr, int power, int padding); - void updateStats(bool GPS, GPSPARSER::longitude lon, GPSPARSER::latitude lat, struct tm time, float temp); - -private: - uint8_t _band; - - Label _lDr; - Label _lFSB; - Label _lSend; - Label _lTemp; - Label _lNoGps; - Label _lPower; - Label _lBlank; - Label _lNoLink; - Label _lPadding; - Label _lNoChannel; - - Field _fDr; - Field _fSw1; - Field _fSw2; - Field _fFSB; - Field _fTemp; - Field _fPower; - Field _fNextCh; - Field _fGpsLat; - Field _fGpsLon; - Field _fResult; - Field _fGpsTime; - Field _fDownSnr; - Field _fPadding; - Field _fDownRssi; +#include "mDot.h" + +class LayoutSemtechJoin : public Layout { + public: + LayoutSemtechJoin(DOGS102* lcd, uint8_t band); + ~LayoutSemtechJoin(); + + void display(); + + void updateId(std::string id); + void updateKey(std::string key); + void updateFsb(uint8_t band); + void updateRate(std::string rate); + void updatePower(uint32_t power); + + private: + uint8_t _band; + + Label _lId; + Label _lKey; + Label _lFsb; + Label _lRate; + Label _lPower; + Label _lJoin; + + Field _fId; + Field _fKey; + Field _fFsb; + Field _fRate; + Field _fPower; + Field _fStatus; + Field _fSubBand; }; #endif - - - -- cgit v1.2.3 From 3b8fe55decbeee5d916db47b9d299895f032c892 Mon Sep 17 00:00:00 2001 From: Ryan Klaassen Date: Mon, 8 Aug 2016 09:50:11 -0500 Subject: Replace LayoutSemtech.h --- Layout/LayoutSemtech.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Layout') diff --git a/Layout/LayoutSemtech.h b/Layout/LayoutSemtech.h index 374c1ff..dd62fd6 100644 --- a/Layout/LayoutSemtech.h +++ b/Layout/LayoutSemtech.h @@ -33,6 +33,7 @@ public: void display(bool success, mDot::snr_stats snr, mDot::rssi_stats rssi,int power, int fsb, int padding, int dr); void sending(); + void initial(); void updateSw2(string str); void sendResult(string str); void updateNextCh(int count_down); @@ -48,6 +49,7 @@ private: Label _lTemp; Label _lNoGps; Label _lPower; + Label _lBlank; Label _lNoLink; Label _lPadding; Label _lNoChannel; @@ -73,3 +75,4 @@ private: + -- cgit v1.2.3