<div class="text-center"><h1>LIVE VALUES</h1></div>
<div class='row overview'>
    <div class='col-xs-4 text-center'>
        <h2>Speed Feedback</h2>
        <div class="gauge-box">
            <div data-labelheight="10" style="height: 170px; background: transparent; margin: 0 auto;" id="gauge1" data-chart="solidgauge" data-nodename="vfdipp.vfdspeedfdbk" data-units="Hz" data-min="0" data-max="100" data-colors="0.1:#DF5353,0.5:#DDDF0D,0.9:#55BF3B" data-valuefontsize="18px"></div>
            <span data-timeupdate="vfdspeedfdbk"><%= channels["vfdipp.vfdspeedfdbk"].timestamp %></span>
        </div>
    </div>
    <!-- <div class='col-xs-4 text-center'>
        <h2>Speed Reference</h2>
        <div class="gauge-box">
            <div data-labelheight="10" style="height: 170px; background: transparent; margin: 0 auto;" id="gauge2" data-chart="solidgauge" data-nodename="vfdipp.vfdspeedref" data-units="Hz" data-min="0" data-max="100" data-colors="0.1:#DF5353,0.5:#DDDF0D,0.9:#55BF3B" data-decimals="2" data-valuefontsize="18px"></div>
            <span data-timeupdate="vfdspeedref"><%= channels["vfdipp.vfdspeedref"].timestamp %></span>
        </div>
    </div> -->
    <div class='col-xs-4 text-center'>
        <h2>Output Current</h2>
        <div class="gauge-box">
            <div data-labelheight="10" style="height: 170px; background: transparent; margin: 0 auto;" id="gauge4" data-chart="solidgauge" data-nodename="vfdipp.vfdoutputcurrent" data-units="A" data-min="0" data-max="<%= channels["vfdipp.vfdnameplatefla"].value %>" data-colors="0.1:#DF5353,0.5:#DDDF0D,0.9:#55BF3B" data-valuefontsize="18px"></div>
            <span data-timeupdate="vfdoutputcurrent"><%= channels["vfdipp.vfdoutputcurrent"].timestamp %></span>
        </div>
    </div>
    <div class='col-xs-4 text-center'>
        <h2>Output Voltage</h2>
        <div class="gauge-box">
            <div data-labelheight="10" style="height: 170px; background: transparent; margin: 0 auto;" id="gauge5" data-chart="solidgauge" data-nodename="vfdipp.vfdoutputvoltage" data-units="V" data-min="0" data-max="600" data-colors="0.1:#DF5353,0.5:#DDDF0D,0.9:#55BF3B" data-valuefontsize="18px"></div>
            <span data-timeupdate="vfdoutputvoltage"><%= channels["vfdipp.vfdoutputvoltage"].timestamp %></span>
        </div>
    </div>
    <div class='col-xs-4 text-center'>
        <h2>DC Bus Voltage</h2>
        <div class="gauge-box">
            <div data-labelheight="10" style="height: 170px; background: transparent; margin: 0 auto;" id="gauge5" data-chart="solidgauge" data-nodename="vfdipp.vfddcbusvoltage" data-units="V" data-min="0" data-max="700" data-colors="0.1:#DF5353,0.5:#DDDF0D,0.9:#55BF3B" data-valuefontsize="18px"></div>
            <span data-timeupdate="vfddcbusvoltage"><%= channels["vfdipp.vfddcbusvoltage"].timestamp %></span>
        </div>
    </div>
    <div class='col-xs-4 text-center fill-vertically'>
        <h2>VFD Status</h2>
        <div class="gauge-box">
            <table class="table">
                <tbody>
                    <tr>
                        <td>VFD Active</td>
                        <td>
                            <% if (channels["vfdipp.vfdactive"].value == 1){ %>
                                <span class="label label-success">True</span>
                            <% } else { %>
                                <span class="label label-danger">False</span>
                            <% } %>
                        </td>
                    </tr>

                    <tr>
                        <td>VFD Ready</td>
                        <td>
                            <% if (channels["vfdipp.vfdready"].value == 1){ %>
                                <span class="label label-success">True</span>
                            <% } else { %>
                                <span class="label label-danger">False</span>
                            <% } %>
                        </td>
                    </tr>

                    <tr>
                        <td>VFD At Speed</td>
                        <td>
                            <% if (channels["vfdipp.vfdatspeedref"].value == 1){ %>
                                <span class="label label-success">True</span>
                            <% } else { %>
                                <span class="label label-danger">False</span>
                            <% } %>
                        </td>
                    </tr>

                    <tr>
                        <td>VFD Disabled</td>
                        <td>
                            <% if (channels["vfdipp.vfddisabled"].value == 1){ %>
                                <span class="label label-danger">True</span>
                            <% } else { %>
                                <span class="label label-success">False</span>
                            <% } %>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
    <div class='col-xs-4 text-center fill-vertically'>
        <h2>VFD Faults</h2>
        <div class="gauge-box">
            <table class="table">
                <tbody>
                <tr>
                    <td>VFD Faulted</td>
                    <td>
                    <% if (channels["vfdipp.vfdfault"].value == 1){ %>
                        <span class="label label-danger">True</span>
                    <% } else { %>
                        <span class="label label-success">False</span>
                    <% } %>
                    </td>
                </tr>

                <tr>
                    <td>VFD Fault Code</td>
                    <td><%= channels["vfdipp.vfdfaultcode"].value %></td>
                </tr>

                </tbody>

            </table>
        </div>
    </div>
