aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Resources.xaml
blob: ef5d1b599fe4f21fe1bc22f77ed03fb1b90275c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls"
                    xmlns:options="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
                    xmlns:Controls="http://metro.mahapps.com/winfx/xaml/controls"
                    xmlns:fa="http://schemas.fontawesome.io/icons/"
                    xmlns:local="clr-namespace:Tango.Scripting.IDE">

    <Color x:Key="IdeDarkBackgroundColor">#202020</Color>
    <Color x:Key="IdeMidBackgroundColor">#252526</Color>
    <Color x:Key="IdeLightBackgroundColor">#2D2D30</Color>
    <Color x:Key="IdeBorderColor">#676767</Color>
    <Color x:Key="IdeAccentColor">#007ACC</Color>
    <Color x:Key="IdeLightForegroundColor">#007ACC</Color>
    <SolidColorBrush x:Key="IdeDarkBackgroundBrush" Color="{StaticResource IdeDarkBackgroundColor}"></SolidColorBrush>
    <SolidColorBrush x:Key="IdeLightBackgroundBrush" Color="{StaticResource IdeLightBackgroundColor}"></SolidColorBrush>
    <SolidColorBrush x:Key="IdeMidBackgroundBrush" Color="{StaticResource IdeMidBackgroundColor}"></SolidColorBrush>
    <SolidColorBrush x:Key="IdeBorderBrush" Color="{StaticResource IdeBorderColor}"></SolidColorBrush>
    <SolidColorBrush x:Key="IdeAccentBrush" Color="{StaticResource IdeAccentColor}"></SolidColorBrush>
    <SolidColorBrush x:Key="IdeLightForegroundBrush" Color="{StaticResource IdeLightForegroundColor}"></SolidColorBrush>

    <!--  Background  -->
    <SolidColorBrush x:Key="Background" Color="#1C1C1C" options:Freeze="True" />
    <SolidColorBrush x:Key="LightBackground" Color="#2D2D30" options:Freeze="True" />

    <Color x:Key="AccentColor">#2D2D30</Color>
    <Color x:Key="BlackColor">#FFFFFFFF</Color>
    <Color x:Key="WhiteColor">#2D2D30</Color>

    
    
    
    
    
    
    <!--Override Mahapps Colors-->
    
    <!--  re-set brushes too  -->
    <SolidColorBrush x:Key="HighlightBrush" Color="{StaticResource HighlightColor}" options:Freeze="True" />
    <SolidColorBrush x:Key="AccentColorBrush" Color="{StaticResource AccentColor}" />
    <SolidColorBrush x:Key="AccentColorBrush2" Color="{StaticResource IdeAccentColor}" />
    <SolidColorBrush x:Key="AccentColorBrush3" Color="Transparent" />
    <SolidColorBrush x:Key="AccentColorBrush4" Color="{StaticResource IdeAccentColor}" />

    <SolidColorBrush x:Key="WindowTitleColorBrush" Color="{StaticResource AccentColor}" options:Freeze="True" />
    <SolidColorBrush x:Key="NonActiveWindowTitleColorBrush" Color="#808080" options:Freeze="True" />
    <SolidColorBrush x:Key="NonActiveBorderColorBrush" Color="#808080" options:Freeze="True" />

    <SolidColorBrush x:Key="BlackBrush" Color="{StaticResource BlackColor}" options:Freeze="True" />
    <SolidColorBrush x:Key="TextBrush" Color="{StaticResource BlackColor}" options:Freeze="True" />
    <SolidColorBrush x:Key="LabelTextBrush" Color="{StaticResource BlackColor}" options:Freeze="True" />
    <SolidColorBrush x:Key="BlackColorBrush" Color="{StaticResource BlackColor}" options:Freeze="True" />
    <SolidColorBrush x:Key="TextBoxMouseOverInnerBorderBrush" Color="{StaticResource BlackColor}" options:Freeze="True" />
    <SolidColorBrush x:Key="TextBoxFocusBorderBrush" Color="{StaticResource BlackColor}" options:Freeze="True" />
    <SolidColorBrush x:Key="ButtonMouseOverBorderBrush" Color="{StaticResource BlackColor}" options:Freeze="True" />
    <SolidColorBrush x:Key="ButtonMouseOverInnerBorderBrush" Color="{StaticResource BlackColor}" options:Freeze="True" />
    <SolidColorBrush x:Key="ComboBoxMouseOverBorderBrush" Color="{StaticResource BlackColor}" options:Freeze="True" />
    <SolidColorBrush x:Key="ComboBoxMouseOverInnerBorderBrush" Color="{StaticResource BlackColor}" options:Freeze="True" />

    <SolidColorBrush x:Key="ControlBackgroundBrush" Color="{StaticResource WhiteColor}" options:Freeze="True" />
    <SolidColorBrush x:Key="WhiteBrush" Color="{StaticResource WhiteColor}" options:Freeze="True" />
    <SolidColorBrush x:Key="WhiteColorBrush" Color="{StaticResource WhiteColor}" options:Freeze="True" />
    <SolidColorBrush x:Key="DisabledWhiteBrush" Color="{StaticResource WhiteColor}" options:Freeze="True" />
    <SolidColorBrush x:Key="WindowBackgroundBrush" Color="{StaticResource WhiteColor}" options:Freeze="True" />

    <SolidColorBrush x:Key="{x:Static SystemColors.WindowBrushKey}" Color="{StaticResource WhiteColor}" options:Freeze="True" />
    <SolidColorBrush x:Key="{x:Static SystemColors.ControlTextBrushKey}" Color="{StaticResource BlackColor}" options:Freeze="True" />

    <LinearGradientBrush x:Key="CheckBoxBackgroundBrush" StartPoint="0.5,0" EndPoint="0.5,1" options:Freeze="True">
        <GradientStop Offset="0" Color="{StaticResource Gray7}" />
        <GradientStop Offset="1" Color="{StaticResource WhiteColor}" />
    </LinearGradientBrush>

    <!--  Foreground  -->
    <SolidColorBrush x:Key="Foreground" Color="#FFFFFF" options:Freeze="True" />
    <SolidColorBrush x:Key="WindowTitleForeground" Color="#999988" options:Freeze="True" />

    <!--  General  -->
    <SolidColorBrush x:Key="BackgroundHighlighted" Color="#54545C" options:Freeze="True" />
    <SolidColorBrush x:Key="BorderBrushHighlighted" Color="#6A6A75" options:Freeze="True" />
    <SolidColorBrush x:Key="BackgroundSelected" Color="#007ACC" options:Freeze="True" />
    <SolidColorBrush x:Key="BorderBrushSelected" Color="#1C97EA" options:Freeze="True" />
    <SolidColorBrush x:Key="BackgroundNormal" Color="#3F3F46" options:Freeze="True" />
    <SolidColorBrush x:Key="BorderBrushNormal" Color="#54545C" options:Freeze="True" />
    <SolidColorBrush x:Key="WindowGlowBrush" Color="#017ACC" options:Freeze="True" />

    <!--  Text Box  -->
    <SolidColorBrush x:Key="TextBoxBackground" Color="#333337" options:Freeze="True" />
    <SolidColorBrush x:Key="TextBoxBackgroundSelected" Color="#3F3F46" options:Freeze="True" />

    <!--  Search Text Box  -->
    <SolidColorBrush x:Key="SearchTextForeground" Color="#999999" options:Freeze="True" />

    <!--  Link Button  -->
    <SolidColorBrush x:Key="LinkButtonForeground" Color="#1297FB" options:Freeze="True" />
    <SolidColorBrush x:Key="LinkButtonForegroundHighlighted" Color="#55AAFF" options:Freeze="True" />

    <!--  Close Button  -->
    <SolidColorBrush x:Key="CloseButtonBackgroundHighlighted" Color="#39ADFB" options:Freeze="True" />
    <SolidColorBrush x:Key="CloseButtonBackgroundPressed" Color="#084E7D" options:Freeze="True" />
    <SolidColorBrush x:Key="CloseButtonStroke" Color="#AAFFFFFF" options:Freeze="True" />
    <SolidColorBrush x:Key="CloseButtonStrokeHighlighted" Color="#FFFFFF" options:Freeze="True" />

    <!--  Menu  -->
    <SolidColorBrush x:Key="MenuSeparatorBorderBrush" Color="#333337" options:Freeze="True" />
    <SolidColorBrush x:Key="MenuItemHighlightedBackground" Color="#3E3E40" options:Freeze="True" />
    <SolidColorBrush x:Key="SubmenuItemBackground" Color="#1B1B1C" options:Freeze="True" />
    <SolidColorBrush x:Key="SubmenuItemBackgroundHighlighted" Color="#333334" options:Freeze="True" />
    <SolidColorBrush x:Key="MenuDisabledForeground" Color="#656565" options:Freeze="True" />

    <!--  Scroll Bar  -->
    <SolidColorBrush x:Key="ScrollBarPageButtonBackgroundHighlighted" Color="#05FFFFFF" options:Freeze="True" />

    <!--  Notification Button  -->
    <SolidColorBrush x:Key="NotificationButtonForegroundBrush" Color="#000000" />
    <SolidColorBrush x:Key="NotificationButtonBackgroundBrush" Color="#FFCC00" />
    <SolidColorBrush x:Key="NotificationButtonBackgroundOverBrush" Color="#FFDF66" />
    <SolidColorBrush x:Key="NotificationButtonBackgroundPressedBrush" Color="#C59E00" />

    <!--  Quick Launch TextBox  -->
    <SolidColorBrush x:Key="QuickLaunchTextBoxBorderBrush" Color="#3F3F46" />
    <SolidColorBrush x:Key="QuickLaunchTextBoxFocusedBorderBrush" Color="#007ACC" />

    <SolidColorBrush x:Key="HoverBackgroundBrush" Color="Red" options:Freeze="True" />

