<div class="panel panel-default">
  <div class="panel-heading">
    <h3 class="panel-title" translate>Последовательный порт</h3>
  </div>
  <div class="panel-body">
    <form class="form-horizontal" role="form">
      <div class="form-group" ng-if="canReuseInterfacesAsZones">
        <div class="col-md-7 col-md-offset-5">
          <div class="checkbox">
            <label class="control-label">
              <input type="checkbox"
                     ng-model="interfaces.ext232().ext232_enabled"
                     ng-true-value="0"
                     ng-false-value="1">
              <translate>Использовать клеммы «RS-TTL» в качестве зоны</translate>
            </label>
          </div>
        </div>
      </div>
      <div class="form-group">
        <label class="col-md-5 control-label" translate>Тип оборудования</label>
        <div class="col-md-4">
          <select class="form-control"
                  ng-disabled="canReuseInterfacesAsZones && !interfaces.ext232().ext232_enabled"
                  ng-options="item.value as item.text for item in ext232.type"
                  ng-model="interfaces.ext232().ext232_dev_type"
                  ng-change="typeChange()"></select>
        </div>
      </div>
      <div class="form-group">
        <label class="col-md-5 control-label" translate>Скорость обмена</label>
        <div class="col-md-4">
          <select class="form-control"
                  ng-disabled="canReuseInterfacesAsZones && !interfaces.ext232().ext232_enabled || nothingConnected()"
                  ng-options="val for val in ext232.speed"
                  ng-model="interfaces.ext232().ext232_speed"></select>
        </div>
      </div>
      <div class="form-group">
        <label class="col-md-5 control-label" translate>Номера разделов и шлейфов</label>
        <div class="col-md-6">
          <select class="form-control"
                  ng-disabled="canReuseInterfacesAsZones && !interfaces.ext232().ext232_enabled || !streletsConnected()"
                  ng-options="item.value as item.text for item in ext232.strelets_parts"
                  ng-model="interfaces.ext232().ext232_strelets_local_parts"></select>
        </div>
      </div>
      <div class="form-group" ng-if="canConfigureLineType">
        <label class="col-md-5 control-label" translate>Тип линии</label>
        <div class="col-md-4">
          <select class="form-control"
                  ng-options="item.value as item.text for item in ext232.line"
                  ng-model="interfaces.ext232().ext232_line_type"
                  ng-disabled="nothingConnected()"></select>
        </div>
      </div>
    </form>
  </div>
</div>