</div>

<div class="text-center"><h1>TRENDS</h1></div>
<div class="row overview">
  <div class='col-xs-12' style="padding-top: 1em; margin-bottom: 1em;">
     <div class="input-daterange input-group" id="datepicker">
         <input data-chartid="dynamicChart" id="fromDate" data-daysofhistory="7"  type="text" class="form-control" name="start">
          <span class="input-group-addon">to</span>
         <input class="form-control" data-chartid="dynamicChart" id="toDate" type="text"  name="end">
          <span class='input-group-btn'>
             <a href="#!" data-chartid="dynamicChart" data-otherchartids="statusTimeline" class="btn chart-update btn-theme">Run</a>
          </span>
      </div>
  </div>
  <hr>
  <div class='clearfix col-xs-12' style='height: 300px' id="dynamicChart" data-chart="dynamicchart" data-daysofhistory="7"  data-chartlabel="Data" data-ylabel="" data-xlabel="Date" data-units=""  data-channelnames="vfdipp.vfdspeedref,vfdipp.vfdspeedfdbk,vfdipp.vfdoutputcurrent,vfdipp.vfdoutputcurrent,vfdipp.vfddcbusvoltage"></div>
</div>

<div class="text-center"><h1>CONFIGURATION</h1></div>
<div class="row overview">
    <div class="col-md-6">
        <h2>MOTOR NAMEPLATE DATA</h2>
        <table class="table">
            <tbody>
                <tr>
                    <td>Motor FLA</td>
                    <td><%= channels["vfdipp.vfdnameplatefla"].value %> A</td>
                </tr>

                <tr>
                    <td>Motor HP</td>
                    <td><%= Math.round(channels["vfdipp.vfdnameplatehp"].value * 10) / 10 %> HP</td>
                </tr>

                <tr>
                    <td>Motor RPM</td>
                    <td><%= channels["vfdipp.vfdnameplaterpm"].value %> RPM</td>
                </tr>

                <tr>
                    <td>Motor Frequency</td>
                    <td><%= channels["vfdipp.vfdnameplatehz"].value %> Hz</td>
                </tr>

                <tr>
                    <td>Motor Overload Current</td>
                    <td><%= channels["vfdipp.vfdnameplateolcurrent"].value %> A</td>
                </tr>

                <tr>
                    <td>Motor Volts</td>
                    <td><%= channels["vfdipp.vfdnameplatevolts"].value %> V</td>
                </tr>

                <tr>
                    <td>Motor Poles</td>
                    <td><%= channels["vfdipp.vfdmotorpoles"].value %></td>
                </tr>
            </tbody>
        </table>
    </div>

    <div class="col-md-6">
        <h2>VFD SETTINGS</h2>
        <table class="table">
            <tbody>
                <tr>
                    <td>Min. Frequency</td>
                    <td><%= channels["vfdipp.vfdminfreq"].value %> Hz</td>
                </tr>

                <tr>
                    <td>Max. Frequency</td>
                    <td><%= channels["vfdipp.vfdmaxfreq"].value %> Hz</td>
                </tr>

                <tr>
                    <td>Accel. Time</td>
                    <td><%= channels["vfdipp.vfdacceltime"].value %> s.</td>
                </tr>

                <tr>
                    <td>Decel. Time</td>
                    <td><%= channels["vfdipp.vfddeceltime"].value %> s.</td>
                </tr>

                <tr>
                    <td>Stop Mode</td>
                    <td><%= channels["vfdipp.vfdstopmode"].value %></td>
                </tr>

                <tr>
                    <td>Torque Perf. Mode</td>
                    <td><%= channels["vfdipp.vfdtorqueperfmode"].value %></td>
                </tr>
            </tbody>
        </table>
    </div>

</div>

<style>
  .overview .col-xs-4 {
    position: relative;
    padding: 0.5em;
    padding-bottom: 1.5em;
    border: 1px solid #eee;
    /*margin: 1em 0;*/
  }
  .overview .gauge-box {
    margin-top: -0.25em;
  }
  .overview h2 {
      text-transform: uppercase;
      font-size: 14px;
      color: #666;
      font-weight: 400;
      letter-spacing: 1px;
      z-index: 100;
  }
  .dynamic-chart-form {
    background-color: whiteSmoke;
    padding: 1em 0.5em;
    margin-top: 1em;
  }

  .fill-vertically {
      height:261px;
  }

  #systemStatusTimelineContainer h2 {
  text-transform: uppercase;
  font-size: 14px;
  color: #666;
  font-weight: 400;
  letter-spacing: 1px;
  z-index: 100;
  }
</style>
