<commit_before><link rel="import" href="../../bower_components/polymer/polymer-element.html">
<link rel="import" href="../../bower_components/iron-ajax/iron-ajax.html">
<link rel="import" href="../../bower_components/paper-input/paper-input.html">
<link rel="import" href="../../bower_components/paper-checkbox/paper-checkbox.html">
<link rel="import" href="../../bower_components/paper-button/paper-button.html">
<link rel="import" href="../../bower_components/paper-toast/paper-toast.html">
<link rel="import" href="../../bower_components/vaadin-combo-box/vaadin-combo-box.html">
<link rel="import" href="../view-setup.html">
<link rel="import" href="../style/shared-styles.html">
<link rel="import" href="../style/flat-button.html">

<dom-module id="view-setup-factory">
    <template>
        <style include="shared-styles app-grid-style flat-button">
             :host {
                margin: 10px;
                display: block;
                --app-grid-item-height: 50%;
            }

            @media (min-width: 360px) and (max-width: 768px) {
                 :host {
                    --app-grid-columns: 1;
                }
            }

            @media (min-width: 769px) and (max-width: 1024px) {
                 :host {
                    --app-grid-columns: 2;
                }
            }

            @media (min-width: 1025px) and (max-width: 1200px) {
                 :host {
                    --app-grid-columns: 2;
                }
            }

            @media (min-width: 1201px) and (max-width: 2560px) {
                 :host {
                    --app-grid-columns: 2;
                }
            }

            .factory-rule p {
                margin: 16px 0;
            }

            .operation-day-selector {
                margin-top: 16px;
                padding: 10px;
                border: 1px solid rgba(0, 0, 0, .10);
                border-radius: 2px;
            }

            .operation-day-selector>p {
                margin-bottom: 10px;
            }

            .checkbox {
                padding: 0 5px;
            }

            .flex-container {
                display: flex;
                align-items: center;
                justify-content: stretch;
                width: 100%;
            }

            .flex-item {
                flex: 1;
            }

            .flex-item:first-child>p {
                font-weight: 500;
            }

            .flex-item:last-child>p {
                font-weight: 400;
            }

            .info-group {
                margin-top: 15px;
            }

            .info-group>p {
                margin: 12px 0;
            }

            #toastSaveFactoryInfoSuccess,
            #toastErrorIncompleteInput {
                width: 350px;
            }
        </style>
        <firebase-auth app-name="smart-mes" id="auth" user="{{user}}"></firebase-auth>
        <firebase-document app-name="smart-mes" id="userData" path="/user/[[user.uid]]" data="{{k}}"></firebase-document>
        <firebase-document app-name="smart-mes" id="factoryProfile" path="/data/[[k.key]]/factoryData/profile" data="{{factoryProfile}}"></firebase-document>
        <firebase-document app-name="smart-mes" id="factoryOperation" path="/data/[[k.key]]/factoryData/operation" data="{{factoryOperation}}"></firebase-document>
        <firebase-document app-name="smart-mes" id="factoryPerformance" path="/data/[[k.key]]/factoryData/performance" data="{{factoryPerformance}}"></firebase-document>
        <firebase-document app-name="smart-mes" id="factorySchedule" path="/data/[[k.key]]/factoryData/schedule" data="{{factorySchedule}}"></firebase-document>
        <iron-ajax url="../data/factory.json" auto handle-as="json" last-response="{{factoryType}}"></iron-ajax>
        <app-localstorage-document key="app-lang" data="{{language}}"></app-localstorage-document>
        <ul class="app-grid">
            <li>
                <div class="card">
                    <h1>{{localize('factory-initialize')}}</h1>
                    <div>
                        <paper-input label="{{localize('factory-name')}}" id="factoryName" value="[[factoryProfile.name]]" type="text" required always-float-label></paper-input>
                        <vaadin-combo-box label="{{localize('factory-type')}}" id="factoryType" value="[[factoryProfile.type]]" items="[[factoryType]]"
                            item-label-path="name" item-value-path="name" required always-float-label></vaadin-combo-box>
                        <paper-input label="{{localize('operation-start')}} (xx:xx)" id="opStart" value="[[factoryOperation.op_start]]" type="text"
                            required always-float-label auto-validate></paper-input>
                        <paper-input label="{{localize('operation-end')}} (xx:xx)" id="opEnd" value="[[factoryOperation.op_end]]" type="text" required
                            always-float-label auto-validate></paper-input>
                        <paper-input label="{{localize('over-time-start')}} (xx:xx)" id="otStart" value="[[factoryOperation.ot_start]]" type="text"
                            required always-float-label auto-validate></paper-input>
                        <paper-input label="{{localize('over-time-end')}} (xx:xx)" id="otEnd" value="[[factoryOperation.ot_end]]" type="text" required
                            always-float-label auto-validate></paper-input>
                        <vaadin-combo-box label="{{localize('productivity-optimization')}}" id="optimizeType" value="[[factoryPerformance.optimize]]"
                            items="[[optimizationType]]" item-value-path="value" item-label-path="name" required always-float-label>
                            <template>
                                <div>{{localize(item.value)}}</div>
                            </template>
                        </vaadin-combo-box>
                        <paper-input label="{{localize('working-utilization')}} (0-100%)" id="workerUtilize" value="[[factoryPerformance.au]]" type="number"
                            min="0" max="100" step="1" required always-float-label auto-validate></paper-input>
                        <paper-input label="{{localize('standard-machine-efficiency')}} (0-100%)" name="machineStandardEfficiency" id="machineStandardEffi"
                            value="[[factoryPerformance.me]]" type="number" min="0" max="100" step="1" required always-float-label
                            auto-validate></paper-input>
                        <paper-input label="{{localize('acceptable-waste')}} (0.00-1.00)" id="acceptWaste" value="[[factoryPerformance.aw]]" type="number"
                            min="0" max="1" step="0.01" required always-float-label auto-validate></paper-input>
                        <paper-input label="{{localize('reschedule-interval')}} ({{localize('day')}})" id="scheduleInterval" value="[[factorySchedule.interval]]"
                            type="number" min="1" max="30" step="1" required always-float-label auto-validate></paper-input>
                        <div class="operation-day-selector">
                            <p>{{localize('operation-day')}}</p>[[factoryOperationLoaded(factoryOperation.op_day)]]
                            <paper-checkbox class="checkbox" tabindex="0" id="sunday" value="sun">Sun</paper-checkbox>
                            <paper-checkbox class="checkbox" tabindex="0" id="monday" value="mon">Mon</paper-checkbox>
                            <paper-checkbox class="checkbox" tabindex="0" id="tuesday" value="tue">Tue</paper-checkbox>
                            <paper-checkbox class="checkbox" tabindex="0" id="wednesday" value="wed">Wed</paper-checkbox>
                            <paper-checkbox class="checkbox" tabindex="0" id="thursday" value="thu">Thu</paper-checkbox>
                            <paper-checkbox class="checkbox" tabindex="0" id="friday" value="fri">Fri</paper-checkbox>
                            <paper-checkbox class="checkbox" tabindex="0" id="saturday" value="sat">Sat</paper-checkbox>
                        </div>
                        <div class="button-group">
                            <flat-button on-tap="saveValue" class="btn" title="Save settings"><button role="button">{{localize('save-settings')}}</button></flat-button>
                            <flat-button on-tap="resetValue" class="btn" title="Restore Default"><button role="button">{{localize('restore')}}</button></flat-button>
                        </div>
                    </div>
                </div>
            </li>
            <li>
                <div class="card factory-rule" style="margin-bottom: 20px">
                    <h1>{{localize('factory-information')}}</h1>
                    <div class="flex-container">
                        <div class="info-group flex-item">
                            <p>{{localize('factory-name')}}</p>
                            <div class="sidebar-menu-line" role="separator"></div>
                            <p>{{localize('factory-type')}}</p>
                            <div class="sidebar-menu-line" role="separator"></div><commit_msg>fix setup factory parameter input value<commit_after><link rel="import" href="../../bower_components/polymer/polymer-element.html">
