Marios push test

This commit is contained in:
Noe 2024-06-10 15:36:38 +02:00
parent 9481a9be66
commit c19c32a1ec
5 changed files with 63 additions and 17 deletions

View File

@ -11,6 +11,7 @@
"overview": "overview",
"manage": "manage",
"batteryview": "batteryview",
"pvview": "pvview",
"log": "log",
"live": "live",
"information": "information",

View File

@ -310,6 +310,20 @@ function Installation(props: singleInstallationProps) {
></BatteryView>
}
></Route>
<Route
path={routes.pvview + '*'}
element={
<PvView
values={values}
s3Credentials={s3Credentials}
installationId={props.current_installation.id}
productNum={props.current_installation.product}
connected={connected}
></PvView>
}
></Route>
<Route
path={routes.overview}
element={<Overview s3Credentials={s3Credentials}></Overview>}

View File

@ -27,7 +27,8 @@ function InstallationTabs() {
'log',
'information',
'configuration',
'history'
'history',
'pvview'
];
const [currentTab, setCurrentTab] = useState<string>(undefined);
@ -139,14 +140,18 @@ function InstallationTabs() {
/>
)
},
// {
// value: 'history',
// label: (
// <FormattedMessage
// id="history"
// defaultMessage="History Of Actions"
// />
// )
// },
{
value: 'history',
label: (
<FormattedMessage
id="history"
defaultMessage="History Of Actions"
/>
)
value: 'pvview',
label: <FormattedMessage id="pvview" defaultMessage="Pv View" />
}
]
: currentUser.userType == UserType.partner
@ -168,6 +173,10 @@ function InstallationTabs() {
/>
)
},
{
value: 'pvview',
label: <FormattedMessage id="pvview" defaultMessage="Pv View" />
},
{
value: 'information',
@ -227,6 +236,10 @@ function InstallationTabs() {
/>
)
},
{
value: 'pvview',
label: <FormattedMessage id="pvview" defaultMessage="Pv View" />
},
{
value: 'manage',
label: (
@ -258,16 +271,16 @@ function InstallationTabs() {
defaultMessage="Configuration"
/>
)
},
{
value: 'history',
label: (
<FormattedMessage
id="history"
defaultMessage="History Of Actions"
/>
)
}
// {
// value: 'history',
// label: (
// <FormattedMessage
// id="history"
// defaultMessage="History Of Actions"
// />
// )
// }
]
: currentUser.userType == UserType.partner
? [
@ -299,6 +312,10 @@ function InstallationTabs() {
/>
)
},
{
value: 'pvview',
label: <FormattedMessage id="pvview" defaultMessage="Pv View" />
},
{
value: 'information',

View File

@ -35,6 +35,8 @@ export type ConfigurationValues = {
calibrationChargeDate: Date | null;
};
export interface Pv {}
export interface Battery {
BatteryId: number;
FwVersion: I_BoxDataValue;
@ -163,11 +165,19 @@ export type TopologyValues = {
additionalCalibrationChargeDate: I_BoxDataValue[];
batteryView: Battery[];
pvView: Pv[];
};
type TopologyPaths = { [key in keyof TopologyValues]: string[] };
const batteryIds = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
const PvPaths = [
'/PvOnDc/Strings/%id%/Voltage',
'/PvOnDc/Strings/%id%/Current',
'/PvOnDc/Strings/%id%/Power'
];
const batteryPaths = [
'/Battery/Devices/%id%/FwVersion',
'/Battery/Devices/%id%/Dc/Power',
@ -290,6 +300,10 @@ export const topologyPaths: TopologyPaths = {
batteryPaths.map((path) => path.replace('%id%', id.toString()))
),
pvView: batteryIds.flatMap((id) =>
PvPaths.map((path) => path.replace('%id%', id.toString()))
),
minimumSoC: ['/Config/MinSoc'],
installedDcDcPower: ['/DcDc/SystemControl/NumberOfConnectedSlaves'],
gridSetPoint: ['/Config/GridSetPoint'],