<!--

    Copyright (C) 2015-2016 Jeeva Kandasamy (jkandasa@gmail.com)

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

            http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<form role="form">

  <div class="form-group">
    <label>{{ 'REFRESH_TIME_SECONDS' | translate }}</label>
    <input type="text" class="form-control" id="refreshTime" placeholder="{{'REFRESH_TIME_SECONDS' | translate}}" ng-model="config.refreshTime" pf-validation="mycSensorsMixedGraphEdit.cs.isNumber(input)" required>
    <span class="help-block">{{ 'VALIDATION_ERROR_NUMBER' | translate }}</span>
  </div>

  <div class="form-group">
    <input ng-model="config.useInteractiveGuideline" type="checkbox"/>
    <label class="control-label">{{ 'USE_INTERACTIVE_GUIDE_LINE' | translate }}</label>
  </div>

  <div class="form-group">
    <input ng-model="config.enableUniqueName" type="checkbox"/>
    <label class="control-label">{{ 'ENABLE_UNIQUE_NAME' | translate }}</label>
  </div>

  <div class="form-group">
    <label>{{ 'MARGIN' | translate }}</label>
    <table class="adf-table">
      <tr>
        <td>
          <label>{{ 'LEFT' | translate }}</label>
        </td>
        <td>
          <input class="form-control" type="number" id="left" placeholder="{{'LEFT' | translate}}" ng-model="config.marginLeft" pf-validation="mycSensorsMixedGraphEdit.cs.isNumber(input)" required>
        </td>
        <td>
          <label class="mc-margin-right">{{ 'RIGHT' | translate }}</label>
        </td>
        <td>
          <input class="form-control" type="number" id="right" placeholder="{{'RIGHT' | translate}}" ng-model="config.marginRight" pf-validation="mycSensorsMixedGraphEdit.cs.isNumber(input)" required>
        </td>
      </tr>
      <tr>
        <td>
          <label>{{ 'TOP' | translate }}</label>
        </td>
        <td>
          <input class="form-control" type="number" id="top" placeholder="{{'TOP' | translate}}" ng-model="config.marginTop" pf-validation="mycSensorsMixedGraphEdit.cs.isNumber(input)" required>
        </td>
        <td>
          <label>{{ 'BOTTOM' | translate }}</label>
        </td>
        <td>
          <input class="form-control" type="number" id="bottom" placeholder="{{'BOTTOM' | translate}}" ng-model="config.marginBottom" pf-validation="mycSensorsMixedGraphEdit.cs.isNumber(input)" required>
        </td>
      </tr>
    </table>
  </div>

  <div class="form-group">
    <label>{{ 'INTERPOLATE_TYPE' | translate }}</label>
    <select class="form-control" pf-select ng-model="config.chartInterpolate" required>
      <option value="" ng-hide="true"></option>
      <option value="linear">{{ 'LINEAR' | translate }}</option>
      <option value="basis">{{ 'BASIS' | translate }}</option>
      <option value="cardinal">{{ 'CARDINAL' | translate }}</option>
      <option value="monotone">{{ 'MONOTONE' | translate }}</option>
      <option value="bundle">{{ 'BUNDLE' | translate }}</option>
      <option value="step-before">{{ 'STEP_BEFORE' | translate }}</option>
      <option value="step-after">{{ 'STEP_AFTER' | translate }}</option>
      <option value="basis-open">{{ 'BASIS_OPEN' | translate }}</option>
      <option value="basis-closed">{{ 'BASIS_CLOSED' | translate }}</option>
      <option value="cardinal-open">{{ 'CARDINAL_OPEN' | translate }}</option>
      <option value="cardinal-closed">{{ 'CARDINAL_CLOSED' | translate }}</option>
    </select>
  </div>

  <div class="form-group">
    <label>{{ 'TIME_RANGE' | translate }}</label>
    <select id="panelSize" class="form-control" pf-select ng-model="config.chartFromTimestamp" required>
      <option value="" ng-hide="true"></option>
        <option value="300000">{{ 'LAST_5_MINUTES' | translate }}</option>
        <option value="3600000">{{ 'LAST_HOUR' | translate }}</option>
        <option value="21600000">{{ 'LAST_6_HOURS' | translate }}</option>
        <option value="43200000">{{ 'LAST_12_HOURS' | translate }}</option>
        <option value="86400000">{{ 'LAST_DAY' | translate }}</option>
        <option value="604800000">{{ 'LAST_WEEK' | translate }}</option>
        <option value="2419200000">{{ 'LAST_MONTH' | translate }}</option>
        <option value="31536000000">{{ 'LAST_YEAR' | translate }}</option>
    </select>
  </div>

  <div class="form-group">
    <label>{{ 'SENSOR_VARIABLE_TYPE' | translate }}</label>
    <select id="senVarsTypes" class="form-control" multiple pf-select data-live-search="true" ng-model="config.variableType" ng-change="mycSensorsMixedGraphEdit.onVariableTypeChange()" required>
      <option value="" ng-hide="true"></option>
      <option ng-repeat="vType in mycSensorsMixedGraphEdit.variableTypes" value="{{vType.id}}"  ng-selected="config.variableType.indexOf(vType.id) !== -1 ">{{vType.displayName}}</option>
    </select>
  </div>

  <div class="form-group">
    <label>{{ 'SENSOR_VARIABLE' | translate }}</label>
    <select id="senVars" class="form-control" multiple pf-select data-live-search="true" ng-model="config.variableId" required>
      <option value="" ng-hide="true"></option>
      <option ng-repeat="res in mycSensorsMixedGraphEdit.variables" ng-bind-html="res.displayName | mcResourceRepresentation" value="{{res.id}}"
        ng-selected="config.variableId.indexOf(res.id.toString()) !== -1 "></option>
    </select>
  </div>

</form>
