}
public async start(): Promise<void> {
- if (isMainThread && !this.started) {
+ if (isMainThread && this.started === false) {
try {
this.initialize();
await this.storage?.open();
}
public async stop(): Promise<void> {
- if (isMainThread && this.started) {
+ if (isMainThread && this.started === true) {
await this.workerImplementation.stop();
this.workerImplementation = null;
this.uiServer?.stop();
export default class ChargingStation {
public readonly templateFile: string;
public stationInfo!: ChargingStationInfo;
- public stopped: boolean;
+ public started: boolean;
public authorizedTagsCache: AuthorizedTagsCache;
public automaticTransactionGenerator!: AutomaticTransactionGenerator;
public ocppConfiguration!: ChargingStationOcppConfiguration;
this.sharedLRUCache = SharedLRUCache.getInstance();
this.authorizedTagsCache = AuthorizedTagsCache.getInstance();
this.chargingStationWorkerBroadcastChannel = new ChargingStationWorkerBroadcastChannel(this);
- this.stopped = false;
+ this.started = false;
this.wsConnectionRestarted = false;
this.autoReconnectRetryCount = 0;
this.templateFileWatcher.close();
this.sharedLRUCache.deleteChargingStationTemplate(this.stationInfo?.templateHash);
this.bootNotificationResponse = null;
- this.stopped = true;
+ this.started = false;
parentPort.postMessage(MessageChannelUtils.buildStoppedMessage(this));
}
`${this.logPrefix()} Registration failure: max retries reached (${this.getRegistrationMaxRetries()}) or retry disabled (${this.getRegistrationMaxRetries()})`
);
}
- this.stopped && (this.stopped = false);
+ this.started === false && (this.started = true);
this.autoReconnectRetryCount = 0;
this.wsConnectionRestarted = false;
} else {
if (connectorId === 0) {
continue;
} else if (
- !this.stopped &&
+ this.started === true &&
!this.getConnectorStatus(connectorId)?.status &&
this.getConnectorStatus(connectorId)?.bootStatus
) {
this.getConnectorStatus(connectorId).status =
this.getConnectorStatus(connectorId).bootStatus;
} else if (
- this.stopped &&
+ this.started === false &&
this.getConnectorStatus(connectorId)?.status &&
this.getConnectorStatus(connectorId)?.bootStatus
) {
});
this.getConnectorStatus(connectorId).status =
this.getConnectorStatus(connectorId).bootStatus;
- } else if (!this.stopped && this.getConnectorStatus(connectorId)?.status) {
+ } else if (this.started === true && this.getConnectorStatus(connectorId)?.status) {
// Send previous status at template reload
await this.ocppRequestService.requestHandler<
StatusNotificationRequest,
): ChargingStationData {
return {
stationInfo: chargingStation.stationInfo,
- stopped: chargingStation.stopped,
+ started: chargingStation.started,
bootNotificationResponse: chargingStation.bootNotificationResponse,
connectors: [...chargingStation.connectors.values()].map(
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export interface ChargingStationData extends WorkerData {
stationInfo: ChargingStationInfo;
- stopped: boolean;
+ started: boolean;
bootNotificationResponse: BootNotificationResponse;
connectors: ConnectorStatus[];
}
:id-tag="props.idTag"
/>
<td class="cs-table__name-col">{{ getId() }}</td>
- <td class="cs-table__stopped-col">{{ getStopped() }}</td>
+ <td class="cs-table__started-col">{{ getStarted() }}</td>
<td class="cs-table__registration-status-col">{{ getRegistrationStatus() }}</td>
<td class="cs-table__vendor-col">{{ getVendor() }}</td>
<td class="cs-table__model-col">{{ getModel() }}</td>
function getFirmwareVersion(): string {
return Utils.ifUndefined<string>(getInfo().firmwareVersion, 'Ø');
}
-function getStopped(): string {
- return props.chargingStation.stopped === true ? 'Yes' : 'No';
+function getStarted(): string {
+ return props.chargingStation.started === true ? 'Yes' : 'No';
}
function getRegistrationStatus(): string {
return props.chargingStation?.bootNotificationResponse?.status ?? 'Ø';
<th scope="col" class="cs-table__status-col">Status</th>
<th scope="col" class="cs-table__transaction-col">Transaction</th>
<th scope="col" class="cs-table__name-col">Name</th>
- <th scope="col" class="cs-table__stopped-col">Stopped</th>
+ <th scope="col" class="cs-table__started-col">Started</th>
<th scope="col" class="cs-table__registration-status-col">Registration Status</th>
<th scope="col" class="cs-table__vendor-col">Vendor</th>
<th scope="col" class="cs-table__model-col">Model</th>
.cs-table__status-col,
.cs-table__transaction-col,
.cs-table__name-col,
-.cs-table__stopped-col,
+.cs-table__started-col,
.cs-table__registration-status-col,
.cs-table__model-col,
.cs-table__vendor-col,
export type ChargingStationData = {
stationInfo: ChargingStationInfo;
- stopped: boolean;
+ started: boolean;
bootNotificationResponse: BootNotificationResponse;
connectors: ConnectorStatus[];
};
expect(wrapper.text()).to.include('Status');
expect(wrapper.text()).to.include('Transaction');
expect(wrapper.text()).to.include('Name');
- expect(wrapper.text()).to.include('Stopped');
+ expect(wrapper.text()).to.include('Started');
expect(wrapper.text()).to.include('Registration Status');
expect(wrapper.text()).to.include('Vendor');
expect(wrapper.text()).to.include('Model');