Skip to content

Commit

Permalink
fixed logging error
Browse files Browse the repository at this point in the history
  • Loading branch information
timothyscherer committed Feb 15, 2022
1 parent ef11b86 commit 356869e
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
36 changes: 18 additions & 18 deletions docs/rot2prog/rot2prog.html
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,10 @@ <h1 class="title">Module <code>rot2prog.rot2prog</code></h1>

if el &gt; self.max_el:
el = self.max_el
self._log.warning(&#39;Elevation corrected to: &#39; + str(round(float(az), 2)))
self._log.warning(&#39;Elevation corrected to: &#39; + str(round(float(el), 2)))
if el &lt; self.min_el:
el = self.min_el
self._log.warning(&#39;Elevation corrected to: &#39; + str(round(float(az), 2)))
self._log.warning(&#39;Elevation corrected to: &#39; + str(round(float(el), 2)))

self._log.debug(&#39;Set command to be sent&#39;)
self._log.debug(&#39;-&gt; Azimuth: &#39; + str(round(float(az), 2)))
Expand All @@ -182,8 +182,8 @@ <h1 class="title">Module <code>rot2prog.rot2prog</code></h1>
V = int(self._resolution * (float(el) + 360))

# convert to ascii characters
H = &#34;000&#34; + str(H)
V = &#34;000&#34; + str(V)
H = &#34;0000&#34; + str(H)
V = &#34;0000&#34; + str(V)

# build command
cmd = [
Expand Down Expand Up @@ -255,8 +255,8 @@ <h1 class="title">Module <code>rot2prog.rot2prog</code></h1>
self._log.info(&#39;Status command received&#39;)

# convert to byte values
H = &#34;000&#34; + str(round(float(self.az + 360), 1))
V = &#34;000&#34; + str(round(float(self.el + 360), 1))
H = &#34;00000&#34; + str(round(float(self.az + 360), 1))
V = &#34;00000&#34; + str(round(float(self.el + 360), 1))

rsp = [
0x57,
Expand Down Expand Up @@ -469,10 +469,10 @@ <h2 id="args">Args</h2>

if el &gt; self.max_el:
el = self.max_el
self._log.warning(&#39;Elevation corrected to: &#39; + str(round(float(az), 2)))
self._log.warning(&#39;Elevation corrected to: &#39; + str(round(float(el), 2)))
if el &lt; self.min_el:
el = self.min_el
self._log.warning(&#39;Elevation corrected to: &#39; + str(round(float(az), 2)))
self._log.warning(&#39;Elevation corrected to: &#39; + str(round(float(el), 2)))

self._log.debug(&#39;Set command to be sent&#39;)
self._log.debug(&#39;-&gt; Azimuth: &#39; + str(round(float(az), 2)))
Expand All @@ -483,8 +483,8 @@ <h2 id="args">Args</h2>
V = int(self._resolution * (float(el) + 360))

# convert to ascii characters
H = &#34;000&#34; + str(H)
V = &#34;000&#34; + str(V)
H = &#34;0000&#34; + str(H)
V = &#34;0000&#34; + str(V)

# build command
cmd = [
Expand Down Expand Up @@ -554,10 +554,10 @@ <h2 id="args">Args</h2>

if el &gt; self.max_el:
el = self.max_el
self._log.warning(&#39;Elevation corrected to: &#39; + str(round(float(az), 2)))
self._log.warning(&#39;Elevation corrected to: &#39; + str(round(float(el), 2)))
if el &lt; self.min_el:
el = self.min_el
self._log.warning(&#39;Elevation corrected to: &#39; + str(round(float(az), 2)))
self._log.warning(&#39;Elevation corrected to: &#39; + str(round(float(el), 2)))

self._log.debug(&#39;Set command to be sent&#39;)
self._log.debug(&#39;-&gt; Azimuth: &#39; + str(round(float(az), 2)))
Expand All @@ -568,8 +568,8 @@ <h2 id="args">Args</h2>
V = int(self._resolution * (float(el) + 360))

# convert to ascii characters
H = &#34;000&#34; + str(H)
V = &#34;000&#34; + str(V)
H = &#34;0000&#34; + str(H)
V = &#34;0000&#34; + str(V)

# build command
cmd = [
Expand Down Expand Up @@ -723,8 +723,8 @@ <h2 id="args">Args</h2>
self._log.info(&#39;Status command received&#39;)

# convert to byte values
H = &#34;000&#34; + str(round(float(self.az + 360), 1))
V = &#34;000&#34; + str(round(float(self.el + 360), 1))
H = &#34;00000&#34; + str(round(float(self.az + 360), 1))
V = &#34;00000&#34; + str(round(float(self.el + 360), 1))

rsp = [
0x57,
Expand Down Expand Up @@ -802,8 +802,8 @@ <h3>Methods</h3>
self._log.info(&#39;Status command received&#39;)

# convert to byte values
H = &#34;000&#34; + str(round(float(self.az + 360), 1))
V = &#34;000&#34; + str(round(float(self.el + 360), 1))
H = &#34;00000&#34; + str(round(float(self.az + 360), 1))
V = &#34;00000&#34; + str(round(float(self.el + 360), 1))

rsp = [
0x57,
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

setuptools.setup(
name = "rot2prog",
version = "0.0.3",
version = "0.0.4",
author = "TJ Scherer",
author_email = "tjtractorboy@gmail.com",
description = "A python interface to the Alfa ROT2Prog Controller.",
Expand Down
12 changes: 6 additions & 6 deletions src/rot2prog/rot2prog.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@ def set(self, az, el):

if el > self.max_el:
el = self.max_el
self._log.warning('Elevation corrected to: ' + str(round(float(az), 2)))
self._log.warning('Elevation corrected to: ' + str(round(float(el), 2)))
if el < self.min_el:
el = self.min_el
self._log.warning('Elevation corrected to: ' + str(round(float(az), 2)))
self._log.warning('Elevation corrected to: ' + str(round(float(el), 2)))

self._log.debug('Set command to be sent')
self._log.debug('-> Azimuth: ' + str(round(float(az), 2)))
Expand All @@ -153,8 +153,8 @@ def set(self, az, el):
V = int(self._resolution * (float(el) + 360))

# convert to ascii characters
H = "000" + str(H)
V = "000" + str(V)
H = "0000" + str(H)
V = "0000" + str(V)

# build command
cmd = [
Expand Down Expand Up @@ -226,8 +226,8 @@ def run(self):
self._log.info('Status command received')

# convert to byte values
H = "000" + str(round(float(self.az + 360), 1))
V = "000" + str(round(float(self.el + 360), 1))
H = "00000" + str(round(float(self.az + 360), 1))
V = "00000" + str(round(float(self.el + 360), 1))

rsp = [
0x57,
Expand Down

0 comments on commit 356869e

Please sign in to comment.