added associated equipment data to CombinedEquipmentStatistics in Web UI
added associated equipment data to CombinedEquipmentLoad in Web UI Merge branch 'develop'pull/35/head^2
commit
2b11bf15e4
30
README_DE.md
30
README_DE.md
|
|
@ -23,53 +23,43 @@ MyEMS wird von einem erfahrenen Entwicklungsteam entwickelt und gewartet, und de
|
|||
|
||||
Dieses Projekt besteht aus folgenden Komponenten:
|
||||
|
||||
### MyEMS Database
|
||||
SQL
|
||||
### MyEMS Database (SQL)
|
||||
|
||||
[Installieren database](./database/README.md)
|
||||
|
||||
### MyEMS API
|
||||
Python
|
||||
### MyEMS API (Python)
|
||||
|
||||
[Installieren myems-api](./myems-api/README.md)
|
||||
|
||||
### MyEMS Admin UI
|
||||
AngularJS
|
||||
### MyEMS Admin UI (AngularJS)
|
||||
|
||||
[Installieren admin UI](./admin/README.md)
|
||||
|
||||
### MyEMS BACnet/IP Acquisition Service
|
||||
Python
|
||||
### MyEMS BACnet/IP Acquisition Service (Python)
|
||||
|
||||
[Installieren myems-bacnet](./myems-bacnet/README.md)
|
||||
|
||||
### MyEMS Modbus TCP Acquisition Service
|
||||
Python
|
||||
### MyEMS Modbus TCP Acquisition Service (Python)
|
||||
|
||||
[Installieren myems-modbus-tcp](./myems-modbus-tcp/README.md)
|
||||
|
||||
### MyEMS MQTT Data vorwärts Service
|
||||
Python
|
||||
### MyEMS MQTT Data vorwärts Service (Python)
|
||||
|
||||
[Installieren myems-mqtt-publisher](./myems-mqtt-publisher/README.md)
|
||||
|
||||
### MyEMS Cleaning Service
|
||||
Python
|
||||
### MyEMS Cleaning Service (Python)
|
||||
|
||||
[Installieren myems-cleaning](./myems-cleaning/README.md)
|
||||
|
||||
### MyEMS Normalization Service
|
||||
Python
|
||||
### MyEMS Normalization Service (Python)
|
||||
|
||||
[Installieren myems-normalization](./myems-normalization/README.md)
|
||||
|
||||
### MyEMS Aggregation Service
|
||||
Python
|
||||
### MyEMS Aggregation Service (Python)
|
||||
|
||||
[Installieren myems-aggregation](./myems-aggregation/README.md)
|
||||
|
||||
### MyEMS Web UI
|
||||
ReactJS
|
||||
### MyEMS Web UI (ReactJS)
|
||||
|
||||
[Installieren web UI](./web/README.md)
|
||||
|
||||
|
|
|
|||
30
README_EN.md
30
README_EN.md
|
|
@ -23,53 +23,43 @@ MyEMS is being developed and maintained by an experienced development team, and
|
|||
|
||||
This project is compose of following components:
|
||||
|
||||
### MyEMS Database
|
||||
SQL
|
||||
### MyEMS Database (SQL)
|
||||
|
||||
[Install database](./database/README.md)
|
||||
|
||||
### MyEMS API
|
||||
Python
|
||||
### MyEMS API (Python)
|
||||
|
||||
[Install myems-api](./myems-api/README.md)
|
||||
|
||||
### MyEMS Admin UI
|
||||
ReactJS
|
||||
### MyEMS Admin UI (ReactJS)
|
||||
|
||||
[Install admin UI](./admin/README.md)
|
||||
|
||||
### MyEMS BACnet/IP Acquisition Service
|
||||
Python
|
||||
### MyEMS BACnet/IP Acquisition Service (Python)
|
||||
|
||||
[Install myems-bacnet](./myems-bacnet/README.md)
|
||||
|
||||
### MyEMS Modbus TCP Acquisition Service
|
||||
Python
|
||||
### MyEMS Modbus TCP Acquisition Service (Python)
|
||||
|
||||
[Install myems-modbus-tcp](./myems-modbus-tcp/README.md)
|
||||
|
||||
### MyEMS MQTT Data Forwarding Service
|
||||
Python
|
||||
### MyEMS MQTT Data Forwarding Service (Python)
|
||||
|
||||
[Install myems-mqtt-publisher](./myems-mqtt-publisher/README.md)
|
||||
|
||||
### MyEMS Cleaning Service
|
||||
Python
|
||||
### MyEMS Cleaning Service (Python)
|
||||
|
||||
[Install myems-cleaning](./myems-cleaning/README.md)
|
||||
|
||||
### MyEMS Normalization Service
|
||||
Python
|
||||
### MyEMS Normalization Service (Python)
|
||||
|
||||
[Install myems-normalization](./myems-normalization/README.md)
|
||||
|
||||
### MyEMS Aggregation Service
|
||||
Python
|
||||
### MyEMS Aggregation Service (Python)
|
||||
|
||||
[Install myems-aggregation](./myems-aggregation/README.md)
|
||||
|
||||
### MyEMS Web UI
|
||||
AngularJS
|
||||
### MyEMS Web UI (AngularJS)
|
||||
|
||||
[Install web UI](./web/README.md)
|
||||
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ import { comparisonTypeOptions } from '../common/ComparisonTypeOptions';
|
|||
|
||||
|
||||
const DetailedDataTable = loadable(() => import('../common/DetailedDataTable'));
|
||||
const AssociatedEquipmentTable = loadable(() => import('../common/AssociatedEquipmentTable'));
|
||||
|
||||
const CombinedEquipmentLoad = ({ setRedirect, setRedirectUrl, t }) => {
|
||||
let current_moment = moment();
|
||||
|
|
@ -87,6 +88,10 @@ const CombinedEquipmentLoad = ({ setRedirect, setRedirectUrl, t }) => {
|
|||
|
||||
const [detailedDataTableData, setDetailedDataTableData] = useState([]);
|
||||
const [detailedDataTableColumns, setDetailedDataTableColumns] = useState([{dataField: 'startdatetime', text: t('Datetime'), sort: true}]);
|
||||
|
||||
const [associatedEquipmentTableData, setAssociatedEquipmentTableData] = useState([]);
|
||||
const [associatedEquipmentTableColumns, setAssociatedEquipmentTableColumns] = useState([{dataField: 'name', text: t('Associated Equipment'), sort: true }]);
|
||||
|
||||
const [excelBytesBase64, setExcelBytesBase64] = useState(undefined);
|
||||
|
||||
useEffect(() => {
|
||||
|
|
@ -291,6 +296,7 @@ const CombinedEquipmentLoad = ({ setRedirect, setRedirectUrl, t }) => {
|
|||
|
||||
// Reinitialize tables
|
||||
setDetailedDataTableData([]);
|
||||
setAssociatedEquipmentTableData([]);
|
||||
|
||||
let isResponseOK = false;
|
||||
fetch(APIBaseURL + '/reports/combinedequipmentload?' +
|
||||
|
|
@ -418,7 +424,44 @@ const CombinedEquipmentLoad = ({ setRedirect, setRedirectUrl, t }) => {
|
|||
});
|
||||
});
|
||||
setDetailedDataTableColumns(detailed_column_list);
|
||||
|
||||
let associated_equipment_value_list = [];
|
||||
if (json['associated_equipment']['associated_equipment_names_array'].length > 0) {
|
||||
json['associated_equipment']['associated_equipment_names_array'][0].forEach((currentEquipmentName, equipmentIndex) => {
|
||||
let associated_equipment_value = {};
|
||||
associated_equipment_value['id'] = equipmentIndex;
|
||||
associated_equipment_value['name'] = currentEquipmentName;
|
||||
json['associated_equipment']['energy_category_names'].forEach((currentValue, energyCategoryIndex) => {
|
||||
associated_equipment_value['a' + 2 * energyCategoryIndex] = json['associated_equipment']['sub_averages'][energyCategoryIndex][equipmentIndex].toFixed(2);
|
||||
associated_equipment_value['a' + 2 * energyCategoryIndex + 1] = json['associated_equipment']['sub_maximums'][energyCategoryIndex][equipmentIndex].toFixed(2);
|
||||
});
|
||||
associated_equipment_value_list.push(associated_equipment_value);
|
||||
});
|
||||
};
|
||||
|
||||
setAssociatedEquipmentTableData(associated_equipment_value_list);
|
||||
|
||||
let associated_equipment_column_list = [];
|
||||
associated_equipment_column_list.push({
|
||||
dataField: 'name',
|
||||
text: t('Associated Equipment'),
|
||||
sort: true
|
||||
});
|
||||
json['associated_equipment']['energy_category_names'].forEach((currentValue, index) => {
|
||||
let unit = json['associated_equipment']['units'][index];
|
||||
associated_equipment_column_list.push({
|
||||
dataField: 'a' + 2 * index,
|
||||
text: currentValue + ' ' + t('Average Load') + ' (' + unit + '/H)',
|
||||
sort: true
|
||||
});
|
||||
associated_equipment_column_list.push({
|
||||
dataField: 'a' + (2 * index + 1),
|
||||
text: currentValue + ' ' + t('Maximum Load') + ' (' + unit + '/H)',
|
||||
sort: true
|
||||
});
|
||||
});
|
||||
|
||||
setAssociatedEquipmentTableColumns(associated_equipment_column_list);
|
||||
|
||||
setExcelBytesBase64(json['excel_bytes_base64']);
|
||||
|
||||
// enable submit button
|
||||
|
|
@ -642,6 +685,9 @@ const CombinedEquipmentLoad = ({ setRedirect, setRedirectUrl, t }) => {
|
|||
<br />
|
||||
<DetailedDataTable data={detailedDataTableData} title={t('Detailed Data')} columns={detailedDataTableColumns} pagesize={50} >
|
||||
</DetailedDataTable>
|
||||
<br />
|
||||
<AssociatedEquipmentTable data={associatedEquipmentTableData} title={t('Associated Equipment Data')} columns={associatedEquipmentTableColumns}>
|
||||
</AssociatedEquipmentTable>
|
||||
|
||||
</Fragment>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ import { comparisonTypeOptions } from '../common/ComparisonTypeOptions';
|
|||
|
||||
|
||||
const DetailedDataTable = loadable(() => import('../common/DetailedDataTable'));
|
||||
const AssociatedEquipmentTable = loadable(() => import('../common/AssociatedEquipmentTable'));
|
||||
|
||||
const CombinedEquipmentStatistics = ({ setRedirect, setRedirectUrl, t }) => {
|
||||
let current_moment = moment();
|
||||
|
|
@ -87,6 +88,10 @@ const CombinedEquipmentStatistics = ({ setRedirect, setRedirectUrl, t }) => {
|
|||
|
||||
const [detailedDataTableData, setDetailedDataTableData] = useState([]);
|
||||
const [detailedDataTableColumns, setDetailedDataTableColumns] = useState([{dataField: 'startdatetime', text: t('Datetime'), sort: true}]);
|
||||
|
||||
const [associatedEquipmentTableData, setAssociatedEquipmentTableData] = useState([]);
|
||||
const [associatedEquipmentTableColumns, setAssociatedEquipmentTableColumns] = useState([{dataField: 'name', text: t('Associated Equipment'), sort: true }]);
|
||||
|
||||
const [excelBytesBase64, setExcelBytesBase64] = useState(undefined);
|
||||
|
||||
useEffect(() => {
|
||||
|
|
@ -291,6 +296,7 @@ const CombinedEquipmentStatistics = ({ setRedirect, setRedirectUrl, t }) => {
|
|||
|
||||
// Reinitialize tables
|
||||
setDetailedDataTableData([]);
|
||||
setAssociatedEquipmentTableData([]);
|
||||
|
||||
let isResponseOK = false;
|
||||
fetch(APIBaseURL + '/reports/combinedequipmentstatistics?' +
|
||||
|
|
@ -416,6 +422,37 @@ const CombinedEquipmentStatistics = ({ setRedirect, setRedirectUrl, t }) => {
|
|||
})
|
||||
});
|
||||
setDetailedDataTableColumns(detailed_column_list);
|
||||
let associated_equipment_value_list = [];
|
||||
if (json['associated_equipment']['associated_equipment_names_array'].length > 0) {
|
||||
json['associated_equipment']['associated_equipment_names_array'][0].forEach((currentEquipmentName, equipmentIndex) => {
|
||||
let associated_equipment_value = {};
|
||||
associated_equipment_value['id'] = equipmentIndex;
|
||||
associated_equipment_value['name'] = currentEquipmentName;
|
||||
json['associated_equipment']['energy_category_names'].forEach((currentValue, energyCategoryIndex) => {
|
||||
associated_equipment_value['a' + energyCategoryIndex] = json['associated_equipment']['subtotals_array'][energyCategoryIndex][equipmentIndex].toFixed(2);
|
||||
});
|
||||
associated_equipment_value_list.push(associated_equipment_value);
|
||||
});
|
||||
};
|
||||
|
||||
setAssociatedEquipmentTableData(associated_equipment_value_list);
|
||||
|
||||
let associated_equipment_column_list = [];
|
||||
associated_equipment_column_list.push({
|
||||
dataField: 'name',
|
||||
text: t('Associated Equipment'),
|
||||
sort: true
|
||||
});
|
||||
json['associated_equipment']['energy_category_names'].forEach((currentValue, index) => {
|
||||
let unit = json['associated_equipment']['units'][index];
|
||||
associated_equipment_column_list.push({
|
||||
dataField: 'a' + index,
|
||||
text: currentValue + ' (' + unit + ')',
|
||||
sort: true
|
||||
});
|
||||
});
|
||||
|
||||
setAssociatedEquipmentTableColumns(associated_equipment_column_list);
|
||||
|
||||
setExcelBytesBase64(json['excel_bytes_base64']);
|
||||
|
||||
|
|
@ -657,6 +694,9 @@ const CombinedEquipmentStatistics = ({ setRedirect, setRedirectUrl, t }) => {
|
|||
<br />
|
||||
<DetailedDataTable data={detailedDataTableData} title={t('Detailed Data')} columns={detailedDataTableColumns} pagesize={50} >
|
||||
</DetailedDataTable>
|
||||
<br />
|
||||
<AssociatedEquipmentTable data={associatedEquipmentTableData} title={t('Associated Equipment Data')} columns={associatedEquipmentTableColumns}>
|
||||
</AssociatedEquipmentTable>
|
||||
|
||||
</Fragment>
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in New Issue