From 8c72bf11686f888046e99fe5142797784c182d4e Mon Sep 17 00:00:00 2001 From: Lars Brubaker Date: Mon, 12 Dec 2016 12:14:30 -0800 Subject: [PATCH] Refactored network printing settings to match the other printer settings Took out the automatic changes to other settings --- .../PrinterConnectionAndCommunication.cs | 2 +- SetupWizard/EditPrinterSettingsPage.cs | 4 +- StaticData/SliceSettings/Layouts.txt | 8 +++- StaticData/SliceSettings/Properties.json | 46 ++++++++----------- StaticData/Translations/Master.txt | 3 ++ Submodules/agg-sharp | 2 +- 6 files changed, 32 insertions(+), 33 deletions(-) diff --git a/PrinterCommunication/PrinterConnectionAndCommunication.cs b/PrinterCommunication/PrinterConnectionAndCommunication.cs index bebbb840e..f71e4e2e7 100644 --- a/PrinterCommunication/PrinterConnectionAndCommunication.cs +++ b/PrinterCommunication/PrinterConnectionAndCommunication.cs @@ -2606,7 +2606,7 @@ namespace MatterHackers.MatterControl.PrinterCommunication private bool IsNetworkPrinting() { - return ActiveSliceSettings.Instance.GetValue(SettingsKey.enable_network_printing) == "1"; + return ActiveSliceSettings.Instance.GetValue(SettingsKey.enable_network_printing); } private void OnAtxPowerStateChanged(bool enableAtxPower) diff --git a/SetupWizard/EditPrinterSettingsPage.cs b/SetupWizard/EditPrinterSettingsPage.cs index b3b5466f4..f2a889e41 100644 --- a/SetupWizard/EditPrinterSettingsPage.cs +++ b/SetupWizard/EditPrinterSettingsPage.cs @@ -53,15 +53,15 @@ namespace MatterHackers.MatterControl int tabIndex = 0; AddNameSetting(SettingsKey.printer_name, contentRow, ref tabIndex); AddNameSetting(SettingsKey.auto_connect, contentRow, ref tabIndex); - AddNameSetting(SettingsKey.baud_rate, contentRow, ref tabIndex); //Check if networked printing is on before displaying comport or ip/port - if(ActiveSliceSettings.Instance.GetValue(SettingsKey.enable_network_printing)=="1") + if(ActiveSliceSettings.Instance.GetValue(SettingsKey.enable_network_printing)) { AddNameSetting(SettingsKey.ip_address, contentRow, ref tabIndex); AddNameSetting(SettingsKey.ip_port, contentRow, ref tabIndex); } else { + AddNameSetting(SettingsKey.baud_rate, contentRow, ref tabIndex); AddNameSetting(SettingsKey.com_port, contentRow, ref tabIndex); } diff --git a/StaticData/SliceSettings/Layouts.txt b/StaticData/SliceSettings/Layouts.txt index 04cf64d5c..433a3cffa 100644 --- a/StaticData/SliceSettings/Layouts.txt +++ b/StaticData/SliceSettings/Layouts.txt @@ -15,6 +15,8 @@ Simple auto_connect baud_rate com_port + ip_address + ip_port Intermediate General Layers / Surface @@ -77,6 +79,8 @@ Intermediate auto_connect baud_rate com_port + ip_address + ip_port Advanced General Layers / Surface @@ -284,8 +288,6 @@ Advanced printer_name Details auto_connect - enable_network_printing - enable_sailfish_communication baud_rate com_port ip_address @@ -308,6 +310,8 @@ Advanced has_heated_bed has_sd_card_reader has_power_control + enable_network_printing + enable_sailfish_communication Behavior z_homes_to_max z_can_be_negative diff --git a/StaticData/SliceSettings/Properties.json b/StaticData/SliceSettings/Properties.json index 4d00efc25..5903af56c 100644 --- a/StaticData/SliceSettings/Properties.json +++ b/StaticData/SliceSettings/Properties.json @@ -2463,7 +2463,7 @@ "DataEditType": "INT", "ExtraSettings": "", "ShowAsOverride": false, - "ShowIfSet": null, + "ShowIfSet": "!enable_network_printing", "ResetAtEndOfPrint": false, "DefaultValue": "250000", "RebuildGCodeOnChange": false @@ -2578,17 +2578,6 @@ }, { "QuickMenuSettings": [ ], - "SetSettingsOnChange": [ - { - "TargetSetting": "driver_type", - "OnValue": "TCPIP", - "OffValue": "RepRap" - }, - { - "TargetSetting": "enable_sailfish_communication", - "OnValue": "0" - } - ], "SlicerConfigName": "enable_network_printing", "PresentationName": "Networked Printing", "HelpText": "Sets MatterControl to attempt to connect to a printer over the network. (You must disconnect and reconnect for this to take effect)", @@ -2596,24 +2585,20 @@ "ExtraSettings": "", "ShowAsOverride": true, "ShowIfSet": null, + "SetSettingsOnChange": [ + { + "TargetSetting": "driver_type", + "OnValue": "TCPIP", + "OffValue": "RepRap" + } + ], "ResetAtEndOfPrint": false, "DefaultValue": "0", "RebuildGCodeOnChange": false, "ReloadUiWhenChanged": true }, - { + { "QuickMenuSettings": [ ], - "SetSettingsOnChange": [ - { - "TargetSetting": "driver_type", - "OnValue": "X3G", - "OffValue": "RepRap" - }, - { - "TargetSetting": "enable_network_printing", - "OnValue": "0" - } - ], "SlicerConfigName": "enable_sailfish_communication", "PresentationName": "Sailfish Communication", "HelpText": "Sets MatterControl to use s3g communication method. (You must disconnect and reconnect for this to take effect)", @@ -2621,6 +2606,13 @@ "ExtraSettings": "", "ShowAsOverride": true, "ShowIfSet": null, + "SetSettingsOnChange": [ + { + "TargetSetting": "driver_type", + "OnValue": "X3G", + "OffValue": "RepRap" + } + ], "ResetAtEndOfPrint": false, "DefaultValue": "0", "RebuildGCodeOnChange": false, @@ -2634,7 +2626,7 @@ "HelpText": "IP Address of printer/printer controller", "DataEditType": "STRING", "ExtraSettings": "", - "ShowAsOverride": true, + "ShowAsOverride": false, "ShowIfSet": "enable_network_printing", "ResetAtEndOfPrint": false, "DefaultValue": "127.0.0.1", @@ -2645,10 +2637,10 @@ "SetSettingsOnChange": [ ], "SlicerConfigName": "ip_port", "PresentationName": "Port", - "HelpText": "Port number to be used with IP Adress to connect to printer over the network", + "HelpText": "Port number to be used with IP Address to connect to printer over the network", "DataEditType": "INT", "ExtraSettings": "", - "ShowAsOverride": true, + "ShowAsOverride": false, "ShowIfSet": "enable_network_printing", "ResetAtEndOfPrint": false, "DefaultValue": "23", diff --git a/StaticData/Translations/Master.txt b/StaticData/Translations/Master.txt index 339d0fbdc..1a97ae9ec 100644 --- a/StaticData/Translations/Master.txt +++ b/StaticData/Translations/Master.txt @@ -5653,3 +5653,6 @@ Translated:Show In Action Menu English:Unable to Connect Translated:Unable to Connect +English:Port number to be used with IP Address to connect to printer over the network +Translated:Port number to be used with IP Address to connect to printer over the network + diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index a4a07ad33..f676c35a6 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit a4a07ad3397766f5c67cf5f53bc5ea5ecd479150 +Subproject commit f676c35a6660435156d8069da691ddedff8e2aee