fix: analoge Eingänge Modal Label /Bezeichnung anzeigen
This commit is contained in:
@@ -6,5 +6,5 @@ NEXT_PUBLIC_USE_MOCK_BACKEND_LOOP_START=false
|
|||||||
NEXT_PUBLIC_EXPORT_STATIC=false
|
NEXT_PUBLIC_EXPORT_STATIC=false
|
||||||
NEXT_PUBLIC_USE_CGI=false
|
NEXT_PUBLIC_USE_CGI=false
|
||||||
# App-Versionsnummer
|
# App-Versionsnummer
|
||||||
NEXT_PUBLIC_APP_VERSION=1.6.422
|
NEXT_PUBLIC_APP_VERSION=1.6.423
|
||||||
NEXT_PUBLIC_CPL_MODE=jsmock # json (Entwicklungsumgebung) oder jsmock (CPL ->CGI-Interface-Simulator) oder production (CPL-> CGI-Interface Platzhalter)
|
NEXT_PUBLIC_CPL_MODE=jsmock # json (Entwicklungsumgebung) oder jsmock (CPL ->CGI-Interface-Simulator) oder production (CPL-> CGI-Interface Platzhalter)
|
||||||
@@ -5,5 +5,5 @@ NEXT_PUBLIC_CPL_API_PATH=/CPL
|
|||||||
NEXT_PUBLIC_EXPORT_STATIC=true
|
NEXT_PUBLIC_EXPORT_STATIC=true
|
||||||
NEXT_PUBLIC_USE_CGI=true
|
NEXT_PUBLIC_USE_CGI=true
|
||||||
# App-Versionsnummer
|
# App-Versionsnummer
|
||||||
NEXT_PUBLIC_APP_VERSION=1.6.422
|
NEXT_PUBLIC_APP_VERSION=1.6.423
|
||||||
NEXT_PUBLIC_CPL_MODE=production
|
NEXT_PUBLIC_CPL_MODE=production
|
||||||
@@ -12,7 +12,7 @@ export default function AnalogInputSettingsModal({
|
|||||||
isOpen,
|
isOpen,
|
||||||
onClose,
|
onClose,
|
||||||
}: Props) {
|
}: Props) {
|
||||||
const [name, setName] = useState("");
|
const [label, setLabel] = useState("");
|
||||||
const [offset, setOffset] = useState("0.000");
|
const [offset, setOffset] = useState("0.000");
|
||||||
const [factor, setFactor] = useState("1.000");
|
const [factor, setFactor] = useState("1.000");
|
||||||
const [loggerInterval, setLoggerInterval] = useState("10");
|
const [loggerInterval, setLoggerInterval] = useState("10");
|
||||||
@@ -21,7 +21,7 @@ export default function AnalogInputSettingsModal({
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (selectedInput && isOpen) {
|
if (selectedInput && isOpen) {
|
||||||
setName(selectedInput.name || "");
|
setLabel(selectedInput.label || "");
|
||||||
setOffset(
|
setOffset(
|
||||||
typeof selectedInput.offset === "number"
|
typeof selectedInput.offset === "number"
|
||||||
? selectedInput.offset.toFixed(3)
|
? selectedInput.offset.toFixed(3)
|
||||||
@@ -51,7 +51,7 @@ export default function AnalogInputSettingsModal({
|
|||||||
const offsetParam = offset.replace(",", ".");
|
const offsetParam = offset.replace(",", ".");
|
||||||
const factorParam = factor.replace(",", ".");
|
const factorParam = factor.replace(",", ".");
|
||||||
const loggerParam = loggerInterval;
|
const loggerParam = loggerInterval;
|
||||||
const acn = encodeURIComponent(name);
|
const acn = encodeURIComponent(label);
|
||||||
const acu = encodeURIComponent(unit);
|
const acu = encodeURIComponent(unit);
|
||||||
|
|
||||||
const url = `/CPL?/Service/ae.ACP&ACN${slot}=${acn}&ACO${slot}=${offsetParam}&ACF${slot}=${factorParam}&ACL${slot}=${loggerParam}&ACU${slot}=${acu}`;
|
const url = `/CPL?/Service/ae.ACP&ACN${slot}=${acn}&ACO${slot}=${offsetParam}&ACF${slot}=${factorParam}&ACL${slot}=${loggerParam}&ACU${slot}=${acu}`;
|
||||||
@@ -63,7 +63,7 @@ export default function AnalogInputSettingsModal({
|
|||||||
headers: { "Content-Type": "application/json" },
|
headers: { "Content-Type": "application/json" },
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
updates: [
|
updates: [
|
||||||
{ key: "win_analogInputsNames", index: slot - 1, value: name },
|
{ key: "win_analogInputsNames", index: slot - 1, value: label },
|
||||||
{
|
{
|
||||||
key: "win_analogInputsOffset",
|
key: "win_analogInputsOffset",
|
||||||
index: slot - 1,
|
index: slot - 1,
|
||||||
@@ -125,8 +125,8 @@ export default function AnalogInputSettingsModal({
|
|||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
className="w-full border rounded px-3 py-1 mb-4"
|
className="w-full border rounded px-3 py-1 mb-4"
|
||||||
value={name}
|
value={label}
|
||||||
onChange={(e) => setName(e.target.value)}
|
onChange={(e) => setLabel(e.target.value)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "cpl-v4",
|
"name": "cpl-v4",
|
||||||
"version": "1.6.422",
|
"version": "1.6.423",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "cpl-v4",
|
"name": "cpl-v4",
|
||||||
"version": "1.6.422",
|
"version": "1.6.423",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fontsource/roboto": "^5.1.0",
|
"@fontsource/roboto": "^5.1.0",
|
||||||
"@iconify-icons/ri": "^1.2.10",
|
"@iconify-icons/ri": "^1.2.10",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "cpl-v4",
|
"name": "cpl-v4",
|
||||||
"version": "1.6.422",
|
"version": "1.6.423",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev",
|
"dev": "next dev",
|
||||||
|
|||||||
Reference in New Issue
Block a user