</ResourceDictionary>
    
cessParameters.pb-c.h" #include "PMR/Printing/UploadProcessParametersRequest.pb-c.h" #include "PMR/Printing/UploadProcessParametersResponse.pb-c.h" #include "PMR/Hardware/HardwarePidControlType.pb-c.h" #include "PMR/common/MessageContainer.pb-c.h" #include "drivers/Valves/Valve.h" #include "drivers/I2C_Communication/ADC_MUX/ADC_MUX.h" #include "modules/ids/ids_ex.h" #include "Common/SWUpdate/FileSystem.h" #include "StateMachines/Initialization/PowerIdle.h" #include "StateMachines/Initialization/InitSequence.h" #include "drivers/Flash_ram/FlashProgram.h" #include <Drivers/I2C_Communication/I2C_Task.h> #include "drivers/Flash_ram/MCU_E2Prom.h" #include <Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.h> double dyeingspeed = 0; double dryerbufferlength = 0; double mininkuptake = 0; double feedertension = 0; double pullertension = 0; double windertension = 0; double headairflow = 5.0; double dryerairflow = 5.0; double pressurebuildup = 0; double dryerzone1temp = 0; int32_t tableindex = 0; double headBlowersFlow[2] = {1.5,1.5}; double dryerbufferMeters = 0; double dryerbufferCentimeters = 0; #define MAX_ALLOWED_TEMPERATURE 280 int MaxAllowedTemperature = MAX_ALLOWED_TEMPERATURE; char ProcessParamsConfigPath[50] = "0://SysInfo//ProcessP.cfg"; bool MachineReadyForHeating = false; void SetMachineReadyForHeating(bool value) { MachineReadyForHeating = value; } ProcessParameters ProcessParametersKeep; void HeatersStopControlOnHeatersOff(ProcessParameters* ProcessParams) { uint32_t temp_sum = 0; temp_sum += ProcessParams->dryerzone1temp; temp_sum += ProcessParams->dryerzone2temp; temp_sum += ProcessParams->dryerzone3temp; temp_sum += ProcessParams->mixertemp; temp_sum += ProcessParams->headzone1temp; temp_sum += ProcessParams->headzone2temp; temp_sum += ProcessParams->headzone3temp; temp_sum += ProcessParams->headzone4temp; temp_sum += ProcessParams->headzone5temp; temp_sum += ProcessParams->headzone6temp; temp_sum += ProcessParams->headzone7temp; temp_sum += ProcessParams->headzone8temp; temp_sum += ProcessParams->headzone9temp; temp_sum += ProcessParams->headzone10temp; temp_sum += ProcessParams->headzone11temp; temp_sum += ProcessParams->headzone12temp; if (temp_sum == 0)// heating off { HeatersControlStop(); REPORT_MSG(temp_sum,"Heating control off - temperatures off"); } else { HeatersControlStart(); } } char ProcessErrorMsg[50]; uint32_t HandleProcessParameters(ProcessParameters* ProcessParams,bool saveData) { uint32_t status = 0,Bytes = 0; if (ProcessParams==NULL) { status = ERROR_CODE__INVALID_PARAMETER; ReportWithPackageFilter(InitFilter,"HandleProcessParameters NULL",__FILE__,(int)__LINE__,(int)0,RpWarning,(int)0,0); usnprintf(ProcessErrorMsg, 50, "ProcessParameters NULL"); return status; } if (ProcessParams->dryerzone1temp > MaxAllowedTemperature) status = ERROR_CODE__INVALID_PARAMETER; if (ProcessParams->dryerzone2temp > MaxAllowedTemperature) status = ERROR_CODE__INVALID_PARAMETER; if (ProcessParams->dryerzone3temp > MaxAllowedTemperature) status = ERROR_CODE__INVALID_PARAMETER; if (ProcessParams->mixertemp > MaxAllowedTemperature) status = ERROR_CODE__INVALID_PARAMETER; if (ProcessParams->headzone1temp > MaxAllowedTemperature) status = ERROR_CODE__INVALID_PARAMETER; if (ProcessParams->headzone2temp > MaxAllowedTemperature) status = ERROR_CODE__INVALID_PARAMETER; if (ProcessParams->headzone3temp > MaxAllowedTemperature) status = ERROR_CODE__INVALID_PARAMETER; if (ProcessParams->headzone4temp > MaxAllowedTemperature) status = ERROR_CODE__INVALID_PARAMETER; if (ProcessParams->headzone5temp > MaxAllowedTemperature) status = ERROR_CODE__INVALID_PARAMETER; if (ProcessParams->headzone6temp > MaxAllowedTemperature) status = ERROR_CODE__INVALID_PARAMETER; if (status != 0) { status = ERROR_CODE__INVALID_PARAMETER; ReportWithPackageFilter(InitFilter,"HandleProcessParameters Temperature too high",__FILE__,(int)__LINE__,(int)status,RpWarning,(int)0,0); usnprintf(ProcessErrorMsg, 50, "ProcessParameters Temperature too high"); return status; } if (ProcessParams) { memcpy (&ProcessParametersKeep,ProcessParams,sizeof(ProcessParameters)); } if (saveData == true) { if ((ProcessParams->dryerzone1temp > 0.1)&&(ProcessParams->headzone2temp > 0.1)&&(ProcessParams->headzone3temp > 0.1)&&(ProcessParams->headzone1temp > 0.1))//NOT turning off heaters { Bytes = sizeof(ProcessParameters); FileWrite(ProcessParams,Bytes,ProcessParamsConfigPath,BIOS_WAIT_FOREVER); EraseFlashSection(PROCESS_PARAMETERS_MAP_IN_FLASH); ReadAppAndProgram(PROCESS_PARAMETERS_MAP_IN_FLASH, 4,&Bytes); ReadAppAndProgram(PROCESS_PARAMETERS_MAP_IN_FLASH+4, Bytes, ProcessParams); REPORT_MSG(Bytes,"Bytes write to flash"); } else { if (ProcessParams->has_headairflow == false) ProcessParams->headairflow = headairflow; if (ProcessParams->has_feedertension == false) ProcessParams->feedertension = feedertension; if (ProcessParams->has_windertension == false) ProcessParams->windertension = windertension; if (ProcessParams->has_pullertension == false) ProcessParams->pullertension = pullertension; ReportWithPackageFilter(InitFilter,"HandleProcessParameters temp off blower on",__FILE__,(int)__LINE__,(int)ProcessParams->headairflow,RpWarning,(int)ProcessParametersKeep.headairflow,0); } } HeatersStopControlOnHeatersOff(ProcessParams); dyeingspeed = ProcessParams->dyeingspeed; dryerbufferlength = ProcessParams->dryerbufferlength; dryerbufferMeters = dryerbufferlength*0.76+0.9; dryerbufferCentimeters = dryerbufferlength*76+90; mininkuptake = ProcessParams->mininkuptake; feedertension = ProcessParams->feedertension; pullertension = ProcessParams->pullertension; windertension = ProcessParams->windertension; headairflow = ProcessParams->headairflow; dryerairflow = ProcessParams->dryerairflow; pressurebuildup = ProcessParams->pressurebuildup; dryerzone1temp = ProcessParams->dryerzone1temp; if (MachineReadyForHeating == false) { ReportWithPackageFilter(InitFilter,"HandleProcessParameters Init not ready",__FILE__,(int)__LINE__,(int)status,RpWarning,(int)GetMachineState(),0); status = ERROR_CODE__GENERAL_ERROR; usnprintf(ProcessErrorMsg, 50, "ProcessParameters Init not ready"); return status; } //Report("drier buffer length",__FILE__,(int)dryerbufferlength,(int)dryerbufferMeters*100,RpWarning,(int)dryerbufferCentimeters,0); ReportWithPackageFilter(InitFilter,"HandleProcessParameters Head type",__FILE__,(int)headairflow,(int)Head_Type,RpWarning,(int)dryerbufferCentimeters,0); WHS_Set_SetPoint_Q_value(headairflow); if (ProcessParams->mixertemp>1) status |= HeaterCommandRequestMessage(HARDWARE_PID_CONTROL_TYPE__MixerHeater, true,ProcessParams->mixertemp); else status |= HeaterCommandRequestMessage(HARDWARE_PID_CONTROL_TYPE__MixerHeater, false,ProcessParams->mixertemp); if (ProcessParams->headzone1temp>1) { status |= HeaterCommandRequestMessage(HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ1, true,ProcessParams->headzone1temp); } else { status |= HeaterCommandRequestMessage(HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ1, false,ProcessParams->headzone1temp); } if (ProcessParams->headzone2temp>1) { status |= HeaterCommandRequestMessage(HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ2, true,ProcessParams->headzone2temp); } else { status |= HeaterCommandRequestMessage(HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ2, false,ProcessParams->headzone2temp); } if (ProcessParams->headzone3temp>1) { status |= HeaterCommandRequestMessage(HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ3, true,ProcessParams->headzone3temp); } else { status |= HeaterCommandRequestMessage(HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ3, false,ProcessParams->headzone3temp); } if(Head_Type != HEAD_TYPE_ARC) { Trigger_HeaterWriting(); if (ProcessParams->headzone4temp>1) { status |= HeaterCommandRequestMessage(HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ4, true,ProcessParams->headzone4temp); } else { status |= HeaterCommandRequestMessage(HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ4, false,ProcessParams->headzone4temp); } if (ProcessParams->headzone5temp>1) { status |= HeaterCommandRequestMessage(HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ5, true,ProcessParams->headzone5temp); } else { status |= HeaterCommandRequestMessage(HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ5, false,ProcessParams->headzone5temp); } if (ProcessParams->headzone6temp>1) { status |= HeaterCommandRequestMessage(HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ6, true,ProcessParams->headzone6temp); } else { status |= HeaterCommandRequestMessage(HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ6, false,ProcessParams->headzone6temp); } } if (ProcessParams->dryerzone1temp>1) status |= HeaterCommandRequestMessage(HARDWARE_PID_CONTROL_TYPE__DryerAirTemperature, true,ProcessParams->dryerzone1temp); else status |= HeaterCommandRequestMessage(HARDWARE_PID_CONTROL_TYPE__DryerAirTemperature, false,ProcessParams->dryerzone1temp); if(Head_Type == HEAD_TYPE_FLAT) { if (ProcessParams->headzone7temp>1) { status |= HeaterCommandRequestMessage(HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ7, true,ProcessParams->headzone7temp); } else { status |= HeaterCommandRequestMessage(HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ7, false,ProcessParams->headzone7temp); } Trigger_HeaterWriting(); if (ProcessParams->headzone8temp>1) { status |= HeaterCommandRequestMessage(HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ8, true,ProcessParams->headzone8temp); } else { status |= HeaterCommandRequestMessage(HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ8, false,ProcessParams->headzone8temp); } if (ProcessParams->headzone9temp>1) { status |= HeaterCommandRequestMessage(HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ9, true,ProcessParams->headzone9temp); } else { status |= HeaterCommandRequestMessage(HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ9, false,ProcessParams->headzone9temp); } if (ProcessParams->headzone10temp>1) { status |= HeaterCommandRequestMessage(HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ10, true,ProcessParams->headzone10temp); } else { status |= HeaterCommandRequestMessage(HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ10, false,ProcessParams->headzone10temp); } Trigger_HeaterWriting(); if (ProcessParams->headzone11temp>1) { status |= HeaterCommandRequestMessage(HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ11, true,ProcessParams->headzone11temp); } else { status |= HeaterCommandRequestMessage(HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ11, false,ProcessParams->headzone11temp); } if (ProcessParams->headzone12temp>1) { status |= HeaterCommandRequestMessage(HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ12, true,ProcessParams->headzone12temp); } else { status |= HeaterCommandRequestMessage(HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ12, false,ProcessParams->headzone12temp); } } if(Head_Type == HEAD_TYPE_ARC) { Trigger_HeaterWriting(); if (ProcessParams->rblowertemp>1) { status |= HeaterCommandRequestMessage(HARDWARE_PID_CONTROL_TYPE__HeadCoverHeater1, true,ProcessParams->rblowertemp); } else { status |= HeaterCommandRequestMessage(HARDWARE_PID_CONTROL_TYPE__HeadCoverHeater1, false,ProcessParams->rblowertemp); } Trigger_HeaterWriting(); if (ProcessParams->lblowertemp>1) { status |= HeaterCommandRequestMessage(HARDWARE_PID_CONTROL_TYPE__HeadCoverHeater2, true,ProcessParams->lblowertemp); } else { status |= HeaterCommandRequestMessage(HARDWARE_PID_CONTROL_TYPE__HeadCoverHeater2, false,ProcessParams->lblowertemp); } headBlowersFlow[HEAD_FAN_RIGHT] = ProcessParams->rblowerflow; headBlowersFlow[HEAD_FAN_LEFT] = ProcessParams->lblowerflow; Trigger_HeaterWriting(); } if (status) { ReportWithPackageFilter(InitFilter,"HandleProcessParameters start heaters error",__FILE__,(int)__LINE__,(int)status,RpWarning,(int)GetMachineState(),0); status = ERROR_CODE__JOB_TEMPERATURE_ALARM; usnprintf(ProcessErrorMsg, 50, "ProcessParameters start heaters error"); } return status;//status; } void ProcessRequestFunc(MessageContainer* requestContainer) { MessageContainer responseContainer; uint8_t* container_buffer; uint32_t status = 0; UploadProcessParametersRequest* request = upload_process_parameters_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data); ProcessParameters* ProcessParams = request->processparameters; //////////////////////////////////////////////////////////////////////// /*UploadProcessParametersRequest* requesttest; uint8_t* buffer = NULL; uint32_t Bytes = 0; ProcessParameters* ProcessParamsTest; FileRead(ProcessParamsConfigPath, &Bytes, &buffer); requesttest = upload_process_parameters_request__unpack(NULL, Bytes, buffer); // ProcessParameters* ProcessParams = process_parameters__unpack(NULL, Bytes, buffer); if (requesttest) { ProcessParamsTest = request->processparameters; } free (buffer); upload_process_parameters_request__free_unpacked(requesttest,NULL); */ ///////////////////////////////////////////////////////// UploadProcessParametersResponse response = UPLOAD_PROCESS_PARAMETERS_RESPONSE__INIT; responseContainer = createContainer(MESSAGE_TYPE__UploadProcessParametersResponse, requestContainer->token, true, &response, &upload_process_parameters_response__pack, &upload_process_parameters_response__get_packed_size); //REPORT_MSG (ProcessParams->dryerzone1temp,"Process Params Dryer"); PowerIdleOutOfIdleState(); if (status == 0) status = HandleProcessParameters(ProcessParams,true); if ((status)&&(status != ERROR_CODE__GENERAL_ERROR)) //ignore init not ready result { responseContainer.has_error = true; responseContainer.error = (ErrorCode)status; responseContainer.errormessage = ProcessErrorMsg; } container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); size_t container_size = message_container__pack(&responseContainer, container_buffer); my_free(responseContainer.data.data); SendChars(container_buffer, container_size); upload_process_parameters_request__free_unpacked(request,NULL); } uint32_t LoadProcessParamsFromFile(void) { FRESULT Fresult = FR_OK; uint8_t* buffer = NULL; uint32_t Bytes = 0; Fresult = FileRead(ProcessParamsConfigPath, &Bytes, &buffer); if (Fresult == FR_OK) { ProcessParameters* ProcessParams = (ProcessParameters*)buffer; if (ProcessParams!=NULL) { if ((ProcessParams->dryerzone1temp > 0.1)&&(ProcessParams->headzone2temp > 0.1)&&(ProcessParams->headzone3temp > 0.1)&&(ProcessParams->headzone4temp > 0.1))//NOT turning off heaters { Bytes = sizeof(ProcessParameters); EraseFlashSection(PROCESS_PARAMETERS_MAP_IN_FLASH); ReadAppAndProgram(PROCESS_PARAMETERS_MAP_IN_FLASH, 4,&Bytes); ReadAppAndProgram(PROCESS_PARAMETERS_MAP_IN_FLASH+4, Bytes, ProcessParams); REPORT_MSG(Bytes,"ProcessParameters Bytes write to flash"); free (buffer); } } else { Report("process parameters not loaded",__FILE__,__LINE__,(int)0,RpWarning,(int)0,0); return ERROR; } } return Fresult; } uint32_t ProcessParamsInit(void) { FRESULT Fresult = FR_NOT_READY; uint32_t Bytes; memcpy(&Bytes,(void *)PROCESS_PARAMETERS_MAP_IN_FLASH,sizeof(Bytes)); REPORT_MSG(Bytes,"Bytes read from flash"); if ((Bytes)&&(Bytes < 1000)) { ProcessParameters* ProcessParams = (ProcessParameters *)(PROCESS_PARAMETERS_MAP_IN_FLASH+4); Fresult = HandleProcessParameters(ProcessParams,false); } else { if (LoadProcessParamsFromFile()==OK) { memcpy(&Bytes,(void *)PROCESS_PARAMETERS_MAP_IN_FLASH,sizeof(Bytes)); REPORT_MSG(Bytes,"ProcessParams Bytes read from flash"); if ((Bytes)&&(Bytes < 1000)) { ProcessParameters* ProcessParams = (ProcessParameters *)(PROCESS_PARAMETERS_MAP_IN_FLASH+4); Fresult = HandleProcessParameters(ProcessParams,false); } } } return Fresult; }