Skip to content

Commit

Permalink
feat: update shared
Browse files Browse the repository at this point in the history
  • Loading branch information
kylebonnici committed Feb 23, 2024
1 parent 9a0ea91 commit 2ff9dfe
Show file tree
Hide file tree
Showing 19 changed files with 66 additions and 212 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"prepare": "husky install"
},
"devDependencies": {
"@nordicsemiconductor/pc-nrfconnect-shared": "^157.0.0",
"@nordicsemiconductor/pc-nrfconnect-shared": "^160.0.0",
"chart.js": "^4.0.1",
"chartjs-adapter-date-fns": "^2.0.1",
"react-chartjs-2": "^5.0.1",
Expand Down
2 changes: 0 additions & 2 deletions src/appReducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import { NrfConnectState } from '@nordicsemiconductor/pc-nrfconnect-shared';
import { combineReducers } from 'redux';

import confirmBeforeCloseReducer from './features/confirmBeforeClose/confirmBeforeCloseSlice';
import downloadBatteryModelSlice from './features/pmicControl/downloadBatteryModelSlice';
import pmicControlReducer from './features/pmicControl/pmicControlSlice';
import profilingProjectsReducer from './features/pmicControl/profilingProjectsSlice.';
Expand All @@ -20,7 +19,6 @@ type AppState = ReturnType<typeof appReducer>;
export interface RootState extends NrfConnectState<AppState> {}

const appReducer = combineReducers({
confirmBeforeClose: confirmBeforeCloseReducer,
profilingProjects: profilingProjectsReducer,
profiling: profilingReducer,
pmicControl: pmicControlReducer,
Expand Down
8 changes: 5 additions & 3 deletions src/components/Cards/Buck/BuckCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
Card,
classNames,
Dropdown,
NumberInputSliderWithUnit,
NumberInput,
StateSelector,
Toggle,
} from '@nordicsemiconductor/pc-nrfconnect-shared';
Expand Down Expand Up @@ -160,7 +160,7 @@ export default ({
disabled={disabled}
/>

<NumberInputSliderWithUnit
<NumberInput
label={
<DocumentationTooltip card={card} item="VOUT">
<div>
Expand All @@ -177,10 +177,11 @@ export default ({
value={internalVOut}
onChange={setInternalVOut}
onChangeComplete={onVOutChange}
showSlider
/>
{!summary && (
<>
<NumberInputSliderWithUnit
<NumberInput
label={
<DocumentationTooltip card={card} item="RETVOUT">
<div>
Expand All @@ -197,6 +198,7 @@ export default ({
value={internalRetVOut}
onChange={setInternalRetVOut}
onChangeComplete={onRetVOutChange}
showSlider
/>
<Toggle
label={
Expand Down
5 changes: 3 additions & 2 deletions src/components/Cards/LDO/LDOCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
Card,
classNames,
Dropdown,
NumberInputSliderWithUnit,
NumberInput,
StateSelector,
Toggle,
} from '@nordicsemiconductor/pc-nrfconnect-shared';
Expand Down Expand Up @@ -116,7 +116,7 @@ export default ({
}
/>

<NumberInputSliderWithUnit
<NumberInput
label={
<DocumentationTooltip card={card} item="VOUTLDO">
<div>
Expand All @@ -135,6 +135,7 @@ export default ({
onChangeComplete={value =>
npmDevice.setLdoVoltage(index, value)
}
showSlider
/>

{!summary && (
Expand Down
8 changes: 5 additions & 3 deletions src/components/Cards/Power/PowerCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
Card,
classNames,
Dropdown,
NumberInputSliderWithUnit,
NumberInput,
Toggle,
} from '@nordicsemiconductor/pc-nrfconnect-shared';

Expand Down Expand Up @@ -94,7 +94,7 @@ export default ({
</div>
}
>
<NumberInputSliderWithUnit
<NumberInput
label={
<DocumentationTooltip card={card} item="VTERM">
<div>
Expand All @@ -109,8 +109,9 @@ export default ({
value={internalVTerm}
onChange={setInternalVTerm}
onChangeComplete={v => npmDevice.setChargerVTerm(v)}
showSlider
/>
<NumberInputSliderWithUnit
<NumberInput
label={
<DocumentationTooltip card={card} item="ICHG">
<div>
Expand All @@ -125,6 +126,7 @@ export default ({
value={internalIChg}
onChange={setInternalIChg}
onChangeComplete={v => npmDevice.setChargerIChg(v)}
showSlider
/>

{!summary && (
Expand Down
5 changes: 3 additions & 2 deletions src/components/Charger/Jeita.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
classNames,
Dropdown,
NumberInlineInput,
NumberInputSliderWithUnit,
NumberInput,
Slider,
Toggle,
} from '@nordicsemiconductor/pc-nrfconnect-shared';
Expand Down Expand Up @@ -281,7 +281,7 @@ export default ({
<span>{npmDevice.getChargerJeitaRange().max}°C</span>
</div>
</div>
<NumberInputSliderWithUnit
<NumberInput
label={
<DocumentationTooltip card={card} item="Vtermr">
<div>
Expand All @@ -296,6 +296,7 @@ export default ({
onChange={value => setInternalVTermr(value)}
onChangeComplete={npmDevice.setChargerVTermR}
disabled={disabled}
showSlider
/>
<Dropdown
label={
Expand Down
17 changes: 11 additions & 6 deletions src/components/Profiling/Dialog/ConfigurationDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
Dropdown,
GenericDialog,
Group,
NumberInputSliderWithUnit,
NumberInput,
} from '@nordicsemiconductor/pc-nrfconnect-shared';

import { selectDirectoryDialog } from '../../../actions/fileActions';
Expand Down Expand Up @@ -186,7 +186,8 @@ export default ({ isVisible }: { isVisible: boolean }) => {
value={name}
/>
</div>
<NumberInputSliderWithUnit
<NumberInput
showSlider
label={
<DocumentationTooltip card="charger" item="VTERM">
<div>
Expand All @@ -206,7 +207,8 @@ export default ({ isVisible }: { isVisible: boolean }) => {
onChange={setUpperVCutOff}
/>

<NumberInputSliderWithUnit
<NumberInput
showSlider
label={
<DocumentationTooltip card="profiling" item="Capacity">
<div>
Expand All @@ -225,7 +227,8 @@ export default ({ isVisible }: { isVisible: boolean }) => {
onChange={setLowerVCutOff}
/>

<NumberInputSliderWithUnit
<NumberInput
showSlider
label={
<DocumentationTooltip card="profiling" item="Capacity">
<div>
Expand All @@ -244,7 +247,8 @@ export default ({ isVisible }: { isVisible: boolean }) => {
}}
/>

<NumberInputSliderWithUnit
<NumberInput
showSlider
label={
<DocumentationTooltip card="charger" item="ICHG">
<div>
Expand Down Expand Up @@ -289,7 +293,8 @@ export default ({ isVisible }: { isVisible: boolean }) => {
{temperatures.map((temp, index) => (
<React.Fragment key={`temp-${index + 1}`}>
<div className="tw-flex tw-flex-row tw-items-center">
<NumberInputSliderWithUnit
<NumberInput
showSlider
className="tw-flex-grow"
label={
<DocumentationTooltip
Expand Down
22 changes: 10 additions & 12 deletions src/components/Profiling/Dialog/ProfilingWizard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,20 @@
import React, { useEffect, useRef, useState } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import {
addConfirmBeforeClose,
Alert,
clearConfirmBeforeClose,
clearWaitForDevice,
ConfirmationDialog,
describeError,
isConfirmCloseDialogOpen,
logger,
setWaitForDevice,
} from '@nordicsemiconductor/pc-nrfconnect-shared';
import { appendFileSync, writeFileSync } from 'fs';
import path from 'path';

import { closeDevice, openDevice } from '../../../actions/deviceActions';
import {
addConfirmBeforeClose,
clearConfirmBeforeClose,
getShowConfirmCloseDialog,
} from '../../../features/confirmBeforeClose/confirmBeforeCloseSlice';
import { Profile } from '../../../features/pmicControl/npm/types';
import {
getBucks,
Expand Down Expand Up @@ -92,7 +90,7 @@ export default () => {
const index = useSelector(getProfileIndex);
const ccProfilingState = useSelector(getCcProfilingState);
const abortAction = useSelector(getAbort);
const showCloseAppDialog = useSelector(getShowConfirmCloseDialog);
const confirmCloseDialogOpen = useSelector(isConfirmCloseDialogOpen);
const pmicState = useSelector(getPmicState);
const [initializing, setInitializing] = useState(false);

Expand Down Expand Up @@ -376,32 +374,32 @@ export default () => {
)}
{profilingStage === 'Configuration' && (
<ConfigurationDialog
isVisible={!abortAction && !showCloseAppDialog}
isVisible={!abortAction && !confirmCloseDialogOpen}
/>
)}
{profilingStage === 'Checklist' && (
<ChecklistDialog
isVisible={!abortAction && !showCloseAppDialog}
isVisible={!abortAction && !confirmCloseDialogOpen}
/>
)}
{profilingStage === 'Charging' && (
<ChargingDialog
isVisible={!abortAction && !showCloseAppDialog}
isVisible={!abortAction && !confirmCloseDialogOpen}
/>
)}
{profilingStage === 'Resting' && (
<RestingDialog
isVisible={!abortAction && !showCloseAppDialog}
isVisible={!abortAction && !confirmCloseDialogOpen}
/>
)}
{profilingStage === 'Profiling' && (
<ProfilingDialog
isVisible={!abortAction && !showCloseAppDialog}
isVisible={!abortAction && !confirmCloseDialogOpen}
/>
)}
{profilingStage === 'Complete' && (
<CompleteDialog
isVisible={!abortAction && !showCloseAppDialog}
isVisible={!abortAction && !confirmCloseDialogOpen}
/>
)}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
DialogButton,
GenericDialog,
Group,
NumberInputSliderWithUnit,
NumberInput,
} from '@nordicsemiconductor/pc-nrfconnect-shared';
import path from 'path';

Expand Down Expand Up @@ -102,7 +102,7 @@ export default ({
>
<Group>
<div>
<NumberInputSliderWithUnit
<NumberInput
label={
<div>
<span>Temperature</span>
Expand All @@ -115,6 +115,7 @@ export default ({
max: 85,
}}
onChange={value => setTemperature(value)}
showSlider
/>
</div>
<div className="flex-column">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
DialogButton,
GenericDialog,
Group,
NumberInputSliderWithUnit,
NumberInput,
} from '@nordicsemiconductor/pc-nrfconnect-shared';

import { showSaveDialog } from '../../../actions/fileActions';
Expand Down Expand Up @@ -131,7 +131,8 @@ export default ({
value={name}
/>
</div>
<NumberInputSliderWithUnit
<NumberInput
showSlider
label={
<div>
<span>Capacity</span>
Expand All @@ -142,7 +143,8 @@ export default ({
range={{ min: 32, max: 3000 }}
onChange={setCapacity}
/>
<NumberInputSliderWithUnit
<NumberInput
showSlider
label={
<div>
<span>V</span>
Expand All @@ -159,7 +161,8 @@ export default ({
}}
onChange={setUpperVCutOff}
/>
<NumberInputSliderWithUnit
<NumberInput
showSlider
label={
<DocumentationTooltip card="profiling" item="Capacity">
<div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

import React, { useEffect } from 'react';
import { useDispatch, useSelector } from 'react-redux';

import {
addConfirmBeforeClose,
clearConfirmBeforeClose,
} from '../../../features/confirmBeforeClose/confirmBeforeCloseSlice';
} from '@nordicsemiconductor/pc-nrfconnect-shared';

import {
getProjectProfileProgress,
getRecentProjects,
Expand Down
Loading

0 comments on commit 2ff9dfe

Please sign in to comment.