aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Tango.PPC.MachineSettings.csproj
blob: 9d44a6a63e98f4932cb077420179757a3294e241 (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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProjectGuid>{91B70E9B-66A7-4873-AE10-400E71CF404F}</ProjectGuid>
    <OutputType>library</OutputType>
    <RootNamespace>Tango.PPC.MachineSettings</RootNamespace>
    <AssemblyName>Tango.PPC.MachineSettings</AssemblyName>
    <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
    <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>..\..\..\Build\PPC\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>..\..\..\Build\PPC\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
      <HintPath>..\..\..\packages\EntityFramework.6.0.0\lib\net45\EntityFramework.dll</HintPath>
      <Private>True</Private>
    </Reference>
    <Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
      <HintPath>..\..\..\packages\EntityFramework.6.0.0\lib\net45\EntityFramework.SqlServer.dll</HintPath>
    </Reference>
    <Reference Include="FontAwesome.WPF, Version=4.7.0.37774, Culture=neutral, PublicKeyToken=0758b07a11a4f466, processorArchitecture=MSIL">
      <HintPath>..\..\..\packages\FontAwesome.WPF.4.7.0.9\lib\net40\FontAwesome.WPF.dll</HintPath>
    </Reference>
    <Reference Include="Google.Protobuf, Version=3.4.1.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
      <HintPath>..\..\..\packages\Google.Protobuf.3.4.1\lib\net45\Google.Protobuf.dll</HintPath>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.ComponentModel.DataAnnotations" />
    <Reference Include="System.Data" />
    <Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
      <HintPath>..\..\..\packages\Expression.Blend.Sdk.1.0.2\lib\net45\System.Windows.Interactivity.dll</HintPath>
    </Reference>
    <Reference Include="System.Xml" />
    <Reference Include="Microsoft.CSharp" />
    <Reference Include="System.Core" />
    <Reference Include="System.Xml.Linq" />
    <Reference Include="System.Data.DataSetExtensions" />
    <Reference Include="System.Net.Http" />
    <Reference Include="System.Xaml">
      <RequiredTargetFramework>4.0</RequiredTargetFramework>
    </Reference>
    <Reference Include="WindowsBase" />
    <Reference Include="PresentationCore" />
    <Reference Include="PresentationFramework" />
  </ItemGroup>
  <ItemGroup>
    <Page Include="App.xaml">
      <Generator>MSBuild:Compile</Generator>
      <SubType>Designer</SubType>
    </Page>
    <Page Include="Views\MainView.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:Compile</Generator>
    </Page>
  </ItemGroup>
  <ItemGroup>
    <Compile Include="..\..\..\Versioning\GlobalVersionInfo.cs">
      <Link>GlobalVersionInfo.cs</Link>
    </Compile>
    <Compile Include="MachineSettingsModule.cs" />
    <Compile Include="MachineSettingsModuleSettings.cs" />
    <Compile Include="Properties\AssemblyInfo.cs">
      <SubType>Code</SubType>
    </Compile>
    <Compile Include="Properties\Resources.Designer.cs">
      <AutoGen>True</AutoGen>
      <DesignTime>True</DesignTime>
      <DependentUpon>Resources.resx</DependentUpon>
    </Compile>
    <Compile Include="Properties\Settings.Designer.cs">
      <AutoGen>True</AutoGen>
      <DependentUpon>Settings.settings</DependentUpon>
      <DesignTimeSharedInput>True</DesignTimeSharedInput>
    </Compile>
    <Compile Include="ViewModelLocator.cs" />
    <Compile Include="ViewModels\MainViewVM.cs" />
    <Compile Include="Views\MainView.xaml.cs">
      <DependentUpon>MainView.xaml</DependentUpon>
    </Compile>
    <EmbeddedResource Include="Properties\Resources.resx">
      <Generator>ResXFileCodeGenerator</Generator>
      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
    </EmbeddedResource>
    <None Include="app.config" />
    <None Include="packages.config" />
    <None Include="Properties\Settings.settings">
      <Generator>SettingsSingleFileGenerator</Generator>
      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
    </None>
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="..\..\..\Tango.BL\Tango.BL.csproj">
      <Project>{f441feee-322a-4943-b566-110e12fd3b72}</Project>
      <Name>Tango.BL</Name>
    </ProjectReference>
    <ProjectReference Include="..\..\..\Tango.Core\Tango.Core.csproj">
      <Project>{a34ee0f0-649d-41c8-8489-b6f1cc6924ee}</Project>
      <Name>Tango.Core</Name>
    </ProjectReference>
    <ProjectReference Include="..\..\..\Tango.DragAndDrop\Tango.DragAndDrop.csproj">
      <Project>{b112d89a-a106-41ae-a0c1-4abc84c477f5}</Project>
      <Name>Tango.DragAndDrop</Name>
    </ProjectReference>
    <ProjectReference Include="..\..\..\Tango.Logging\Tango.Logging.csproj">
      <Project>{bc932dbd-7cdb-488c-99e4-f02cf441f55e}</Project>
      <Name>Tango.Logging</Name>
    </ProjectReference>
    <ProjectReference Include="..\..\..\Tango.PMR\Tango.PMR.csproj">
      <Project>{e4927038-348d-4295-aaf4-861c58cb3943}</Project>
      <Name>Tango.PMR</Name>
    </ProjectReference>
    <ProjectReference Include="..\..\..\Tango.Settings\Tango.Settings.csproj">
      <Project>{d8f1ad85-526a-4f50-b6dc-d437af63d8d8}</Project>
      <Name>Tango.Settings</Name>
    </ProjectReference>
    <ProjectReference Include="..\..\..\Tango.SharedUI\Tango.SharedUI.csproj">
      <Project>{8491d07b-c1f6-4b62-a412-41b9fd2d6538}</Project>
      <Name>Tango.SharedUI</Name>
    </ProjectReference>
    <ProjectReference Include="..\..\..\Tango.Touch\Tango.Touch.csproj">
      <Project>{fd86424c-6e84-491b-8df9-3d0f5c236a2a}</Project>
      <Name>Tango.Touch</Name>
    </ProjectReference>
    <ProjectReference Include="..\..\..\Tango.Transport\Tango.Transport.csproj">
      <Project>{74e700b0-1156-4126-be40-ee450d3c3026}</Project>
      <Name>Tango.Transport</Name>
    </ProjectReference>
    <ProjectReference Include="..\..\..\Tango.WiFi\Tango.WiFi.csproj">
      <Project>{6aa425c9-ea6a-4b01-aaed-5ff122e8b663}</Project>
      <Name>Tango.WiFi</Name>
    </ProjectReference>
    <ProjectReference Include="..\..\Tango.PPC.Common\Tango.PPC.Common.csproj">
      <Project>{0be74eee-22cb-4dba-b896-793b9e1a3ac0}</Project>
      <Name>Tango.PPC.Common</Name>
    </ProjectReference>
  </ItemGroup>
  <ItemGroup>
    <Resource Include="Images\settings-module.png" />
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  <ProjectExtensions>
    <VisualStudio>
      <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" />
    </VisualStudio>
  </ProjectExtensions>
</Project>
"modules/thread/thread.h" #include "modules/waste/waste.h" #include "modules/ids/ids.h" #include "modules/control/control.h" #include "modules/AlarmHandling/AlarmHandling.h" #include "modules/heaters/heaters_ex.h" #include "modules/Diagnostics/Diagnostics.h" #include "Modules/General/process.h" #include "Modules/Thread/Thread_ex.h" #include "Common/SWUpdate/FirmwareUpgrade.h" #include "StateMachines/Printing/PrintingSTM.h" #include "PowerIdle.h" #include "InitSequence.h" #include "drivers/I2C_Communication/DAC/Blower.h" #include "drivers/I2C_Communication/ADC_MUX/ADC_MUX.h" #include "drivers/Heater/TemperatureSensor.h" #include "drivers/Valves/Valve.h" #include "heaters/heaters_ex.h" #include "PowerOffSequence.h" /* typedef enum { POWER_OFF_INIT, POWER_OFF_STOP_RUNNING_JOB, POWER_OFF_HEAD_CLEAN, POWER_OFF_MIXER_FLUSH, POWER_OFF_HEATERS_OFF, POWER_OFF_STORE_DATA, POWER_OFF_SET_VALVE_POSITION, POWER_OFF_WAIT_FOR_TEMPERATURE, POWER_OFF_WAIT_FOR_PROCESSES,//wait for waste emptying, ink filling, thread loading POWER_OFF_TURN_OFF_DRYER_FAN, POWER_OFF_TURN_OFF_COOLER, POWER_OFF_TURN_OFF_BLOWER, POWER_OFF_POWER_OFF, POWER_OFF_MAX, }POWER_OFF_STAGES_ENUM; */ POWER_OFF_STAGES_ENUM PowerOffMachineState = POWER_OFF_INIT,StoredMachineState = POWER_OFF_INIT; uint32_t PowerOffControlId = 0xFF; uint32_t WaitForProcessControlId = 0xFF; uint32_t PowerOffSequenceStateMachine( POWER_OFF_STAGES_ENUM ReadValue); bool PowerOffInProcess = false; #define POWER_OFF_TEMP_THRESHOLD 5000 //50 celsious int32_t PowerOffTemperatureThreshold = POWER_OFF_TEMP_THRESHOLD; bool PowerOffInProcessGetState(void) { return PowerOffInProcess; } void PowerOffSetTemperatureThreshold (int32_t temperature) { if (temperature) { PowerOffTemperatureThreshold = temperature*100; } } /*******************************************************************************************************/ uint32_t PowerOffScheduler(uint32_t IfIndex, uint32_t BusyFlag) { if (PowerOffMachineState > StoredMachineState) { StoredMachineState = PowerOffMachineState; PowerOffSequenceStateMachine (PowerOffMachineState); } return OK; } /*******************************************************************************************************/ uint32_t PowerOffInit(void) { LOG_ERROR(0,"Power Off Init"); PowerOffMachineState++; StopInitSequence(); setmachineActive(true); PowerOffInProcess = true; PowerOffControlId = AddControlCallback( PowerOffScheduler, eOneSecond, TemplateDataReadCBFunction,0,0, 0 ); return OK; } /*******************************************************************************************************/ uint32_t PowerOffCancel(void) { if (PowerOffMachineState >= POWER_OFF_HEAD_CLEAN) PowerOffMachineState = POWER_OFF_CANCELLED; PowerOffInProcess = false; return OK; } /************************************************************************shlomo */ uint32_t PowerOffHeadCleanControlId = 0xff; uint32_t PowerOffHeadCleanCallback(uint32_t DispenserId, uint32_t ReadValue) { if ( JobIsActive()== false) { //stop this control loop SafeRemoveControlCallback(PowerOffHeadCleanControlId, PowerOffHeadCleanCallback ); PowerOffHeadCleanControlId = 0xFF; PowerOffMachineState++; } return OK; } /*******************************************************************************************************/ uint32_t PowerOffHeadClean(void) { //TBD if (AutoHoming_Config >= AutoHoming_PowerOff ) AutoHoming_Config = AutoHoming_JobEnd_PowerOn_off; ThreadCleaningJobFunc(50); if (PowerOffHeadCleanControlId != 0xFF) { RemoveControlCallback(PowerOffHeadCleanControlId, PowerOffHeadCleanCallback ); PowerOffHeadCleanControlId = 0xFF; //return ERROR; } PowerOffHeadCleanControlId = AddControlCallback( PowerOffHeadCleanCallback,eOneSecond , TemplateDataReadCBFunction,0,0, 0 ); // if ( PowerOffHeadCleanControlId == 0xFF) // return ERROR; return OK; } /*******************************************************************************************************/ bool DispenserHomingActive[MAX_SYSTEM_DISPENSERS] = {false,false,false,false,false,false,false,false}; uint32_t PowerOffDispenserHomingCallback(uint32_t DispenserId, uint32_t ReadValue) { DispenserHomingActive[DispenserId] = false; REPORT_MSG (DispenserId, "PowerOffDispenserHomingCallback"); return OK; } #define TI_DISPENSER_ID 4 #define DEFAULT_MIXER_CLEANING_SPEED 1000 #define DEFAULT_MIXER_CLEANING_TIMEOUT 10000 uint32_t PowerOffMixerFlushCallback(void) { //TBD int i; REPORT_MSG (PowerOffMachineState, "PowerOffMixerFlushCallback"); SafeRemoveControlCallback(PowerOffHeadCleanControlId, PowerOffMixerFlushCallback ); Control3WayValvesWithCallback ((Valves_t)TI_DISPENSER_ID, MidTank_Dispenser, NULL); //direction: MidTank_Dispenser or Dispenser_Mixer TimerMotors_t HW_Motor_Id = DispenserIdToMotorId[TI_DISPENSER_ID]; MotorStop(HW_Motor_Id,Hard_Hiz); Task_sleep (20); for (i=0;i<MAX_SYSTEM_DISPENSERS;i++) { if(IDS_HomeDispenser(i,1000,PowerOffDispenserHomingCallback) == OK) { DispenserHomingActive[i] = true; REPORT_MSG (i, "PowerOffDispenserHomingCallback"); } } PowerOffMachineState++; return OK; } uint32_t PowerOffMixerFlushDispenserStopCallback(void) { REPORT_MSG (PowerOffMachineState, "PowerOffMixerFlushDispenserStopCallback"); IDS_Dispenser_Start_Motor_and_Open_Valve(TI_DISPENSER_ID,DEFAULT_MIXER_CLEANING_SPEED,NULL); PowerOffHeadCleanControlId = AddControlCallback( PowerOffMixerFlushCallback,DEFAULT_MIXER_CLEANING_TIMEOUT , TemplateDataReadCBFunction,0,0, 0 ); return OK; } /*******************************************************************************************************/ uint32_t PowerOffMixerFlush(void) { int i; REPORT_MSG (PowerOffMachineState, "PowerOffMixerFlush"); Valve_Set(VALVE_MIXCHIP_WASTECH, Mixer_Waste); //if intersegment is defined throw the ink away for (i=0;i<MAX_SYSTEM_DISPENSERS;i++) { if (i!=TI_DISPENSER_ID) IDS_Dispenser_Close_Valve_And_Stop_Motor(i, NULL); else IDS_Dispenser_Close_Valve_And_Stop_Motor(i, PowerOffMixerFlushDispenserStopCallback); } return OK; } /*******************************************************************************************************/ uint32_t PowerOffHeatersOff(void) { ProcessParameters ProcessParametersClear; ProcessParametersClear.dryerzone1temp = 0; ProcessParametersClear.dryerzone2temp = 0; ProcessParametersClear.dryerzone3temp = 0; ProcessParametersClear.mixertemp = 0; ProcessParametersClear.headzone1temp = 0; ProcessParametersClear.headzone2temp = 0; ProcessParametersClear.headzone3temp = 0; ProcessParametersClear.headzone4temp = 0; ProcessParametersClear.headzone5temp = 0; ProcessParametersClear.headzone6temp = 0; ProcessParametersClear.dyeingspeed = 40; if (HandleProcessParameters(&ProcessParametersClear)!= OK) { LOG_ERROR (PowerOffMachineState, "Turn Off Heaters failed"); return ERROR; } PowerOffMachineState++; return OK; } /*******************************************************************************************************/ uint32_t PowerOffStoreData(void) { //TBD REPORT_MSG (PowerOffMachineState, "Store Data"); IDS_Dispenser_Store_Data(); PowerOffMachineState++; return OK; } /*******************************************************************************************************/ int WaitForProcessCounter = 0; uint32_t PowerOffWaitForProcessesCallback(uint32_t IfIndex, uint32_t BusyFlag) { int i; bool HomingActive = false; for (i=0;i<MAX_SYSTEM_DISPENSERS;i++) { if (DispenserHomingActive[i] ==true) { HomingActive = true; } } if ((WHS_IsEmptying()|| //MidTankFillingActive()|| ThreadLoadingActive()|| SwUpgradeActive()|| (HomingActive == true))&& (WaitForProcessCounter++<900)) { REPORT_MSG (PowerOffMachineState, "Ongoing processes calback, wait for end of process"); resetIdleCounter(); } else { PowerOffMachineState++; SafeRemoveControlCallback(WaitForProcessControlId, PowerOffWaitForProcessesCallback); WaitForProcessControlId = 0xFF; } return OK; } /*******************************************************************************************************/ uint32_t PowerOffWaitForProcesses(void) { int i; REPORT_MSG (PowerOffMachineState, "Stop dispensers homing"); bool HomingActive = false; for (i=0;i<MAX_SYSTEM_DISPENSERS;i++) { if (DispenserHomingActive[i] ==true) { HomingActive = true; IDS_StopHomeDispenser(i); REPORT_MSG (i, "IDS_StopHomeDispenser"); IDS_HomeDispenserWaitForHomingEnd(i, 2*eOneMinute /*2 minutes*/ , PowerOffDispenserHomingCallback); } } if (WHS_IsEmptying()|| //MidTankFillingActive()|| ThreadLoadingActive()|| SwUpgradeActive()|| (HomingActive == true)) { WaitForProcessCounter = 0; //15 minutes wait REPORT_MSG (PowerOffMachineState, "Ongoing processes, wait for end of process"); WaitForProcessControlId = AddControlCallback( PowerOffWaitForProcessesCallback, eOneSecond, TemplateDataReadCBFunction,0,0, 0 ); } else { PowerOffMachineState++; } //TBD return OK; } /*******************************************************************************************************/ uint32_t PowerOffStopRunningJob(void) { if (JobIsActive()) { REPORT_MSG (PowerOffMachineState, "Stop running job"); AbortJob("Power off pressed"); } PowerOffMachineState++; return OK; } /*******************************************************************************************************/ uint32_t PowerOffSetValvePosition(void) { //TBD PowerOffMachineState++; return OK; } /*******************************************************************************************************/ uint32_t PowerOffWaitForTemperatureCallback(uint32_t IfIndex, uint32_t BusyFlag) { uint32_t MaxTemp = 0,readTemp; readTemp = TemperatureSensorRead( MIXER_PT100); if ((readTemp>= MaxTemp)&&(readTemp < 28000)) MaxTemp = readTemp; readTemp = TemperatureSensorRead( TEMP_SENSE_ANALOG_DYEINGH_TEMP1); if ((readTemp>= MaxTemp)&&(readTemp < 28000)) MaxTemp = readTemp; readTemp = TemperatureSensorRead( TEMP_SENSE_ANALOG_DYEINGH_TEMP2); if ((readTemp>= MaxTemp)&&(readTemp < 28000)) MaxTemp = readTemp; readTemp = TemperatureSensorRead( TEMP_SENSE_ANALOG_DYEINGH_TEMP3); if ((readTemp>= MaxTemp)&&(readTemp < 28000)) MaxTemp = readTemp; readTemp = TemperatureSensorRead( TEMP_SENSE_ANALOG_DYEINGH_TEMP4); if ((readTemp>= MaxTemp)&&(readTemp < 28000)) MaxTemp = readTemp; readTemp = TemperatureSensorRead( TEMP_SENSE_ANALOG_DYEINGH_TEMP5); if ((readTemp>= MaxTemp)&&(readTemp < 28000)) MaxTemp = readTemp; readTemp = TemperatureSensorRead( HEAD6_PT100); if ((readTemp>= MaxTemp)&&(readTemp < 28000)) MaxTemp = readTemp; readTemp = TemperatureSensorRead( TEMP_SENSE_ANALOG_DRYER_TEMP1); if ((readTemp>= MaxTemp)&&(readTemp < 28000)) MaxTemp = readTemp; if ((MaxTemp>PowerOffTemperatureThreshold)&&(WaitForProcessCounter++<3600)) { Report("On going cooling down, wait for end of cooling",__FILE__,__LINE__,(int)MaxTemp,RpWarning,(int)WaitForProcessCounter,0); resetIdleCounter(); } else { Report("ended cooling down, wait for end of cooling",__FILE__,__LINE__,(int)MaxTemp,RpWarning,(int)WaitForProcessCounter,0); PowerOffMachineState = POWER_OFF_TURN_OFF_DRYER_FAN; SafeRemoveControlCallback(WaitForProcessControlId, PowerOffWaitForTemperatureCallback); WaitForProcessControlId = 0xFF; } return OK; } /*******************************************************************************************************/ uint32_t PowerOffWaitForTemperature(void) { if (WaitForProcessControlId == 0xFF) { WaitForProcessCounter = 0; WaitForProcessControlId = AddControlCallback( PowerOffWaitForTemperatureCallback, eOneSecond, TemplateDataReadCBFunction,0,0, 0 ); } //TBD return OK; } /*******************************************************************************************************/ uint32_t PowerOffTurnOffDryerFan(void) { Control_Dryer_Fan(STOP,75);//use START or STOP, 0 - 100% PowerOffMachineState++; //TBD return OK; } /*******************************************************************************************************/ uint32_t PowerOffTurnOffCooler(void) { uint32_t DeActivateChiller(); PowerOffMachineState++; return OK; } /*******************************************************************************************************/ uint32_t PowerOffTurnOffBlower(void) { Turn_the_Blower_Off();//Turn off PowerOffMachineState++; return OK; } /*******************************************************************************************************/ uint32_t PowerOffPowerOff(void) { int i; for (i = 0;i<10;i++) { REPORT_MSG (10-i, "Power off in x seconds"); Task_sleep (1000); } Power_Off(); return OK; } /*******************************************************************************************************/ uint32_t PowerOffSequenceStateMachine( POWER_OFF_STAGES_ENUM ReadValue) { uint32_t status = OK; REPORT_MSG(ReadValue,"PowerOffSequenceStateMachine"); switch (ReadValue) { case POWER_OFF_INIT: break; case POWER_OFF_HEAD_CLEAN: status = PowerOffHeadClean(); break; case POWER_OFF_MIXER_FLUSH: status = PowerOffMixerFlush(); break; case POWER_OFF_HEATERS_OFF: status = PowerOffHeatersOff(); break; case POWER_OFF_STORE_DATA: status = PowerOffStoreData(); break; case POWER_OFF_WAIT_FOR_PROCESSES: //wait for waste emptying: ink filling: thread loading status = PowerOffWaitForProcesses(); break; case POWER_OFF_STOP_RUNNING_JOB: status = PowerOffStopRunningJob(); break; case POWER_OFF_SET_VALVE_POSITION: status = PowerOffSetValvePosition(); break; case POWER_OFF_WAIT_FOR_TEMPERATURE: status = PowerOffWaitForTemperature(); break; case POWER_OFF_TURN_OFF_DRYER_FAN: status = PowerOffTurnOffDryerFan(); break; case POWER_OFF_TURN_OFF_COOLER: status = PowerOffTurnOffCooler(); break; case POWER_OFF_TURN_OFF_BLOWER: status = PowerOffTurnOffBlower(); break; case POWER_OFF_POWER_OFF: status = PowerOffPowerOff(); break; case POWER_OFF_ERROR: case POWER_OFF_CANCELLED: RemoveControlCallback( PowerOffControlId,PowerOffScheduler); PowerOffControlId = 0xFF; RemoveControlCallback(WaitForProcessControlId, PowerOffWaitForProcessesCallback); RemoveControlCallback(WaitForProcessControlId, PowerOffWaitForTemperatureCallback); WaitForProcessControlId = 0xFF; LOG_ERROR(ReadValue,"POWER OFF Cancelled"); break; default: LOG_ERROR(ReadValue,"ERROR IN POWER OFF STATE MACHINE"); break; } return status; }