Merge branch 'MK3_3.11.0' into MK3_3.11.0_Swedish

This commit is contained in:
3d-gussner 2022-03-10 14:59:46 +01:00 committed by GitHub
commit b4492067a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 5047 additions and 41 deletions

View file

@ -27,7 +27,7 @@ extern PGM_P sPrinterName;
#define FW_VERSION STR(FW_MAJOR) "." STR(FW_MINOR) "." STR(FW_REVISION) "-" STR(FW_FLAVOR) "" STR(FW_FLAVERSION)
#endif
#define FW_COMMIT_NR 4842
#define FW_COMMIT_NR 4864
// FW_VERSION_UNKNOWN means this is an unofficial build.
// The firmware should only be checked into github with this symbol.

View file

@ -1130,6 +1130,7 @@ void setup()
}
#endif //TMC2130
#ifdef PRUSA_SN_SUPPORT
//Check for valid SN in EEPROM. Try to retrieve it in case it's invalid.
//SN is valid only if it is NULL terminated and starts with "CZPX".
{
@ -1146,6 +1147,7 @@ void setup()
puts_P(PSTR("SN update failed"));
}
}
#endif //PRUSA_SN_SUPPORT
#ifndef XFLASH
@ -4570,13 +4572,15 @@ void process_commands()
prusa_sd_card_upload = true;
card.openFileWrite(strchr_pointer+4);
} else if (code_seen_P(PSTR("SN"))) { // PRUSA SN
#ifdef PRUSA_SN_SUPPORT
} else if (code_seen_P(PSTR("SN"))) { // PRUSA SN
char SN[20];
eeprom_read_block(SN, (uint8_t*)EEPROM_PRUSA_SN, 20);
if (SN[19])
puts_P(PSTR("SN invalid"));
else
puts(SN);
#endif //PRUSA_SN_SUPPORT
} else if(code_seen_P(PSTR("Fir"))){ // PRUSA Fir

View file

@ -24,8 +24,7 @@ int serial_count = 0; //index of character read from serial line
bool comment_mode = false;
char *strchr_pointer; // just a pointer to find chars in the command string like X, Y, Z, E, etc
unsigned long TimeSent = _millis();
unsigned long TimeNow = _millis();
ShortTimer serialTimeoutTimer;
long gcode_N = 0;
long gcode_LastN = 0;
@ -400,8 +399,7 @@ void get_command()
MYSERIAL.write(serial_char); // for debuging serial line 2 in farm_mode
selectedSerialPort = 1;
} */ //RP - removed
TimeSent = _millis();
TimeNow = _millis();
serialTimeoutTimer.start();
if (serial_char < 0)
// Ignore extended ASCII characters. These characters have no meaning in the G-code apart from the file names
@ -535,22 +533,11 @@ void get_command()
}
} // end of serial line processing loop
if(farm_mode){
TimeNow = _millis();
if ( ((TimeNow - TimeSent) > 800) && (serial_count > 0) ) {
cmdbuffer[bufindw+serial_count+CMDHDRSIZE] = 0;
bufindw += strlen(cmdbuffer+bufindw+CMDHDRSIZE) + (1 + CMDHDRSIZE);
if (bufindw == sizeof(cmdbuffer))
bufindw = 0;
++ buflen;
serial_count = 0;
SERIAL_ECHOPGM("TIMEOUT:");
//memset(cmdbuffer, 0 , sizeof(cmdbuffer));
return;
}
if (serial_count > 0 && serialTimeoutTimer.expired(farm_mode ? 800 : 2000)) {
comment_mode = false;
serial_count = 0;
SERIAL_ECHOLNPGM("RX timeout");
return;
}
#ifdef SDSUPPORT

View file

@ -52,9 +52,6 @@ extern int serial_count;
extern bool comment_mode;
extern char *strchr_pointer;
extern unsigned long TimeSent;
extern unsigned long TimeNow;
extern long gcode_N;
extern long gcode_LastN;
extern long Stopped_gcode_LastN;

View file

@ -70,6 +70,7 @@
#define COMMUNITY_LANG_GROUP1_HR // Community Croatian language
#define COMMUNITY_LANG_GROUP1_SK // Community Slovak language
#define COMMUNITY_LANG_GROUP1_SV // Community Swedish language
#define COMMUNITY_LANG_GROUP1_NO // Community Norwegian language
//#define COMMUNITY_LANG_GROUP1_DA // Community Danish language
//#define COMMUNITY_LANG_GROUP1_SL // Community Slovanian language
//#define COMMUNITY_LANG_GROUP1_LB // Community Luxembourgish language

View file

@ -218,6 +218,9 @@ const char* lang_get_name_by_code(uint16_t code)
#ifdef COMMUNITY_LANG_GROUP1_SV
case LANG_CODE_SV: return _n("Svenska"); //community Swedish contribution
#endif // COMMUNITY_LANG_GROUP1_SV
#ifdef COMMUNITY_LANG_GROUP1_NO
case LANG_CODE_NO: return _n("Norsk"); //community Swedish contribution
#endif // COMMUNITY_LANG_GROUP1_NO
#ifdef COMMUNITY_LANG_GROUP1_DA
case LANG_CODE_DA: return _n("Dansk"); //community Danish contribution
#endif // COMMUNITY_LANG_GROUP1_DA

View file

@ -101,6 +101,9 @@ typedef struct
#ifdef COMMUNITY_LANG_GROUP1_SV
#define LANG_CODE_SV 0x7376 //!<'sv'
#endif // COMMUNITY_LANG_GROUP1_SV
#ifdef COMMUNITY_LANG_GROUP1_NO
#define LANG_CODE_NO 0x6E6F //!<'no'
#endif // COMMUNITY_LANG_GROUP1_NO
#ifdef COMMUNITY_LANG_GROUP1_DA
#define LANG_CODE_DA 0x6461 //!<'da'
#endif // COMMUNITY_LANG_GROUP1_DA

View file

@ -15,6 +15,8 @@
#define AMBIENT_THERMISTOR
#define PINDA_THERMISTOR
#define PRUSA_SN_SUPPORT //enables the "PRUSA SN" command and 32u2 enhanced firmware support
#define XFLASH // external 256kB flash
#define BOOTAPP // bootloader support

View file

@ -8972,6 +8972,15 @@ bool FarmOrUserECool(){
return farm_mode || UserECoolEnabled();
}
#ifdef PRUSA_SN_SUPPORT
void WorkaroundPrusaSN() {
const char *SN = PSTR("CZPXInvalidSerialNr");
for (uint8_t i = 0; i < 20; i++) {
eeprom_update_byte((uint8_t*)EEPROM_PRUSA_SN + i, pgm_read_byte(SN++));
}
}
#endif //PRUSA_SN_SUPPORT
void lcd_experimental_menu()
{
MENU_BEGIN();
@ -8984,6 +8993,10 @@ void lcd_experimental_menu()
#ifdef TMC2130
MENU_ITEM_TOGGLE_P(_N("E-cool mode"), UserECoolEnabled()?_T(MSG_ON):_T(MSG_OFF), UserECool_toggle);////MSG_MENU_ECOOL c=18
#endif
#ifdef PRUSA_SN_SUPPORT
MENU_ITEM_FUNCTION_P(_N("Fake serial number"), WorkaroundPrusaSN);////MSG_WORKAROUND_PRUSA_SN c=18
#endif //PRUSA_SN_SUPPORT
MENU_END();
}

View file

@ -7,7 +7,12 @@
# lang_add.txt
# Updated files:
# lang_en.txt and all lang_en_xx.txt
#
# List of supported languages
LANGUAGES="cz de es fr it pl"
# Community languages
LANGUAGES+=" nl" #Dutch
# Config:
if [ -z "$CONFIG_OK" ]; then eval "$(cat config.sh)"; fi
@ -21,36 +26,48 @@ echo "fw-clean languages:$LANGUAGES" >&2
# insert single text to english dictionary
# $1 - text to insert
# $2 - metadata
insert_en()
{
#replace '[' and ']' in string with '\[' and '\]'
str=$(echo "$1" | sed "s/\[/\\\[/g;s/\]/\\\]/g")
# extract english texts, merge new text, grep line number
ln=$((cat lang_en.txt; echo "$1") | sed "/^$/d;/^#/d" | sort | grep -n "$str" | sed "s/:.*//")
ln=$((cat lang_en.txt; echo "$1") | sed "/^$/d;/^#/d" | sort | grep -n "$str" | sed "s/:.*//;q")
# calculate position for insertion
ln=$((3*(ln-2)+1))
[ "$ln" -lt 1 ] && ln=1
# insert new text
sed -i "$ln"'i\\' lang_en.txt
sed -i "$ln"'i\'"$1"'\' lang_en.txt
sed -i "$ln"'i\#\' lang_en.txt
sed -i "${ln}i\\#$2" lang_en.txt
}
# insert single text to translated dictionary
# $1 - text to insert
# $2 - sufix
# $2 - suffix
# $3 - metadata
insert_xx()
{
#replace '[' and ']' in string with '\[' and '\]'
str=$(echo "$1" | sed "s/\[/\\\[/g;s/\]/\\\]/g")
# extract english texts, merge new text, grep line number
ln=$((cat lang_en_$2.txt; echo "$1") | sed "/^$/d;/^#/d" | sed -n 'p;n' | sort | grep -n "$str" | sed "s/:.*//")
ln=$((cat lang_en_$2.txt; echo "$1") | sed "/^$/d;/^#/d" | sed -n 'p;n' | sort | grep -n "$str" | sed "s/:.*//;q")
# calculate position for insertion
ln=$((4*(ln-2)+1))
[ "$ln" -lt 1 ] && ln=1
# insert new text
sed -i "$ln"'i\\' lang_en_$2.txt
sed -i "$ln"'i\"\x00"\' lang_en_$2.txt
sed -i "$ln"'i\'"$1"'\' lang_en_$2.txt
sed -i "$ln"'i\#\' lang_en_$2.txt
sed -i "${ln}i\\#$3" lang_en_$2.txt
}
# find the metadata for the specified string
# TODO: this is unbeliveably crude
# $1 - text to search for
find_metadata()
{
sed -ne "s^.*\(_[iI]\|ISTR\)($1).*////\(.*\)^\2^p" ../Firmware/*.[ch]* | head -1
}
# check if input file exists
@ -65,17 +82,15 @@ cat lang_add.txt | sed 's/^/"/;s/$/"/' | while read new_s; do
echo "$new_s"
echo
else
meta=$(find_metadata "$new_s")
echo "adding text:"
echo "$new_s"
echo "$new_s ($meta)"
echo
#insert_en "$new_s"
for lang in $LANGUAGES; do
insert_xx "$new_s" "$lang"
done
#Use the 2 lines below as a template and replace 'qr'
##New language
# insert_xx "$new_s" 'qr'
insert_en "$new_s" "$meta"
for lang in $LANGUAGES; do
insert_xx "$new_s" "$lang" "$meta"
done
fi
done

View file

@ -105,10 +105,12 @@ lang_code_hex_data()
*nl*) echo '\x6c\x6e' ;;
#Swedish
*sv*) echo '\x76\x73' ;;
#Norwegian
*no*) echo '\x6f\x6e' ;;
#Danish
*da*) echo '\x61\x64' ;;
#Slovak
*sk*) echo '\x6b\x73' ;;
*sk*) echo '\x6b\x73' ;;
#Slovanian
*sl*) echo '\x6c\x73' ;;
#Hungarian

View file

@ -342,7 +342,7 @@ def main():
usage="%(prog)s lang")
parser.add_argument(
"lang", nargs='?', default="en", type=str,
help="Check lang file (en|cs|da|de|es|fr|hr|hu|lb|lt|nl|it|pl|ro|sk|sl|sv)")
help="Check lang file (en|cs|da|de|es|fr|hr|hu|it|lb|lt|nl|no|pl|ro|sk|sl|sv)")
parser.add_argument(
"--no-warning", action="store_true",
help="Disable warnings")

View file

@ -85,6 +85,8 @@ else
*nl*) echo "Dutch" ;;
#Swedish
*sv*) echo "Swedish" ;;
#Norwegian
*no*) echo "Norwegian" ;;
#Danish
*da*) echo "Danish" ;;
#Slovak

View file

@ -272,6 +272,36 @@ sed -i 's/\xc3\x85/A/g' $LNG'_filtered.po'
sed -i 's/\xc3\xA5/a/g' $LNG'_filtered.po'
fi
#https://en.wikipedia.org/wiki/Norwegian_orthography éèêóòôù ÅåÆæØø
if [ "$LNG" = "no" ]; then
#repace 'Å' with 'A'
sed -i 's/\xc3\x85/A/g' $LNG'_filtered.po'
#repace 'å' with 'a'
sed -i 's/\xc3\xA5/a/g' $LNG'_filtered.po'
#repace 'Æ' with 'Ae'
sed -i 's/\xc3\x86/A/g' $LNG'_filtered.po'
#repace 'æ' with 'ae'
sed -i 's/\xc3\xa6/a/g' $LNG'_filtered.po'
#repace 'Ø' with 'O'
sed -i 's/\xc3\x98/O/g' $LNG'_filtered.po'
#repace 'ø' with 'o'
sed -i 's/\xc3\xb8/o/g' $LNG'_filtered.po'
#replace 'é' with 'e'
sed -i 's/\xc3\xa9/e/g' $LNG'_filtered.po'
#replace 'è' with 'e'
sed -i 's/\xc3\xa8/e/g' $LNG'_filtered.po'
#replace 'ê' with 'e'
sed -i 's/\xc3\xaa/e/g' $LNG'_filtered.po'
#replace 'ó' with 'o'
sed -i 's/\xc3\xb3/o/g' $LNG'_filtered.po'
#replace 'ò' with 'o'
sed -i 's/\xc3\xb2/o/g' $LNG'_filtered.po'
#replace 'ô' with 'o'
sed -i 's/\xc3\xb4/o/g' $LNG'_filtered.po'
#replace 'ù' with 'u'
sed -i 's/\xc3\xb9/u/g' $LNG'_filtered.po'
fi
if [ "$LNG" = "da" ]; then
#repace 'Å' with 'Aa'
sed -i 's/\xc3\x85/Aa/g' $LNG'_filtered.po'

1403
lang/lang_en_no.txt Normal file

File diff suppressed because it is too large Load diff

1772
lang/po/Firmware_no.po Normal file

File diff suppressed because it is too large Load diff

1772
lang/po/new/no.po Normal file

File diff suppressed because it is too large Load diff