- Request:
`ProcedureName`: 'startTransaction'
`PDU`: {
- `hashId`: charging station unique identifier string (deprecated) | `hashIds`: charging station unique identifier strings array,
+ `hashIds`: charging station unique identifier strings array,
`connectorId`: connector id integer,
`idTag`: RFID tag string
}
- Request:
`ProcedureName`: 'stopTransaction'
`PDU`: {
- `hashId`: charging station unique identifier string (deprecated) | `hashIds`: charging station unique identifier strings array,
+ `hashIds`: charging station unique identifier strings array,
`transactionId`: transaction id integer
}
- Request:
`ProcedureName`: 'startChargingStation'
`PDU`: {
- `hashId`: charging station unique identifier string (deprecated) | `hashIds`: charging station unique identifier strings array
+ `hashIds`: charging station unique identifier strings array
}
- Response:
- Request:
`ProcedureName`: 'stopChargingStation'
`PDU`: {
- `hashId`: charging station unique identifier string (deprecated) | `hashIds`: charging station unique identifier strings array
+ `hashIds`: charging station unique identifier strings array
}
- Response:
- Request:
`ProcedureName`: 'openConnection'
`PDU`: {
- `hashId`: charging station unique identifier string (deprecated) | `hashIds`: charging station unique identifier strings array
+ `hashIds`: charging station unique identifier strings array
}
- Response:
- Request:
`ProcedureName`: 'closeConnection'
`PDU`: {
- `hashId`: charging station unique identifier string (deprecated) | `hashIds`: charging station unique identifier strings array
+ `hashIds`: charging station unique identifier strings array
}
- Response:
if (
requestPayload?.hashId === undefined &&
- (requestPayload?.hashIds as string[])?.includes(this.chargingStation.stationInfo.hashId) ===
- false
+ requestPayload?.hashIds?.includes(this.chargingStation.stationInfo.hashId) === false
) {
return;
}
}
export interface RequestPayload extends JsonObject {
- hashId?: string;
hashIds?: string[];
+ connectorIds?: number[];
}
export enum ResponseStatus {
idTag?: string;
}
-interface HashIdBroadcastChannelRequestPayload extends BaseBroadcastChannelRequestPayload {
- hashId: string;
-}
-
interface HashIdsBroadcastChannelRequestPayload extends BaseBroadcastChannelRequestPayload {
hashIds: string[];
}
-export type BroadcastChannelRequestPayload =
- | HashIdBroadcastChannelRequestPayload
- | HashIdsBroadcastChannelRequestPayload;
+export type BroadcastChannelRequestPayload = HashIdsBroadcastChannelRequestPayload;
export interface BroadcastChannelResponsePayload extends ResponsePayload {
hashId: string;
Start Transaction
</IdTagInputModal> -->
<Button @click="stopTransaction()">Stop Transaction</Button>
+ <Button @click="startAutomaticTransactionGenerator()">Start ATG</Button>
+ <Button @click="stopAutomaticTransactionGenerator()">Stop ATG</Button>
</td>
<td class="cs-table__connector-col">{{ connectorId }}</td>
<td class="cs-table__status-col">{{ connector.status }}</td>
function stopTransaction(): void {
UIClient.getInstance().stopTransaction(props.hashId, props.transactionId);
}
+function startAutomaticTransactionGenerator(): void {
+ UIClient.getInstance().startAutomaticTransactionGenerator(props.hashId, props.connectorId);
+}
+function stopAutomaticTransactionGenerator(): void {
+ UIClient.getInstance().stopAutomaticTransactionGenerator(props.hashId, props.connectorId);
+}
</script>
-import type { JsonType } from '@/types/JsonType';
-import { ProcedureName, ResponseStatus } from '@/types/UIProtocol';
+import { ProcedureName, ResponseStatus, type RequestPayload } from '@/types/UIProtocol';
import type { ProtocolResponse, ResponsePayload } from '@/types/UIProtocol';
import Utils from './Utils';
}
public async startChargingStation(hashId: string): Promise<ResponsePayload> {
- return this.sendRequest(ProcedureName.START_CHARGING_STATION, { hashId });
+ return this.sendRequest(ProcedureName.START_CHARGING_STATION, { hashIds: [hashId] });
}
public async stopChargingStation(hashId: string): Promise<ResponsePayload> {
- return this.sendRequest(ProcedureName.STOP_CHARGING_STATION, { hashId });
+ return this.sendRequest(ProcedureName.STOP_CHARGING_STATION, { hashIds: [hashId] });
}
public async openConnection(hashId: string): Promise<ResponsePayload> {
return this.sendRequest(ProcedureName.OPEN_CONNECTION, {
- hashId,
+ hashIds: [hashId],
});
}
public async closeConnection(hashId: string): Promise<ResponsePayload> {
return this.sendRequest(ProcedureName.CLOSE_CONNECTION, {
- hashId,
+ hashIds: [hashId],
});
}
idTag: string | undefined
): Promise<ResponsePayload> {
return this.sendRequest(ProcedureName.START_TRANSACTION, {
- hashId,
+ hashIds: [hashId],
connectorId,
idTag,
});
transactionId: number | undefined
): Promise<ResponsePayload> {
return this.sendRequest(ProcedureName.STOP_TRANSACTION, {
- hashId,
+ hashIds: [hashId],
transactionId,
});
}
+ public async startAutomaticTransactionGenerator(
+ hashId: string,
+ connectorId: number
+ ): Promise<ResponsePayload> {
+ return this.sendRequest(ProcedureName.START_AUTOMATIC_TRANSACTION_GENERATOR, {
+ hashIds: [hashId],
+ connectorIds: [connectorId],
+ });
+ }
+
+ public async stopAutomaticTransactionGenerator(
+ hashId: string,
+ connectorId: number
+ ): Promise<ResponsePayload> {
+ return this.sendRequest(ProcedureName.STOP_AUTOMATIC_TRANSACTION_GENERATOR, {
+ hashIds: [hashId],
+ connectorIds: [connectorId],
+ });
+ }
+
private openWS(): void {
this._ws = new WebSocket(
`ws://${config.uiServer.host}:${config.uiServer.port}`,
return this._responseHandlers.delete(id);
}
- private async sendRequest(command: ProcedureName, data: JsonType): Promise<ResponsePayload> {
+ private async sendRequest(
+ command: ProcedureName,
+ data: RequestPayload
+ ): Promise<ResponsePayload> {
let uuid: string;
return Utils.promiseWithTimeout(
new Promise((resolve, reject) => {
) => ResponsePayload | Promise<ResponsePayload>;
export enum ProcedureName {
+ START_SIMULATOR = 'startSimulator',
+ STOP_SIMULATOR = 'stopSimulator',
LIST_CHARGING_STATIONS = 'listChargingStations',
START_CHARGING_STATION = 'startChargingStation',
STOP_CHARGING_STATION = 'stopChargingStation',
- START_TRANSACTION = 'startTransaction',
- STOP_TRANSACTION = 'stopTransaction',
- START_SIMULATOR = 'startSimulator',
- STOP_SIMULATOR = 'stopSimulator',
OPEN_CONNECTION = 'openConnection',
CLOSE_CONNECTION = 'closeConnection',
+ START_TRANSACTION = 'startTransaction',
+ STOP_TRANSACTION = 'stopTransaction',
+ START_AUTOMATIC_TRANSACTION_GENERATOR = 'startAutomaticTransactionGenerator',
+ STOP_AUTOMATIC_TRANSACTION_GENERATOR = 'stopAutomaticTransactionGenerator',
}
export interface RequestPayload extends JsonObject {
- hashId?: string;
hashIds?: string[];
+ connectorId?: number;
+ connectorIds?: number[];
}
export enum ResponseStatus {