<link rel="import" href="../../bower_components/iron-ajax/iron-ajax.html">
<link rel="import" href="../../bower_components/paper-input/paper-input.html">
<link rel="import" href="../../bower_components/paper-checkbox/paper-checkbox.html">
<link rel="import" href="../../bower_components/paper-button/paper-button.html">
<link rel="import" href="../../bower_components/paper-toast/paper-toast.html">
<link rel="import" href="../../bower_components/vaadin-combo-box/vaadin-combo-box.html">
<link rel="import" href="../view-setup.html">
<link rel="import" href="../style/shared-styles.html">
<link rel="import" href="../style/flat-button.html">

<dom-module id="view-setup-factory">
    <template>
        <style include="shared-styles app-grid-style flat-button">
             :host {
                margin: 10px;
                display: block;
                --app-grid-item-height: 50%;
            }

            @media (min-width: 360px) and (max-width: 768px) {
                 :host {
                    --app-grid-columns: 1;
                }
            }

            @media (min-width: 769px) and (max-width: 1024px) {
                 :host {
                    --app-grid-columns: 2;
                }
            }

            @media (min-width: 1025px) and (max-width: 1200px) {
                 :host {
                    --app-grid-columns: 2;
                }
            }

            @media (min-width: 1201px) and (max-width: 2560px) {
                 :host {
                    --app-grid-columns: 2;
                }
            }

            .factory-rule p {
                margin: 16px 0;
            }

            .operation-day-selector {
                margin-top: 16px;
                padding: 10px;
                border: 1px solid rgba(0, 0, 0, .10);
                border-radius: 2px;
            }

            .operation-day-selector>p {
                margin-bottom: 10px;
            }

            .checkbox {
                padding: 0 5px;
            }

            .flex-container {
                display: flex;
                align-items: center;
                justify-content: stretch;
                width: 100%;
            }

            .flex-item {
                flex: 1;
            }

            .flex-item:first-child>p {
                font-weight: 500;
            }

            .flex-item:last-child>p {
                font-weight: 400;
            }

            .info-group {
                margin-top: 15px;
            }

            .info-group>p {
                margin: 12px 0;
            }

            #toastSaveFactoryInfoSuccess,
            #toastErrorIncompleteInput {
                width: 350px;
            }
        </style>
        <firebase-auth app-name="smart-mes" id="auth" user="{{user}}"></firebase-auth>
        <firebase-document app-name="smart-mes" id="userData" path="/user/[[user.uid]]" data="{{k}}"></firebase-document>
        <firebase-document app-name="smart-mes" id="factoryProfile" path="/data/[[k.key]]/factoryData/profile" data="{{factoryProfile}}"></firebase-document>
        <firebase-document app-name="smart-mes" id="factoryOperation" path="/data/[[k.key]]/factoryData/operation" data="{{factoryOperation}}"></firebase-document>
        <firebase-document app-name="smart-mes" id="factoryPerformance" path="/data/[[k.key]]/factoryData/performance" data="{{factoryPerformance}}"></firebase-document>
        <firebase-document app-name="smart-mes" id="factorySchedule" path="/data/[[k.key]]/factoryData/schedule" data="{{factorySchedule}}"></firebase-document>
        <iron-ajax url="../data/factory.json" auto handle-as="json" last-response="{{factoryType}}"></iron-ajax>
        <app-localstorage-document key="app-lang" data="{{language}}"></app-localstorage-document>
        <ul class="app-grid">
            <li>
                <div class="card">
                    <h1>{{localize('factory-initialize')}}</h1>
                    <div>
                        <paper-input label="{{localize('factory-name')}}" id="factoryName" value="[[factoryProfile.name]]" type="text" required always-float-label></paper-input>
                        <vaadin-combo-box label="{{localize('factory-type')}}" id="factoryType" value="[[factoryProfile.type]]" items="[[factoryType]]"
                            item-label-path="name" item-value-path="name" required always-float-label></vaadin-combo-box>
                        <paper-input label="{{localize('operation-start')}} (xx:xx)" id="opStart" value="[[factoryOperation.op_start]]" type="text"
                            required always-float-label auto-validate></paper-input>
                        <paper-input label="{{localize('operation-end')}} (xx:xx)" id="opEnd" value="[[factoryOperation.op_end]]" type="text" required
                            always-float-label auto-validate></paper-input>
                        <paper-input label="{{localize('over-time-start')}} (xx:xx)" id="otStart" value="[[factoryOperation.ot_start]]" type="text"
                            required always-float-label auto-validate></paper-input>
                        <paper-input label="{{localize('over-time-end')}} (xx:xx)" id="otEnd" value="[[factoryOperation.ot_end]]" type="text" required
                            always-float-label auto-validate></paper-input>
                        <vaadin-combo-box label="{{localize('productivity-optimization')}}" id="optimizeType" value="[[factoryPerformance.optimize]]"
                            items="[[optimizationType]]" item-value-path="value" item-label-path="name" required always-float-label>
                            <template>
                                <div>{{localize(item.value)}}</div>
                            </template>
                        </vaadin-combo-box>
                        <paper-input label="{{localize('working-utilization')}} (0-100%)" id="workerUtilize" value="[[factoryPerformance.au]]" type="number"
                            min="0" max="100" step="1" required always-float-label auto-validate></paper-input>
                        <paper-input label="{{localize('standard-machine-efficiency')}} (0-100%)" name="machineStandardEfficiency" id="machineStandardEffi"
                            value="[[factoryPerformance.meff]]" type="number" min="0" max="100" step="1" required always-float-label
                            auto-validate></paper-input>
                        <paper-input label="{{localize('acceptable-waste')}} (0.00-1.00)" id="acceptWaste" value="[[factoryPerformance.aw]]" type="number"
                            min="0" max="1" step="0.01" required always-float-label auto-validate></paper-input>
                        <paper-input label="{{localize('reschedule-interval')}} ({{localize('day')}})" id="scheduleInterval" value="[[factorySchedule.interval]]"
                            type="number" min="1" max="30" step="1" required always-float-label auto-validate></paper-input>
                        <div class="operation-day-selector">
                            <p>{{localize('operation-day')}}</p>[[factoryOperationLoaded(factoryOperation.op_day)]]
                            <paper-checkbox class="checkbox" tabindex="0" id="sunday" value="sun">Sun</paper-checkbox>
                            <paper-checkbox class="checkbox" tabindex="0" id="monday" value="mon">Mon</paper-checkbox>
                            <paper-checkbox class="checkbox" tabindex="0" id="tuesday" value="tue">Tue</paper-checkbox>
                            <paper-checkbox class="checkbox" tabindex="0" id="wednesday" value="wed">Wed</paper-checkbox>
                            <paper-checkbox class="checkbox" tabindex="0" id="thursday" value="thu">Thu</paper-checkbox>
                            <paper-checkbox class="checkbox" tabindex="0" id="friday" value="fri">Fri</paper-checkbox>
                            <paper-checkbox class="checkbox" tabindex="0" id="saturday" value="sat">Sat</paper-checkbox>
                        </div>
                        <div class="button-group">
                            <flat-button on-tap="saveValue" class="btn" title="Save settings"><button role="button">{{localize('save-settings')}}</button></flat-button>
                            <flat-button on-tap="resetValue" class="btn" title="Restore Default"><button role="button">{{localize('restore')}}</button></flat-button>
                        </div>
                    </div>
                </div>
            </li>
            <li>
                <div class="card factory-rule" style="margin-bottom: 20px">
                    <h1>{{localize('factory-information')}}</h1>
                    <div class="flex-container">
                        <div class="info-group flex-item">
                            <p>{{localize('factory-name')}}</p>
                            <div class="sidebar-menu-line" role="separator"></div>
                            <p>{{localize('factory-type')}}</p>
                            <div class="sidebar-menu-line" role="separator"></div>
{'fraction_non_alphanumeric': 0.16588810429114612, 'fraction_numerical': 0.012927756653992395, 'mean_word_length': 1.8455950540958268, 'pattern_counts': {'":': 0, '<': 217, '<?xml version=': 0, '>': 225, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5505331', 'n_tokens_mistral': 5232, 'n_tokens_neox': 4847, 'n_words': 746}