Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#include <wincodec.h>
#include <stdio.h>
#include <Windowsx.h>
#include "componentstructs.h"
#include "componentfunctions.h"
#include "componentimages.h"
#include "components.h"
static HWND DPDTState1;
static HWND DPDTState2;
static HWND ModeLatchedDPDT;
static HWND ModeTempDPDT;
HWND* SettingsDialogDPDT;
enum DPDT_Pins { in1 = 0, in2, out11, out12, out21, out22 };
int InitDpdt(void * ComponentAddress)
{
DpdtStruct* d = (DpdtStruct*)ComponentAddress;
d->image = DPDT_1;
d->NS1 = TRUE;
d->latched = TRUE;
d->Volt[in1] = V_OPEN;
d->Volt[in2] = V_OPEN;
d->Volt[out11] = V_OPEN;
d->Volt[out12] = V_OPEN;
d->Volt[out21] = V_OPEN;
d->Volt[out22] = V_OPEN;
}
void SetDpdtIds(int* id, void* ComponentAddress)
{
DpdtStruct* d = (DpdtStruct*)ComponentAddress;
d->PinId[in1] = *id++;
d->PinId[in2] = *id++;
d->PinId[out11] = *id++;
d->PinId[out12] = *id++;
d->PinId[out21] = *id++;
d->PinId[out22] = *id++;
}
void MakeSettingsDialogDPDT()
{
}
void LoadSettings(DpdtStruct* d)
{
if (d->latched)
Button_SetCheck(ModeLatchedDPDT, BST_CHECKED);
else
Button_SetCheck(ModeTempDPDT, BST_CHECKED);
if (d->NS1)
Button_SetCheck(DPDTState1, BST_CHECKED);
else
Button_SetCheck(DPDTState2, BST_CHECKED);
}
BOOL SaveSettings(DpdtStruct* d, void* ImageLocation)
{
if (Button_GetState(ModeLatchedDPDT) == BST_CHECKED)
d->latched = TRUE;
else
d->latched = FALSE;
}
void DpdtSettingsDialog(void* ComponentAddress, void* ImageLocation)
{
DpdtStruct* d = (DpdtStruct*)ComponentAddress;
BOOL exitStatus;
}
double EqualiseRuntimeVoltageDPDT(void* ComponentAdderss, int index, double volt)
{
DpdtStruct* d = (DpdtStruct*)ComponentAdderss;
}
void EqualiseStaticVoltageDPDT(void* ComponentAdderss)
{
DpdtStruct* d = (DpdtStruct*)ComponentAdderss;
}
void ToggleState(DpdtStruct* d, void* ImageLocation)
{
d->image = (d->image == DPDT_1) ? DPDT_2 : DPDT_1;
d->NS1 = (d->NS1 == TRUE) ? FALSE : TRUE;
SetImage(d->image, ImageLocation);
RefreshImages();
}
void HandleDpdtEvent(void * ComponentAddress, int Event, BOOL SimulationStarted, void * ImageLocation, UINT ImageId, HWND * h)
{
}
double DpdtVoltChanged(void * ComponentAddress, BOOL SimulationStarted, int index, double Volt, int Source, void * ImageLocation)
{
}