<div class="panel panel-default">
  <div class="panel-heading">
    <h3 class="panel-title" translate>Телефонная линия</h3>
  </div>
  <div class="panel-body">
    <form class="form-horizontal" role="form" name="phoneInForm" guarded>
      <div class="form-group" ng-if="canReuseInterfacesAsZones">
        <div class="col-md-7 col-md-offset-5">
          <div class="checkbox">
            <label class="control-label">
              <input type="checkbox"
                     ng-model="interfaces.phoneIn().phone_in_enabled"
                     ng-true-value="0"
                     ng-false-value="1">
              <translate>Использовать клеммы «TEL IN» в качестве зоны</translate>
            </label>
          </div>
        </div>
      </div>
      <div class="form-group" ng-class="phoneInForm.HSDelay.$invalid?'has-error':''">
        <label class="col-md-5 control-label" translate>Пауза перед сигналом HS 1400 Гц, мсек</label>
        <div class="col-md-2">
          <input class="form-control" name="HSDelay"
                 ng-disabled="canReuseInterfacesAsZones && !interfaces.phoneIn().phone_in_enabled"
                 ng-model="interfaces.phoneIn().hs_delay"
                 required
                 validate-range="[500, 2000]">
        </div>
        <div ng-show="phoneInForm.HSDelay.$invalid" class="help-block"
             translate translate-params-from="500" translate-params-to="2000">
          Значение должно быть в диапазоне: {[from]}…{[to]}
        </div>
      </div>
      <div class="form-group" ng-class="phoneInForm.HS1400Time.$invalid?'has-error':''">
        <label class="col-md-5 control-label" translate>Длительность сигнала HS 1400 Гц, мсек</label>
        <div class="col-md-2">
          <input class="form-control" name="HS1400Time"
                 ng-disabled="canReuseInterfacesAsZones && !interfaces.phoneIn().phone_in_enabled"
                 ng-model="interfaces.phoneIn().hs_1400_time"
                 required
                 validate-range="[100, 200]">
        </div>
        <div ng-show="phoneInForm.HS1400Time.$invalid" class="help-block"
             translate translate-params-from="100" translate-params-to="200">
          Значение должно быть в диапазоне: {[from]}…{[to]}
        </div>
      </div>
      <div class="form-group" ng-class="phoneInForm.HSPause.$invalid?'has-error':''">
        <label class="col-md-5 control-label" translate>Пауза между HS 1400 Гц и 2300 Гц, мсек</label>
        <div class="col-md-2">
          <input class="form-control" name="HSPause"
                 ng-disabled="canReuseInterfacesAsZones && !interfaces.phoneIn().phone_in_enabled"
                 ng-model="interfaces.phoneIn().hs_pause"
                 required
                 validate-range="[80, 100]">
        </div>
        <div ng-show="phoneInForm.HSPause.$invalid" class="help-block"
             translate translate-params-from="80" translate-params-to="100">
          Значение должно быть в диапазоне: {[from]}…{[to]}
        </div>
      </div>
      <div class="form-group" ng-class="phoneInForm.HS2300Time.$invalid?'has-error':''">
        <label class="col-md-5 control-label" translate>Длительность сигнала HS 2300 Гц, мсек</label>
        <div class="col-md-2">
          <input class="form-control" name="HS2300Time"
                 ng-disabled="canReuseInterfacesAsZones && !interfaces.phoneIn().phone_in_enabled"
                 ng-model="interfaces.phoneIn().hs_2300_time"
                 required
                 validate-range="[100, 200]">
        </div>
        <div ng-show="phoneInForm.HS2300Time.$invalid" class="help-block"
             translate translate-params-from="100" translate-params-to="200">
          Значение должно быть в диапазоне: {[from]}…{[to]}
        </div>
      </div>
      <div class="form-group" ng-class="phoneInForm.KODelay.$invalid?'has-error':''">
        <label class="col-md-5 control-label" translate>Пауза перед сигналом kissoff, мсек</label>
        <div class="col-md-2">
          <input class="form-control" name="KODelay"
                 ng-disabled="canReuseInterfacesAsZones && !interfaces.phoneIn().phone_in_enabled"
                 ng-model="interfaces.phoneIn().ko_delay"
                 required
                 validate-range="[100, 750]">
        </div>
        <div ng-show="phoneInForm.KODelay.$invalid" class="help-block"
             translate translate-params-from="100" translate-params-to="750">
          Значение должно быть в диапазоне: {[from]}…{[to]}
        </div>
      </div>
      <div class="form-group" ng-class="phoneInForm.HSRepeatCount.$invalid?'has-error':''">
        <label class="col-md-5 control-label" translate>Максимальное количество handshake за сеанс</label>
        <div class="col-md-2">
          <input class="form-control" name="HSRepeatCount"
                 ng-disabled="canReuseInterfacesAsZones && !interfaces.phoneIn().phone_in_enabled"
                 ng-model="interfaces.phoneIn().hs_repeat_count"
                 required
                 validate-range="[1, 5]">
        </div>
        <div ng-show="phoneInForm.HSRepeatCount.$invalid" class="help-block"
             translate translate-params-from="1" translate-params-to="5">
          Значение должно быть в диапазоне: {[from]}…{[to]}
        </div>
      </div>
    </form>
  </div>
</div>
