DPsim
Loading...
Searching...
No Matches
dpsim-models
include
dpsim-models
Base
Base_Ph1_Switch.h
1
/* Copyright 2017-2021 Institute for Automation of Complex Power Systems,
2
* EONERC, RWTH Aachen University
3
*
4
* This Source Code Form is subject to the terms of the Mozilla Public
5
* License, v. 2.0. If a copy of the MPL was not distributed with this
6
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
7
*********************************************************************************/
8
9
#pragma once
10
11
#include <dpsim-models/AttributeList.h>
12
#include <dpsim-models/Definitions.h>
13
14
namespace
CPS {
15
namespace
Base {
16
namespace
Ph1 {
18
class
Switch {
19
public
:
21
const
Attribute<Real>::Ptr
mOpenResistance
;
23
const
Attribute<Real>::Ptr
mClosedResistance
;
25
const
Attribute<Bool>::Ptr
mIsClosed
;
26
27
explicit
Switch(CPS::AttributeList::Ptr attributeList)
28
:
mOpenResistance
(attributeList->create<Real>(
"R_open"
)),
29
mClosedResistance
(attributeList->create<Real>(
"R_closed"
)),
30
mIsClosed
(attributeList->create<Bool>(
"is_closed"
)){};
31
33
void
setParameters(Real openResistance, Real closedResistance,
34
Bool closed =
false
) {
35
**
mOpenResistance
= openResistance;
36
**
mClosedResistance
= closedResistance;
37
**
mIsClosed
= closed;
38
}
39
41
void
close
() { **
mIsClosed
=
true
; }
43
void
open
() { **
mIsClosed
=
false
; }
45
Bool
isClosed
() {
return
**
mIsClosed
; }
46
};
47
}
// namespace Ph1
48
}
// namespace Base
49
}
// namespace CPS
CPS::Base::Ph1::Switch::close
void close()
Close switch.
Definition
Base_Ph1_Switch.h:41
CPS::Base::Ph1::Switch::mClosedResistance
const Attribute< Real >::Ptr mClosedResistance
Resistance if switch is closed [ohm].
Definition
Base_Ph1_Switch.h:23
CPS::Base::Ph1::Switch::isClosed
Bool isClosed()
Check if switch is closed.
Definition
Base_Ph1_Switch.h:45
CPS::Base::Ph1::Switch::mOpenResistance
const Attribute< Real >::Ptr mOpenResistance
Resistance if switch is open [ohm].
Definition
Base_Ph1_Switch.h:21
CPS::Base::Ph1::Switch::mIsClosed
const Attribute< Bool >::Ptr mIsClosed
Defines if Switch is open or closed.
Definition
Base_Ph1_Switch.h:25
CPS::Base::Ph1::Switch::open
void open()
Open switch.
Definition
Base_Ph1_Switch.h:43
Generated by
1.13.2