Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LE COENT Lise Helena
SIT213_a4
Commits
ad2410a1
Commit
ad2410a1
authored
Sep 14, 2022
by
l21lecoe
Browse files
création classes Emetteur, EmetteurNRZ et EmetteurRZ
parent
d7cb3c78
Changes
4
Hide whitespace changes
Inline
Side-by-side
GUEYE_BENOIT_LECOENT_QUERE/out/production/Projet_SIT213/.gitignore
View file @
ad2410a1
...
...
@@ -4,3 +4,4 @@
/sources/
/transmetteurs/
/visualisations/
/emetteurs/
GUEYE_BENOIT_LECOENT_QUERE/src/transmetteurs/Emetteur.java
0 → 100644
View file @
ad2410a1
package
transmetteurs
;
import
information.Information
;
import
information.InformationNonConformeException
;
public
abstract
class
Emetteur
<
Boolean
,
Float
>
extends
Transmetteur
<
Boolean
,
Float
>{
@Override
public
void
recevoir
(
Information
<
Boolean
>
information
)
throws
InformationNonConformeException
{
this
.
informationRecue
=
information
;
}
@Override
public
void
emettre
()
throws
InformationNonConformeException
{
}
public
abstract
void
conversion
();
}
GUEYE_BENOIT_LECOENT_QUERE/src/transmetteurs/EmetteurNRZ.java
0 → 100644
View file @
ad2410a1
package
transmetteurs
;
import
information.Information
;
import
information.InformationNonConformeException
;
public
class
EmetteurNRZ
<
Boolean
,
Float
>
extends
Emetteur
<
Boolean
,
Float
>{
Information
<
java
.
lang
.
Float
>
signalEchantillonee
;
private
float
vmax
;
private
float
vmin
;
private
int
nbTechantillon
;
public
EmetteurNRZ
(
float
vmax
,
float
vmin
,
int
nbTechantillon
)
{
this
.
vmax
=
vmax
;
this
.
vmin
=
vmin
;
this
.
nbTechantillon
=
nbTechantillon
;
}
public
void
recevoir
(
Information
<
Boolean
>
information
)
throws
InformationNonConformeException
{
super
.
recevoir
(
information
);
this
.
conversion
();
this
.
emettre
();
}
@Override
public
void
conversion
()
{
this
.
signalEchantillonee
=
new
Information
<
java
.
lang
.
Float
>();
for
(
Boolean
bit
:
informationRecue
)
{
for
(
int
i
=
0
;
i
<
nbTechantillon
;
i
++)
{
if
(
bit
.
equals
(
true
))
signalEchantillonee
.
add
(
vmax
);
else
signalEchantillonee
.
add
(
vmin
);
}
informationEmise
=
(
Information
<
Float
>)
this
.
signalEchantillonee
;
}
}
}
\ No newline at end of file
GUEYE_BENOIT_LECOENT_QUERE/src/transmetteurs/EmetteurRZ.java
0 → 100644
View file @
ad2410a1
package
transmetteurs
;
import
information.Information
;
import
information.InformationNonConformeException
;
public
class
EmetteurRZ
<
Boolean
,
Float
>
extends
Emetteur
<
Boolean
,
Float
>{
Information
<
java
.
lang
.
Float
>
signalEchantillonee
;
private
float
v
;
private
int
nbTechantillon
;
public
EmetteurRZ
(
float
v
,
int
nbTechantillon
)
{
this
.
v
=
v
;
this
.
nbTechantillon
=
nbTechantillon
;
}
public
void
recevoir
(
Information
<
Boolean
>
information
)
throws
InformationNonConformeException
{
super
.
recevoir
(
information
);
this
.
conversion
();
this
.
emettre
();
}
@Override
public
void
conversion
()
{
this
.
signalEchantillonee
=
new
Information
<>();
for
(
Boolean
bit
:
informationRecue
)
{
if
(
bit
.
equals
(
true
))
{
for
(
int
i
=
0
;
i
<
nbTechantillon
/
3
;
i
++)
this
.
signalEchantillonee
.
add
(
0
f
);
for
(
int
i
=
0
;
i
<
nbTechantillon
/
3
;
i
++)
this
.
signalEchantillonee
.
add
(
v
);
for
(
int
i
=
0
;
i
<
nbTechantillon
/
3
;
i
++)
this
.
signalEchantillonee
.
add
(
0
f
);
}
else
{
for
(
int
i
=
0
;
i
<
nbTechantillon
;
i
++)
this
.
signalEchantillonee
.
add
(
0
f
);
}
informationEmise
=
(
Information
<
Float
>)
signalEchantillonee
;
}
}
}
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment